docs

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 bundles the directory named by build.dist in yourspace.yml (or --dist <path> per-run), uploads the bundle + config in one multipart POST, and reports the resulting URL. Repeated deploys bump a version counter on the site:

$ yourspace deploy
  ✓ Validating yourspace.yml
  ✓ Bundled dist/ — 12 files, 4.8 KB
  ✓ Uploaded (v1)
  ✓ live → https://my-site.yo.urspace.net

Pass --json to get the raw API response for tooling. The CLI resolves your bearer token from $YOURSPACE_TOKEN, then falls back to the on-disk token written by yourspace login — see CLI → login for the storage path and precedence.

Redeploy — the version bump

Running yourspace deploy again on the same site mints a fresh version; the deploy output is the same shape as the first run with the counter incremented. yourspace status confirms which version is live:

$ yourspace deploy
  ✓ Validating yourspace.yml
  ✓ Bundled dist/ — 14 files, 5.1 KB
  ✓ Uploaded (v2)
  ✓ live → https://my-site.yo.urspace.net

$ yourspace status
  my-site (v2) — live
  nodes: iad, cdg, gru, sin

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 — Bundle your site

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

Step 2 — Upload and deploy

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

{"status":"ok","name":"my-site","url":"https://my-site.yo.urspace.net","version":1}

tl;dr — two commands, no CLI needed

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

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

After the deploy — yourspace status

Check a site's live state without parsing ls output. Without arguments, reads the name: field from the local yourspace.yml; pass a name to check any site you own:

$ yourspace status
  my-site (v3) — live
  nodes: iad, cdg, gru, sin

yourspace ls lists every site on the account; yourspace status <name> focuses on one. Both accept --json for scripting.