CLI
Authentication
Authenticate the CLI with your Edge account using API keys.
On this page10 sections
1. Generate an API key#
Create an API key in your Edge account:
- Go to Account → API Keys.
- Click Create API Key.
- Give it a name (e.g. “CLI - MacBook”).
- Copy the key immediately. It won’t be shown again.
The same key also authenticates direct HTTPS calls. See the REST API documentation.
2. Log in#
Run the login command and paste your API key when prompted (interactive), or pass the key directly, which is useful for scripts (non-interactive):
$ edge auth login
? Enter your API key: ek_live_••••••••••••••••••••••••
✓ Authenticated successfully
Account: Acme Corp
User: john@example.comedge auth login --key ek_live_abc123def456...Check authentication status#
$ edge auth status
✓ Authenticated
Account: Acme Corp
User: john@example.com
Key: ek_live_abc1****
Expires: NeverLog out#
Remove stored credentials:
$ edge auth logout
✓ Credentials removedEnvironment variable#
You can also authenticate using the EDGE_API_KEY environment variable:
# Set for current session
export EDGE_API_KEY=ek_live_abc123def456...
# Or add to your shell profile (~/.bashrc, ~/.zshrc)
echo 'export EDGE_API_KEY=ek_live_abc123...' >> ~/.zshrcThe environment variable takes precedence over the stored config file.
Config file location#
Credentials are stored in:
- macOS / Linux:
~/.edge/config.json - Windows:
%USERPROFILE%\.edge\config.json
Example config:
{
"api_key": "ek_live_abc123def456...",
"default_region": "london",
"output": "table"
}CI/CD integration#
Use environment variables in your CI/CD pipelines:
# GitHub Actions example
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Edge CLI
run: curl -fsSL https://edge.network/install.sh | sh
- name: Deploy
env:
EDGE_API_KEY: ${{ secrets.EDGE_API_KEY }}
run: |
edge cdn purge my-deployment
edge storage sync ./dist my-bucket/app/Authentication priority#
The CLI checks for credentials in this order:
- Command-line flag:
--api-key - Environment variable:
EDGE_API_KEY - Config file:
~/.edge/config.json
Activity tracking#
All actions performed via the CLI are logged in your account activity log with full attribution:
- Source badge: CLI actions are tagged with a CLI badge to distinguish them from web or API actions
- User attribution: for accounts with team members, the activity log shows which user performed each action
- Full audit trail: all create, update and delete operations are logged with timestamps
This helps teams track automated deployments, distinguish CI/CD activity from manual changes, and maintain compliance records.
Next steps
Something unclear or out of date? Tell us