Skip to content

fix(cli): default to the host that serves the API - #6791

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/cli-default-endpoint
Aug 17, 2026
Merged

fix(cli): default to the host that serves the API#6791
waleedlatif1 merged 1 commit into
stagingfrom
fix/cli-default-endpoint

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The built-in default endpoint was unusable. DEFAULT_ENDPOINT was https://sim.ai, which answers /api/** with a 301 to www.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 host Location names — 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.
  • Before fix(cli): resolve findings from a full command-surface audit #6788 this was quieter and worse rather than absent: reads followed the redirect and worked, writes arrived with no body. sim login was already broken on the default — the device-flow POST became a bodyless GET and the route answered 405.
  • Trims credentials providers list 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 while reading empty on every OAuth row. Both ids stay, because which one the next command takes depends on the row: credentials connect names an OAuth provider by serviceId, credentials create matches a service account on providerId.
  • Updates the README and the CLI guides that documented the old default, including the approval URL the login flow prints.

Type of Change

  • Bug fix

Testing

Tested manually. With a local build and no endpoint configured, sim workflows list against production now reaches the API (Invalid API key) instead of erroring on the redirect, and sim whoami reports Endpoint: https://www.sim.ai (default). Provider catalogue verified on staging for both row kinds — OAuth rows show serviceId, 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 in check:audits pass, including check:cli-docs.

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)

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

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 17, 2026 11:20pm

Request Review

@cursor

cursor Bot commented Aug 17, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
The endpoint default is a behavioral fix for all unconfigured CLI users against production; wrong host choice would still break API calls. Provider list changes are display-only and low risk.

Overview
The CLI’s built-in default endpoint changes from https://sim.ai to https://www.sim.ai, because the apex redirects /api/** with a 301 and the client does not follow redirects (301 turns POSTs into bodyless GETs). Users who never configured an endpoint therefore saw failures on every command; docs, README, login URL examples, and validation error hints are updated to match.

credentials providers list table output is narrowed via an explicit listCredentialProviders contract: seven catalogue columns (type, service/provider ids, name, family, available, description) instead of eleven inferred fields such as docsUrl, helpText, and nested fields. A contract test locks that shape.

Reviewed by Cursor Bugbot for commit cbdd60f. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR changes the CLI’s built-in endpoint from the redirecting apex domain to the API-serving www host and aligns its documentation and tests. It also narrows the credential-provider catalogue to seven selection-oriented columns.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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

Comment thread packages/sim-cli/src/contract/commands.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@waleedlatif1
waleedlatif1 merged commit 60097c8 into staging Aug 17, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/cli-default-endpoint branch August 17, 2026 23:26
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