@cookbook/router-cli API
Command-line and programmatic APIs for configuration, static route loading, generation, validation, manifests, and bundler integration.
Package role
@cookbook/router-cli turns route sources into validated physical artifacts. It also exports the same engine used by every bundler plugin. There is one generation pipeline, not six plugins with six interpretations of your route tree.
Binary
The package installs two binary names that resolve to the same entrypoint:
cookbook-router <command> [options]
cbr <command> [options]Commands are init, generate, manifest, and validate. generate --watch invokes the exported watch engine.
Public API groups
Commands
CLI flags and programmatic command functions.
Configuration
Config shape, discovery, loading, and effective option precedence.
Generation
Contracts, manifest, register, routes module, and safe writes.
Route loading
Static extraction, globs, composition, and route input resolution.
Build integration
Runner results, watch paths, error formatting, and compiler hooks.
Contracts
Every public interface and supporting data model.
Import boundary
All documented imports come from the package root:
import { generateRouterArtifacts, type CliRouteOptions } from '@cookbook/router-cli';Internal source paths are not public API. A helper existing in src/ is not permission to depend on it.
React contracts
Public type contracts, context values, provider props, link props, outlet props, fallback props, hook options, and generated registration types exported by @cookbook/router-react.
CLI commands and command APIs
Exact commands, flags, programmatic options, result behavior, watch behavior, and embedding APIs.