Skip to main content
The Primo CLI (primo-cli) lets you build and edit Primo sites from local files using your own editor and version control. It runs a local CMS server, syncs file changes both directions, and ships your workspace to production.
The CLI is optional. You can still build everything in the in-browser editor — the CLI is for developers who prefer working in files and Git.

Installation

npm install -g primo-cli
Requirements:

Quick Start

# Create a new site and start the local CMS
primo new my-site
This scaffolds a workspace and starts primo dev on http://my-site.localhost:3000.

Workspace Structure

A Primo workspace contains one or more sites and a shared block library:
workspace/
├── server.yaml          # Port, site groups, server-level config
├── library/             # Shared blocks reusable across sites
│   ├── marketing/
│   │   └── hero/
│   └── shared/
│       └── footer/
└── sites/
    ├── site-one/
    │   ├── site.yaml    # Site name, hostname, group
    │   ├── blocks/      # Site-specific blocks
    │   ├── pages/
    │   ├── page-types/
    │   ├── site/        # Site-wide fields, head, foot
    │   └── uploads/     # Images and files synced to the CMS
    └── site-two/
        └── site.yaml
Each site is served on its own subdomain in dev: site-one.localhost:3000, site-two.localhost:3000.

Command Summary

CommandWhat it does
primo init [name]Initialize a new workspace
primo new [name]Create a new site and start dev
primo devRun the local CMS with file/CMS sync
primo pull <server>Pull a hosted server into local files
primo push <server>Push local changes to a hosted server
primo library pull/pushSync just the shared block library
primo login <server>Authenticate with a hosted instance
primo deployDeploy the workspace to Railway or Fly.io
primo buildBuild a static site for any host
primo validateCheck site structure for errors

When to Use Which Command

You want to…Use
Let collaborators edit content from a CMS UIprimo deploy
Ship a static site to Netlify/Vercel/Cloudflareprimo build
Sync local edits to an existing hosted serverprimo push
Pull a hosted server’s content into Gitprimo pull

Next Steps

Local Development

Run the local CMS and learn the file/CMS sync model

Sync with a Hosted Server

Use primo push and primo pull against a deployed instance

Deploy

Deploy your workspace to Railway, Fly.io, or any static host

MCP Server

Let AI agents work inside your Primo workspace safely