CLI
Command line interface reference
Generate type-safe clients from OpenAPI specifications.
Basic Usage
orvalBy default, Orval searches for an orval.config.js file.
Options
--input, -i
Path or URL to your OpenAPI specification:
orval --input ./petstore.yaml--output, -o
Output path for generated files:
orval --output ./api/endpoints/petstoreFromFileSpec.ts--config, -c
Path to your Orval config:
orval --config ./api/orval.config.js--project, -p
Focus on specific projects in your config:
orval --project petstore
orval --project dogstore catstore--watch, -w
Watch files and regenerate on changes:
orval --watch
orval --watch ./src--clean
Clean the output directories before regenerating:
orval --clean
orval --clean ./srcThis cleans all output target and schemas folders.
--formatter
Format generated files with the specified formatter (prettier, biome, or oxfmt):
orval --formatter prettier
orval --formatter biome
orval --formatter oxfmt--tsconfig
Specify the path to your tsconfig:
orval --tsconfig ./src/tsconfig.json--log-level
Set the log level. One of error, warn, info, verbose, or debug. The default is info. Mutually exclusive with --verbose and --quiet:
orval --log-level warn--verbose
Shortcut for --log-level verbose. Mutually exclusive with --log-level and --quiet:
orval --verbose--quiet
Shortcut for --log-level warn. Errors and warnings are printed; info, verbose, and debug are suppressed. Mutually exclusive with --log-level and --verbose:
orval --quiet--fail-on-warnings
Exit with error code 1 when warnings are emitted during generation. Useful in CI pipelines to enforce warning-free builds:
orval --fail-on-warnings