Anthropic API key fetcher#
simple cli to fetch an anthropic access token using oauth (pkce), built with bun
usage#
bunx anthropic-api-key
npx anthropic-api-key
# override port
PORT=9999 bunx anthropic-api-key
# help
bunx anthropic-api-key --help
what it does#
- starts a local server and auto-opens your browser
- guides you through anthropic oauth (pkce)
- prints an access token to stdout and exits
- caches tokens at
~/.config/crush/anthropicand reuses them on later runs - if a cached token is still valid, it prints immediately and exits
- if expired and a refresh token exists, it refreshes, saves, prints, and exits
© 2025-present Kieran Klukas