Publish
The bash command is ship (not publish). ship create binds one folder to one URL. The mount tracks branch head and redeploys on every autosave checkpoint. Run create once per path. Do not mint a second mount to "refresh" a link. Do not run repo save as a ritual.
A folder with sails.site.json at the mount root compiles as a static site. Any other folder is served as files. Tailwind CSS and TypeScript/TSX transpile when served.
Done looks like
ship list shows a row with a public_url you can open. For --policy 644, that URL returns 200 without sign-in. Edit a file under the mount path; the same URL updates. You did not run ship create again.
Worked example: public site once
cp -r /templates/static-site-demo ./site
ship create site --policy 644
ship list
<name> is required and unique in the repo. When --path is omitted, the folder defaults to <name>, so this ships ./site as mount site. --path is repository-root-relative, not relative to your current directory. Use --path . to ship the current directory.
Expected create output is JSON. This is the shape of a real 2026-11-02 run (ids shortened, mount renamed to site). Without --hostname, the host is {org}-{name}.sails.app (org ryan here):
{
"id": "01a19d0f-…",
"name": "site",
"path_prefix": "site",
"hostname": "ryan-site.sails.app",
"hostname_verified": true,
"mcp_enabled": false,
"file_mode_policy": "644",
"published_commit_id": "01a19d0f-…",
"public_url": "https://ryan-site.sails.app/",
"is_staging": false
}
With --mcp, the JSON also has mcp_url and mcp_client_id. mcp_url is {public_url}mcp, so a hostname with a path prefix gives https://example.com/app/mcp, not https://example.com/mcp. Always hand clients the mcp_url value from ship list. Open public_url. Edit under site/. Stop. Autosave already checkpointed.
Commands
This matches live ship help:
ship create <name> [--path PATH] [--branch B] [--hostname H] [--mcp] [--policy MODE] [--stage-of LIVE]
ship stage <live-name-or-id> [--path DEST] [--name NAME] [--hostname H] [--mcp] [--policy MODE]
ship list
ship update <id|name> [--name NAME] [--policy MODE] [--hostname H] [--stage-of LIVE] [--mcp|--no-mcp]
ship delete <id> [--now] # plain delete: tombstone 7 days
ship restore <id>
ship promote <id-or-name>
ship verify <id>
ship analytics <id-or-name> [--since 7d] [--until RFC3339] [--granularity day|hour] [--path PREFIX] [--active-window 5m] [--visitor UUID] [--exclude-visitor UUID] [--visitors-limit 50]
ship issues <id-or-name> [--status open|resolved|ignored|all] [--limit 50]
ship issues show <id-or-name> <issue-id>
ship issues resolve <id-or-name> <issue-id>
ship issues ignore <id-or-name> <issue-id>
ship token create <id-or-name> [--path /mcp] [--header NAME] [--name LABEL]
ship token list <id-or-name> [--all]
ship token rotate <token-id>
ship token revoke <token-id>
| Flag / command | What it does |
|---|---|
--path | Folder to mount (default <name>), repository-root-relative |
--policy | HTTP access for the whole mount (static + *.api.sh) |
--hostname | Platform host, custom domain, or host/prefix |
--mcp | Streamable HTTP MCP at /mcp (under the hostname path prefix, if any) for *.mcp.sh / *.tool.sh |
ship update --mcp / --no-mcp | Turn MCP on or off for an existing mount. Owner only. Keeps hostname, policy, path, and data. Never delete and recreate a custom-domain mount just for this |
ship stage | Copy live folder to {path}-staging (mode 0700) and link with --stage-of |
ship promote | Three-way-merge staging folder into live (see .shipignore) |
ship delete | Tombstone 7 days (restorable). Avoid --now unless the URL should die |
ship issues | Error issues captured on this mount (see Errors) |
ship token | Header secret for one path on one mount (see Endpoint tokens) |
Policy
| Policy | Who can load the URL |
|---|---|
| 644 | Anyone (public web) |
| 640 | Owner or default-group members (others sign in, then 403) |
| 600 | Owner only (default) |
Anonymous visitors on 600 / 640 go to /auth/login (a 303 on /). Public sites need --policy 644. Policy does not rewrite per-file VFS modes in the workspace.
Who can ship
| Actor | create / update / delete / restore / promote / stage | Custom --hostname, ship update --hostname, ship verify, ship token |
|---|---|---|
| Repository owner | Any path, including repo root | Yes |
| write member / agent | Non-root path they have Unix write on (and inside an agent jail) | No |
| read member | No | No |
Agents can ship a preview URL for a folder they can write. Binding a custom hostname and minting endpoint tokens stay owner-only.
Hostnames
Platform hosts (*.sails.app, *.localtest.me, *.localhost) include the org slug by default. ship create crm --hostname crm binds {org}-crm.sails.app, not crm.sails.app. Those hosts are auto-verified.
Custom domains do not get the org prefix. The first host on a new domain needs DNS TXT. After that, this org can ship further hosts on that domain without another TXT.
--hostname host/prefix (example: {org}.sails.app/admin) mounts under a path. Ship the host root first in this repository. You cannot hang a prefix on another repo's host.
To attach or replace a hostname on a folder that is already shipped, use ship update <id> --hostname example.com (owner only). Do not run a second ship create on the same --path: that is a path collision, not a hostname claim. A hostname binds to one mount. To move a custom domain to another folder, delete the old mount, then ship create (or ship update --hostname) the new one. Keep at least one verified host on the domain if you want to skip a new TXT.
Custom domain TXT
Do not invent a TXT value. Sails prints a one-time token.
ship create site --path site --hostname example.com --policy 644
ship list
ship verify <id>
Until verify succeeds, public_url stays {published-path-id}.sails.app. hostname already shows example.com. Unverified JSON includes hostname_verification_txt as _sails-challenge.example.com = <token>. Copy the token (the part after =).
DNS (zone example.com): Type TXT, name _sails-challenge, value = the token only. Then CNAME the hostname to cname.sails.app (apex often needs ALIAS / ANAME / CNAME-flattening). ship verify checks ownership only. It does not wait for the CNAME.
Staging and promote
Use a folder pair, not a hostname swap. Both URLs keep serving their own folders.
ship stage site # copy to site-staging (0700) + linked mount
# edit site-staging/; optional .env with KEY=ssec_…
# list .env in site/.shipignore if prod env must not be overwritten
ship promote site # merge staging into live
# optional: ship delete site-staging && rm -rf site-staging
.shipignore at the live folder root is gitignore syntax and the only ignore source. .shipignore itself is never promoted. Do not default-ignore *.json, because sails.site.json must promote. Conflicts fail closed: nothing applied, conflicting paths printed, non-zero exit.
Endpoint tokens
Some outside clients (for example a voice agent builder) can only send a fixed header, not OAuth or a Sails sign-in. ship token mints an ept_ secret that unlocks exactly one URL path on one mount, usually /mcp. It works on a private 600 mount, and the rest of that mount stays private. It is not a login: no CLI, admin, secrets, or other routes. Owner only. Only a SHA-256 hash is stored.
Worked example: private MCP endpoint for an outside client
Verified live on 2026-11-02 with a throwaway mount (deleted after). mcp/echo.mcp.sh is the minimal tool from /skills/mcp-handlers.md with auth: optional added, because a token caller is not a signed-in visitor.
ship create handled --path handled --mcp # default policy 600 is fine
ship token create handled --path /mcp --name xai > ~/handled-mcp-token.json
# Do not print or paste the token. Hand the user a one-time download:
download ~/handled-mcp-token.json
rm ~/handled-mcp-token.json
ship token list handled # id, route_path, header_name, token_prefix, last_used_at. Never the secret
ship token create JSON has id, published_path_id, mount, route, header, token_prefix, token (plaintext, shown once), and message. Tell the user: the MCP URL is the mcp_url from ship list or ship create ({public_url}mcp, so a hostname path prefix such as https://example.com/app/mcp is included; https://{host}/mcp also works when that mount is the only MCP-enabled mount on the host), and the header is Authorization: Bearer <token>.
What the endpoint returned in the live test (POST tools/list to /mcp):
| Request | Result |
|---|---|
| No header | HTTP 200 with JSON-RPC error -32600 "sign in required for this published mount" |
Wrong, rotated, or revoked ept_ token | HTTP 401, empty body |
| Valid token | HTTP 200, search_tools / describe_tool / call_tool |
Valid token on / (not the token's path) | HTTP 401 |
--header X-Api-Key token sent as Authorization: Bearer | HTTP 401. Send it in the header you named |
Tool names on a published mount come from the path. In the test, mcp/echo.mcp.sh on mount tmp-guides-mcp was named tmp-guides-mcp_mcp_echo, and call_tool with "name": "echo" failed with "unknown tool". Have the client run search_tools first and copy the exact name, or set name: in the tool front matter. A successful call looks like:
{"jsonrpc":"2.0","id":4,"result":{"content":[{"type":"text","text":"hi"}],"isError":false}}
Rotate and revoke
ship token rotate <token-id> > ~/new-token.json # old token dies at once
ship token revoke <token-id> # immediate
ship token list handled --all # include revoked rows (revoked_at)
ship token rotate returns a new token id and revokes the old one (message says "Previous token … revoked"). Save the new id from the rotate JSON. A later ship token revoke with the old id prints "revoked": true and changes nothing, so the rotated token keeps working. To be sure, run ship token list <mount> (active only) and revoke every id it shows.
--path defaults to /mcp. You can scope a token to another path (the test minted one for /index.html), but use it only for a route an outside client truly must reach.
Analytics
HTML page views are recorded automatically (no SDK). Assets are not counted. Unique visitors use a sails_vid cookie. Bots are classified from User-Agent and excluded from headline counts.
ship analytics site --since 7d --granularity day
ship analytics site --exclude-visitor 0199a0c0-1111-7000-8000-000000000001
Custom events (both strings, max 128 chars):
navigator.sendBeacon(
"/sails/analytics/events",
JSON.stringify({ name: "signup", value: "pro" }),
);
On a path-prefixed URL, POST /prefix/sails/analytics/events or POST /sails/analytics/events with a same-origin Referer.
Errors
Shipped mounts capture errors with no SDK. HTML pages get /sails/errors.js, which records browser error and unhandledrejection events. SSR render failures and published *.api.ts / *.api.sh exceptions are recorded on the server. Report your own from page JS:
Sails.captureException(err);
Sails.captureMessage("checkout failed", { level: "warning" });
ship issues site # open issues (default)
ship issues site --status all --limit 20
ship issues show site <issue-id>
ship issues resolve site <issue-id>
ship issues ignore site <issue-id>
A mount with no errors returns {"published_path_id": "…", "name": "site", "status": "open", "issues": []}. Events group into issues by the normalized message plus top stack frames. A resolved issue that comes back on a new published commit reopens. Ignored issues stay ignored. Emails, cookies, auth headers, JWTs, ssec_ secrets, and query tokens are scrubbed before storage, and each mount's ingest rate is capped. Any repository member can list, show, resolve, and ignore. More in /skills/errors.md.
In published *.api.sh / *.mcp.sh, only ship analytics and ship issues list/show are allowed. create, update, delete, list, verify, token, and issue resolve / ignore stay session-only.
Failure modes
| What you see | What it means | What to do |
|---|---|---|
ship: published path 'x' does not exist on branch 'main' right after mkdir | The new folder has not reached a checkpoint yet, or --path was read from repo root, not cwd | Check the path from repo root (or use --path .). If it is a brand-new folder, wait for autosave or run repo save once, then create |
Second ship create for the same folder | You tried to mint a "fresh" URL or add a hostname | Keep the first mount. ship list is the URL. Use ship update --hostname for a host |
ship delete --now then a new URL | You hard-deleted the old links | Prefer plain ship delete (7-day tombstone) unless the URL must die |
Agent cannot --hostname or ship token | Owner-only | Owner binds the host or mints the token; agent can still ship a preview path |
ship create denied for repo root | Write members / agents cannot ship / | Ship a subfolder they can write |
Custom domain still shows *.sails.app | TXT not verified | Copy hostname_verification_txt, add the TXT, ship verify <id> |
Outside client gets 401 with no body on a hostname with a path prefix | Client called https://host/mcp instead of the mount's own URL | Use the exact mcp_url from ship list (for example https://host/app/mcp) |
Outside client gets 401 with no body | Wrong, rotated, or revoked token, wrong header, or wrong path | ship token list <mount>; check header_name and route_path; rotate and resend |
| Client gets JSON-RPC "sign in required for this published mount" | No token header reached /mcp on a private mount | Send the header from ship token create |
| Token still works after revoke | You revoked the pre-rotate id | Revoke the id from the rotate JSON, or every id in ship token list |
call_tool says "unknown tool" | Published tool names include the mount and path | search_tools first, or set name: in front matter |
| Promote fails closed | Merge conflict | Resolve conflicting paths in staging; promote again |
You typed publish create | Binary is ship | ship help |
How to: Publish a site, Connect an MCP server, Check a site before you publish.