From 43c0c8cc148f9e759785d4becf23cb78583a15ca Mon Sep 17 00:00:00 2001 From: Kishore Kumar Date: Fri, 19 Jun 2026 13:25:02 +0530 Subject: [PATCH 1/2] docs(cli): drop AGENTSFLEET_TOKEN; document AGENTSFLEET_API_KEY precedence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CLI removed the `AGENTSFLEET_TOKEN` environment variable. The service API key `AGENTSFLEET_API_KEY` is now the sole env-sourced bearer and wins over a stored `login` session at the wire. - cli/configuration.mdx — rewrite Auth precedence to the new model (no TTY-dependence): API key wins over stored credentials; login seeding is `--token` → stdin → browser. Drop the env-var table row; update the CI example to `AGENTSFLEET_API_KEY`. - cli/agentsfleet.mdx — login/logout/auth-status: token resolution is `--token` → stdin; the env-seeding example and the auth-status source list now use `AGENTSFLEET_API_KEY`. - quickstart.mdx, agents/troubleshooting.mdx — non-interactive auth uses `--token`/stdin or a standing `AGENTSFLEET_API_KEY`. - api-reference/introduction.mdx — curl example uses `$AGENTSFLEET_API_KEY`. Co-Authored-By: Claude Opus 4.8 (1M context) --- agents/troubleshooting.mdx | 9 ++++----- api-reference/introduction.mdx | 2 +- cli/agentsfleet.mdx | 12 ++++++------ cli/configuration.mdx | 20 +++++++++----------- quickstart.mdx | 2 +- 5 files changed, 21 insertions(+), 24 deletions(-) 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 f7e6c18..0aeb1ad 100644 --- a/cli/agentsfleet.mdx +++ b/cli/agentsfleet.mdx @@ -37,7 +37,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 ``` @@ -46,13 +46,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