ttsc & ttsx CLI flags
For ttsc and ttsx CLI users (command-line, build scripts, CI runners). Plugin authors should also skim the Consumed by column to see which layer reads each flag.
Single source of truth: packages/ttsc/src/flags/schema.ts. Each row is one
entry in FLAG_SCHEMA; the parsing engine, the docs table, and the Go
allow-lists are generated from the same array so a new flag never lands in
one layer and silently disappears at the next boundary.
| Flag | Aliases | Kind | Subcommands | Consumed by | Notes | Description |
|---|---|---|---|---|---|---|
--help | -h | boolean | ttsc, ttsx, build, check, fix, format | launcher | terminal, consumed-not-forwarded | Show command help and exit. |
--version | -v | boolean | ttsc, ttsx | launcher | terminal, consumed-not-forwarded | Print the launcher version and exit. |
--build | -b | boolean | ttsc, ttsx, build, check, fix, format | launcher | consumed-not-forwarded | Refused by the launcher: ttsc pins one resolved project, so tsgo’s solution-build mode is unsupported. |
--tsconfig | -p, --project | value | ttsc, ttsx, build, cache, check, fix, format, prepare, clean | launcher, host, lint | - | Resolve project settings from this tsconfig. |
--cwd | - | value | ttsc, ttsx, build, cache, check, fix, format, prepare, clean | launcher, host, lint | - | Resolve project-relative paths from this directory. |
--emit | - | boolean | ttsc, build, check | launcher, runBuild, host, lint | - | Force emitted files during build. |
--noEmit | - | boolean | ttsc, build, check | launcher, runBuild, host, lint | shadow | Force analysis-only build with no file writes. |
--outDir | - | value | ttsc, build, check | launcher, host, lint | - | Override compilerOptions.outDir for this invocation. |
--composite | - | boolean | ttsc, ttsx, build, check, fix, format | tsgo | tsconfig-only | Configure project-reference constraints in tsconfig; CLI accepts only false or null. |
--incremental | -i | boolean | ttsc, ttsx, build, check, fix, format | tsgo | - | Write build information for incremental compilation. |
--tsBuildInfoFile | - | value | ttsc, ttsx, build, check, fix, format | tsgo | - | Choose the incremental build-information file. |
--declaration | -d | boolean | ttsc, ttsx, build, check, fix, format | tsgo | - | Emit declaration files. |
--declarationDir | - | value | ttsc, ttsx, build, check, fix, format | tsgo | - | Choose the declaration output directory. |
--declarationMap | - | boolean | ttsc, ttsx, build, check, fix, format | tsgo | - | Emit source maps for declaration files. |
--emitDeclarationOnly | - | boolean | ttsc, ttsx, build, check, fix, format | tsgo | - | Emit declarations without JavaScript. |
--inlineSourceMap | - | boolean | ttsc, ttsx, build, check, fix, format | tsgo | - | Inline source maps into emitted JavaScript. |
--sourceMap | - | boolean | ttsc, ttsx, build, check, fix, format | tsgo | - | Emit external JavaScript source maps. |
--outFile | - | value | ttsc, ttsx, build, check, fix, format | tsgo | - | Forward the removed legacy option for TypeScript-Go’s diagnostic. |
--rootDir | - | value | ttsc, ttsx, build, check, fix, format | tsgo | - | Choose the compiler input root. |
--jsx | - | value | ttsc, ttsx, build, check, fix, format | tsgo | - | Choose the JSX emit transform. |
--watch | -w | boolean | ttsc, build, check | launcher | consumed-not-forwarded | Rebuild when project files change. |
--preserveWatchOutput | - | boolean | ttsc, build, check | launcher | consumed-not-forwarded | Do not clear the screen between watch rebuilds. |
--quiet | - | boolean | ttsc, build, check, fix, format | launcher, host, lint | - | Keep build output quiet (default). |
--verbose | - | boolean | ttsc, build, check, fix, format | launcher, host, lint | - | Print the build summary and emitted files. |
--binary | - | value | ttsc, ttsx, build, check, fix, format, prepare, clean | launcher | consumed-not-forwarded | Use an explicit tsgo binary. |
--cache-dir | - | value | ttsc, ttsx, build, cache, check, fix, format, prepare, clean | launcher | consumed-not-forwarded | Override the runner and source-plugin cache root. |
--json | - | boolean | cache | launcher | consumed-not-forwarded | Print cache paths as JSON. |
--singleThreaded | - | boolean | ttsc, ttsx, build, check, fix, format | launcher, runBuild, tsgo, host, lint | capability: threadingArgs | Run TypeScript-Go single-threaded (one checker). |
--checkers | - | value | ttsc, ttsx, build, check, fix, format | launcher, runBuild, tsgo, host, lint | capability: threadingArgs | Type-checker pool size (default: TypeScript-Go’s). |
--require | -r | value | ttsx | launcher | repeatable, consumed-not-forwarded | Preload a module before the entrypoint (ttsx; repeatable). |
--no-plugins | - | boolean | ttsx | launcher | consumed-not-forwarded | Build the project without ttsc plugins (ttsx). |
--listEmittedFiles | - | boolean | ttsc, build, check | runBuild, tsgo | shadow | Print the list of emitted files (forwarded to tsgo; ttsc keeps the lines when forwarded). |
--pretty | - | boolean | ttsc, ttsx, build, check, fix, format | tsgo | shadow | Toggle tsgo pretty-printed diagnostics (forwarded to tsgo). |
--diagnostics | - | boolean | ttsc, ttsx, build, check, fix, format | runBuild, tsgo, lint | capability: diagnosticsTiming | Print compiler performance information; plugin-backed ttsc runs add plugin wall-clock timings. |
--extendedDiagnostics | - | boolean | ttsc, ttsx, build, check, fix, format | runBuild, tsgo, lint | capability: diagnosticsTiming | Print detailed compiler performance information; plugin-backed ttsc runs add plugin wall-clock timings. |
--showConfig | - | boolean | ttsc, build, check | tsgo | terminal | Print the resolved tsconfig and exit (forwarded to tsgo). |
--listFilesOnly | - | boolean | ttsc, build, check | tsgo | terminal | Print the project file list and exit (forwarded to tsgo). |
--all | - | boolean | ttsc, build, check | tsgo | terminal, project-free | Print the full tsgo CLI help and exit. |
--init | - | boolean | ttsc, build, check | tsgo | terminal, project-free | Write a starter tsconfig.json and exit (forwarded to tsgo). |
-? | - | boolean | ttsc, build, check | tsgo | terminal, project-free | Print the tsgo CLI help and exit (forwarded to tsgo). |
--tsgo-args | - | value | ttsc, build, check, fix, format, prepare, clean | host, lint | - | JSON-encoded tsgo passthrough argv (internal: accepted by ttsc’s own hosts; the launcher forwards it in TTSC_TSGO_ARGS). |
--plugins-json | - | value | build, check, fix, format | host, lint | - | JSON-encoded ttsc plugin manifest (internal: emitted by runBuild). |
--project-context-json | - | value | build, check, fix, format | lint | - | JSON-encoded lexical and physical project identity (internal: emitted by runBuild). |
--manifest | - | value | build | host | - | Write emitted file list as JSON to this path (host build only). |
--file | - | value | build, check | lint | - | Absolute or cwd-relative path of the .ts file to transform (lint transform only). |
--out | - | value | build, check | lint | - | Write transform output to PATH (lint transform only; default: stdout). |
Reading this table
- Kind
booleanflags take no required value;valueflags consume the next argv token;valueOptionalkeeps a value optional. Launcher-owned flags also accept--flag=VALUE. Flags forwarded to tsgo preserve their original spelling, and the pinned tsgo CLI does not support inline=VALUE. - Consumed by lists every layer that reads the flag into its own option struct. A flag without a Consumed-by entry is forwarded verbatim to tsgo.
- Notes marks structural attributes:
terminal(the flag asks tsgo to print and exit),project-free(a terminal flag ttsc answers without resolving a project, so it works in a directory that has no tsconfig yet),repeatable(every occurrence counts, not just the last),shadow(ttsc adds the flag internally; post-processing must not eat a user-forwarded copy), andcapability: ...(the flag is delivered to native check-stage hosts that opt in via the matchingITtscPluginCapabilitiesfield).
Flag names are matched the way the compiler matches them: case-insensitively,
with one or two leading dashes. --noemit, --NoEmit, and -noEmit are
the same flag to ttsc because they are the same option to tsgo.
Unknown --prefixed flags are forwarded to tsgo without registration in
the schema, so adding a flag is only needed for flags ttsc itself consumes,
mutates, or shadows.