Cairn v2.4.1 github.com/cairn-build

CLI reference

Five commands are the whole surface. Global flags first, then each command with its usage, flags and an example.

Two flags work on every command: --config <path> points at a cairn.toml outside the working directory, and --quiet reduces output to errors only. cairn --version and cairn help <command> do what they say.

cairn init

Scaffolds a working site: content folder, default theme, and a cairn.toml pointed at both.

usage
cairn init [directory] [flags]
init flags
FlagDefaultDescription
--bareoffSkip the sample content; scaffold config and theme only.
--forceoffInitialise into a non-empty directory. Existing files are never overwritten.
terminal
cairn init docs --bare
➤ scaffolded docs/ (config, theme)

cairn serve

Local server with live reload. Drafts are always included; nothing is written to disk.

usage
cairn serve [flags]
serve flags
FlagDefaultDescription
--port4131Port to listen on.
--host127.0.0.1Bind address. Use 0.0.0.0 to preview from another device.
--openoffOpen the browser once the server is up.
terminal
cairn serve --port 8080 --open
➤ serving on http://127.0.0.1:8080 (live reload)

cairn build

Builds the site into the output directory. Incremental: only pages affected by a change are rebuilt.

usage
cairn build [flags]
build flags
FlagDefaultDescription
--draftsoffInclude draft pages, overriding the config for this run.
--cleanoffDiscard the incremental cache and rebuild everything.
--base-urlfrom configOverride base_url, for preview deployments.
terminal
cairn build --clean
➤ 42 pages in 118ms → dist/

cairn deploy

Builds, then hands dist/ to the deploy command named in your config. It is a convenience wrapper so "ship it" is one word; CI pipelines usually call build and upload themselves.

usage
cairn deploy [flags]
deploy flags
FlagDefaultDescription
--dry-runoffBuild and print what would be uploaded, then stop.
--skip-checkoffSkip the pre-deploy link check. Not recommended.

cairn check

Lints the site without writing output: broken internal links, pages missing front matter, and images without alt text. Exits non-zero on any finding, which is what makes it useful in CI.

usage
cairn check [flags]
check flags
FlagDefaultDescription
--externaloffAlso verify external links respond. Slower; network-dependent.
--strictoffTreat warnings (missing descriptions, empty alt text) as failures.
terminal
cairn check --strict
➤ 42 pages, 0 errors, 0 warnings