Skip to main content

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

CommandUsageResult
doctornpx @litpage/cli [global options] doctorDiagnose LitPage CLI setup and site readiness.
config currentnpx @litpage/cli [global options] config currentPrint resolved configuration.
config setnpx @litpage/cli config set KEY VALUESet a project-level configuration value.
site listnpx @litpage/cli [global options] site listList accessible sites.
site resolvenpx @litpage/cli [global options] site resolve SUBDOMAINResolve a subdomain or active domain to a site.
site createnpx @litpage/cli site create --subdomain NAME --name TITLECreate a website with draft navigation.
site initnpx @litpage/cli site init --subdomain NAMEPublish the default header and footer for a new site.

Markdown workflow

CommandUsageResult
applynpx @litpage/cli [global options] apply FILE [--slug SLUG] [--subdomain NAME]Upsert markdown content without publishing.
publishnpx @litpage/cli [global options] publish FILE [--slug SLUG] [--subdomain NAME]Upsert markdown content and publish it.
content templatenpx @litpage/cli content template FILE [--type TYPE] [--title TITLE] [--slug SLUG] [--subdomain NAME]Write a starter markdown template file.
content validatenpx @litpage/cli content validate FILEValidate Markdown metadata offline.
content pullnpx @litpage/cli [global options] content pull (--id ID|--slug SLUG) --out FILE [--subdomain NAME]Pull remote content into a markdown file.
content typesnpx @litpage/cli content typesList registered content type routes.
content listnpx @litpage/cli [global options] content list [--subdomain NAME] [filters]List content summaries.
content getnpx @litpage/cli [global options] content get (--id ID|--slug SLUG) [--subdomain NAME]Get content by id or slug.
content createnpx @litpage/cli [global options] content create --file FILE [--subdomain NAME]Create content from a markdown file.
content updatenpx @litpage/cli [global options] content update --id ID --file FILE [--subdomain NAME]Update content by id from a markdown file.
content upsertnpx @litpage/cli [global options] content upsert --file FILE [--slug SLUG] [--subdomain NAME]Upsert content by slug from a markdown file.
content publishnpx @litpage/cli [global options] content publish --id ID [--subdomain NAME]Publish existing content by id.
content unpublishnpx @litpage/cli [global options] content unpublish --id ID [--subdomain NAME]Unpublish existing content by id.

Landing pages and block contracts

CommandUsageResult
page listnpx @litpage/cli page list --subdomain SITE [--language EN]Find pages and content indexes.
page templatenpx @litpage/cli page template FILE --slug PATH --title TITLEWrite a starter page file locally.
page validatenpx @litpage/cli page validate --file FILECheck the page file offline.
page collectionnpx @litpage/cli page collection --subdomain SITE --type TYPE --out FILECreate a draft Blog, Docs, Changelog or Product index.
page pullnpx @litpage/cli page pull (--id PAGE_ID|--path PATH) [--out PATH]Export a landing page and its current version pointers.
page createnpx @litpage/cli page create --file PATH [--out PATH]Create a landing page draft from YAML or JSON.
page savenpx @litpage/cli page save --file PATH [--out PATH]Save a new draft of an existing page.
page publishnpx @litpage/cli page publish --file PATH [--out PATH]Publish the exact draft recorded in a page snapshot.
page verifynpx @litpage/cli page verify --file published.page.yamlVerify the exact published revision and its canonical URL.
block listnpx @litpage/cli block listList the available block authoring contracts and variants.
block schemanpx @litpage/cli block schema TYPE [--variant NAME]Read a JSON Schema, structured examples and supported variants.
block examplenpx @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

CommandUsageResult
docs rootsnpx @litpage/cli docs roots [options]List the editing roots for the selected site and language.
docs treenpx @litpage/cli docs tree [options]Read the complete editing tree for the selected site and language.
docs create-rootnpx @litpage/cli docs create-root --name LABEL --slug SLUG [options]Create an empty documentation root.
docs create-foldernpx @litpage/cli docs create-folder --root SLUG --name LABEL --slug SLUG [options]Create an empty folder or group in an existing root.
docs templatenpx @litpage/cli docs template FILE --root SLUG [options]Write a local DOC Markdown template.

Image candidates

CommandUsageResult
image searchnpx @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 list supports --type, --language, and --status filters. For example, npx @litpage/cli content list --type PRODUCT --language EN --status PUBLISHED --subdomain your-site finds published English products.
  • For npx @litpage/cli content pull by 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 template accepts --doc-type guide, tutorial, or reference to 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.