feat(cli): add 'coder login token' command to print session token by kacpersaw · Pull Request #21627 · coder/coder
Documentation Check
Updates Needed
-
docs/admin/users/sessions-tokens.md- Add a section showing how to usecoder login tokento retrieve the current session token for use in scripts and automation (similar to thegh auth tokenpattern mentioned in issue Allow fetching current auth token via CLI #21515) -
docs/ai-coder/ai-bridge/client-config.md- Update the Authentication section (line 18-23) to mention that users can retrieve their session token usingcoder login tokenrather than only referencing long-lived API keys -
docs/ai-coder/ai-bridge/client-config.md- Update the example in the PR description to show in the docs (theCODER_SESSION_TOKEN=$(coder login token)and AI Bridge usage patterns)
Context
The PR adds a new coder login token command that prints the current session token for use in scripts and automation, similar to gh auth token. While the CLI reference docs are auto-generated and included, the feature documentation could benefit from:
- Session token documentation should explain this new retrieval method alongside the existing
/cli-authURL method - AI Bridge documentation currently only mentions long-lived API keys for external clients but could show the new command as a way to retrieve session tokens for scripting
- Usage examples from the PR description (setting
ANTHROPIC_API_KEYandANTHROPIC_BASE_URL) would be valuable to include
The auto-generated CLI docs at docs/reference/cli/login_token.md are already included and correct.
Automated review via Coder Tasks