Edge

CLI

Authentication

Authenticate the CLI with your Edge account using API keys.

1

Generate an API Key

Create an API key in your Edge account:

  1. Go to Account → API Keys
  2. Click Create API Key
  3. Give it a name (e.g., "CLI - MacBook")
  4. Copy the key immediately — it won't be shown again

Important

API keys have the same permissions as your user account. Keep them secure and never commit them to version control.

2

Log In

Interactive Login

Run the login command and paste your API key when prompted:

$ edge auth login
? Enter your API key: ek_live_••••••••••••••••••••••••

✓ Authenticated successfully
  Account: Acme Corp
  User: john@example.com

Non-Interactive Login

Pass the key directly (useful for scripts):

edge 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:  Never

Log Out

Remove stored credentials:

$ edge auth logout
✓ Credentials removed

Environment 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...' >> ~/.zshrc

The environment variable takes precedence over the stored config file.

Config File Location

Credentials are stored in:

  • ~/.edge/config.json macOS / Linux
  • %USERPROFILE%\.edge\config.json Windows

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/

Tip

Create a dedicated API key for CI/CD with a descriptive name like "GitHub Actions - Production".

Authentication Priority

The CLI checks for credentials in this order:

  1. Command-line flag: --api-key
  2. Environment variable: EDGE_API_KEY
  3. 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