BunPress Documentation
On this page 19

Options:

OptionDefaultDescription
--outdir <dir>./distOutput directory
--config <path>bunpress.config.tsConfig file path
--minifyfalseMinify output
--sourcemapfalseGenerate source maps
--watchfalseWatch mode
--verbosefalseVerbose output

preview

Preview the production build locally:

bunpress preview
bunpress preview --port 8080
bunpress preview --open

Options:

OptionDefaultDescription
--port <port>4173Server port
--outdir <dir>./distDirectory to serve
--openfalseOpen browser

Content Commands

new

Create a new markdown file:

bunpress new guide/getting-started
bunpress new api/reference --title "API Reference"
bunpress new blog/announcement --template blog

Options:

OptionDescription
--title <title>Page title
--template <name>Template: default, guide, api, blog

Templates:

  • default - Basic page with frontmatter
  • guide - Tutorial-style with sections
  • api - API documentation structure
  • blog - Blog post with date and author

Configuration Commands

config:show

Display current configuration:

bunpress config:show
bunpress config:show --json

config:validate

Validate configuration file:

bunpress config:validate
bunpress config:validate --fix

Options:

OptionDescription
--fixAttempt to fix issues

config:init

Create a new configuration file:

bunpress config:init
bunpress config:init --force

SEO Commands

seo:check

Check SEO across all pages:

bunpress seo:check
bunpress seo:check --fix
bunpress seo:check --verbose

Options:

OptionDescription
--fixAuto-fix common issues
--verboseShow detailed results

Checks performed:

  • Title length (50-60 characters)
  • Description length (150-160 characters)
  • Heading hierarchy
  • Image alt text
  • Internal link validity
  • Meta tag presence

Utility Commands

clean

Remove build artifacts:

bunpress clean
bunpress clean --force
bunpress clean --outdir ./public

Options:

OptionDefaultDescription
--outdir <dir>./distDirectory to clean
--forcefalseSkip confirmation
--verbosefalseVerbose output

stats

Show documentation statistics:

bunpress stats
bunpress stats --verbose
bunpress stats --dir ./docs

Options:

OptionDescription
--dir <dir>Documentation directory
--verboseShow per-file breakdown

Output includes:

  • Total file count
  • Total size
  • Word and line counts
  • Heading and code block counts
  • Reading time estimates
  • Largest files

doctor

Run diagnostic checks:

bunpress doctor
bunpress doctor --fix

Checks performed:

  • Bun runtime version
  • Configuration file validity
  • docs/ directory existence
  • Markdown files presence
  • package.json scripts
  • Dependencies installed
  • Git repository status
  • TypeScript configuration

llm

Generate LLM-friendly markdown:

bunpress llm
bunpress llm --full
bunpress llm --output context.md

Options:

OptionDescription
--dir <dir>Documentation directory
--output <file>Output file path
--fullInclude full content (not just headings)

Global Options

These options work with all commands:

OptionDescription
--help, -hShow help information
--version, -vShow version number
--verboseEnable verbose output
--config <path>Custom config file path

Examples

Development Workflow


# Initialize new project

bunpress init --name my-docs

# Start development

bunpress dev --open

# Create new pages

bunpress new guide/installation
bunpress new api/methods --template api

# Check quality

bunpress doctor
bunpress seo:check

# Build for production

bunpress build --minify

# Preview build

bunpress preview

CI/CD Pipeline


# Install dependencies

bun install

# Validate configuration

bunpress config:validate

# Run diagnostics

bunpress doctor

# Build

bunpress build --minify

# Check SEO

bunpress seo:check

Content Management


# View statistics

bunpress stats --verbose

# Create content

bunpress new changelog/v2.0 --template blog
bunpress new api/authentication --template api

# Generate LLM context

bunpress llm --full --output docs-context.md