Anthropic API key fetcher#
simple cli to fetch an anthropic access token using oauth (pkce), built with bun
install#
bun install
usage#
# one-off via bunx (recommended)
bunx anthropic
# or via npx
npx anthropic
# override port
PORT=9999 bunx anthropic
# help
bunx anthropic --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