Skip to content

docs(cli): drop AGENTSFLEET_TOKEN; document AGENTSFLEET_API_KEY precedence#103

Open
indykish wants to merge 1 commit into
mainfrom
chore/cli-drop-token-env-docs
Open

docs(cli): drop AGENTSFLEET_TOKEN; document AGENTSFLEET_API_KEY precedence#103
indykish wants to merge 1 commit into
mainfrom
chore/cli-drop-token-env-docs

Conversation

@indykish

@indykish indykish commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Companion docs update for the CLI change in agentsfleet/agentsfleet#431, which removes the AGENTSFLEET_TOKEN environment variable and makes AGENTSFLEET_API_KEY win over a stored login session at the wire.

Changes

  • cli/configuration.mdx — rewrote Auth precedence to the new model (no TTY-dependence): the service API key (AGENTSFLEET_API_KEY) wins over stored credentials; login seeding is --token → stdin → browser. Dropped the AGENTSFLEET_TOKEN env-var table row; CI example now exports AGENTSFLEET_API_KEY.
  • cli/agentsfleet.mdxlogin token resolution is now --token → stdin; the env-seeding example, logout note, and auth status source list use AGENTSFLEET_API_KEY.
  • quickstart.mdx / agents/troubleshooting.mdx — non-interactive auth via --token/stdin or a standing AGENTSFLEET_API_KEY.
  • api-reference/introduction.mdx — curl bearer example uses $AGENTSFLEET_API_KEY.

Note for reviewers

cli/configuration.mdx still describes AGENTSFLEET_API_KEY's provenance as "from agentsfleet agent-key add" (pre-existing). Per AUTH.md, control-plane CLI auth wants an agt_t… tenant key (dashboard → Settings → API keys), not an agt_a… agent key — worth reconciling separately; left as-is here to keep this PR scoped to the AGENTSFLEET_TOKEN removal.

🤖 Generated with Claude Code

Greptile Summary

This PR removes the AGENTSFLEET_TOKEN environment variable across all CLI documentation and replaces it with the simpler AGENTSFLEET_API_KEY-wins-over-stored-login model. The auth-precedence for agentsfleet login token seeding is updated to --token → stdin → browser (dropping the env-var step), and every CI, troubleshooting, and reference example is updated consistently.

  • cli/configuration.mdx — rewrites Auth precedence to the new TTY-agnostic model; consolidates the env-var table from two rows (AGENTSFLEET_TOKEN + AGENTSFLEET_API_KEY) to one; updates the CI usage example.
  • cli/agentsfleet.mdx — updates login flag docs, logout note, and auth status description to reflect AGENTSFLEET_API_KEY as the active-credential override rather than AGENTSFLEET_TOKEN.
  • agents/troubleshooting.mdx, quickstart.mdx, api-reference/introduction.mdx — narrower touch-ups replacing the removed variable name and correcting the credentials path (adding .json suffix).

Confidence Score: 5/5

Documentation-only PR; all five files are updated consistently with no leftover AGENTSFLEET_TOKEN references.

Every occurrence of AGENTSFLEET_TOKEN has been replaced with the correct variable, the auth-precedence prose is internally consistent across all files, and the incidental credentials path fix (adding .json) is a net improvement. No logic, code, or API contracts are touched.

No files require special attention; the acknowledged provenance note (agent-key vs tenant-key) is intentionally deferred per the PR description.

Important Files Changed

Filename Overview
cli/configuration.mdx Auth precedence rewritten cleanly; env-var table consolidated to one AGENTSFLEET_API_KEY row; CI example updated correctly
cli/agentsfleet.mdx login/logout/auth-status docs updated consistently; "when present" qualifier correctly handles non-JWT API keys in auth status description
agents/troubleshooting.mdx Auth resolution order updated; incidentally fixes credentials path to include .json suffix
quickstart.mdx Non-interactive auth note updated to reflect new AGENTSFLEET_API_KEY approach for ongoing machine auth
api-reference/introduction.mdx Single-line curl example updated from AGENTSFLEET_TOKEN to AGENTSFLEET_API_KEY

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[CLI command issued] --> B{AGENTSFLEET_API_KEY set?}
    B -->|Yes| C[Send API key as bearer]
    B -->|No| D{credentials.json exists?}
    D -->|Yes| E[Send stored login JWT]
    D -->|No| F[Unauthenticated / error]

    G[agentsfleet login] --> H{--token flag?}
    H -->|Yes| I[Validate and persist token]
    H -->|No| J{stdin pipe?}
    J -->|Yes| I
    J -->|No| K{Interactive terminal?}
    K -->|Yes| L[Browser device flow]
    L --> I
    K -->|No or --no-input| M[Exit with error]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[CLI command issued] --> B{AGENTSFLEET_API_KEY set?}
    B -->|Yes| C[Send API key as bearer]
    B -->|No| D{credentials.json exists?}
    D -->|Yes| E[Send stored login JWT]
    D -->|No| F[Unauthenticated / error]

    G[agentsfleet login] --> H{--token flag?}
    H -->|Yes| I[Validate and persist token]
    H -->|No| J{stdin pipe?}
    J -->|Yes| I
    J -->|No| K{Interactive terminal?}
    K -->|Yes| L[Browser device flow]
    L --> I
    K -->|No or --no-input| M[Exit with error]
Loading

Reviews (1): Last reviewed commit: "docs(cli): drop AGENTSFLEET_TOKEN; docum..." | Re-trigger Greptile

…dence

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) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
agentsfleet 🟢 Ready View Preview Jun 19, 2026, 7:56 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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