get your claude code tokens here
Shell 47.4%
TypeScript 29.8%
HTML 18.2%
Other 4.6%
13 1 0

Clone this repository

https://tangled.org/dunkirk.sh/anthropic-api-key
git@knot.dunkirk.sh:dunkirk.sh/anthropic-api-key

For self-hosted knots, clone URLs may differ based on your setup.

README.md

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/anthropic and 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