feat(cli): Sim CLI with AWS-style profiles and a platform key exchange - #6147
Conversation
…ming improvements
…, library, typescript 7, jupyter notebook, o11y, meta muse, gpt 5.6
…ys, cmd-k speedups, pagespeed optimizations, security hardening
…ious providers, library updates, platform and solutions pages
…itlab tools, deployment state machine, gitlab tools, rich rendering
…lback, mothership experience improvements, soft delete chats
… test speedup, org session policies, proxy URL for API calls
…B docs, mcp fixes
… agent thinking/tool-calls/prompt-caching, opus 5, daytona failover
… mutation locks, slack oauth scope fix, tiktok
|
@cursor review |
|
@cursor review |
|
@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 ab22e0d. Configure here.
|
@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 18fc377. Configure here.
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7b84b02. Configure here.

High-level idea
Problem: Sim’s public API lacks a terminal-native client that can securely obtain a platform credential, preserve environment-specific defaults, and expose the v2 resource surface—including binary, multipart, and credential-connection workflows—as predictable shell commands.
Solution: This PR publishes the CLI as
sim@2.0.0with browser-approved key exchange, AWS-style profiles, generated v2 commands plus terminal-shaped adapters, structured output, and branch-mapped npm releases in a single Node-compatible bundle.Implementation level
Primary level: CLI application and runtime, supported by public API authentication and credential contracts plus release infrastructure.
Chokepoint:
buildGeneratedCommands()consumes the generatedV2_OPERATIONStable plus the sparse, hand-authoredCLI_CONTRACTdiff and turns them into the Commander command tree registered bysrc/index.ts.Contract → runtime
The runtime is implemented and active in this PR. At the current head, the generated manifest contains 139 API operations; the generic runtime exposes 123 JSON operations plus three command variants, producing 126 generated command actions across 13 top-level resource groups. An operation absent from
CLI_CONTRACTstill becomes a command—the contract only records exceptions such as friendlier names, aliases, confirmations, positional arguments, output columns, and deliberately hidden operations.The protocol layer handles the cases that cannot be represented as one ordinary JSON request. It hides the low-level transfer/session operations and attaches 12 terminal-shaped commands for file download and upload, knowledge-document upload, table import, and combined resource/folder navigation. These adapters compose the same v2 operations; they do not override backend behavior.
Credential creation is similarly translated into three terminal-shaped commands.
sim credentials connect <providerId> --name <displayName>andsim credentials reconnect <credentialId>print a short-lived OAuth authorization URL and expiry.sim credentials create <providerId> --name <displayName> --credentials <json|@file>discovers the service-account provider, validates its exact required fields locally, and submits the provider-shaped credentials without exposing every provider’s secret fields as unrelated flags. The low-level generated forms are hidden.sim secrets set <name> --scope <scope>uses a masked TTY prompt by default, restores terminal state on completion or cancellation, and fails fast without a terminal. Scripts can pass--value <value>explicitly; help warns that direct values are visible to shell history. The API response remains metadata-only.Approval UI
sim loginconfirms before replacing an existing profile; non-interactive callers must pass--yes.Type of Change
Testing
bun run lintbun run check:auditsbun run apps/sim/scripts/check-block-registry.ts origin/stagingbun run check:migrationsbun run check:import-specifiers --verbosebun run check:cli-apibun run --filter sim type-checkbun run --filter sim test— 242 passed, 1 skippedbun run --filter sim buildgit diff --checkChecklist