CLI Commands
All commands are run from your repo root where ciderpress.config.ts lives.
The ten registered commands are: setup, dev, build, serve, sync, check, diff, draft, clean, dump.
Common flags
Several commands share the same option set. Where a per-command table omits a flag, it isn't supported.
setup
Initialize a ciderpress config file in the current project.
Derives the project title from git remote get-url origin (falling back to the directory name), writes a starter ciderpress.config.ts, ensures .ciderpress/ is gitignored, and generates initial branded SVG assets in .ciderpress/public/. Skips with a warning if ciderpress.config.ts already exists.
sync
Sync documentation sources into .ciderpress/.
Resolves all entries in the config, copies source files into .ciderpress/content/, merges frontmatter, and writes _meta.json and _nav.json files alongside each section.
dev
Start the dev server with live reload.
Runs sync first, starts a file watcher on all source files, and launches the Rspress dev server. Changes to source markdown files are detected and re-synced automatically.
--headless is required when invoking dev from a non-TTY shell (CI, Docker, nodemon, background tasks) — the default Ink TUI needs raw-mode stdin and will error otherwise.
build
Build the static site for production.
Runs sync first, then builds the Rspress site. Output is written to .ciderpress/dist/. Branded SVG assets (banner, logo, icon) are regenerated as a side effect when title is configured.
When --check is enabled (the default), config validation and deadlink detection run as part of the build. Use --no-check to skip checks and build with standard Rspress output. Use --verbose to see raw Rspress diagnostics during the check pass.
serve
Preview the production build locally.
Starts a local static file server pointed at .ciderpress/dist/. Requires a prior ciderpress build.
clean
Remove build artifacts, synced content, and build cache.
Deletes the following directories:
Safe to run at any time — all directories are regenerated by sync and build.
diff
Show changed files in configured source directories.
Loads the config and extracts every source directory from include fields, plus their top-level roots and the config files themselves.
Default mode (no --ref) runs git status --short scoped to those paths and prints a space-separated file list to stdout — suitable for piping into lefthook, scripts, or git hooks.
Ref mode (--ref <ref>) runs git diff --name-only <ref> HEAD and exits with code 1 when changes are detected. This matches the Vercel ignoreCommand convention — exit 1 means "proceed with build", exit 0 means "skip build":
Use --pretty for labeled, human-readable output instead of the machine-friendly list.
dump
Resolve and print the full site structure as JSON.
Loads the config, resolves all entries (including glob patterns and recursive discovery), and outputs the resolved navigation tree to stdout. Useful for debugging your site structure.
Output includes text, link, collapsible, hidden, standalone, and nested items for each entry.
check
Validate config and check for broken links.
Validates the config file, syncs content, then runs a build to detect deadlinks. Reports results for both config validation and link checking. Exits with code 1 if any check fails. Useful for CI pipelines.
draft
Scaffold a new documentation file from a template.
When --type or --title are omitted, an interactive prompt lets you select from the available templates and enter a title. The output filename is derived from the title slug (e.g. "Authentication" → authentication.md).
References
- Configuration — full
ciderpress.config.tsschema - Frontmatter — per-page metadata
- VSCode Extension — preview docs inside the editor
Resources
- Vercel ignoreCommand — exit-code contract used by
diff --ref