fix(cli): default to the host that serves the API - #6791
Conversation
`sim.ai` answers /api/** with a 301 to `www.sim.ai`, and the client refuses to follow redirects — a 301 rewrites a POST into a bodyless GET, so following one turns a write into a silent no-op and hands the API key to whatever host Location names. Defaulting to the apex therefore failed every command for anyone who never set an endpoint. Before the refusal shipped it was quieter and worse: reads succeeded while writes did nothing. Also trims the provider catalogue from eleven inferred columns to seven. `docsUrl`, `helpText`, `requiresClientGeneratedCredentialId` and the nested `fields` are what you read once you have chosen a provider, not what you scan to choose one, and they pushed the table well past a terminal. Both ids stay: `credentials connect` names an OAuth provider by `serviceId`, `credentials create` matches a service account on `providerId`.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview
Reviewed by Cursor Bugbot for commit cbdd60f. Configure here. |
Greptile SummaryThe PR changes the CLI’s built-in endpoint from the redirecting apex domain to the API-serving Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/sim-cli/src/config/profile.ts | Changes the default endpoint to https://www.sim.ai so default CLI requests reach the API host directly. |
| packages/sim-cli/src/contract/commands.ts | Defines a focused seven-column catalogue for credential providers. |
| packages/sim-cli/src/config/profile.test.ts | Updates endpoint expectations and adds coverage that pins the API-serving hostname. |
| packages/sim-cli/src/contract/commands.test.ts | Adds coverage for the credential-provider catalogue’s intended columns. |
| apps/docs/content/docs/en/cli/configuration.mdx | Updates the documented built-in endpoint and example configuration. |
Reviews (2): Last reviewed commit: "fix(cli): default to the host that serve..." | Re-trigger Greptile
|
@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 cbdd60f. Configure here.
Summary
DEFAULT_ENDPOINTwashttps://sim.ai, which answers/api/**with a 301 towww.sim.ai. Since fix(cli): resolve findings from a full command-surface audit #6788 the client refuses to follow redirects — a 301 rewrites a POST into a bodyless GET, so following one turns a write into a silent no-op and hands the API key to whatever hostLocationnames — so every command failed for anyone who never set an endpoint explicitly. Verified against production with the published CLI: default endpoint →Endpoint redirected to https://www.sim.ai, now → the request reaches the API.sim loginwas already broken on the default — the device-flow POST became a bodyless GET and the route answered 405.credentials providers listfrom eleven inferred columns to seven.docsUrl,helpText,requiresClientGeneratedCredentialIdand the nestedfieldsare what you read once you have chosen a provider, not what you scan to choose one, and they pushed the table well past a terminal while reading empty on every OAuth row. Both ids stay, because which one the next command takes depends on the row:credentials connectnames an OAuth provider byserviceId,credentials creatematches a service account onproviderId.Type of Change
Testing
Tested manually. With a local build and no endpoint configured,
sim workflows listagainst production now reaches the API (Invalid API key) instead of erroring on the redirect, andsim whoamireportsEndpoint: https://www.sim.ai (default). Provider catalogue verified on staging for both row kinds — OAuth rows showserviceId, service-account rows show both ids.Suite is 341 passed / 1 skipped. Both new assertions were proven red by reverting their source change and green on restore.
lint,type-check,build, and all 29 audits incheck:auditspass, includingcheck:cli-docs.Checklist