tsx
$ tsx Community Med RiskFast Node.js TypeScript runner wrapping esbuild to execute .ts, .tsx, and .mts scripts directly without a prior build step. Handles ESM/CommonJS interop seamlessly; note that tsx strips types for speed rather than type-checking (tsc --noEmit is still needed).
npm install -g tsx Local Node.js script runner for executing TypeScript automation scripts and dev entrypoints directly.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Clean non-interactive execution via tsx <file> and tsx -e, with --no-cache and --tsconfig, though it has no --json output mode.
- Supports
-e,--no-cache, and--tsconfig - Bare
tsxenters interactive REPL if no file is given
Executes arbitrary script code with full Node.js permissions and skips TypeScript type-checking by design.
- Transpiles via esbuild without validating type errors
Installable via npm/npx across macOS, Linux, and Windows on top of Node.js.
- Standard npm package with prebuilt esbuild binaries
Eliminates ts-node ESM config friction and runs TypeScript scripts in milliseconds.
- Zero-config ESM/CommonJS and
tsconfig.jsonpathssupport
Widely adopted community tool maintained by privatenumber under MIT.
- Active
privatenumber/tsxrepository
Crisp, well-organized documentation at tsx.is covering flags, ESM caveats, and Node loader integration.
- Clear docs at tsx.is
Security, Auth & Guardrails
No credentials required; caches transpiled artifacts in OS temp directory unless --no-cache is passed.
MIT open-source CLI; completely free.
# tsx Agent Rules - Remember `tsx` transpiles without type-checking; always run `tsc --noEmit` alongside `tsx` for type safety. - Never pass `watch` (`tsx watch`) in non-interactive agent turns without a timeout/background runner.
Agent-Ready Command Recipes
Safe Read-Only Queries
tsx --version
Prints both tsx and underlying Node.js versions cleanly.
tsx --no-cache -e "console.log(process.version)"
Evaluates inline TypeScript via -e without leaving transpilation cache files.
Controlled Writes & Previews
tsx --no-cache scripts/verify.ts
Runs scripts/verify.ts directly with full ESM/CJS resolution and custom tsconfig.json paths.
Strengths for Agents
- + Instant zero-config TypeScript execution with clean ESM/CommonJS interop.
- +
--no-cacheand-emake one-off script execution tidy in agent workflows.
Caveats & Pitfalls
- ! Does not perform type checking; type errors still pass through unless
tsc --noEmitis run separately. - ! Running
tsxwith no script or-estarts a REPL;tsx watchblocks indefinitely.