CLI
Configuration
Customise CLI behaviour with persistent settings and flags.
On this page9 sections
Configuration commands#
List all settings#
Text
$ edge config list
api_url https://api.edge.network
output table
default_region london
no_color falseGet a setting#
Text
$ edge config get output
table
$ edge config get default_region
londonSet a value#
Terminal
# 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 trueUnset a value#
Terminal
# Remove a setting (use default)
edge config unset default_regionAvailable 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:
Terminal
# 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 londonJSON#
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-def456Scripting examples#
Combine CLI commands for automation:
Terminal
#!/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
Something unclear or out of date? Tell us