CLI Reference
pnpm add -D @routegraph/cliEvery command falls back to plain, colorless, non-animated output automatically when stdout isn’t a TTY — CI logs stay readable without a flag.
routegraph init
Scaffold a new project.
routegraph init --name my-api # interactive wizard
routegraph init --name my-api --yes # defaults: Express, port 3000, every feature, pnpm| Flag | Description |
|---|---|
--name <name> | project directory name |
--adapter <express|hono|fastify|elysia|koa> | skip the framework prompt |
--yes | accept every default, skip all prompts |
--pm <pnpm|npm|bun> | package manager for the generated scripts |
routegraph dev
Dev server: hot reload + docs UI (where auto-mounted — see Integrations).
routegraph dev
routegraph dev --port 4000routegraph build
Validate → typecheck → generate RouteMap → export docs + OpenAPI. The
command you put in CI before a deploy.
routegraph buildExit code 1 on any validation or typecheck failure — safe to gate a
pipeline on.
routegraph routes
Print every registered route as a table. Useful for a quick sanity check after a refactor.
routegraph routes GET /health
GET /users
POST /users
GET /users/:id
DELETE /users/:idroutegraph validate
Check every route file’s exports and config shape without starting a
server.
routegraph validate
routegraph validate --strict # also fail on routes with no config (unvalidated)routegraph generate-client
Writes the RouteMap type file @routegraph/client consumes.
routegraph generate-client --out ./routemap.tsroutegraph export-docs
Export a static docs site or an OpenAPI spec — no running server required.
routegraph export-docs --out ./dist/docs
routegraph export-docs --format openapi --out ./openapi.jsonFull flag list, defaults, and exit codes: packages/cli/README.md.