Skip to content

CLI

The CLI entrypoint is for projects that already have a shell build command and want the smallest OpenNav setup.

Install OpenNav in the project that owns the static build command.

Terminal window
npm install @opennav-ai/opennav
Terminal window
opennav build --static \
--output dist \
--site-url https://example.com \
--site-name "Example Docs"

Add --dry-run to preview without writing files.

Runs OpenNav against an existing static output folder.

Terminal window
opennav build --static \
--output <directory> \
--site-url <url> \
--site-name <name> \
[--preset <preset>] \
[--platform <platform>] \
[--strip-layout] \
[--static-headers] \
[--dry-run]

Required. Treats --output as a finished static-site folder. OpenNav scans existing HTML, Markdown, and robots.txt files in that folder.

Required. Built output folder, such as dist, out, or build.

All created and modified files stay inside this folder.

Required. Public deployed site URL used for generated links and manifest URLs. The value should include the protocol and host, such as https://example.com.

Required. Human-readable site or docs name written into generated llms files and metadata.

Optional. Framework hint for static-folder conventions.

Supported values are astro and next-export.

Optional. Static hosting platform for platform-specific generated files.

Supported values are cloudflare-pages. When --platform cloudflare-pages is passed, OpenNav creates or updates the Cloudflare Pages _headers file by default. That file gives generated Markdown, llms.txt, and manifest files explicit response content types, and adds per-page HTTP Link headers on HTML routes so agents can discover each page’s Markdown alternate and the root llms.txt index from response headers.

If an existing caller-owned _headers route overlaps OpenNav’s generated routes, OpenNav leaves _headers untouched and reports a warning.

Omit --platform for a generic static build. Additional platform values will be added as OpenNav gains first-class support for more static hosts.

Optional. Sets contentExtraction.stripLayout to true.

By default, OpenNav converts the whole HTML <body> when it creates generated Markdown page artifacts and llms-full.txt. Pass --strip-layout only when your built HTML uses normal layout elements for repeated interface such as navigation, sidebars, search, headers, footers, or table-of-contents panels.

See the content extraction reference for the exact elements OpenNav removes when this flag is enabled.

This first version uses a fixed strip list. Future versions are expected to add more granular HTML element controls, such as tag-level, class-level, or selector-level strip and preserve rules.

Optional. Explicitly requests the platform response-header artifact.

For Cloudflare Pages, this is already enabled by default when --platform cloudflare-pages is passed. The flag is mainly useful when you want the command to fail if no platform was supplied, because static header files are platform-specific. Passing --static-headers without --platform aborts with a clear error.

Optional. Reports planned created, modified, skipped, and warning paths without changing files.

The CLI writes files by default. There is no --full-run flag for the current static workflow.