publish.my

Docs / Publish with curl

Publish with curl (no agent)

No AI agent, no browser — just a terminal. publish.my is a plain HTTP API: pack a folder into a tarball, POST it, and you get a live URL. Here's the whole thing by hand.

You'll need curl and tar — both ship with macOS, Linux, and Windows 10/11. Your site must have an index.html at the top of the folder (see What you can host).

1. Pack your folder

Pack the contents of your site folder (the -C dir . form puts index.html at the archive root, where it must be):

tar -czf /tmp/site.tar.gz -C ./mysite .

Subfolders are preserved — mysite/css/style.css stays at css/style.css, so relative links keep working.

2. Deploy (first time — no account)

curl -s -X POST https://api.publish.my/v1/deploy \
     -F "site=@/tmp/site.tar.gz"

You get back JSON:

{
  "project_id": "88vk3mqtxz",
  "url": "https://88vk3mqtxz.publish.my",
  "status": "staged",
  "deploy_secret": "KEEP-THIS-FOR-THIS-SESSION",
  "agent_exchange_token": "USE-THIS-TO-FETCH-YOUR-KEY",
  "expires_at": "2026-06-24T12:00:00.000Z"
}

Your site is staged at that url — visible, but not live until you confirm it's yours. Note the project_id, deploy_secret, and agent_exchange_token.

3. Activate it (one-time email confirm)

Open the url in a browser, enter your email, and click the link we send (or use Continue with Google). Your site goes live at the same address.

Before you activate, you can re-deploy with the deploy_secret Tweaking the staged site? Re-pack and push again with the secret from step 2 — it works until you activate:
curl -s -X POST https://api.publish.my/v1/deploy \
     -F "project_id=PROJECT_ID" \
     -H "X-Deploy-Secret: DEPLOY_SECRET" \
     -F "site=@/tmp/site.tar.gz"

4. Grab your API key (for future updates)

After you've clicked the activation link, exchange the token from step 2 for your API key — it's handed out once. Poll until it returns the key (it's 202 while pending):

curl -s https://api.publish.my/v1/agent/exchange/EXCHANGE_TOKEN

When it returns {"api_key":"…"}, save just the key to ~/.publishmy:

curl -s https://api.publish.my/v1/agent/exchange/EXCHANGE_TOKEN \
  | sed -n 's/.*"api_key":"\([^"]*\)".*/\1/p' > ~/.publishmy

Prefer a button? You can also sign in at console.publish.myAPI keys and copy one.

5. Update later (same URL)

Re-pack (step 1), then POST with your key and the project_id:

curl -s -X POST https://api.publish.my/v1/deploy \
  -H "Authorization: Bearer $(cat ~/.publishmy)" \
  -F "project_id=PROJECT_ID" \
  -F "site=@/tmp/site.tar.gz"

It overwrites the same site at the same URL — no email, no new link. List your sites any time:

curl -s https://api.publish.my/v1/projects \
  -H "Authorization: Bearer $(cat ~/.publishmy)"

One-command script

Rather not retype the curl steps each time? There is a configurable one-command script for macOS/Linux and Windows — set the folder at the top and run it; later runs update in place. See One-command script →.

If a deploy is rejected 422 no_index = no top-level index.html (you probably packed the wrong folder); 413 too_large = over 50 MB; 429 = slow down and retry. Limits and allowed file types are in What you can host.