[Skip to content](#_top)

[![OpenNav AI](/_astro/full-open-logo.CGezuffk.svg) OpenNav AI](https://opennav.ai/)

Search CtrlK

Cancel

[Docs](https://docs.opennav.ai/index.md)

[Quick Start](https://docs.opennav.ai/getting-started/index.md)

[SDK](https://docs.opennav.ai/sdk/index.md)

[OpenNav AI on X](https://x.com/OpenNavAI)

[Joshua Bellew on X](https://x.com/manofyear93)

[Email Joshua Bellew](mailto:joshua@opennav.ai)

- Start Here

  - [Overview](https://docs.opennav.ai/index.md)
  - [How It Works](https://docs.opennav.ai/how-it-works/index.md)
  - [Getting Started](https://docs.opennav.ai/getting-started/index.md)

- Use OpenNav

  - [CLI](https://docs.opennav.ai/cli/index.md)
  - [SDK](https://docs.opennav.ai/sdk/index.md)

- Frameworks

  - [Astro](https://docs.opennav.ai/frameworks/astro/index.md)
  - [Next.js](https://docs.opennav.ai/frameworks/next/index.md)
  - [Server-side frameworks Soon](https://docs.opennav.ai/frameworks/server-side/index.md)

- Platforms

  - [Cloudflare](https://docs.opennav.ai/platforms/cloudflare/index.md)

- Reference

  - [Generated Files](https://docs.opennav.ai/reference/generated-files/index.md)
  - [Content Extraction](https://docs.opennav.ai/reference/content-extraction/index.md)
  - [Access Guidance](https://docs.opennav.ai/reference/access-guidance/index.md)

- External

  - [AcceptMarkdown](https://acceptmarkdown.com/)
  - [Cloudflare Agent Readiness](https://blog.cloudflare.com/agent-readiness/)
  - [Is It Agent Ready?](https://isitagentready.com/)

[OpenNav AI on X](https://x.com/OpenNavAI)

[Joshua Bellew on X](https://x.com/manofyear93)

[Email Joshua Bellew](mailto:joshua@opennav.ai)

On this page

- [Overview](#_top)
- [Install](#install)
- [opennav build --static](#opennav-build---static)
  - [\--static](#--static)
  - [\--output <directory>](#--output-directory)
  - [\--site-url <url>](#--site-url-url)
  - [\--site-name <name>](#--site-name-name)
  - [\--preset <preset>](#--preset-preset)
  - [\--platform <platform>](#--platform-platform)
  - [\--strip-layout](#--strip-layout)
  - [\--static-headers](#--static-headers)
  - [\--dry-run](#--dry-run)

## On this page

- [Overview](#_top)
- [Install](#install)
- [opennav build --static](#opennav-build---static)
  - [\--static](#--static)
  - [\--output <directory>](#--output-directory)
  - [\--site-url <url>](#--site-url-url)
  - [\--site-name <name>](#--site-name-name)
  - [\--preset <preset>](#--preset-preset)
  - [\--platform <platform>](#--platform-platform)
  - [\--strip-layout](#--strip-layout)
  - [\--static-headers](#--static-headers)
  - [\--dry-run](#--dry-run)

# 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)

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

- [npm](#tab-panel-0)
- [pnpm](#tab-panel-1)
- [yarn](#tab-panel-2)
- [bun](#tab-panel-3)

Terminal window

```txt
npm install @opennav-ai/opennav
```

Terminal window

```txt
pnpm add @opennav-ai/opennav
```

Terminal window

```txt
yarn add @opennav-ai/opennav
```

Terminal window

```txt
bun add @opennav-ai/opennav
```

Terminal window

```txt
opennav 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”](#opennav-build---static)

Runs OpenNav against an existing static output folder.

Terminal window

```txt
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”](#--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>”](#--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>”](#--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>”](#--site-name-name)

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

### `--preset <preset>`

[Section titled “--preset <preset>”](#--preset-preset)

Optional. Framework hint for static-folder conventions.

Supported values are `astro` and `next-export`.

### `--platform <platform>`

[Section titled “--platform <platform>”](#--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”](#--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](https://docs.opennav.ai/reference/content-extraction/index.md) 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”](#--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”](#--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.

[PreviousGetting Started](https://docs.opennav.ai/getting-started/index.md)

[NextSDK](https://docs.opennav.ai/sdk/index.md)

---

Site index: [llms.txt](https://docs.opennav.ai/llms.txt)

<!-- opennav compatible="true" version="1.0" profile="static-agent-ready" build-fingerprint="sha256:ef7e48fe34cc" manifest="/.well-known/opennav.json" -->
