Getting Started
Run OpenNav after your existing static build command. The output folder must
already contain real prerendered HTML such as index.html,
docs/getting-started/index.html, or docs/api/index.html.
Install
Section titled “Install”Install OpenNav in the project that builds your static site.
npm install @opennav-ai/opennavpnpm add @opennav-ai/opennavyarn add @opennav-ai/opennavbun add @opennav-ai/opennavCLI Quick Start
Section titled “CLI Quick Start”opennav build --static --output dist --site-url https://example.com --site-name "Example Docs"Use --dry-run first when you want to preview the exact files OpenNav would
create, modify, or skip.
opennav build --static \ --output dist \ --site-url https://example.com \ --site-name "Example Docs" \ --dry-runWhere It Runs
Section titled “Where It Runs”OpenNav is designed for static site platforms first. If your deployment is a folder of files, OpenNav can run before you upload that folder.
| Platform style | Example output | How OpenNav fits |
|---|---|---|
| Cloudflare Pages | dist/ or framework output | Run OpenNav after the build with --platform cloudflare-pages, then deploy the same folder. |
| Netlify | dist/, build/, or framework output | Add OpenNav as the final build step before publish. |
| Vercel static output | out/ or generated assets | Run OpenNav for exported static routes before upload. |
| GitHub Pages or CDN hosting | Plain HTML folder | Run OpenNav locally or in CI, then publish the generated files. |
Framework SDKs
Section titled “Framework SDKs”Use the TypeScript SDK when OpenNav should run inside a framework build or a custom Node script. Static Astro and Next.js export builds are the first framework-specific SDK paths.
| Framework | Current support | Output folder |
|---|---|---|
| Astro | Static build helper. | dist/ |
| Next.js | Static export helper for output: "export". | out/ |
More framework helpers will follow in coming releases.
Server-Side Frameworks
Section titled “Server-Side Frameworks”OpenNav supports runtime HTML-to-Markdown content negotiation for any Node.js or
WinterCG-compatible server. Import OpenNavServer from
@opennav-ai/opennav/server and wrap your existing route handlers:
import { OpenNavServer } from "@opennav-ai/opennav/server";
const opennav = new OpenNavServer();
app.get("/docs/:slug", async (c) => { const htmlResponse = await renderPage(c.req.param("slug")); const result = await opennav.negotiate({ request: c.req.raw, htmlResponse, }); if (result.isErr()) return c.text("Internal error", 500); return result.value;});When the client sends Accept: text/markdown, the HTML is converted to Markdown
on-the-fly. Browser requests still receive normal HTML, and responses include
Vary: Accept so caches keep both representations separate.
See the Server-Side Frameworks guide for framework-specific advice.