:::contentbit
Reference

CLI reference

Commands, options, shared flags, and exit behavior for the contentbit CLI.

Use contentbit for project setup, validation, content health reports, rendering, internal-link indexes, generated authoring docs, and LLM-agent integration.

Quote globs so your shell does not expand them before contentbit receives them:

contentbit validate "content/**/*.md" --registry ./blocks/registry.ts

Commands

contentbit <command> [options]
CommandPurpose
initScaffold contentbit into a project.
validateCheck block syntax, block schemas, and internal links.
briefPrint an agent-ready SEO brief.
doctorPrint a ranked content repair plan.
studioOpen the local read-only content dashboard.
statsPrint document stats as JSON.
renderRender one file to plain Markdown.
instructionsPrint generated LLM or human authoring instructions.
docsPrint generated human block docs.
agentsInstall or refresh coding-agent guidance.
linksBuild or fix the internal-link index.

init

Scaffold packages, starter content, a block registry, renderer files, scripts, and agent instructions.

contentbit init [-t react|markdown|astro] [--md <library>] [-y] [--seo]

Options:

OptionMeaning
-t, --target <target>Force the target instead of detecting it.
--md <library>Choose the Markdown library wiring when supported.
-y, --yesAccept defaults.
--cwd <path>Run setup in another directory.
--no-installWrite files without installing packages.
--no-pageSkip generated example route/page files.
--no-styledSkip styled component pack setup.
--no-agentsSkip AGENTS.md and Claude Code skills.
--seoScaffold contentbit.seo.config.ts.

validate

Check content and print file:line:col diagnostics.

contentbit validate <globs...> [--registry <module.ts>] [--strict-warnings]

Options:

OptionMeaning
--registry <module>Load custom blocks from a registry module.
--no-generic-blocksDo not load the generic block pack first.
--strict-warningsExit 1 when warnings are present.
Link resolver optionsSee Shared link options.

Exit codes:

  • 0 when no errors are found.
  • 1 when errors are found.
  • 1 when warnings are found and --strict-warnings is passed.
  • 2 for command input problems such as missing or unmatched globs.

brief

Print a page brief from contentbit.seo.config.ts, existing content, or both.

contentbit brief <key-or-slug> [globs...] [--json]

Options:

OptionMeaning
--registry <module>Load custom blocks before checking required blocks.
--no-generic-blocksDo not load the generic block pack first.
--seo-config <module>Use a non-default SEO config file.
--jsonPrint machine-readable JSON.
Link resolver optionsSee Shared link options.

Targets resolve by page key first, then by slug, then by internal page id. Use SEO briefs and contracts for config details and Programmatic SEO workflows for the full writing loop.

doctor

Print a ranked repair plan across validation, internal links, document stats, image alt text, and optional SEO contracts.

contentbit doctor <globs...> [--registry <module.ts>] [--json]

Options:

OptionMeaning
--registry <module>Load custom block definitions.
--no-generic-blocksDo not load the generic block pack first.
--strict-warningsExit 1 when warnings are present.
--strict-seoTreat required SEO contract findings as build failures.
--jsonPrint stable JSON for agents and CI.
--min-section-words <n>Change the thin-section threshold.
--seo-config <module>Use a non-default SEO config file.
--no-seoIgnore SEO config even when one exists.
Link resolver optionsSee Shared link options.

Use Content doctor for workflow guidance.

studio

Open the local read-only dashboard for previews, diagnostics, links, backlinks, keywords, and stats.

contentbit studio <globs...> [--registry <module.ts>] [--no-open]

Options:

OptionMeaning
--registry <module>Load custom blocks and preview components.
--port <n>Choose the first port to try.
--host <host>Bind to a custom host.
--no-openStart the server without opening a browser.
--no-generic-blocksDo not load generic blocks or preview components.
--min-section-words <n>Change the thin-section threshold.
--seo-config <module>Use a non-default SEO config file.
--no-seoIgnore SEO config even when one exists.
Link resolver optionsSee Shared link options.

Use Content Studio for workflow guidance. When an SEO config is loaded, document pages also include a read-only Brief view with copy/download actions for Markdown and JSON.

stats

Print raw document stats as JSON.

contentbit stats <globs...> [--registry <module.ts>]

Options:

OptionMeaning
--registry <module>Include validation summaries from this registry.
--no-generic-blocksDo not load the generic block pack first.
--no-validateAnalyze Markdown only, without loading a registry.

One matched file prints one JSON object. Multiple files print an array. No matched files is a command input error.

render

Render one file to plain Markdown.

contentbit render <file> [--out <file>]

Options:

OptionMeaning
--target <target>Render target. Today this is markdown.
--registry <module>Load custom block definitions before rendering.
--no-generic-blocksDo not load the generic block pack first.
--out <file>Write output to a file instead of stdout.

instructions

Print generated authoring instructions from the block registry.

contentbit instructions [--audience llm|human] [--out <file>]

Options:

OptionMeaning
--audience <audience>llm by default, or human.
--no-examplesOmit block examples.
--registry <module>Load custom blocks.
--no-generic-blocksDo not load the generic block pack first.
--out <file>Write the guide to a file.

docs

Print generated human block docs from the block registry.

contentbit docs [--registry <module.ts>] [--out <file>]

Options:

OptionMeaning
--registry <module>Load custom blocks.
--no-generic-blocksDo not load the generic block pack first.
--out <file>Write docs to a file.

The site's Block reference is generated from this kind of registry data.

agents

Install or refresh agent guidance.

contentbit agents [--claude] [--no-agents-md]

Options:

OptionMeaning
--claudeInstall Claude Code skills even when .claude/ is absent.
--no-agents-mdSkip AGENTS.md updates.
--cwd <path>Run in another directory.

AGENTS.md is updated between <!-- contentbit:start --> and <!-- contentbit:end --> markers. Content outside those markers is left alone.

Build .contentbit/link-index.json from frontmatter slugs, aliases, and linksTo values.

contentbit links <globs...> [--fix] [--out <file>]

Options:

OptionMeaning
--fixRewrite stale alias references inside linksTo.
--out <file>Write the index somewhere other than .contentbit/link-index.json.
Link resolver optionsSee Shared link options.

--fix is narrow. It only rewrites linksTo values that point at known aliases.

Shared registry options

Commands that validate or render blocks load the generic block pack by default. Pass a registry when your project adds custom blocks:

contentbit validate "content/**/*.md" --registry ./blocks/registry.ts

Use --no-generic-blocks when the registry intentionally owns the complete block set, including generic names such as callout or comparison.

validate, brief, doctor, studio, and links accept the same internal link resolver options:

OptionMeaning
--link-resolve <mode>Choose how linksTo targets resolve.
--locale-field <name>Frontmatter field for locale.
--slug-field <name>Frontmatter field for slug.
--key-field <name>Frontmatter field for stable content key.
--default-locale <locale>Locale to assume when a page omits one.

Resolver modes:

ModeUse when
global-slugSlugs are globally unique.
same-locale-slugEach locale has its own slug set.
same-locale-keyTranslations share stable keys and have localized slugs.
prefer-same-locale-key-fallback-slugPrefer keys, but allow same-locale slug links.

See Internal linking for examples.

On this page