fix(cli): resolve findings from a full command-surface audit - #6788
Conversation
Exercised all 147 commands against a live deployment. Fixes the defects that surfaced, plus the docs and generator drift they exposed. Transport - Stop following redirects. A bare domain that 301s to www silently converted POST to GET and dropped the body, so reads worked while every write failed with a misleading validation error and login returned 405. Both the client and the device flow now explain the redirect and name the endpoint to configure, rather than carrying credentials off-origin. - Report a non-JSON response as one instead of printing the HTML page. - Name the personal-API-key remedy on a workspace-key refusal, reading the machine-readable code the API actually sends. - Drop union-branch noise from validation errors that contradicted itself. - Show paging progress on stderr for multi-page fetches. Output - Clamp record values for table only. text is the format built for pipes, and it was truncating signed URLs and tool source mid-value. - Infer timestamp, duration, bytes and boolean formatting for API-owned keys so undeclared commands stop printing raw ISO and float ms. Skips user-defined table cells and leaves json/yaml on the raw payload. - Render a declared-but-absent field as an em dash; billing credits were vanishing silently. Paths, naming and validation - Percent-encode folder paths per segment and decode them for display, so a folder reads and types as the name shown in the app. - Reject a malformed endpoint where it is set and where it resolves, instead of crashing with a URL parse trace. - Request the detail level logs list's own columns need; its workflow column could never populate. - Rename three commands that described themselves wrongly and align two flags with their siblings. Old spellings still work: hidden, warned on stderr, and kept out of help and docs. - Verify whoami against the API, separating a bad key from an unreachable endpoint, and report the workspace by name. - Correct the --yes help text, which advertised skipping a prompt that does not exist. Docs - Teach the docs generator that a flag required by the runtime is required, and that hidden commands are not documented.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Redirects and endpoints — The client and login poll use Output — Record clamping applies only in table mode so Commands and flags — Three paths are renamed to match behavior ( Docs — Generated and narrative CLI docs align with the above (whoami, folder wording, restore/count/status commands, exit codes). Reviewed by Cursor Bugbot for commit ac958ac. Configure here. |
Greptile SummaryThis PR resolves failures found during a full CLI command-surface audit and preserves compatibility for renamed commands and flags.
Confidence Score: 5/5The PR appears safe to merge. The previously reported pagination cleanup defect is fixed in both pagination loops, and no blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/sim-cli/src/http/client.ts | Adds redirect refusal, safer response handling, pagination progress reporting, and unconditional progress cleanup. |
| packages/sim-cli/src/runtime/execute.ts | Adds progress reporting and finally-based cleanup to generated-command cursor pagination. |
| packages/sim-cli/src/commands/auth.ts | Adds live whoami verification with distinct credential and connectivity outcomes. |
| packages/sim-cli/src/output/render.ts | Corrects format-specific truncation and improves inferred formatting for API-owned output fields. |
| packages/sim-cli/src/runtime/build.ts | Implements compatible command and option renames while preserving hidden deprecated spellings. |
| scripts/generate-cli-docs.ts | Corrects required-option documentation and excludes hidden compatibility commands. |
Reviews (3): Last reviewed commit: "fix(cli): name a working API root when a..." | Re-trigger Greptile
Progress is written without a trailing newline so it can be overwritten in place, and both paging loops cleaned it up only on success. A page that threw part-way through left `fetched 1200…` on the line the error was then printed onto, so the two ran together.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
2 issues from previous reviews remain unresolved.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 00fca62. Configure here.
The suggested endpoint was the redirect target's origin, which drops a path prefix. A self-hosted deployment reached at https://host/sim was told to set https://www.host — not an API root, so following the advice replaced one broken endpoint with another. Derive it by stripping the request's own path from the target instead, so a prefix survives, and say nothing about --set-endpoint when the target resolves to the endpoint already configured: a trailing-slash or path normalization redirect keeps the origin, and naming the value the caller already has explains nothing. The login poll shared both faults and now shares the helper.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ac958ac. Configure here.

Summary
wwwconverted POST to GET and dropped the body, so reads worked while every create/update/delete failed with a misleadingWorkspace ID is requiredandsim loginreturned 405. The client and device flow now refuse to follow and name the endpoint to configure — following would also carry the API key and login secret to another origin.--output textno longer truncates. The record path clamped at 160 chars before branching on format, corrupting the format built for pipes;tables exports downloadreturned an unusable signed URL. Clamping is now table-only.workflows runstops printingdurationMs: 9.145596999907866. User-defined table cells are untouched, andjson/yamlstill render from the raw payload.--folder '/Folder 1'works; the wire form still does too. Encoding mirrors the server's canonical segment encoder byte for byte.sim logs listcan attribute a run. Itsworkflowcolumn could never populate because the default detail level omits the data.whoamiverifies against the API and separates a bad key from an unreachable endpoint.Required: Yes(42 rows saidNofor--yes), and hidden commands are no longer documented.Type of Change
Testing
Tested manually against a live deployment — every finding reproduced before the fix and re-verified after, including the redirect, path encoding, output formats, renamed spellings, and exit codes. Regression swept the pre-existing surface: both global-flag positions, exit codes,
--limit 0auto-paging, export/import round-trip, upload/get/delete, and the trace renderer.Suite is 334 passed / 1 skipped (was 242 / 1). Every new assertion was proven red by reverting its source change and green on restore.
lint,type-check,build, and all 29 audits incheck:auditspass, includingcheck:cli-docsandcheck:cli-api.Checklist