Deploy Command
Deploy a directory or ZIP file to a site. The deploy command is the primary CLI operation — it handles zipping, uploading, and optionally publishing in one step.
Usage
zyber deploy [path] --site <slug> [--publish]. The path argument defaults to . (current directory). It can be a directory or a .zip file.
Options
--site <slug> (required) — Target site slug. --publish — Publish immediately after upload. Without this flag, the deployment is created in draft status and can be published later via the API.
Auto-create
If the site slug doesn't exist, it is created automatically. The site name is set to the slug. This makes first-deploy workflows seamless: just pick a slug and deploy.
File handling
When deploying a directory: reads .gitignore from the directory root and excludes matched files. Always excludes: .git/, node_modules/, .env, .env.*, .DS_Store, Thumbs.db. Builds a ZIP archive in memory (compression level 6) and uploads it. When deploying a .zip file, it is uploaded as-is.
Deploy flow
1. Resolve team via /api/v1/whoami. 2. Check if site exists (GET), auto-create if not (POST). 3. Zip directory or read ZIP file. 4. Upload as multipart/form-data to /sites/{slug}/deployments. 5. Optionally publish via /sites/{slug}/deployments/{id}/publish.
Example response
✔ Team: My Team (my-team) ✔ Site "my-portfolio" found ✔ Zipped 42 files (1.2 MB -> 340.0 KB) ✔ Uploaded Deployment Site my-portfolio Files 42 files (1.2 MB) Deployment v-2vka1lafuv0ebvru9m3 Preview https://v-2vka1lafuv0ebvru9m3-my-portfolio.zxapi.net Status draft info To publish: zyber deploy ./dist --site my-portfolio --publish done Done
Code examples
# Deploy a directory as draft
zyber deploy ./dist --site my-site
# Deploy and publish in one step
zyber deploy ./dist --site my-site --publish
# Deploy current directory
zyber deploy . --site my-app --publish
# Deploy a ZIP file
zyber deploy ./build.zip --site my-blog --publish// The deploy command is a CLI tool, but the same flow
// can be replicated via the REST API:
// 1. Auto-create site (if needed)
await fetch(`https://www.zyberspace.com/api/v1/{teamSlug}/sites`, {
method: "POST",
headers: { Authorization: "Bearer zxk_live_YOUR_API_KEY", "Content-Type": "application/json" },
body: JSON.stringify({ name: "my-site", slug: "my-site" }),
});
// 2. Upload ZIP
const form = new FormData();
form.append("file", zipBlob, "deploy.zip");
const deploy = await fetch(`https://www.zyberspace.com/api/v1/{teamSlug}/sites/my-site/deployments`, {
method: "POST", headers: { Authorization: "Bearer zxk_live_YOUR_API_KEY" }, body: form,
}).then(r => r.json());
// 3. Publish
await fetch(`https://www.zyberspace.com/api/v1/{teamSlug}/sites/my-site/deployments/${deploy.data.deploymentId}/publish`, {
method: "POST", headers: { Authorization: "Bearer zxk_live_YOUR_API_KEY" },
});Base URL: https://www.zyberspace.com