Command line
Every primecms command and option.
Run commands with bunx @getprimecms/cli <command>, or npx @getprimecms/cli <command>. Once a project has the package installed (init and every template add it), the command is simply primecms, as in primecms dev in a package.json script. Commands work in the project root unless you pass --root.
| Command | What it does |
|---|---|
init |
Sets prime up in an existing project: writes prime.config.ts, installs the packages, connects your framework and updates .gitignore. --no-install skips the install. Refuses to run if prime.config.ts already exists. |
new [template] [folder] |
Starts a site from a template. With no template it lists them. It refuses a folder that already has files. |
dev [--port 4300] |
Runs the admin on its own at http://127.0.0.1:4300/prime, for generators without an adapter such as Hugo, Jekyll and Eleventy. |
check |
Validates every entry against the schema and exits with an error if any is broken. Use it in CI. |
schema [--check] |
Writes .prime/schema.json, which the multi-site admin reads. With --check it fails when the file is missing or out of date. |
hub [--port 4300] [--host 127.0.0.1] |
Runs the multi-site admin for an Agency plan, from prime.hub.ts. |
license [key] --host example.com |
Checks a license key against a domain and prints its state. It reads the key from the argument, then prime.config.ts, then PRIME_LICENSE. Exits with an error if the key does not cover the domain. |
Options
| Option | What it does |
|---|---|
--root <dir> |
The project root. Defaults to the current directory. |
--config <file> |
The config file. Defaults to prime.config.ts. |
-h, --help |
Shows the help. |
Exit codes
A command exits with 0 when it succeeded and 1 when it did not: a missing config, an entry that fails check, a license that does not cover the host, or an install that failed during init.