Orval
$ orval Community Low RiskOrval generates type-safe TypeScript API clients, TanStack Query / SWR hooks, Zod validation schemas, and MSW mock handlers from OpenAPI v3 or Swagger v2 specifications. Agents can target specific config files with --config (-c) and individual targets with --project (-p).
npm install -g orval Full-stack TypeScript client, Zod, and MSW code generation runs locally on repository files via orval without MCP overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Runs headlessly with --config and --project flags and clear exit codes, though it has no --dry-run or --json summary mode and --watch blocks continuously.
- Headless
--config(-c) and--project(-p) targeting - Lacks
--dry-runand--jsonoutput
Writes generated TypeScript/Zod/MSW files directly to paths specified in orval.config.ts without a built-in --dry-run flag.
- Overwrites target output files defined in config
Cross-platform Node package via npm or npx orval (plus ghcr.io/orval-labs/orval container image).
- Standard npm / npx installation
Generates complete frontend integration layers (Axios/Fetch clients, React Query hooks, Zod schemas, MSW mocks) in a single command.
- Supports Fetch, Axios, TanStack Query, SWR, Zod, and MSW
Actively maintained community project (orval-labs/orval) under MIT.
- Frequent releases in
orval-labs/orval
Comprehensive configuration and CLI reference at orval.dev.
- Official docs at orval.dev
Security, Auth & Guardrails
None required; reads local orval.config.* and OpenAPI specifications.
100% free and MIT open-source.
# Orval Agent Rules - Always inspect `orval.config.ts` output paths before running `orval`, as it overwrites configured target files. - Use `--project <name>` to scope regeneration to one API target; never pass `--watch` in foreground agent calls.
Agent-Ready Command Recipes
Safe Read-Only Queries
orval --help
Prints supported Orval CLI flags without reading specs or writing generated code.
Controlled Writes & Previews
orval --config orval.config.ts --project petstore
Runs code generation only for the petstore project defined in orval.config.ts.
Strengths for Agents
- + All-in-one generator for TypeScript HTTP clients, TanStack Query/SWR hooks, Zod schemas, and MSW mocks.
- +
--configand--projectlet agents regenerate a single API target cleanly. - + Supports both OpenAPI v3 and Swagger v2 specs.
Caveats & Pitfalls
- ! No
--dry-runflag; runningorvalimmediately overwrites configured output files. - ! Passing
--watch(-w) blocks indefinitely waiting for file changes.