CLI
The CLI entrypoint is for projects that already have a shell build command and want the smallest OpenNav setup.
Install
Section titled “Install”Install OpenNav in the project that owns the static build command.
npm install @opennav-ai/opennavpnpm add @opennav-ai/opennavyarn add @opennav-ai/opennavbun add @opennav-ai/opennavopennav build --static \ --output dist \ --site-url https://example.com \ --site-name "Example Docs"Add --dry-run to preview without writing files.
opennav build --static
Section titled “opennav build --static”Runs OpenNav against an existing static output folder.
opennav build --static \ --output <directory> \ --site-url <url> \ --site-name <name> \ [--preset <preset>] \ [--platform <platform>] \ [--strip-layout] \ [--static-headers] \ [--dry-run]--static
Section titled “--static”Required. Treats --output as a finished static-site folder. OpenNav scans
existing HTML, Markdown, and robots.txt files in that folder.
--output <directory>
Section titled “--output <directory>”Required. Built output folder, such as dist, out, or build.
All created and modified files stay inside this folder.
--site-url <url>
Section titled “--site-url <url>”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.
--site-name <name>
Section titled “--site-name <name>”Required. Human-readable site or docs name written into generated llms files
and metadata.
--preset <preset>
Section titled “--preset <preset>”Optional. Framework hint for static-folder conventions.
Supported values are astro and next-export.
--platform <platform>
Section titled “--platform <platform>”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.
--strip-layout
Section titled “--strip-layout”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.
--static-headers
Section titled “--static-headers”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.
--dry-run
Section titled “--dry-run”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.