Skip to content

Commit 7d8a9c6

Browse files
fix(cli): correct API-key authentication guidance
1 parent 08447ca commit 7d8a9c6

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

apps/docs/content/docs/cli/authentication.mdx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ sim login --method api-key
2727
server must enable `OAUTH_PROVIDER_ENABLED=true`. Explicit OAuth selection also
2828
overrides SSH/headless detection; your browser still needs to reach the CLI's
2929
local callback. `--method api-key` uses pairing-code approval to create a new
30-
permanent API key. To supply an existing key, use the global `--api-key <key>`
31-
option or `SIM_API_KEY` instead.
30+
permanent API key. To supply an existing key, set `SIM_API_KEY` instead.
31+
32+
API-key pairing requires a server that supports `platform` API keys. Upgrade
33+
older deployments that only issue `copilot` keys before starting login; those
34+
keys cannot authenticate the platform CLI.
3235

3336
OAuth login opens your browser on Sim's sign-in page, then on a consent page that
3437
names the Sim CLI and what it will be able to do. Approve, and the browser hands
@@ -100,9 +103,10 @@ approving. That check is what binds the approval to your terminal.
100103

101104
The handoff issues a permanent personal API key rather than a renewing login,
102105
so revoke it under **Settings → API keys** when you are done with that machine.
103-
It is also the path for a deployment that predates OAuth sign-in, or one with
104-
the provider switched off; the CLI detects that and selects API-key login when
105-
`--method` is omitted. An explicit `--method oauth` fails in that case.
106+
It also works when OAuth is unavailable or switched off, provided the server
107+
supports platform API-key pairing. When `--method` is omitted, the CLI checks
108+
OAuth availability and selects pairing if unavailable; that discovery does not
109+
verify pairing compatibility. An explicit `--method oauth` fails in that case.
106110

107111
`--read-only` and `--callback-port` belong to OAuth login and have no
108112
meaning here, so combining either with the handoff stops the login rather than

packages/sim-cli/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ it. OAuth still needs the browser to reach the CLI's loopback callback. Over SSH
4949
or in a container without port forwarding, use
5050
`sim login --method api-key --no-browser` to approve from another device and
5151
create a permanent personal API key. `--method api-key` creates a new key;
52-
the global `--api-key <key>` option supplies an existing one.
52+
set `SIM_API_KEY` to supply an existing one.
53+
54+
Pairing requires a server that supports `platform` API keys. Upgrade older
55+
deployments that only issue `copilot` keys before login; they are not compatible
56+
with the platform CLI. OAuth discovery does not check pairing compatibility.
5357

5458
Check the active profile and verify that its endpoint, credential, and workspace
5559
work together:

0 commit comments

Comments
 (0)