Skip to content

fix(sim-cli): an unknown option lists the command's own flags - #8845

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/cli-unknown-option-lists-flags
Oct 9, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/cli-unknown-option-lists-flags

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

When a CLI call uses an unknown option, the error now lists that command's own flags:

error: unknown option '--row-ids'
Options for sim tables rows batch-delete: --filter <json|@file>, --limit <value>, --row <value...>, -y, --yes

Commander only suggests a flag when the spelling is close. --row-ids is too far from --row, so the caller got a bare unknown option.

Agents guess this flag because the sibling commands use --file-ids and --table-ids. In the mothership DE1 bench (kit-8, 20261009t065013z), Opus 5.5 ran tables 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

  • Bug fix

Testing

  • New embed-isolation.test.ts case:
    • a guessed --row-ids gets the flag list, including --row <value...>;
    • a dash-prefixed id still gets Example: sim audit-logs get -- -X9abc and no flag list.
  • The new case fails without the change.
  • packages/sim-cli: vitest 476/476, type-check clean, biome clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

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.
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 9, 2026 8:07am UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread packages/sim-cli/src/runtime/build.ts Outdated
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Unknown options now list the command’s visible flags. Dash-prefixed IDs still get the -- example when the command accepts positional arguments.

  • The latest change also lists flags for ID-shaped tokens when the command has no positional arguments.
  • The added test checks this case alongside guessed flags and dash-prefixed IDs.
  • No new actionable issues were found.

Reviews (2) · Last reviewed commit: "fix(sim-cli): an id-shaped token lists t..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit b1c1be0 into staging Oct 9, 2026
47 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 0b2eef2e Deployed Oct 9, 2026 by vercel[bot]
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.

1 participant