get your claude code tokens here

docs: add readme

dunkirk.sh 7138ba24 a09cdafa

verified
Changed files
+63 -5
+27
LICENSE.md
···
+
The MIT License (MIT)
+
=====================
+
+
Copyright © `2025` `Kieran Klukas`
+
+
Permission is hereby granted, free of charge, to any person
+
obtaining a copy of this software and associated documentation
+
files (the “Software”), to deal in the Software without
+
restriction, including without limitation the rights to use,
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
+
copies of the Software, and to permit persons to whom the
+
Software is furnished to do so, subject to the following
+
conditions:
+
+
The above copyright notice and this permission notice shall be
+
included in all copies or substantial portions of the Software.
+
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+
OTHER DEALINGS IN THE SOFTWARE.
+
+
+36 -5
README.md
···
-
# anthropic-api-key
+
# Anthropic API key fetcher
+
+
simple cli to fetch an anthropic access token using oauth (pkce), built with bun
+
+
<p align="center">
+
<img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" />
+
</p>
-
To install dependencies:
+
## install
```bash
bun install
```
-
To run:
+
## usage
```bash
-
bun run index.ts
+
# one-off via bunx (recommended)
+
bunx anthropic
+
+
# or via npx
+
npx anthropic
+
+
# override port
+
PORT=9999 bunx anthropic
+
+
# help
+
bunx anthropic --help
```
-
This project was created using `bun init` in bun v1.2.19. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
+
## 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
+
+
<p align="center">
+
<i><code>&copy 2025-present <a href="https://github.com/taciturnaxolotl">Kieran Klukas</a></code></i>
+
</p>
+
+
<p align="center">
+
<a href="https://github.com/taciturnaxolotl/anthropic-api-key/blob/master/LICENSE"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a>
+
</p>