primo-cli
v0.1.3
Published
Local development CLI for Primo
Maintainers
Readme
Primo CLI
Local development CLI for Primo - build and edit sites with a visual CMS.
Installation
npm install -g primo-cliQuick Start
# Create a new site
primo new my-site
# This starts the local CMS automatically
# Edit at: http://my-site.localhost:3000/admin/site
# Preview at: http://my-site.localhost:3000/Commands
primo new [name]
Create a new site with starter files.
primo new # Interactive prompt for name
primo new my-site # Create "my-site" directory
primo new --skip-dev # Create files without starting CMSprimo dev
Start the local CMS server. Watches for file changes and syncs edits from the CMS back to local files.
primo dev # Start in current directory
primo dev -p 8080 # Use custom portprimo push
Push local files to a hosted Primo instance.
primo push -s https://cms.example.com --site abc123
primo push --preview # Preview changes without applyingOptions:
-s, --server <url>- Server URL--site <id>- Site ID-d, --dir <dir>- Directory (default:.)-t, --token <token>- Auth token--preview- Preview only
primo pull
Pull from a hosted Primo instance to local files.
primo pull -s https://cms.example.com
primo pull --site abc123 -o ./my-siteOptions:
-s, --server <url>- Server URL (auto-detects local)--site <id>- Site ID (interactive if not provided)-o, --output <dir>- Output directory (default:.)-t, --token <token>- Auth token
primo login
Authenticate with a hosted Primo instance.
primo login https://cms.example.com
primo login https://cms.example.com -e [email protected]primo publish
Deploy your site with CMS to Railway or Fly.io.
primo publish # Interactive provider selection
primo publish -p railway # Deploy to Railway
primo publish -p fly # Deploy to Fly.ioprimo validate
Check site structure for errors.
primo validate
primo validate --strict # Strict modeprimo build
Build static HTML site for deployment to any static host.
primo build # Output to ./dist
primo build -o ./public # Custom output directoryDeploy the output anywhere:
# Netlify
npx netlify deploy --prod --dir=dist
# Vercel
npx vercel dist
# Cloudflare Pages
npx wrangler pages deploy dist
# Or just push to a repo connected to any static hostSite Structure
my-site/
├── primo.json # Site config (name, site_id, host)
├── blocks/ # Svelte components
│ └── hero/
│ ├── component.svelte
│ ├── fields.json
│ └── content.yaml
├── pages/ # Page content (YAML)
│ └── index.yaml
├── page-types/ # Page templates
│ └── default/
│ └── config.json
├── site/ # Site-wide settings
│ ├── fields.json
│ ├── content.yaml
│ └── head.svelte
└── uploads/ # Media filesMultiple Sites
Run primo dev from a parent folder to work on multiple sites at once:
workspace/
├── server.json # Optional: { "port": 3000 }
├── site-one/
│ └── primo.json
└── site-two/
└── primo.jsonEach site gets its own subdomain: site-one.localhost:3000, site-two.localhost:3000
Documentation
Full documentation: primo.page/docs
Requirements
- Node.js 18+
- For
primo publish: Railway CLI or Fly.io CLI
