Skip to main content

Global Options

Global options can be used with any Doom command. They configure behavior that applies across commands.

Configuration

-c, —config

--config
string
Specify the path to the config file
Default: Auto-detected (searches for doom.config.* files) Example:
doom dev --config ./custom-config.yaml
doom build --config ../shared-config.ts
Use Cases:
  • Multiple configuration files for different environments
  • Shared configuration across projects
  • Testing configuration changes

Version & Base Path

-v

-v
string
Specify the version of the documentationSpecial values:
  • unversioned - No version in path
  • unversioned-x.y - Version in config but not in path
Example:
doom build --v 2.0
doom dev --v unversioned
doom build --v unversioned-1.5
Output paths:
  • --v 2.0dist/docs/2.0/
  • --v unversioneddist/docs/
  • --v unversioned-1.5dist/docs/ (1.5 stored in config)

-b, —base

--base
string
Override the base of the documentation
Default: / (root) Example:
doom build --base /docs/
doom dev --base /help/
Impact:
  • URL structure: https://example.com/docs/page
  • Asset paths
  • Navigation links
  • Sitemap generation

-p, —prefix

--prefix
string
Specify the prefix of the documentation base
Example:
doom build --prefix /api --base /docs/
# Results in: /api/docs/
Combined with base:
--prefix /v2 --base /docs/ /v2/docs/

Content Filtering

-I, —include

--include
string[]
Include only the specific language(s)
Example:
doom build --include en
doom build --include en zh
doom dev --include ru
Use Cases:
  • Build only English docs for faster iteration
  • Test single language during development
  • Deploy language-specific builds

-E, —exclude

--exclude
string[]
Include all languages except the specific language(s)
Example:
doom build --exclude ru
doom build --exclude zh ru
Use Cases:
  • Skip incomplete translations
  • Reduce build time by excluding large translations
  • Regional deployments

-i, —ignore

--ignore
boolean
default:"false"
Ignore internal routes defined in internalRoutes config
Example:
doom dev --ignore
doom build --ignore
doom lint --ignore
Configuration:
internalRoutes:
  - drafts/**
  - internal/**
  - wip/**
Use Cases:
  • Hide draft content
  • Exclude internal documentation
  • Production builds without work-in-progress content

—lang

--lang
string
Specify the language of the documentation
Example:
doom dev --lang zh
doom build --lang en

Export & Download

-d, —download

--download
boolean
default:"false"
Display download PDF link on nav bar
Example:
doom build --download
doom dev --download
Behavior:
  • Adds download button to navigation
  • Links to generated PDF (if available)
  • Only shows when PDF exists

-e, —export

--export
boolean
default:"false"
Run or build in exporting PDF modeAutomatically ignores apis/** and */apis/** routes
Example:
doom build --export
doom dev --export
Impact:
  • Excludes API routes
  • Optimizes for PDF rendering
  • Applies print-specific styles
Workflow:
doom build --export
doom export

Output

-o, —out-dir

--out-dir
string
Override the outDir defined in config or default dist/{base}/{version}The resulting path will be dist/{outDir}/{version}
Default: dist/{base}/{version} Example:
doom build --out-dir build
# Output: dist/build/latest/

doom build --out-dir public --v 2.0
# Output: dist/public/2.0/

Redirect Behavior

-r, —redirect

--redirect
enum
default:"only-default-lang"
Whether to redirect to the locale closest to navigator.languageOptions:
  • auto - Always redirect to browser language
  • never - Never redirect
  • only-default-lang - Redirect only from default language
Example:
doom build --redirect auto
doom dev --redirect never
Behavior:
ValueUser visits /Browser: zhBrowser: en
autoRedirects/zh/en
neverNo redirect//
only-default-langRedirects if defaultConditionalConditional

Edit Repository

-R, —edit-repo

--edit-repo
boolean | string
default:"false"
Enable or override the editRepoBaseUrl config feature
  • true - Enable with config URL
  • false - Disable
  • string - Override with URL (GitHub prefix optional)
  • lang-code - Use same repo with language sub-path
Example:
# Enable with config URL
doom build --edit-repo

# Override with custom URL
doom build --edit-repo https://github.com/user/repo/blob/main

# Omit GitHub prefix
doom build --edit-repo user/repo/blob/main

# Language-specific repos
doom build --edit-repo zh
# Results in: repo/zh/ for Chinese pages

-a, —algolia

--algolia
boolean | 'alauda'
default:"false"
Enable or use preset for Algolia search
  • true - Enable with config
  • false - Disable
  • alauda - Use Alauda preset (docs.alauda.io)
Example:
# Enable with config
doom build --algolia

# Use Alauda preset
doom build --algolia alauda
Configuration:
algolia:
  appId: YOUR_APP_ID
  apiKey: YOUR_API_KEY
  indexName: docs

Sitemap

-S, —site-url

--site-url
boolean
default:"false"
Enable siteUrl for sitemap generation
Example:
doom build --site-url
Configuration:
siteUrl: https://docs.example.com
Output: Generates sitemap.xml in output directory

Force Operations

-f, —force

--force
boolean
default:"false"
Force operations:
  1. Fetch latest reference remotes or scaffolding templates (ignore cache)
  2. Translate without hash equality check and original text
Example:
# Force fetch templates
doom new --force

# Force re-translation
doom translate --glob "**" --force

# Force update references
doom build --force
Impact by Command:
CommandEffect
newIgnores local template cache
translateRetranslates even if source unchanged
buildRefetches external references
devRefetches external references

Browser Control

-n, —no-open

--no-open
boolean
Do not open the browser after starting the server
Example:
doom dev --no-open
Use Cases:
  • Headless environments
  • CI/CD pipelines
  • Multiple simultaneous servers
  • Personal preference

Examples

Development

# Basic dev
doom dev

# Dev with custom config and no browser
doom dev --config dev.config.yaml --no-open

# Dev with specific language
doom dev --lang zh --ignore

Production Build

# Standard build
doom build

# Versioned build with custom base
doom build --v 2.0 --base /docs/

# Multi-language build (en and zh only)
doom build --include en zh

# Production build excluding drafts
doom build --ignore

Translation

# Translate with force
doom translate --glob "guides/**" --force

# Translate excluding internals
doom translate --glob "**" --ignore

Export

# Build and export
doom build --export
doom export

# Export with custom port
doom export --port 8080

Option Combinations

Localized Builds

# English only for US
doom build --include en --base /us/

# Chinese only for CN
doom build --include zh --base /cn/

Versioned Deployments

# Version 1.x
doom build --v 1.5 --base /v1/

# Version 2.x  
doom build --v 2.0 --base /v2/

Development Workflow

# Fast iteration (English only, ignore drafts)
doom dev --include en --ignore --no-open

# Full preview (all languages, with drafts)
doom dev

Build docs developers (and LLMs) love