Authentication
How to authenticate Arial with Anthropic's Claude API.
Overview
Arial supports two authentication methods:
| Method | Best For | Setup |
|---|---|---|
| **Local credentials** | Local development | `claude login` |
| **API key** | CI/CD, automation, teams | Environment variable |
If both are available, API key takes precedence.
Local Credentials (Recommended for Development)
Use Claude's built-in authentication for the simplest setup.
Setup
# Authenticate with your Anthropic account
claude loginThis opens a browser for OAuth authentication and stores credentials locally.
Usage
No additional configuration needed. Arial automatically uses local credentials:
arial init
arial plan --specs ./specs
arial runVerify
# Check if logged in
claude whoamiAPI Key
Use an API key for automated environments or when local credentials aren't available.
Get an API Key
- Go to console.anthropic.com
- Navigate to API Keys
- Create a new key (starts with
sk-ant-)
Setup
Temporary (current session):
export ANTHROPIC_API_KEY=sk-ant-your-key-herePersistent (add to shell config):
# For bash
echo 'export ANTHROPIC_API_KEY=sk-ant-your-key-here' >> ~/.bashrc
source ~/.bashrc
# For zsh
echo 'export ANTHROPIC_API_KEY=sk-ant-your-key-here' >> ~/.zshrc
source ~/.zshrcVerify
echo $ANTHROPIC_API_KEY
# Should output: sk-ant-...Authentication Precedence
When both methods are available:
- API key (if
ANTHROPIC_API_KEYis set) - Local credentials (fallback)
This allows you to:
- Use local credentials for development
- Override with API key in CI/CD via environment variable
CI/CD Setup
For GitHub Actions, add your API key as a secret:
# .github/workflows/arial.yml
jobs:
run-arial:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Arial
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: |
npx arial init
npx arial plan --specs ./specs -y
npx arial run --no-tuiFor other CI systems, set ANTHROPIC_API_KEY as an environment variable or secret.
Troubleshooting
"Missing ANTHROPIC_API_KEY environment variable"
This error appears when:
- No API key is set, AND
- No local credentials exist
Fix: Either run claude login or set ANTHROPIC_API_KEY.
"Invalid API key"
Fix: Verify your key at console.anthropic.com. Keys start with sk-ant-.
Local credentials not working
# Re-authenticate
claude logout
claude loginCheck which auth method is active
# If this shows your key, API key auth is active
echo $ANTHROPIC_API_KEY
# If empty, local credentials will be used (if available)
claude whoamiSecurity Best Practices
- Never commit API keys to version control
- Use secrets in CI/CD systems
- Rotate keys periodically via the Anthropic console
- Use local credentials for development to avoid key exposure