Skip to content

Command-Line Interface

Lumen builds on the Astro CLI and adds specific commands to manage your documentation lifecycle.

Starts the development server with Hot Module Replacement (HMR).

Fenêtre de terminal
pnpm dev
# equivalent to:
pnpm astro dev

Available options:

Option Description
--host Expose the server on the network (default: localhost).
--port Server port (default: 4321).
--open Automatically open the browser.

Example:

Fenêtre de terminal
pnpm astro dev --host 0.0.0.0 --port 3000

Generates the static site for production. Output goes to the dist/ folder.

Fenêtre de terminal
pnpm build
# equivalent to:
pnpm astro build

Available options:

Option Description
--verbose Show detailed build process logs.
--drafts Include pages marked as drafts.

Serves the built site locally to preview the production output.

Fenêtre de terminal
pnpm preview

Checks TypeScript types across the entire project without emitting output. Useful for detecting errors before building.

Fenêtre de terminal
pnpm astro check

The astro sync command generates TypeScript types for content collections and configuration.

Fenêtre de terminal
pnpm astro sync

This command runs automatically before astro dev and astro build. Run it manually if your types seem out of sync.

The Pagefind tool automatically indexes your content during build. To verify the index in development:

Fenêtre de terminal
pnpm build
pnpm preview

Search is available client-side and requires no external server.

Here are the scripts to configure in your package.json for an optimal workflow:

{
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro",
"check": "astro check",
"check:watch": "astro check --watch",
"format": "prettier --write .",
"format:check": "prettier --check ."
}
}
Script Usage
dev / start Local development with HMR.
build Static site generation.
preview Production build preview.
check TypeScript type checking.
check:watch Continuous checking during dev.
format Automatic code formatting.
format:check Format check (CI).

The CLI respects standard Astro environment variables:

Variable Description
PORT Development server port.
HOST Development server host.
NODE_ENV Environment (development or production).
SITE Deployment URL (used for canonical links).

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.