# CLI (Command Line Interface)

## Executable

> Straight forward way:

>     openapi-spec-validator openapi.yaml

> pipes way:

>     cat openapi.yaml | openapi-spec-validator -

## Docker

>     docker run -v path/to/openapi.yaml:/openapi.yaml --rm pythonopenapi/openapi-spec-validator /openapi.yaml

## Python interpreter

>     python -m openapi_spec_validator openapi.yaml

    usage: openapi-spec-validator [-h] [--errors {best-match,all}]
                                  [--schema {2.0,3.0.0,3.1.0,detect}]
                                  filename

    positional arguments:
      filename              Absolute or relative path to file

    options:
      -h, --help            show this help message and exit
      --errors {best-match,all}
                            Control error reporting. Defaults to "best-
                            match", use "all" to get all subschema
                            errors.
      --schema {2.0,3.0.0,3.1.0,detect}
                            OpenAPI schema (default: detect)