Skip to content

Generate shell-completion command sets from route metadata #1527

Closed

Description

@sentry-junior

ORG_PROJECT_COMMANDS and ORG_ONLY_COMMANDS in packages/cli/src/lib/complete.ts are hand-maintained. Every new org- or project-scoped command has to be added by hand (e.g. integration list/delete in #1523), and the only guard is the drift test in test/lib/completions.property.test.ts, which fails after the fact.

Why it's manual today: the __complete fast path deliberately skips the Stricli boot (see the complete.ts header), so it can't walk the route tree at runtime.

Proposal: generate both sets at build time from the route tree, like the other script/generate-*.ts outputs, and import the generated module from complete.ts.

  • Classify commands from positional metadata instead of the current heuristic (placeholder mentions org, or is issue). An explicit per-command target kind (org-only vs org/project) would be more reliable than parsing placeholder text.
  • Keep the special cases (project create) explicit.
  • Replace the drift test with a check that the generated file is current.

Raised in review of #1523: #1523 (comment)

via Junior system actor event.

--

View Junior Session [Sentry]

Activity

  1. linear-code commented on Oct 16, 2026

    @linear-code
  2. added a commit that references this issue on Oct 20, 2026
    db7608a
  3. added a commit that references this issue on Oct 20, 2026
    4196231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions