Skip to content

CLI: derive the value-carrying flag table from command definitions (alias + help-flag scan misroutes) #1221

Description

@arul28

Backlog: the CLI value-carrying flag table is incomplete

Found 2026-09-02 during the ADE-148 plugin fix pass (commit 34129a262).

apps/ade-cli/src/cliArgScan.ts holds the table of flags that carry a value. The plugin CLI alias (ade cursor cloud <word>, ade review, ade history, ade linear) and hasHelpFlag (cli.ts near line 12975) both scan argv with it to find the first positional word. The fix pass added --repo, --repo-name and --repo-owner, but the table still omits about a hundred value-carrying flags across the CLI, for example --issue-id and --out.

Effect. When a value-carrying flag that is missing from the table comes before the subcommand, its value is read as the subcommand. Example shape: ade linear --issue-id ADE-1 comment routes on ADE-1. The same scan decides whether --help is a flag or a value, so help detection is wrong for the same flags.

Fix. Derive the table from the command definitions instead of a hand list, or generate it at build time from the option specs each command registers, then delete the hand list. Add a test that walks every registered command and asserts each value-carrying option is in the table.

Scope. CLI-wide, not plugin-specific. Windows parity applies (no platform-specific parsing).

Activity

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