# CLI Reference ## ty An extremely fast Python type checker.
ty checkCheck a project for type errors
ty serverStart the language server
ty versionDisplay ty's version
ty helpPrint this message or the help of the given subcommand(s)
PATHSList of files or directories to check [default: the project root]
--color whenControl when colored output is used
Possible values:
auto: Display colors if the output goes to an interactive terminalalways: Always display colorsnever: Never display colors--config, -c config-optionA TOML <KEY> = <VALUE> pair (such as you might find in a ty.toml configuration file)
overriding a specific configuration option.
Overrides of individual settings using this option always take precedence over all configuration files.
--config-file pathThe path to a ty.toml file to use for configuration.
While ty configuration can be included in a pyproject.toml file, it is not allowed in this context.
May also be set with the TY_CONFIG_FILE environment variable.
--error ruleTreat the given rule as having severity 'error'. Can be specified multiple times.
--error-on-warningUse exit code 1 if there are any warning-level diagnostics
--exclude excludeGlob patterns for files to exclude from type checking.
Uses gitignore-style syntax to exclude files and directories from type checking. Supports patterns like tests/, *.tmp, **/__pycache__/**.
--exit-zeroAlways use exit code 0, even when there are error-level diagnostics
--extra-search-path pathAdditional path to use as a module-resolution source (can be passed multiple times).
This is an advanced option that should usually only be used for first-party or third-party modules that are not installed into your Python environment in a conventional way. Use --python to point ty to your Python environment if it is in an unusual location.
--help, -hPrint help (see a summary with '-h')
--ignore ruleDisables the rule. Can be specified multiple times.
--output-format output-formatThe format to use for printing diagnostic messages
Possible values:
full: Print diagnostics verbosely, with context and helpful hints (default)concise: Print diagnostics concisely, one per linegitlab: Print diagnostics in the JSON format expected by GitLab Code Quality reportsgithub: Print diagnostics in the format used by GitHub Actions workflow error annotations--project projectRun the command within the given project directory.
All pyproject.toml files will be discovered by walking up the directory tree from the given project directory, as will the project's virtual environment (.venv) unless the venv-path option is set.
Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.
--python, --venv pathPath to your project's Python environment or interpreter.
ty uses your Python environment to resolve third-party imports in your code.
If you're using a project management tool such as uv or you have an activated Conda or virtual environment, you should not generally need to specify this option.
This option can be used to point to virtual or system Python environments.
--python-platform, --platform platformTarget platform to assume when resolving types.
This is used to specialize the type of sys.platform and will affect the visibility of platform-specific functions and attributes. If the value is set to all, no assumptions are made about the target platform. If unspecified, the current system's platform will be used.
--python-version, --target-version versionPython version to assume when resolving types.
The Python version affects allowed syntax, type definitions of the standard library, and type definitions of first- and third-party modules that are conditional on the Python version.
If a version is not specified on the command line or in a configuration file, ty will try the following techniques in order of preference to determine a value: 1. Check for the project.requires-python setting in a pyproject.toml file and use the minimum version from the specified range 2. Check for an activated or configured Python environment and attempt to infer the Python version of that environment 3. Fall back to the latest stable Python version supported by ty (see ty check --help output)
Possible values:
3.73.83.93.103.113.123.133.14--quiet, -qUse quiet output (or -qq for silent output)
--respect-ignore-filesRespect file exclusions via .gitignore and other standard ignore files. Use --no-respect-gitignore to disable
--typeshed, --custom-typeshed-dir pathCustom directory to use for stdlib typeshed stubs
--verbose, -vUse verbose output (or -vv and -vvv for more verbose output)
--warn ruleTreat the given rule as having severity 'warn'. Can be specified multiple times.
--watch, -WWatch files for changes and recheck files related to the changed files
--help, -hPrint help
--help, -hPrint help
SHELL--help, -hPrint help