Update setup skill to use claude setup-token for auth

Replace manual credential extraction with the proper CLI command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gavriel Cohen
2026-02-03 21:03:35 +02:00
parent 21c66df2b1
commit 7ff9a65792

View File

@@ -80,23 +80,21 @@ Ask the user:
### Option 1: Claude Subscription (Recommended)
Ask the user:
> Want me to grab the OAuth token from your current Claude session?
Tell the user:
> Open another terminal window and run:
> ```
> claude setup-token
> ```
> A browser window will open for you to log in. Once authenticated, the token will be displayed in your terminal. Either:
> 1. Paste it here and I'll add it to `.env` for you, or
> 2. Add it to `.env` yourself as `CLAUDE_CODE_OAUTH_TOKEN=<your-token>`
If they give you the token, add it to `.env`:
If yes:
```bash
TOKEN=$(cat ~/.claude/.credentials.json 2>/dev/null | jq -r '.claudeAiOauth.accessToken // empty')
if [ -n "$TOKEN" ]; then
echo "CLAUDE_CODE_OAUTH_TOKEN=$TOKEN" > .env
echo "Token configured: ${TOKEN:0:20}...${TOKEN: -4}"
else
echo "No token found - are you logged in to Claude Code?"
fi
echo "CLAUDE_CODE_OAUTH_TOKEN=<token>" > .env
```
If the token wasn't found, tell the user:
> Run `claude` in another terminal and log in first, then come back here.
### Option 2: API Key
Ask if they have an existing key to copy or need to create one.