Deploy

Push your site to the edge with the CLI, or do it yourself with curl.

Option 1: yourspace deploy

The simplest path. The CLI validates your config, bundles your site, and pushes everything in one step:

$ yourspace deploy
  ✓ Validating yourspace.yml
  ✓ Bundling dist → site.tar.gz (142 KB)
  ✓ TLS provisioned
  ✓ 14 edge nodes active
  ✓ live → your-site.yo.urspace.net

Option 2: Do it yourself with curl

If you prefer scripting your own deploy pipeline, or want to understand what the CLI does under the hood, here's the manual process:

Step 1 — Generate an account key

Create an API key from your YourSpace account. This key authenticates all API requests.

$ curl -X POST https://api.yo.urspace.net/v1/keys \
    -H "Content-Type: application/json" \
    -d '{"name": "deploy-key"}' \
    | jq .key

"ys_live_k1_abc123..."

Step 2 — Bundle your site

$ tar -czf site.tar.gz -C dist .

Step 3 — Upload and deploy

$ curl -X POST https://api.yo.urspace.net/v1/deploy \
    -H "Authorization: Bearer ys_live_k1_abc123..." \
    -F "config=@yourspace.yml" \
    -F "bundle=@site.tar.gz"

{"status":"ok","url":"https://your-site.yo.urspace.net","nodes":14}

tl;dr — three commands, no CLI needed

# 1. generate a key (once)
curl -X POST https://api.yo.urspace.net/v1/keys \
  -d '{"name":"my-key"}' | jq .key

# 2. package your site
tar -czf site.tar.gz -C dist .

# 3. ship it
curl -X POST https://api.yo.urspace.net/v1/deploy \
  -H "Authorization: Bearer YOUR_KEY" \
  -F "config=@yourspace.yml" \
  -F "bundle=@site.tar.gz"