Developers

CLI and API to automate your CDN

The cdn-pizza CLI and the REST API drive zones, files, purge, statistics and private networks from your terminal or your CI.

$ curl -fsSL https://console.cdn.pizza/downloads/cdn-pizza-cli/install.sh | sh$ cdn-pizza login --token "$CDN_PIZZA_TOKEN"$ cdn-pizza zone:create -n assets -d assets.example.com$ cdn-pizza upload -z 42 -f ./app.css --cache-ttl 86400$ cdn-pizza purge -z 42 --path /assets/app.css

Install the CLI

The console serves an install script that checks for Node.js 18 or newer, then installs the official package. Then sign in with a personal API token.

$ curl -fsSL https://console.cdn.pizza/downloads/cdn-pizza-cli/install.sh | sh$ cdn-pizza login --token "$CDN_PIZZA_TOKEN"

CLI commands

29 commands, from sign-in to files, purge, private networks and status agents.

  • loginSign in with credentials or a personal token.
  • whoamiShow the current user, role, and organization.
  • logoutRevoke the current local token.
  • zonesList zones.
  • zone:createCreate a connected zone.
  • uploadUpload a file to storage nodes.
  • filesList files.
  • file:showShow file details.
  • file:deletePermanently delete a file.
  • purgePurge a path or the entire zone.
  • statsShow zone statistics.
  • nodesList nodes.
  • networksList private networks.
  • network:createCreate a private WireGuard network.
  • network:keyCreate a short-lived enrollment key.
  • network:showShow a network and its availability.
  • network:profileGenerate a WireGuard profile without enabling it.
  • network:enrollEnroll the machine and write its profile.
  • network:refreshRefresh an existing WireGuard profile without dropping the tunnel.
  • status-agent:enrollEnroll this machine as a status agent.
  • status-agent:keyCreate an agent enrollment key.
  • status-agent:statusList local agents without exposing their tokens.
  • status-agent:runSend local heartbeats and results.
  • agent:statusInspect local WireGuard profiles.
  • agent:upEnable a profile with wg-quick.
  • agent:downStop a WireGuard profile.
  • agent:runAutomatically keep a tunnel active.
  • configShow configuration sources without revealing the secret.
  • devServe a static directory locally.

REST API, GraphQL and webhooks

42 REST operations are documented and described in OpenAPI. GraphQL is available read-only and webhooks push events to your tools.

CI recipes

Inject the token from the runner secret store, use --json output and pass explicit zone or network identifiers.

Read the documentation
FAQ

Frequently asked questions

Does the CLI work in CI?

Yes. It accepts a token through CDN_PIZZA_TOKEN, its read commands output JSON and destructive actions ask for --yes.

Can I start without the CLI?

Yes. The console is enough to start; automation helps once the work repeats.

Put your domain behind cdn.pizza

Create an account, add a domain and choose your POPs. No card is required and there is no subscription.

  • No subscription, no card
  • No fee on standard and partner POP traffic
  • Documentation in French, English and German