Repository navigation
fix(cli): an unknown flag lists the command's real flags - #7740
Merged
Merged
Conversation
The error only said to run --help, so an agent guessed another flag. It now names every long flag the command declares, and --search points to --query.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Contributor
Contributor
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 1 nit
- nit: the list includes every declared arg, so
initnow advertises its rename shims (--template,--video-legacy,--agent) to agents. That matches--helptoday. Skipping args whose description starts with[renamed]/Deprecatedwould keep agents off them.
Scope
Read all 3 files. Locally 35/35 pass at head, and reverting reject-unknown-flags.ts fails exactly the 4 named tests, so the fails-without-the-fix line holds. The old hint text has no other pins in the repo. The docs example matches catalog's declared args in order. CI on this head is all green.
This was referenced Nov 14, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An unknown flag now answers with the command's real long flags, plus a "Did you mean" when one is close or means the same.
--searchoncatalogpoints to--query.Why
The hint used to say only "Run 'hyperframes snapshot --help' to see its flags." Agents usually guess a second flag instead of reading help (
snapshot --width, then--scale;catalog --searchinstead of--query), so each wrong guess cost another failed round. Listing the flags in the error lets the next call be right.Related work
None.
How
packages/cli/src/utils/reject-unknown-flags.ts, the one place every command's unknown-flag error is built: the hint lists the long flags from the command's ownargs(positionals left out), so the list cannot drift from the command.FLAG_SYNONYMSgainssearch -> query.snapshotstill has no size option; this change only makes the error say what it does take.docs/packages/cli.mdx: the JSON error example is the real output forcatalog --search.Test plan
reject-unknown-flags.test.ts:lists the command's own flags, not its positionals, when nothing close matchesandpoints --search at the query flag. The two tests that pinned the old hint now pin the new one.reject-unknown-flags.tschange reverted, 4 fail (the 2 new, the 2 updated); with it, 35 passed, 3 runs in a row.snapshot <project> --at 1 --width 360 --json,catalog --search light-leak --json,render <project> --out x.mp4 --json; before, each hint said only to run--help; after, each lists the flags, and--searchand--outget "Did you mean --query?" and "Did you mean --output?".oxfmt --check,oxlinton both files,tsc --noEmitforpackages/cli: clean.docs/packages/cli.mdx.