Skip to content

Split --help "Flags:" into command-specific and common flags - #226

Merged
sawka-harness merged 4 commits into
mainfrom
fix/issue#192
Sep 22, 2026
Merged

sawka-harness merged 4 commits into
mainfrom
fix/issue#192

Conversation

@BlueLabelscotch

Copy link
Copy Markdown
Collaborator

Summary

  • --help on a leaf command (e.g. harness list project) currently dumps every flag into one Flags: block — mixing the command's own flags with framework-level flags that are mechanically the same across every command sharing its verb (--format, --json, --columns, --all, --limit, etc). This makes it harder to scan for humans and costly for AI agents that have to read past a large block of repeated boilerplate to find what's actually specific to the command.
  • Adds a custom Cobra usage template (pkg/rootcmd/usage.go) that splits the existing Flags: section into two: Flags: (command-specific) and Common Flags: (built-in verb/endpoint flags), leaving Global Flags: untouched.
  • Purely a --help rendering change: no flags are hidden, no flag registration/parsing/completion behavior changes.

Future Work

  • we can hide the common verbs and global flags behind a generic command like list --help , but this has some tradeoffs and problem with verb specific and conditional flags.

@sawka-harness
sawka-harness merged commit eccd02c into main Sep 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants