diff --git a/agents/troubleshooting.mdx b/agents/troubleshooting.mdx index 6eb8535..2987fc5 100644 --- a/agents/troubleshooting.mdx +++ b/agents/troubleshooting.mdx @@ -177,13 +177,12 @@ Pass `--json` for the structured envelope: `{ ok: bool, api_url: string, checks: ### Auth resolution order -If `agentsfleet` keeps acting unauthenticated, your token might be coming from somewhere unexpected. Resolution order, highest priority first: +If `agentsfleet` keeps acting unauthenticated, your bearer might be coming from somewhere unexpected. Resolution order, highest priority first: -1. `--token ` flag -2. `AGENTSFLEET_TOKEN` environment variable -3. Stored credentials at `~/.config/agentsfleet/credentials` (written by `agentsfleet login`) +1. `AGENTSFLEET_API_KEY` environment variable (a service API key) +2. Stored credentials at `~/.config/agentsfleet/credentials.json` (written by `agentsfleet login`) -Unset `AGENTSFLEET_TOKEN` if you've been running CI scripts that exported it; otherwise it overrides whatever `agentsfleet login` wrote. +Unset `AGENTSFLEET_API_KEY` if you've been running CI scripts that exported it; otherwise it overrides whatever `agentsfleet login` wrote. ## When to escalate diff --git a/api-reference/introduction.mdx b/api-reference/introduction.mdx index 01bc395..334eeb8 100644 --- a/api-reference/introduction.mdx +++ b/api-reference/introduction.mdx @@ -15,7 +15,7 @@ All API endpoints require a Bearer token in the `Authorization` header, except h ```bash curl https://api.agentsfleet.net/v1/workspaces/0198a7b0-3c2d-7f14-9a08-1b6e4d2f8c50/agents \ - -H "Authorization: Bearer $AGENTSFLEET_TOKEN" + -H "Authorization: Bearer $AGENTSFLEET_API_KEY" ``` Two kinds of bearer token are accepted: diff --git a/cli/agentsfleet.mdx b/cli/agentsfleet.mdx index 443622e..4d556d7 100644 --- a/cli/agentsfleet.mdx +++ b/cli/agentsfleet.mdx @@ -40,7 +40,7 @@ agentsfleet login --token-name "kishore-macbook" ```bash # Non-interactive (CI, scripts): supply a token instead of the browser flow -AGENTSFLEET_TOKEN="$MY_TOKEN" agentsfleet login +agentsfleet login --token "$MY_TOKEN" # …or pipe it so it never lands in shell history printf '%s' "$MY_TOKEN" | agentsfleet login ``` @@ -49,13 +49,13 @@ After the token persists, `login` also fetches `GET /v1/tenants/me/workspaces` a Flags: -- `--token ` — authenticate non-interactively with a token directly, skipping the browser entirely; the token is validated against the server and persisted. Prefer the `AGENTSFLEET_TOKEN` env var or piping the token on stdin to keep it out of your shell history. `--token-name` is ignored for any non-browser token source — `--token`, the `AGENTSFLEET_TOKEN` env var, or piped stdin — since there's no browser session to label. +- `--token ` — authenticate non-interactively with a token directly, skipping the browser entirely; the token is validated against the server and persisted. Prefer piping the token on stdin to keep it out of your shell history. `--token-name` is ignored for any non-browser token source — `--token` or piped stdin — since there's no browser session to label. - `--token-name