LitPage CLI Command Reference
Look up commands for LitPage CLI 0.7.0 and find the appropriate help entry for flags and inputs.
This reference lists the commands in CLI 0.7.0. Square brackets indicate optional inputs. Select a command by the result you need, then run its help in your shell for exact flags. See how to find commands for an example of moving from root help to a specific action.
For remote reads you need a Workspace Key that can access the site. Saving drafts and publishing require the applicable write permission. Templates, block discovery and offline validation run locally. Use a fresh output path for exports.
Setup and site lookup
| Command | Usage | Result |
|---|---|---|
doctor | npx @litpage/cli [global options] doctor | Diagnose LitPage CLI setup and site readiness. |
config current | npx @litpage/cli [global options] config current | Print resolved configuration. |
config set | npx @litpage/cli config set KEY VALUE | Set a project-level configuration value. |
site list | npx @litpage/cli [global options] site list | List accessible sites. |
site resolve | npx @litpage/cli [global options] site resolve SUBDOMAIN | Resolve a subdomain or active domain to a site. |
site create | npx @litpage/cli site create --subdomain NAME --name TITLE | Create a website with draft navigation. |
site init | npx @litpage/cli site init --subdomain NAME | Publish the default header and footer for a new site. |
Markdown workflow
| Command | Usage | Result |
|---|---|---|
apply | npx @litpage/cli [global options] apply FILE [--slug SLUG] [--subdomain NAME] | Upsert markdown content without publishing. |
publish | npx @litpage/cli [global options] publish FILE [--slug SLUG] [--subdomain NAME] | Upsert markdown content and publish it. |
content template | npx @litpage/cli content template FILE [--type TYPE] [--title TITLE] [--slug SLUG] [--subdomain NAME] | Write a starter markdown template file. |
content validate | npx @litpage/cli content validate FILE | Validate Markdown metadata offline. |
content pull | npx @litpage/cli [global options] content pull (--id ID|--slug SLUG) --out FILE [--subdomain NAME] | Pull remote content into a markdown file. |
content types | npx @litpage/cli content types | List registered content type routes. |
content list | npx @litpage/cli [global options] content list [--subdomain NAME] [filters] | List content summaries. |
content get | npx @litpage/cli [global options] content get (--id ID|--slug SLUG) [--subdomain NAME] | Get content by id or slug. |
content create | npx @litpage/cli [global options] content create --file FILE [--subdomain NAME] | Create content from a markdown file. |
content update | npx @litpage/cli [global options] content update --id ID --file FILE [--subdomain NAME] | Update content by id from a markdown file. |
content upsert | npx @litpage/cli [global options] content upsert --file FILE [--slug SLUG] [--subdomain NAME] | Upsert content by slug from a markdown file. |
content publish | npx @litpage/cli [global options] content publish --id ID [--subdomain NAME] | Publish existing content by id. |
content unpublish | npx @litpage/cli [global options] content unpublish --id ID [--subdomain NAME] | Unpublish existing content by id. |
Landing pages and block contracts
| Command | Usage | Result |
|---|---|---|
page list | npx @litpage/cli page list --subdomain SITE [--language EN] | Find pages and content indexes. |
page template | npx @litpage/cli page template FILE --slug PATH --title TITLE | Write a starter page file locally. |
page validate | npx @litpage/cli page validate --file FILE | Check the page file offline. |
page collection | npx @litpage/cli page collection --subdomain SITE --type TYPE --out FILE | Create a draft Blog, Docs, Changelog or Product index. |
page pull | npx @litpage/cli page pull (--id PAGE_ID|--path PATH) [--out PATH] | Export a landing page and its current version pointers. |
page create | npx @litpage/cli page create --file PATH [--out PATH] | Create a landing page draft from YAML or JSON. |
page save | npx @litpage/cli page save --file PATH [--out PATH] | Save a new draft of an existing page. |
page publish | npx @litpage/cli page publish --file PATH [--out PATH] | Publish the exact draft recorded in a page snapshot. |
page verify | npx @litpage/cli page verify --file published.page.yaml | Verify the exact published revision and its canonical URL. |
block list | npx @litpage/cli block list | List the available block authoring contracts and variants. |
block schema | npx @litpage/cli block schema TYPE [--variant NAME] | Read a JSON Schema, structured examples and supported variants. |
block example | npx @litpage/cli block example TYPE [--variant NAME] [--format json|yaml] | Export a block for configuration.sections. Set a unique id on each instance. |
Documentation containers
| Command | Usage | Result |
|---|---|---|
docs roots | npx @litpage/cli docs roots [options] | List the editing roots for the selected site and language. |
docs tree | npx @litpage/cli docs tree [options] | Read the complete editing tree for the selected site and language. |
docs create-root | npx @litpage/cli docs create-root --name LABEL --slug SLUG [options] | Create an empty documentation root. |
docs create-folder | npx @litpage/cli docs create-folder --root SLUG --name LABEL --slug SLUG [options] | Create an empty folder or group in an existing root. |
docs template | npx @litpage/cli docs template FILE --root SLUG [options] | Write a local DOC Markdown template. |
Image candidates
| Command | Usage | Result |
|---|---|---|
image search | npx @litpage/cli [global options] image search [options] | Search normalized image candidates. |
Read the output
Most commands return JSON on standard output and errors on standard error. Help and version print text. A block example in YAML format prints YAML. For a page write, keep the revision and operation ID where relevant. For a Markdown publish, verify the actual public page after receiving a success receipt.
Use the content types reference for type and route details. See troubleshooting for how to recover when an output file or remote request fails.
Common options by task
Use top-level npx @litpage/cli apply and npx @litpage/cli publish for normal Markdown files. Use the content actions when a script needs a particular read, create, export, or publish-by-ID operation.
npx @litpage/cli content listsupports--type,--language, and--statusfilters. For example,npx @litpage/cli content list --type PRODUCT --language EN --status PUBLISHED --subdomain your-sitefinds published English products.- For
npx @litpage/cli content pullby slug, specify type and language to resolve the intended version. For example,npx @litpage/cli content pull --slug getting-ready --type DOC --language EN --subdomain your-site --out current.md. npx @litpage/cli docs templateaccepts--doc-type guide,tutorial, orreferenceto choose the initial outline.- For
npx @litpage/cli page pull, open the site's landing page in Builder and copy the UUID after/content/landing/in the editor address. For block fields and SEO, see configure page YAML.