Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openapistack/openapicmd
The CLI for all things OpenAPI and Swagger
https://github.com/openapistack/openapicmd
cli hacktoberfest openapi swagger
Last synced: 6 days ago
JSON representation
The CLI for all things OpenAPI and Swagger
- Host: GitHub
- URL: https://github.com/openapistack/openapicmd
- Owner: openapistack
- License: mit
- Created: 2019-01-26T07:15:34.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2024-09-21T11:32:04.000Z (3 months ago)
- Last Synced: 2024-12-20T19:15:21.107Z (7 days ago)
- Topics: cli, hacktoberfest, openapi, swagger
- Language: TypeScript
- Homepage: https://openapistack.co
- Size: 2.15 MB
- Stars: 58
- Watchers: 4
- Forks: 9
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
OpenAPI Command Line Tool
[![CI](https://github.com/openapistack/openapicmd/workflows/CI/badge.svg)](https://github.com/openapistack/openapicmd/actions?query=workflow%3ACI)
[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/openapistack/openapicmd/blob/main/LICENSE)
[![npm version](https://img.shields.io/npm/v/openapicmd.svg)](https://www.npmjs.com/package/openapicmd)
[![npm downloads](https://img.shields.io/npm/dw/openapicmd.svg)](https://www.npmjs.com/package/openapicmd)
![npm type definitions](https://img.shields.io/npm/types/openapicmd.svg)
[![Buy me a coffee](https://img.shields.io/badge/donate-buy%20me%20a%20coffee-orange)](https://buymeacoff.ee/anttiviljami)openapicmd - The CLI for all things OpenAPI and Swagger
# Install
```
npm install -g openapicmd
openapi help
```# Features
- [x] Read and convert local and remote JSON/YAML OpenAPI definition files
- [x] Generate TypeScript types from OpenAPI definitions
- [x] Use as a CLI client to easily call API endpoints
- [x] Run Local Mock APIs
- [x] Automate API tests and validate specs
- [x] Run [Swagger UI](https://github.com/swagger-api/swagger-ui) or [ReDoc](https://github.com/Redocly/redoc) locally
- [x] Bundle static [Swagger UI](https://github.com/swagger-api/swagger-ui) or [ReDoc](https://github.com/Redocly/redoc) sites
- [x] Run [Swagger Editor](https://github.com/swagger-api/swagger-editor) locally
- [x] Convert Swagger to OpenAPI# Commands
* [`openapi auth [DEFINITION]`](#openapi-auth-definition)
* [`openapi call [DEFINITION]`](#openapi-call-definition)
* [`openapi help [COMMAND]`](#openapi-help-command)
* [`openapi info [DEFINITION]`](#openapi-info-definition)
* [`openapi init`](#openapi-init)
* [`openapi load DEFINITION`](#openapi-load-definition)
* [`openapi mock [DEFINITION]`](#openapi-mock-definition)
* [`openapi read [DEFINITION]`](#openapi-read-definition)
* [`openapi redoc [DEFINITION]`](#openapi-redoc-definition)
* [`openapi swagger-editor [DEFINITION]`](#openapi-swagger-editor-definition)
* [`openapi swagger-ui [DEFINITION]`](#openapi-swagger-ui-definition)
* [`openapi swagger2openapi [DEFINITION]`](#openapi-swagger2openapi-definition)
* [`openapi test`](#openapi-test)
* [`openapi test add [DEFINITION]`](#openapi-test-add-definition)
* [`openapi typegen [DEFINITION]`](#openapi-typegen-definition)
* [`openapi unload`](#openapi-unload)## `openapi auth [DEFINITION]`
Authenticate with apis (writes to .openapiconfig)
```
USAGE
$ openapi auth [DEFINITION] [-h] [-V] [-D] [-B] [-R /] [-H ...] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U] [-s
...] [-k ] [-t ] [-u ] [-P ]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-P, --password= set basic auth password
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-h, --help Show CLI help.
-k, --apikey= set api key
-s, --security=... use security scheme
-t, --token= set bearer token
-u, --username= set basic auth usernameDESCRIPTION
Authenticate with apis (writes to .openapiconfig)EXAMPLES
$ openapi auth$ openapi auth --token eyJh...
$ openapi auth --security ApiKeyAuth --apikey secret123
$ openapi auth --security BasicAuth --username admin --password password
```_See code: [src/commands/auth.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/auth.ts)_
## `openapi call [DEFINITION]`
Call API endpoints
```
USAGE
$ openapi call [DEFINITION] [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U]
[--interactive] [-o operationId] [-p key=value...] [-d ] [-i] [-v] [-s ...] [-k ] [-t ]
[-u ] [-P ]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-P, --password= set basic auth password
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-d, --data= request body
-h, --help Show CLI help.
-i, --include include status code and response headers the output
-k, --apikey= set api key
-o, --operation=operationId operationId
-p, --param=key=value... parameter
-s, --security=... use security scheme
-t, --token= set bearer token
-u, --username= set basic auth username
-v, --verbose verbose mode
--[no-]interactive [default: true] enable CLI interactive modeDESCRIPTION
Call API endpointsEXAMPLES
$ openapi call -o getPets$ openapi call -o getPet -p id=1
$ openapi call -o createPet -d '{ "name": "Garfield" }'
```_See code: [src/commands/call.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/call.ts)_
## `openapi help [COMMAND]`
Display help for openapi.
```
USAGE
$ openapi help [COMMAND...] [-n]ARGUMENTS
COMMAND... Command to show help for.FLAGS
-n, --nested-commands Include all nested commands in the output.DESCRIPTION
Display help for openapi.
```_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.8/src/commands/help.ts)_
## `openapi info [DEFINITION]`
Display API information
```
USAGE
$ openapi info [DEFINITION] [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U]
[--security] [--operations] [--schemas]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-h, --help Show CLI help.
--operations list operations in document
--schemas list schemas in document
--security list security schemes in documentDESCRIPTION
Display API informationEXAMPLES
$ openapi info https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml$ openapi info ./openapi.yml
```_See code: [src/commands/info.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/info.ts)_
## `openapi init`
Initialise a definition file from scratch
```
USAGE
$ openapi init [-h] [-T ] [-d ] [-v ] [--terms ] [--license mit|apache2] [-S
http://localhost:9000...] [-I {"info":{"version":"1.0.0"}}...] [-f json|yaml|yml | --json | --yaml]FLAGS
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-S, --server=http://localhost:9000... override servers definition
-T, --title= [default: My API] The title for the API
-d, --description= Description for the API
-f, --format= [default: yaml] output format
-h, --help Show CLI help.
-v, --version= [default: 0.0.1] Version of the API
--json format as json (short for -f json)
--license= The license for the API
--terms= A URL to the Terms of Service for the API.
--yaml format as yaml (short for -f yaml)DESCRIPTION
Initialise a definition file from scratchEXAMPLES
$ openapi init --title 'My API' > openapi.yml
```_See code: [src/commands/init.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/init.ts)_
## `openapi load DEFINITION`
Set the default definition file for a workspace (writes to .openapiconfig)
```
USAGE
$ openapi load DEFINITION [-h] [-V] [-S http://localhost:9000...]ARGUMENTS
DEFINITION input definition fileFLAGS
-S, --server=http://localhost:9000... override servers definition
-V, --validate validate against openapi schema
-h, --help Show CLI help.DESCRIPTION
Set the default definition file for a workspace (writes to .openapiconfig)EXAMPLES
$ openapi load ./openapi.yml$ openapi load https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
```_See code: [src/commands/load.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/load.ts)_
## `openapi mock [DEFINITION]`
Start a local mock API server
```
USAGE
$ openapi mock [DEFINITION] [-h] [-p 9000] [--logger] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-C default|all|openapi_client_axios|openapi_backend] [-E x-internal] [-H
...] [-R /] [-U docs] [--validate]ARGUMENTS
DEFINITION input definition fileFLAGS
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --swagger-ui=docs Swagger UI endpoint
-h, --help Show CLI help.
-p, --port=9000 [default: 9000] port
--[no-]logger [default: true] log requests
--[no-]validate [default: true] validate requests according to schemaDESCRIPTION
Start a local mock API serverEXAMPLES
$ openapi mock ./openapi.yml$ openapi mock https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml
```_See code: [src/commands/mock.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/mock.ts)_
## `openapi read [DEFINITION]`
Read and manipulate definition files
```
USAGE
$ openapi read [DEFINITION] [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U] [-f
json|yaml|yml | --json | --yaml]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-f, --format= [default: yaml] output format
-h, --help Show CLI help.
--json format as json (short for -f json)
--yaml format as yaml (short for -f yaml)DESCRIPTION
Read and manipulate definition filesEXAMPLES
$ openapi read https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml$ openapi read ./openapi.yml -f json > openapi.json
```_See code: [src/commands/read.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/read.ts)_
## `openapi redoc [DEFINITION]`
Start or bundle a ReDoc instance
```
USAGE
$ openapi redoc [DEFINITION] [-h] [-p 9000] [--logger] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-H
...] [-R /] [-B outDir]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle=outDir bundle a static site to directory
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-h, --help Show CLI help.
-p, --port=9000 [default: 9000] port
--[no-]logger [default: true] log requestsDESCRIPTION
Start or bundle a ReDoc instanceEXAMPLES
$ openapi redoc$ openapi redoc ./openapi.yml
$ openapi redoc ./openapi.yml --bundle outDir
```_See code: [src/commands/redoc.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/redoc.ts)_
## `openapi swagger-editor [DEFINITION]`
Start a Swagger Editor instance
```
USAGE
$ openapi swagger-editor [DEFINITION] [-h] [-p 9000] [--logger] [-H ...]ARGUMENTS
DEFINITION input definition fileFLAGS
-H, --header=... add request headers when calling remote urls
-h, --help Show CLI help.
-p, --port=9000 [default: 9000] port
--[no-]logger [default: true] log requestsDESCRIPTION
Start a Swagger Editor instanceEXAMPLES
$ openapi swagger-editor$ openapi swagger-editor ./openapi.yml
```_See code: [src/commands/swagger-editor.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/swagger-editor.ts)_
## `openapi swagger-ui [DEFINITION]`
Start or bundle a Swagger UI instance
```
USAGE
$ openapi swagger-ui [DEFINITION] [-h] [-p 9000] [--logger] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-C default|all|openapi_client_axios|openapi_backend] [-E x-internal] [--expand
full|list|none] [--operationids] [--filter] [--deeplinks] [--withcredentials] [--requestduration] [-H ...]
[-R /] [--proxy | -B outDir]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle=outDir bundle a static site to directory
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-h, --help Show CLI help.
-p, --port=9000 [default: 9000] port
--[no-]deeplinks [default: true] allow deep linking
--expand= [default: list] default expansion setting for the
operations and tags
--[no-]filter [default: true] enable filtering by tag
--[no-]logger [default: true] log requests
--[no-]operationids [default: true] display operationIds
--proxy set up a proxy for the api to avoid CORS issues
--[no-]requestduration [default: true] display request durations in "try it
now"
--[no-]withcredentials [default: true] send cookies in "try it now"DESCRIPTION
Start or bundle a Swagger UI instanceEXAMPLES
$ openapi swagger-ui$ openapi swagger-ui ./openapi.yml
$ openapi swagger-ui ./openapi.yml --bundle outDir
```_See code: [src/commands/swagger-ui.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/swagger-ui.ts)_
## `openapi swagger2openapi [DEFINITION]`
Convert Swagger 2.0 definitions to OpenAPI 3.0.x
```
USAGE
$ openapi swagger2openapi [DEFINITION] [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U] [-f
json|yaml|yml | --json | --yaml]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-f, --format= [default: yaml] output format
-h, --help Show CLI help.
--json format as json (short for -f json)
--yaml format as yaml (short for -f yaml)DESCRIPTION
Convert Swagger 2.0 definitions to OpenAPI 3.0.xEXAMPLES
$ openapi swagger2openapi --yaml ./swagger.json > openapi.yml
```_See code: [src/commands/swagger2openapi.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/swagger2openapi.ts)_
## `openapi test`
Run automated tests against APIs
```
USAGE
$ openapi test [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U]
[--interactive] [-o operationId...] [-v] [-s ...] [-k ] [-t ] [-u ] [-P ]FLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-P, --password= set basic auth password
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-h, --help Show CLI help.
-k, --apikey= set api key
-o, --operation=operationId... filter by operationId
-s, --security=... use security scheme
-t, --token= set bearer token
-u, --username= set basic auth username
-v, --verbose verbose mode
--[no-]interactive [default: true] enable CLI interactive modeDESCRIPTION
Run automated tests against APIsEXAMPLES
$ openapi test$ openapi test -o getPets
```_See code: [src/commands/test/index.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/test/index.ts)_
## `openapi test add [DEFINITION]`
Add automated tests for API operations
```
USAGE
$ openapi test add [DEFINITION] [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U] [--auto]
[-o operationId] [-n my test] [-c 2XXStatus...] [-p key=value...] [-d ] [-v] [--interactive] [-s ...]
[-k ] [-t ] [-u ] [-P ]ARGUMENTS
DEFINITION input definition fileFLAGS
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-P, --password= set basic auth password
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-c, --checks=2XXStatus... checks to include in test
-d, --data= request body
-h, --help Show CLI help.
-k, --apikey= set api key
-n, --name=my test test name
-o, --operation=operationId operationId
-p, --param=key=value... parameter
-s, --security=... use security scheme
-t, --token= set bearer token
-u, --username= set basic auth username
-v, --verbose verbose mode
--auto auto generate tests for all operations
--[no-]interactive [default: true] enable CLI interactive modeDESCRIPTION
Add automated tests for API operationsEXAMPLES
$ openapi test add$ openapi test add -o getPet --checks all
```_See code: [src/commands/test/add.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/test/add.ts)_
## `openapi typegen [DEFINITION]`
Generate types from openapi definition
```
USAGE
$ openapi typegen [DEFINITION] [-h] [-D] [-B] [-R /] [-H ...] [-V] [-S http://localhost:9000...] [-I
{"info":{"version":"1.0.0"}}...] [-E x-internal] [-C default|all|openapi_client_axios|openapi_backend] [-U] [-b
] [--client] [--backend] [-A]ARGUMENTS
DEFINITION input definition fileFLAGS
-A, --[no-]type-aliases Generate module level type aliases for schema components
defined in spec
-B, --bundle resolve remote $ref pointers
-C, --strip=default|all|openapi_client_axios|openapi_backend Strip optional metadata such as examples and
descriptions from definition
-D, --dereference resolve $ref pointers
-E, --exclude-ext=x-internal Specify an openapi extension to exclude parts of the
spec
-H, --header=... add request headers when calling remote urls
-I, --inject={"info":{"version":"1.0.0"}}... inject JSON to definition with deep merge
-R, --root=/ override API root path
-S, --server=http://localhost:9000... override servers definition
-U, --[no-]remove-unreferenced Remove unreferenced components, you can skip individual
component being removed by setting x-openapicmd-keep to
true
-V, --validate validate against openapi schema
-b, --banner= include a banner comment at the top of the generated
file
-h, --help Show CLI help.
--backend Generate types for openapi-backend
--client Generate types for openapi-client-axios (default)DESCRIPTION
Generate types from openapi definitionEXAMPLES
$ openapi typegen ./openapi.yml > openapi.d.ts
```_See code: [src/commands/typegen.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/typegen.ts)_
## `openapi unload`
Unset the default definition file for a workspace (writes to .openapiconfig)
```
USAGE
$ openapi unload [-h]FLAGS
-h, --help Show CLI help.DESCRIPTION
Unset the default definition file for a workspace (writes to .openapiconfig)EXAMPLES
$ openapi unload
```_See code: [src/commands/unload.ts](https://github.com/openapistack/openapicmd/blob/v2.6.1/src/commands/unload.ts)_
## Commercial support
For assistance with using openapicmd in your company, reach out at [email protected].
## Contributing
`openapicmd` is Free and Open Source Software. Issues and pull requests are more than welcome!