Authentication & Token Setup
All CLI commands require an API token. Tokens are team-scoped and follow the format zxk_live_.... Generate one from the dashboard under Team Settings > API Keys.
Token resolution order
The CLI resolves your token in this priority: 1. --token CLI flag (highest). 2. ZYBERSPACE_TOKEN environment variable. 3. Saved config file at ~/.zyberspace/config.json (owner-only permissions 0o600).
Save a token
Run zyber whoami --token zxk_live_... --save to persist the token to ~/.zyberspace/config.json. All subsequent commands will use it automatically. The file is created with owner-only read/write permissions.
Environment variable
Set ZYBERSPACE_TOKEN in your shell or CI environment. This is the recommended approach for CI/CD pipelines: export ZYBERSPACE_TOKEN=zxk_live_AbCdEfGhIjKlMnOpQrSt....
Required scopes
Different commands need different scopes: zyber whoami — any valid token. zyber deploy — sites:read, deployments:write (+ sites:write if auto-creating). zyber sites list — sites:read. zyber sites create — sites:write. zyber sites delete — sites:write.
Code examples
# Method 1: Pass token directly
zyber whoami --token zxk_live_YOUR_API_KEY
# Method 2: Environment variable
export ZYBERSPACE_TOKEN=zxk_live_YOUR_API_KEY
zyber sites list
# Method 3: Save token for future use
zyber whoami --token zxk_live_YOUR_API_KEY --save
zyber sites list// For CI/CD, set ZYBERSPACE_TOKEN as an environment variable
// Example: GitHub Actions
// env:
// ZYBERSPACE_TOKEN: ${{ secrets.ZYBERSPACE_TOKEN }}
// For local development, save to config:
// zyber whoami --token zxk_live_YOUR_API_KEY --saveBase URL: https://www.zyberspace.com