CLI inspector
@daloyjs/core ships a tiny daloy binary that loads your App instance and prints what is registered. It is the fastest way to answer questions like “what routes does this service expose?”, “are any operationIds missing?”, or “give me the OpenAPI spec” without starting a server.
Quick start
Loading the App
The entry file must export an App instance. The CLI accepts a default export, named app or default_app exports, a zero-argument buildApp or createApp factory, or any named export that is already an App:
Without an explicit entry, daloy inspect tries src/app.ts, src/app.js, src/build-app.ts, src/build-app.js, app.ts, app.js, build-app.ts, and build-app.js. TypeScript entry files are loaded via tsx. create-daloy templates already include tsx; in other projects install it with pnpm add -D tsx.
Point inspect, doctor, and diff at import-safe app construction files, not files that call serve(...) as a module side effect. When redirecting JSON or YAML to a file, keep app-construction logs off stdout so the output stays parseable.
Flags
--json: emit a machine-readable JSON document instead of a human table.--check: run the contract suite ( missing operationIds, duplicate operationIds, dead routes, body schemas on safe methods, invalid examples) and exit 1 on any error.--schemas: add aB/Q/P/Hcolumn showing which of body, query, params, and headers schemas the route declares.--openapi: print the OpenAPI 3.1 document.--asyncapi: print the AsyncAPI 3.0 document forapp.ws()WebSocket surfaces.--ai: print an AI/codegen-friendly dump of the route catalog with JSON Schemas and anymeta.examplesyou authored. See the AI-friendly route metadata guide.--yaml·--format <json|yaml>: emit--openapi,--asyncapi, or--aioutput as YAML instead of JSON. YAML drops braces, commas, and most quotes, so the payload is typically ~30% smaller than the equivalent pretty-printed JSON, useful when pasting route metadata into an LLM system prompt where every token counts.--tag <tag>: only show routes that declare this tag.--method <method>: only show routes for this HTTP method.--runtime <node|bun|deno>: force the runtime fordaloy dev.--audit-secrets: makedaloy doctorscan matching environment variables for known-weak placeholders and short production secrets.--no-audit-defaults: skip the default secure-defaults audit indaloy doctor.-h, --help·-v, --version
daloy dev: watch-mode dev server
daloy dev [entry] starts your app in the host runtime's native watch mode, no extra config, no extra dependency to install on Bun or Deno:
The exact command spawned depends on the runtime that hosts the CLI:
- Node:
node --import tsx --watch <entry>(installtsxas a dev dependency for TypeScript entries). - Bun:
bun --hot <entry>. - Deno:
deno run --watch --allow-net --allow-env --allow-read <entry>.
Pass --runtime <node|bun|deno> to override runtime detection. This is required when running daloy dev from a package.json script on Bun or Deno, because the CLI binary's #!/usr/bin/env node shebang otherwise forces Node detection. The bun-basic template ships "dev": "daloy dev --runtime bun" for this reason.
daloy doctor: secure-defaults audit
daloy doctor [entry] loads the same App as inspect, then audits the live configuration for secure-by-default regressions. It exits 1 when it finds an error-level issue, so it can guard CI or a container HEALTHCHECK:
Warning-level findings are advisory and exit 0. In JSON mode, ok is only true when there are no findings at all.
daloy diff: OpenAPI change gate
daloy diff <baseline> <current> compares two OpenAPI 3.1 JSON files, reports added, removed, and changed operations, and exits 1 when it detects a breaking change:
CI usage
daloy inspect --check is a drop-in replacement for the in-process runContractTests runner. Wire it into your pipeline to fail builds on dead routes, duplicate operationIds, and missing operationIds:
Programmatic API
The CLI is also exported as a function so you can wire it into custom scripts or your own binary: