---
title: "Configuration"
description: "Configure the Edge CLI with edge config: default region, output formats (table, JSON, quiet), global flags, environment variables, and scripting examples."
url: "https://edge.network/docs/cli/configuration"
section: "CLI"
---

# Configuration

Customise CLI behaviour with persistent settings and flags.

## Configuration commands

### List all settings

```text
$ edge config list
api_url         https://api.edge.network
output          table
default_region  london
no_color        false
```

### Get a setting

```text
$ edge config get output
table

$ edge config get default_region
london
```

### Set a value

```bash
# Set default output format
edge config set output json

# Set default region
edge config set default_region london

# Disable colored output
edge config set no_color true
```

### Unset a value

```bash
# Remove a setting (use default)
edge config unset default_region
```

## Available settings

| Setting | Description | Default |
|---|---|---|
| `api_url` | API endpoint URL | `https://api.edge.network` |
| `output` | Default output format (`table`, `json`, `yaml`) | `table` |
| `default_region` | Default region for new resources | None |
| `no_color` | Disable coloured output | `false` |

## Config file

Settings are stored in a JSON file:

- **macOS / Linux:** `~/.edge/config.json`
- **Windows:** `%USERPROFILE%\.edge\config.json`

```json
{
  "api_key": "ek_live_abc123...",
  "api_url": "https://api.edge.network",
  "output": "table",
  "default_region": "london",
  "no_color": false
}
```

## Global flags

Override settings for individual commands:

```bash
# Override output format for single command
edge compute list --output json

# Override output format shorthand
edge compute list -o json

# Quiet mode (IDs only)
edge compute list --quiet
edge compute list -q

# Verbose mode (debug info)
edge compute list --verbose
edge compute list -v

# Skip confirmation prompts
edge compute delete vm-abc123 --yes
edge compute delete vm-abc123 -y

# Specify API key directly
edge compute list --api-key ek_live_xyz...
```

## Output formats

### Table (default)

Human-readable tabular format:

```text
$ edge compute list
ID          NAME           STATUS    IP             SIZE           REGION
vm-abc123   web-1          running   192.0.2.10     s-2vcpu-4gb    london
vm-def456   api-server     running   192.0.2.11     s-4vcpu-8gb    london
```

### JSON

Machine-readable JSON for scripting:

```text
$ edge compute list -o json
[
  {
    "id": "vm-abc123",
    "name": "web-1",
    "status": "running",
    "ip": "192.0.2.10",
    "size": "s-2vcpu-4gb",
    "region": "london"
  },
  {
    "id": "vm-def456",
    "name": "api-server",
    "status": "running",
    "ip": "192.0.2.11",
    "size": "s-4vcpu-8gb",
    "region": "london"
  }
]
```

### Quiet

IDs only, one per line:

```text
$ edge compute list -q
vm-abc123
vm-def456
```

## Scripting examples

Combine CLI commands for automation:

```bash
#!/bin/bash

# Stop all VMs
for vm in $(edge compute list -q); do
  echo "Stopping $vm..."
  edge compute stop "$vm" --yes
done

# Purge CDN and sync new assets
edge cdn purge my-deployment --yes
edge storage sync ./dist my-bucket/website/

# Get VM IP as variable
VM_IP=$(edge compute get vm-abc123 -o json | jq -r '.ip')
echo "VM IP: $VM_IP"
```

## Environment variables

| Variable | Description |
|---|---|
| `EDGE_API_KEY` | API key for authentication |
| `EDGE_API_URL` | Override API endpoint |
| `EDGE_OUTPUT` | Default output format |
| `EDGE_REGION` | Default region |
| `NO_COLOR` | Disable colours (standard env var) |

Environment variables take precedence over config file settings but are overridden by command-line flags.

## Exit codes

| Code | Meaning |
|---|---|
| `0` | Success |
| `1` | General error |
| `2` | Authentication error |
| `130` | Interrupted (Ctrl+C) |

## Next steps

- [Authentication](/docs/cli/authentication) — API key setup
- [CLI overview](/docs/cli) — Getting started guide
