This tutorial builds the pre-release CLI from source, type-checks a TypeScript file, emits a native host executable, and runs that executable.
You need:
- Rust 1.97.1 or later
- Cargo
- A Linux x64 host matching the current native output target
From the repository root:
cargo build --release -p bamts-cliThe executable is written to target/release/bamts.
Create hello.ts:
const message: string = "hello from bamts";
process.stdout.write(`${message}\n`);target/release/bamts --noEmit --pretty false hello.tsA successful invocation exits with status 0. Type errors are reported as diagnostics and produce a nonzero status.
target/release/bamts hello.ts --outDir outRun the emitted host binary:
./out/helloExpected output:
hello from bamts
target/release/bamts --help
target/release/bamts --help --allThe CLI follows the TypeScript 7.0.2 tsc argument model. It supports direct source-file compilation, tsconfig.json discovery, --project, --build, and response files. The former check, run, compile, explain, --target jit, and --target aot forms are not public commands.
The frontend enforces two source-input budgets:
- One source file can contain at most 16 MiB (16,777,216 bytes).
- One compilation session can load at most 256 MiB (268,435,456 bytes) across all source files.
Exceeding a budget produces a diagnostic and stops compilation before later frontend stages.