CLI Usage
CLI Usage
All configuration options can be passed as CLI flags. Flags override values from the config file.
Basic usage
ng-openapi-gen -i openapi.yaml -o src/app/apiFlags
| Flag | Alias | Description |
|---|---|---|
--config | -c | Path to configuration JSON file |
--input | -i | OpenAPI spec file or URL |
--output | -o | Output directory |
--silent | Suppress verbose output | |
--help | Show help |
All configuration properties can also be passed as flags using camelCase or kebab-case:
ng-openapi-gen --input spec.yaml --model-prefix "My" --enum-style upper --promises falseExamples
Basic generation
ng-openapi-gen -i petstore.yaml -o src/app/apiWith URL input
ng-openapi-gen -i https://example.com/openapi.json -o src/app/apiUsing a config file
ng-openapi-gen -c my-config.jsonMulti-API setup
ng-openapi-gen -c api-users.json
ng-openapi-gen -c api-orders.jsonExit codes
| Code | Meaning |
|---|---|
0 | Success |
1 | Error (parsing, generation, etc.) |
Environment
No environment variables are required. The tool respects $GOPATH if set for Go-based installs, but the binary itself is standalone.