cyrus-setup-claude-auth
Original:🇺🇸 English
Translated
Configure Claude Code authentication for Cyrus — API key, OAuth token, or third-party provider.
2installs
Sourceceedaragents/cyrus
Added on
NPX Install
npx skill4agent add ceedaragents/cyrus cyrus-setup-claude-authTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →CRITICAL: Never use , , or tools on or any file inside . Use only commands (, , etc.) to interact with env files — secrets must never be read into the conversation context.
ReadEditWrite~/.cyrus/.env~/.cyrus/Bashgrepprintf >>Setup Claude Auth
Configures Claude Code credentials so Cyrus can run AI sessions.
Step 1: Check Existing Auth
Check if credentials are already configured:
bash
grep -c -E '^(ANTHROPIC_API_KEY|CLAUDE_CODE_OAUTH_TOKEN)=' ~/.cyrus/.env 2>/dev/null || echo "0"If the count is >= 1, inform the user:
Claude Code authentication is already configured. Skipping this step. To reconfigure, remove the existing key fromand re-run this skill.~/.cyrus/.env
Skip to completion.
Step 2: Choose Auth Method
Ask the user:
How would you like to authenticate Claude Code?
- Current account (easiest) — use the credentials from your active
CLI sessionclaude- API Key — from console.anthropic.com
- Separate OAuth token — run
to generate a token for a specific accountclaude setup-token- Third-Party Provider — Vertex AI, AWS Bedrock, Azure, etc.
Step 3: Configure Credentials
CRITICAL: Secrets must NEVER appear in the conversation. Do not explore looking for credential files. Use only the methods below.
~/.claude/Detect the OS for the right clipboard command:
bash
uname -sOption 1: Current Account
Check if is authenticated on this machine:
claudebash
claude auth statusIf authenticated, instruct the user to run which will output a token.
claude setup-tokenTo capture it safely, append a placeholder line to the env file, then open it in a GUI window so the user can paste the token:
bash
grep -q '^CLAUDE_CODE_OAUTH_TOKEN=' ~/.cyrus/.env || echo 'CLAUDE_CODE_OAUTH_TOKEN=' >> ~/.cyrus/.envThen open the file in a separate window — use whatever GUI editor is available:
bash
# macOS: VS Code if available, otherwise TextEdit
code --new-window ~/.cyrus/.env 2>/dev/null || open -a TextEdit ~/.cyrus/.env
# Linux
code ~/.cyrus/.env 2>/dev/null || xdg-open ~/.cyrus/.envTell the user:
- Run
in a separate terminalclaude setup-token- Copy the token it outputs
- I've opened
— find the~/.cyrus/.envlineCLAUDE_CODE_OAUTH_TOKEN=- Paste the token right after the
(no spaces, no newline)=- Save and close the file
Option 2: API Key
Instruct the user to copy their API key from the Anthropic Console, then provide the appropriate command:
macOS:
bash
printf 'ANTHROPIC_API_KEY=%s\n' "$(pbpaste)" >> ~/.cyrus/.envLinux:
bash
printf 'ANTHROPIC_API_KEY=%s\n' "$(xclip -selection clipboard -o)" >> ~/.cyrus/.envUniversal fallback:
bash
read -s -p "Paste your Anthropic API key: " val && printf 'ANTHROPIC_API_KEY=%s\n' "$val" >> ~/.cyrus/.env && echo " ✓ Saved"Option 3: Separate OAuth Token
This is for when the user wants to generate a token for a different account than the one currently logged in (e.g., running on another machine).
claude setup-tokenAppend the placeholder, then open the file for the user to paste:
bash
grep -q '^CLAUDE_CODE_OAUTH_TOKEN=' ~/.cyrus/.env || echo 'CLAUDE_CODE_OAUTH_TOKEN=' >> ~/.cyrus/.envbash
# macOS
code --new-window ~/.cyrus/.env 2>/dev/null || open -a TextEdit ~/.cyrus/.env
# Linux
code ~/.cyrus/.env 2>/dev/null || xdg-open ~/.cyrus/.envTell the user:
- On the other machine, run
claude setup-token- Copy the token it outputs
- I've opened
— find~/.cyrus/.envand paste the token after theCLAUDE_CODE_OAUTH_TOKEN==- Save and close
Option 4: Third-Party Provider
Inform the user:
For third-party providers, you'll need to set provider-specific environment variables. See Third-Party Integrations for details.Common configurations:AWS Bedrock:CLAUDE_CODE_USE_BEDROCK=1 AWS_REGION=us-east-1Google Vertex AI:CLAUDE_CODE_USE_VERTEX=1 CLOUD_ML_REGION=us-east5 ANTHROPIC_VERTEX_PROJECT_ID=your-project-id
Guide the user to add the appropriate variables to using the clipboard-to-env pattern.
~/.cyrus/.envStep 4: Verify
After the user runs the command, verify the key was written:
bash
grep -c -E '^(ANTHROPIC_API_KEY|CLAUDE_CODE_OAUTH_TOKEN|CLAUDE_CODE_USE_BEDROCK|CLAUDE_CODE_USE_VERTEX)=' ~/.cyrus/.envIf the count is 0, the credential was not saved. Ask the user to try again.
Completion
✓ Claude Code authentication configured.