Skip to content

urfave/cli/v2 parser doesn't intersperse flags — confusing UX on subcommands with positional args #813

@ArangoGutierrez

Description

@ArangoGutierrez

Found during PR #812 review.

The vendored urfave/cli/v2 parser stops parsing flags after the first non-flag (positional) token, so the natural invocation:

holodeck skill add using-holodeck --claude

is rejected with:

❌ must specify at least one of --claude/--cursor/--codex/--gemini/--all-agents

using-holodeck is consumed as the positional, after which --claude is treated as a second positional and never sets the flag.

PR #812 worked around this by rewriting all in-binary --help examples and README.md to flag-first ordering (holodeck skill add --claude using-holodeck) and locked the docs with a regression test (TestBuildAddCommand_DescriptionUsesFlagFirstExamples).

The proper fix is to allow the natural ordering. Two paths:

  1. Migrate to urfave/cli/v3, which interleaves flags and positional args by default. Likely affects every subcommand wiring.
  2. Manual arg pre-parse in v2 — reorder os.Args so flags precede positional args before urfave gets them. Less invasive, but a hand-rolled shim.

Affects every subcommand that takes both flags and a positional. Worth fixing before the surface grows.

Posted via Team Lead workflow after PE review of PR #812.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions