Exit Codes
tyc follows the conventional “0 = success, non-zero = failure” pattern. Specific values:
| Code | Meaning |
|---|---|
| 0 | Success. |
| 1 | Compile-time or run-time failure — at least one error-severity diagnostic, a tyc fmt --check that would reformat, an unknown tyc explain code, a missing file or required tool (e.g. uv not installed for tyc add), or a program that exited non-zero under tyc run. |
| 2 | Invocation error — invalid arguments or an unknown subcommand (reported by the argument parser). |
| 130 | Interrupted (Ctrl-C / SIGINT). |
Per-command notes
| Command | 0 means | Non-zero means |
|---|---|---|
tyc check | No errors. | 1 if any error-severity diagnostic, the input is invalid, or there was nothing to check (no .ty files under the paths); 2 if the command line is malformed. |
tyc check --stubs | No drift. | 1 if any tyc::stub_mismatch at error severity (the stub-check default). |
tyc build | Build succeeded. | 1 if any error-severity diagnostic stops emission. |
tyc fmt | No changes / changes written. | 1 (with --check) if any file would change. |
tyc run | Script exited 0. | Propagates the script’s exit code verbatim. |
tyc repl | Clean exit. | 130 on Ctrl-C. With stdin piped (a script fed in), 1 if any snippet failed to compile or raised. |
tyc debug | Debugger exited 0. | Whatever the debugger exits with. |
tyc trace | Traceback remapped. | 1 if the file is unreadable / not a valid traceback. |
tyc profile | Instrumented build written. | 1 if the build or the instrumentation failed. (tyc profile does not run the program — you do, and the profile is written on its exit.) |
tyc migrate | Wrote .ty. | 1 if the input is missing or unreadable. --check is a preview to stdout and exits 0 whenever the migration itself succeeds. |
tyc ty | ty returned 0. | Propagates ty’s exit code. |
tyc stubtest | mypy.stubtest returned 0. | Propagates mypy’s exit code. |
tyc add / remove / sync | Manifest updated and uv sync succeeded. | 1 if uv missing; non-zero from uv on resolution failure. |
tyc lsp | The client sent shutdown before exit. | 1 when the client sends exit without shutdown (the LSP spec’s rule) or closes stdin without it. |
Severity-to-exit-code mapping
[strictness] keys control whether a finding is error, warn, or off. Only error-severity findings change the exit code.
[strictness]unused-import = "warn" # surfaces but doesn't fail CIexhaustive-match = "error" # fails CITo gate CI on warnings, raise the relevant key to "error" — there is no --quiet switch to filter output with.
Where next
tyc check— the CI command.- Reading Diagnostics — diagnostic severities and format.
[strictness]config — every severity knob.