Repository navigation
fix(sim-cli): an unknown option lists the command's own flags - #8845
Conversation
Commander suggests only a near spelling, so a guessed flag such as `tables rows batch-delete --row-ids` (the flag is --row) got a bare "unknown option" and the caller had to look the command up before retrying. The parse-error formatter now appends the command's flags; an id that opens with a dash keeps its `--` example instead.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
|
|
@cubic-dev-ai review this PR |
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
Summary
When a CLI call uses an unknown option, the error now lists that command's own flags:
Commander only suggests a flag when the spelling is close.
--row-idsis too far from--row, so the caller got a bareunknown option.Agents guess this flag because the sibling commands use
--file-idsand--table-ids. In the mothership DE1 bench (kit-8,20261009t065013z), Opus 5.5 rantables rows batch-delete --row-ids …, got the bare error, looked the command up, and then retried with--row. That is three calls for one delete.The fix is in the CLI's existing parse-error formatter, which already adds the
--example for ids that start with a dash. That behaviour is unchanged; the id case does not list flags. Every caller benefits, both humans and the embedded CLI the copilot uses.Type of Change
Testing
embed-isolation.test.tscase:--row-idsgets the flag list, including--row <value...>;Example: sim audit-logs get -- -X9abcand no flag list.packages/sim-cli: vitest 476/476, type-check clean, biome clean.Checklist