yaakdoc

CLI

Every yaakdoc command and flag.

npx yaakdoc [command] [options]
CommandDescription
yaakdoc [export]Same as yaakdoc dev.
yaakdoc dev [export]Starts the dev server.
yaakdoc build [export]Builds the static site.
yaakdoc previewServes the built site locally.
yaakdoc initCreates a yaakdoc.config.json.
yaakdoc ejectCopies the theme into your project.

Shared options

dev and build take the path of the Yaak export as an argument, and these options. Flags take precedence over the config file.

FlagDescription
--config, -cPath to the config file.
--theme, -tTheme name, package or local path.
--pagessingle or per-request.
--baseBase path the site is served from, e.g. /docs/.
--environment, -eEnvironment used to resolve variables.
--workspace, -wWorkspace to document (id or name).
--overridesConfig values merged over the config file. See below.

When no export is passed (as an argument or export in the config), yaakdoc uses yaakdoc.json, then yaak.json, from the current directory.

dev

Starts the dev server, with server rendering, live reload and HMR. It reloads when the export or the config changes.

FlagDescription
--port, -pPort. Default: 4000.
--hostHost to listen on. Use --host 0.0.0.0 to expose it on your network.
--open, -oOpen the browser.
--no-watchDon't watch the export and config for changes.

build

Builds the static site.

FlagDescription
--out-dir, -oOutput directory. Default: dist.

preview

Serves the built site locally, to check it before deploying.

FlagDescription
--out-dirDirectory to serve. Default: dist.
--port, -pPort. Default: 4000.
--hostHost to listen on.
--open, -oOpen the browser.

init

Asks a few questions and writes a yaakdoc.config.json. See Project setup.

FlagDescription
--yes, -yUse defaults without prompting.
--forceOverwrite an existing config.

eject

Copies the current theme into your project, and points the config at it. See Ejecting.

FlagDescription
--config, -cPath to the config file.
--outDestination directory. Default: ./theme.
--forceOverwrite a non-empty destination.

Overrides

--overrides sets any config value from the command line. It takes inline JSON or the path of a JSON file:

npx yaakdoc build --overrides '{"branding":{"title":"Staging API"},"runInYaak":false}'
npx yaakdoc build --overrides ./staging.json
  • Overrides are deep-merged over the config file. Arrays are replaced, not merged.
  • Explicit flags, such as --theme, still win over overrides.
  • Paths in overrides are relative to the current directory.

On this page