§ Atlas docs · CLI

Eight commands. No surprises.

The CLI is the only seam between your repo and the plugin. Install it once, keep this page open in a tab.

Install

The CLI ships as @atlas/cli on npm. It runs on Node 18+ and has no native dependencies. Install it as a dev dependency in the repo that holds your components.

terminal Bash
# project-local install (recommended)
npm install --save-dev @atlas/cli

# or, one-off invocation
npx @atlas/cli@latest init

init

Scaffolds a new Atlas project in the current directory. Writes atlas.config.ts, a starter components/ directory, and a manifests/ output directory. Idempotent — re-running on an existing project leaves your files alone and only fills gaps.

terminal Bash
atlas init # interactive
atlas init --yes # non-interactive, accept defaults

add

Scaffolds a new component file with a typed prop interface and a stub fallback. The component name is converted to PascalCase; the file lands at components/<Name>.tsx. Re-running against an existing component fails — use --force to overwrite.

terminal Bash
atlas add Hero
atlas add PricingTable --island  # marks the component as needing hydration

compile

Reads every component referenced by every page in pages/, type-checks the props, and emits one manifest per page into manifests/. Exits non-zero on type errors — wire it into CI as the gate that blocks broken merges.

terminal Bash
atlas compile                 # compile every page
atlas compile pages/home.tsx  # single-page recompile
atlas compile --watch          # recompile on save

validate

Checks every JSON file in manifests/ against the current schema. Useful as a pre-commit hook — catches hand-edited manifests that no longer match their component\'s prop interface. Reports line-and-field for every mismatch.

terminal Bash
atlas validate
atlas validate manifests/home.json
atlas validate --strict  # also flag missing fallback fields

render

Renders a manifest to HTML on the command line — same code path the WordPress plugin uses, isolated from a WP install. The fastest way to eyeball "what will this look like before I push it" without spinning up a local WordPress.

terminal Bash
atlas render manifests/home.json          # to stdout
atlas render manifests/home.json --out dist/home.html

push

Uploads compiled manifests to a WordPress install via the plugin\'s REST endpoint. Authenticates with an application password set in ATLAS_WP_TOKEN. Diffs against the remote manifest first and skips upload when content has not changed.

terminal Bash
atlas push --site https://yoursite.com
atlas push --site $WP_SITE --dry-run   # preview the diff, no upload

Env

The CLI reads three environment variables. None are required for compile / validate / render; push requires ATLAS_WP_SITE and ATLAS_WP_TOKEN if the corresponding flags are not passed.

  • ATLAS_WP_SITE — base URL of the WordPress install.
  • ATLAS_WP_TOKEN — application password issued by WordPress for the user the CLI uploads as.
  • ATLAS_LOGsilent, info (default), or debug.