Skip to Content

Compile (ttsc)

Day-to-day compiler commands and the full flag reference.

Build the project

npx ttsc

Reads tsconfig.json from the current directory, type-checks the project, runs every configured plugin, writes JavaScript + declaration files to outDir. Equivalent to ttsc build.

Type-check only

npx ttsc --noEmit npx ttsc check # same thing, named subcommand

No files written. Non-zero exit on failure β€” this is the CI form.

Watch

npx ttsc --watch

Re-compiles on save. Pass --preserveWatchOutput to keep your scrollback.

Other day-to-day commands

npx ttsc -p tsconfig.build.json # pick a tsconfig npx ttsc --outDir build/server # override outDir npx ttsc --emit # force emit when noEmit: true is set npx ttsc --verbose # print every emitted file path npx ttsc fix # apply lint + format autofixes, then re-check npx ttsc format # apply only format autofixes (no lint cascade) npx ttsc prepare # pre-build plugin cache (CI warmup) npx ttsc clean # drop the plugin cache

ttsc fix and ttsc format belong to @ttsc/lint β€” see Fix & format commands.

Subcommands

SubcommandPurpose
ttscDefault. Same as ttsc build.
ttsc buildBuild + emit.
ttsc checkType-check only. Same as ttsc --noEmit.
ttsc fixRun lint + format autofixes from @ttsc/lint, then a no-emit check. One-shot pass; cannot combine with --watch or --emit.
ttsc formatApply only the format-class lint rules.
ttsc preparePre-build every plugin binary into the cache.
ttsc cleanDelete the plugin binary cache.
ttsc versionPrint the CLI version.
ttsc helpPrint help.

Flags

FlagMeaning
-p, --project <file>tsconfig file. Same as --tsconfig.
--tsconfig <file>tsconfig file.
--cwd <dir>Resolve relative paths against this directory.
--noEmitType-check only, no file writes.
--emitForce emit even when tsconfig sets noEmit: true.
-w, --watchWatch source files and re-check on change.
--preserveWatchOutputDon’t clear the screen between watch runs.
--outDir <dir>Override compilerOptions.outDir.
--quietSuppress per-file output (default).
--verbosePrint build summary and emitted file paths.
--binary <path>Use a specific tsgo binary instead of the bundled one.
--cache-dir <dir>Plugin binary cache root. Defaults to node_modules/.ttsc.

Settings like target, module, strict, lib, declaration, sourceMap, and other classic tsc compilerOptions are read from tsconfig.json, not from CLI flags.

Exit codes

CodeMeaning
0Success β€” no errors. Warnings may have been printed.
1Build failure β€” type errors, lint errors, or plugin failure.
2Configuration error β€” bad tsconfig.json, missing plugin, invalid flags.

Plugin cache

The plugin binary cache lives at node_modules/.ttsc/ by default. Override with --cache-dir. Safe to delete at any time (ttsc clean) β€” binaries get rebuilt on next use.

See also

Last updated on