Skip to content

fix(cli): one --workflow flag across commands; deprecate --workflow-id - #10594

Merged
waleedlatif1 merged 4 commits into
stagingfrom
fix/cli-workflow-flag-consistency
Dec 1, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
fix/cli-workflow-flag-consistency

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A Mothership agent ran sim logs list --workflow-id <id> and failed. Every command spells a workflow --workflow except four, whose generated flag kept the request field name workflowId:

  • chat-deployments list
  • workflows source catalog
  • workflow-mcp-servers tools create
  • tables groups update

This PR gives each one concept one long flag name across the CLI:

  • Renames: the four commands now take --workflow, through the contract's existing renamedFrom. --workflow-id keeps working, hidden from help, the docs and the inventory. It warns in the standard rename wording ("flag "--workflow-id" has been renamed to "--workflow". The old name still works."), on stderr for table output or as the result's note in JSON/YAML. Passing both spellings is refused.
  • renamedFrom keeps required flags required: a renamed or aliased flag used to lose commander's required check, so help said "(required)" while the command inventory reported required: false. A value typed under another spelling is now copied onto the documented flag as it is parsed (source implied). Commander's required check, the inventory and any action all read the documented flag, and foldOtherSpellings still warns and refuses both spellings. This also fixes tables rows search --query (renamed from --q) and workflows move --to (renamed from --folder), which the inventory had marked optional.
  • Unknown flag beside a missing required one: commander checks required flags before unknown ones, so workflows runs get <id> --workflow-id X only said required option '--workflow <workflowId>' not specified and never got commander's did-you-mean. It now adds --workflow-id is not an option of sim workflows runs get. (Did you mean --workflow?) and then the Example: line. A plain unknown option already gets commander's own suggestion; showSuggestionAfterError is on.

The CLI reference docs are regenerated.

Mothership: the command inventory changes. Those four commands now list --workflow/workflow in place of --workflow-id/workflowId, and tables rows search --query and workflows move --to are now required: true. A re-sync is needed.

Type of Change

  • Bug fix

Testing

Tests that failed before the fix, in src/runtime/file-references.test.ts:

  • each of the four commands takes --workflow with no warning
  • each still takes --workflow-id, with the rename warning
  • passing both spellings is refused
  • tools create still requires a workflow, checked by commander
  • help names only --workflow
  • the required-flag case suggests --workflow

I also reverted each guard and watched its test fail. Ran sim-cli vitest (1374 passed), sim-cli type-check, lint, bun run generate and check:audits. The only audit failure is check:unused-exports: knip can't resolve the generated apps/docs/.content import, which isn't present in a local checkout and isn't touched here.

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)

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Ready Ready Preview Dec 1, 2026 9:56pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Standardizes four commands on --workflow, while keeping --workflow-id as a hidden, warning-producing spelling.

  • Four more CLI commands use --workflow for workflow filters.
  • Renamed flags still satisfy required options.
  • CLI errors point from an unknown flag to the missing option.

No new actionable issues found. Tests were inspected, not run.

Reviews (4) · Last reviewed commit: "fix(cli): refuse a flag's two spellings ..." · Reviewed by Greptile

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

1 issue found across 6 files

Confidence score: 5/5

  • In build.ts, runs get -- -Ab3x can get misleading guidance that the ID is an option when a required option is missing. Preserve the --/ID handling in this case.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/sim-cli/src/runtime/build.ts">

<violation number="1" location="packages/sim-cli/src/runtime/build.ts:311">
P3: This treats a dash-prefixed positional as an unknown flag when a required option is also missing. For example, `runs get -- -Ab3x` receives misleading guidance that the ID is not an option; preserve the `--`/ID handling here or distinguish actual unknown options from escaped operands.</violation>
</file>

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 Resolved
Comment thread packages/sim-cli/src/runtime/build.ts Resolved
@greptile-apps

This comment has been minimized.

@waleedlatif1 waleedlatif1 changed the title fix(cli): accept --workflow-id on logs filters and --workflow on single-workflow commands fix(cli): one --workflow flag across commands; deprecate --workflow-id Dec 1, 2026
@blacksmith-sh

This comment has been minimized.

@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 Dec 1, 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.

@blacksmith-sh

This comment has been minimized.

@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 12 files

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

Turn on auto-fix | Re-trigger cubic

@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 Dec 1, 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 13 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

…le-workflow commands

logs list, logs stats and logs follow answer to --workflow-id; chat-deployments list
and workflows source catalog answer to --workflow. Both spellings are hidden from help
and the command inventory, and passing both is refused.

A required flag missing beside an unknown one now names the unknown flag: commander
reports the missing flag first and never reaches its did-you-mean suggestion.
chat-deployments list, workflows source catalog, workflow-mcp-servers tools create
and tables groups update named the workflow --workflow-id; they now take --workflow
like every other command. --workflow-id still works with the rename warning.

Drops the hidden aliases the previous commit added. A former spelling is now copied
onto the documented flag as it is parsed, so a required renamed flag stays required
in commander and the command inventory (tables rows search --query and workflows
move --to were reported optional). A required flag missing beside an unknown one
suggests it in commander's words.
…y hook runs

Both spellings at once were refused only when the generated action ran, after
catalog's preAction had already resolved a workflow name (a listWorkflows request).
The parse-time copy now refuses the pair in either order with commander's error,
and one helper words the refusal for both checks.
@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 Dec 1, 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 13 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 5e0ec02 into staging Dec 1, 2026
87 checks passed

This branch was successfully deployed

1 active deployment
Preview — 74eedad4 Deployed Dec 1, 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