Developers
CLI reference
#Overview
The CLI covers frequent workflows and provides JSON output for automation.
#Installation and configuration
Install the official package, then use cdn-pizza login or cdn-pizza login --token YOUR_API_TOKEN. CDN_PIZZA_API_URL and CDN_PIZZA_TOKEN can supply configuration; cdn-pizza config shows the effective source without revealing the secret.
Primary read commands support --json. Validation errors exit non-zero. pizza is an alias, but use cdn-pizza in scripts for clarity.
#Safe CI usage
Inject the token through the runner secret store.
Use JSON output rather than colored prose.
Pass explicit zone or network identifiers.
Add
--yesonly to already-reviewed destructive actions.
#31 commands
cdn-pizza --help · cdn-pizza --version · pizza
#login
Sign in with credentials or a personal token.
cdn-pizza login [options]
Options
-e, --email <email>- Email.
-p, --password <password>- Password; prefer the interactive prompt.
--token <token>- Personal API token.
--api-url <url>- Custom API URL.
Example
cdn-pizza login --token "$CDN_PIZZA_TOKEN"
#whoami
Show the current user, role, and organization.
cdn-pizza whoami
Example
cdn-pizza whoami
#logout
Revoke the current local token.
cdn-pizza logout [--revoke-env]
Options
--revoke-env- Also revoke CDN_PIZZA_TOKEN.
Example
cdn-pizza logout
#zones
List zones.
cdn-pizza zones [--json]
Options
--json- JSON output.
Example
cdn-pizza zones --json
#zone:create
Create a connected zone.
cdn-pizza zone:create -n <name> -d <domain>
Options
-n, --name <name>*- Zone name.
-d, --domain <domain>*- Domain.
--region <region>- Legacy ignored option.
Example
cdn-pizza zone:create -n assets -d assets.example.com
#upload
Upload a file to storage nodes.
cdn-pizza upload -z <zoneId> -f <path> [options]
Options
-z, --zone <zoneId>*- Zone ID.
-f, --file <path>*- Local file.
-n, --name <name>- Remote name.
--cache-ttl <seconds>- Cache TTL.
--direct-public-link- Create the direct storage link.
--storage-node <id...>- Up to three nodes.
Example
cdn-pizza upload -z 42 -f ./app.css --cache-ttl 86400
#files
List files.
cdn-pizza files [-z <zoneId>] [--json]
Options
-z, --zone <zoneId>- Filter by zone.
--json- JSON output.
Example
cdn-pizza files -z 42
#file:show
Show file details.
cdn-pizza file:show <uuid> [--json]
Options
<uuid>*- File UUID.
--json- JSON output.
Example
cdn-pizza file:show 550e8400-e29b-41d4-a716-446655440000
#file:delete
Permanently delete a file.
cdn-pizza file:delete <uuid> [--yes]
Options
<uuid>*- File UUID.
--yes- Confirm without prompting.
Example
cdn-pizza file:delete 550e8400-e29b-41d4-a716-446655440000 --yes
#purge
Purge a path or the entire zone.
cdn-pizza purge -z <zoneId> (--path <path> | --all) [--yes]
Options
-z, --zone <zoneId>*- Zone ID.
-p, --path <path>- Specific path.
--all- Entire zone.
--yes- Confirm a full purge.
Example
cdn-pizza purge -z 42 --path /assets/app.css
#stats
Show zone statistics.
cdn-pizza stats -z <zoneId> [--json]
Options
-z, --zone <zoneId>*- Zone ID.
--json- JSON output.
Example
cdn-pizza stats -z 42 --json
#nodes
List nodes.
cdn-pizza nodes [--json]
Options
--json- JSON output.
Example
cdn-pizza nodes
#billing
Show the current subscription.
cdn-pizza billing [--json]
Options
--json- JSON output.
Example
cdn-pizza billing
#billing:plans
List plans.
cdn-pizza billing:plans [--json]
Options
--json- JSON output.
Example
cdn-pizza billing:plans
#billing:checkout
Create a checkout session.
cdn-pizza billing:checkout --plan <plan>
Options
--plan <plan>*- Plan code.
Example
cdn-pizza billing:checkout --plan pro
#networks
List private networks.
cdn-pizza networks [--json]
Options
--json- JSON output.
Example
cdn-pizza networks
#network:create
Create a private WireGuard network.
cdn-pizza network:create -n <name> --cidr <cidr> [options]
Options
-n, --name <name>*- Name.
--cidr <cidr>*- Private CIDR.
-d, --description <text>- Description.
--route <cidr...>- Advertised routes.
Example
cdn-pizza network:create -n backoffice --cidr 10.42.0.0/24
#network:key
Create a short-lived enrollment key.
cdn-pizza network:key <networkId> [options]
Options
<networkId>*- Network ID.
-n, --name <name>- Key name.
--uses <number>- Maximum uses.
--hours <number>- Validity in hours.
Example
cdn-pizza network:key 7 --name deploy --uses 1 --hours 1
#network:show
Show a network and its availability.
cdn-pizza network:show <networkId> [--json]
Options
<networkId>*- Network ID.
--json- JSON output.
Example
cdn-pizza network:show 7
#network:profile
Generate a WireGuard profile without enabling it.
cdn-pizza network:profile --token <token> [options]
Options
--token <token>*- cpn_… key.
-n, --name <name>- Device name.
--type <type>- Peer type.
--endpoint <endpoint>- Public endpoint.
--output <path>- Output file.
--install- Enable with wg-quick.
Example
cdn-pizza network:profile --token "$ENROLLMENT_TOKEN" --output ./wg-cdn.conf
#network:enroll
Enroll the machine and write its profile.
cdn-pizza network:enroll --token <token> [options]
Options
--token <token>*- cpn_… key.
-n, --name <name>- Device name.
--type <type>- Peer type.
--endpoint <endpoint>- Public endpoint.
--output <path>- Output file.
--install- Enable with wg-quick.
Example
cdn-pizza network:enroll --token "$ENROLLMENT_TOKEN" --install
#status-agent:enroll
Enroll this machine as a status agent.
cdn-pizza status-agent:enroll --token <token> [options]
Options
--token <token>*- cps_… key.
-n, --name <name>- Agent name.
--api-url <url>- API URL.
Example
cdn-pizza status-agent:enroll --token "$STATUS_ENROLLMENT_TOKEN"
#status-agent:key
Create an agent enrollment key.
cdn-pizza status-agent:key --status-page <id> -n <name> [options]
Options
--status-page <id>*- Page ID.
-n, --name <name>*- Name.
--uses <number>- Maximum uses.
--hours <number>- Validity.
--yes- Script compatibility.
Example
cdn-pizza status-agent:key --status-page 3 -n branch-geneva
#status-agent:status
List local agents without exposing their tokens.
cdn-pizza status-agent:status [--json]
Options
--json- JSON output.
Example
cdn-pizza status-agent:status
#status-agent:run
Send local heartbeats and results.
cdn-pizza status-agent:run [options]
Options
--agent <id>- Local agent.
--interval <seconds>- Interval, minimum 5 s.
--once- Run once.
Example
cdn-pizza status-agent:run --once
#agent:status
Inspect local WireGuard profiles.
cdn-pizza agent:status [options]
Options
--config <path>- Specific profile.
--json- JSON output.
Example
cdn-pizza agent:status --json
#agent:up
Enable a profile with wg-quick.
cdn-pizza agent:up --config <path> [--unsafe-config]
Options
--config <path>*- WireGuard profile.
--unsafe-config- Allow an unregistered external profile.
Example
sudo cdn-pizza agent:up --config ./wg-cdn.conf
#agent:down
Stop a WireGuard profile.
cdn-pizza agent:down --config <path> [--unsafe-config]
Options
--config <path>*- WireGuard profile.
--unsafe-config- Allow an unregistered external profile.
Example
sudo cdn-pizza agent:down --config ./wg-cdn.conf
#agent:run
Automatically keep a tunnel active.
cdn-pizza agent:run --config <path> [options]
Options
--config <path>*- WireGuard profile.
--interval <seconds>- Check interval.
--unsafe-config- Allow an unregistered external profile.
Example
sudo cdn-pizza agent:run --config ./wg-cdn.conf --interval 30
#config
Show configuration sources without revealing the secret.
cdn-pizza config
Example
cdn-pizza config
#dev
Serve a static directory locally.
cdn-pizza dev [-p <port>] [-d <dir>]
Options
-p, --port <port>- Port, default 3000.
-d, --dir <dir>- Directory, current by default.
Example
cdn-pizza dev -p 3000 -d ./dist