Skip to content

feat(Cli): add trae/codex support#1050

Merged
ArgoZhang merged 5 commits into
masterfrom
chore-cli
Jun 25, 2026
Merged

feat(Cli): add trae/codex support#1050
ArgoZhang merged 5 commits into
masterfrom
chore-cli

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Jun 25, 2026

Copy link
Copy Markdown
Member

Link issues

fixes #1049

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Add Trae and Codex agent support and move CLI discovery templates into editable embedded Markdown files.

New Features:

  • Support installing discovery artifacts for Trae (skill) and Codex (AGENTS.md) alongside existing Claude and Cursor integrations.

Enhancements:

  • Externalize instructions, skill, and Cursor rule content into embedded Markdown templates under Templates/ for easier maintenance.
  • Extend CLI install help and README to document Trae and Codex clients and the shared template-based discovery layer.

@bb-auto bb-auto Bot added the enhancement New feature or request label Jun 25, 2026
@bb-auto bb-auto Bot added this to the v10.0.0 milestone Jun 25, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds Trae and Codex agent support to the bb-llms CLI and refactors agent discovery templates to be external embedded Markdown files instead of inline C# strings.

Sequence diagram for bb_llms_install with Trae and Codex support

sequenceDiagram
    actor User
    participant BbLlmsCli
    participant Scaffolder
    participant TemplatesAssembly
    participant FileSystem

    User->>BbLlmsCli: bb-llms install --client codex --scope project
    BbLlmsCli->>Scaffolder: Install(client, scope, target, force)
    Scaffolder->>Scaffolder: client.ToLowerInvariant()
    Scaffolder->>Scaffolder: scope.ToLowerInvariant()
    Scaffolder->>Scaffolder: switch(client)
    alt client == "claude" or "trae"
        Scaffolder->>Scaffolder: SkillMarkdown
        Scaffolder->>TemplatesAssembly: ReadTemplate("SKILL.md")
        TemplatesAssembly-->>Scaffolder: templateContent
        Scaffolder->>FileSystem: File.WriteAllText(path, templateContent)
    else client == "cursor"
        Scaffolder->>Scaffolder: CursorRule
        Scaffolder->>TemplatesAssembly: ReadTemplate("bootstrapblazor.mdc")
        TemplatesAssembly-->>Scaffolder: templateContent
        Scaffolder->>FileSystem: File.WriteAllText(path, templateContent)
    else client == "codex"
        Scaffolder->>Scaffolder: GenericSnippet
        Scaffolder->>TemplatesAssembly: ReadTemplate("instructions.md")
        TemplatesAssembly-->>Scaffolder: templateContent
        Scaffolder->>FileSystem: File.Exists(AGENTS.md)
        alt [file missing or force]
            Scaffolder->>FileSystem: File.WriteAllText(AGENTS.md, templateContent)
        else [file exists and !force]
            Scaffolder-->>BbLlmsCli: no write
        end
    end
    Scaffolder-->>BbLlmsCli: return status
    BbLlmsCli-->>User: exit code
Loading

File-Level Changes

Change Details Files
Refactor scaffolding templates from inline C# string literals to embedded Markdown files and normalize template output.
  • Replace GenericSnippet, SkillMarkdown, and CursorRule constants with properties that read from embedded templates via ReadTemplate
  • Introduce ReadTemplate helper that loads UTF-8 embedded resources by logical name and normalizes trailing whitespace to a single newline
  • Update Instructions() to use Console.Write instead of WriteLine to rely on template newline normalization
tools/BootstrapBlazor.LLMsDocs.Cli/Scaffolder.cs
tools/BootstrapBlazor.LLMsDocs.Cli/Templates/instructions.md
tools/BootstrapBlazor.LLMsDocs.Cli/Templates/SKILL.md
tools/BootstrapBlazor.LLMsDocs.Cli/Templates/bootstrapblazor.mdc
Extend bb-llms install command to support Trae and Codex agents, including path selection and client routing.
  • Update supported client list and error message to include trae and codex in the Install method
  • Add switch cases that map claude, cursor, trae, and codex to appropriate output paths and template content, including Codex AGENTS.md behavior in project vs user scope and force handling notes
  • Adjust client option description and install command description to mention Trae skill and Codex AGENTS.md artifacts
tools/BootstrapBlazor.LLMsDocs.Cli/Scaffolder.cs
tools/BootstrapBlazor.LLMsDocs.Cli/CommandFactory.cs
Document new agent integrations and the external template editing workflow in the CLI README.
  • Update overview to mention Trae and Codex alongside Claude Code and Cursor
  • Expand usage examples for bb-llms install to cover trae, codex, and all clients
  • Update client option help text and ecosystem integration section from three to five ecosystems with detailed behavior for Trae and Codex, including AGENTS.md overwrite caveats
  • Add a new section explaining how to modify discovery-layer templates under Templates/ and how they are embedded as resources
tools/BootstrapBlazor.LLMsDocs.Cli/README.md

Assessment against linked issues

Issue Objective Addressed Explanation
#1049 Extend the CLI install functionality to support the Trae agent by generating an appropriate skill file.
#1049 Extend the CLI install functionality to support the Codex agent by generating or updating an appropriate AGENTS.md file.
#1049 Update CLI help text and README documentation to describe Trae and Codex support, including usage examples and options.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved by bb-auto

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit 110587f into master Jun 25, 2026
3 checks passed
@ArgoZhang ArgoZhang deleted the chore-cli branch June 25, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(Cli): add trae/codex support

1 participant