primo publish to make a hosted site’s saved changes public. Use primo push --publish to upload local files first, then publish them.
Before you start
You need:- primo-cli 0.2.1 or later, on a supported Node.js version.
- A deployed Primo server that supports the CLI publication API. CLI version alone does not add this support to an older server; update the CMS if publication status is unavailable.
- An account with permission to edit and publish the site.
- A connected hostname to view the published result.
--token supplies an explicit token; the CLI does not automatically read a PRIMO_TOKEN environment variable.
Publishing includes the whole site’s saved draft, including changes on other pages. Save open CMS dialogs and review collaborators’ changes before publishing.
Publish saved CMS changes
Run these commands from your workspace root. Replacemy-site with the folder name under sites/:
1
Check the hosted draft
--server https://cms.example.com to select it explicitly.2
Publish the site
3
Verify the result
current when the saved draft matches the successful publication. Open the site’s public hostname and check your changed page, navigation, images, and interactions.--dir:
primo publish without --only or --dir.
Without a local checkout, select the server and site ID explicitly:
site.yaml after a pull, or use a known site ID from your CMS.
Upload and publish local changes
After editing local files, run from your workspace root:primo publish --only my-site.
If someone edits the hosted draft between your upload and publication, the CLI stops instead of publishing a different revision. Review the new changes before retrying.
Options
primo publish [server] accepts:
primo status --hosted accepts the same target, directory, token, and JSON options. --server also enables hosted status. To combine upload and publication, use the push options with --publish.
For an automated check:
Understand publication status
Troubleshooting
Publication status is unavailable, or the endpoint returns 404: Update the CMS to a release that supports the publication API and verify the server URL and site ID. Until then, use Publish in the browser editor. Permission denied: Runprimo login again if your saved session expired. Confirm that your account can edit and publish this site.
The draft changed: Review the latest hosted changes. If you also have local edits, save them before pulling, then follow push recovery. Do not force an overwrite just to publish.
A build fails: Fix the block, page, or asset reported in the error. Successfully uploaded files remain in the hosted draft; retry with primo publish after the fix.
The connection drops or the result is unknown: Run primo status --hosted for the same site and inspect the public result before retrying. A lost response does not prove publication failed.
The build succeeds but no public URL is assigned: Connect a hostname in the dashboard, then verify the public site there.