Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

tsx

$ tsx Community Med Risk
privatenumber · Code & DevOps · MIT · macos / linux / windows

Fast 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).

FCRS-1.0 Score
78 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g tsx
CLI vs MCP Decision CLI Only

Local Node.js script runner for executing TypeScript automation scripts and dev entrypoints directly.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 17 / 25

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 tsx enters interactive REPL if no file is given
Trust & Safety 18 / 25

Executes arbitrary script code with full Node.js permissions and skips TypeScript type-checking by design.

  • Transpiles via esbuild without validating type errors
Setup & Portability 13 / 15

Installable via npm/npx across macOS, Linux, and Windows on top of Node.js.

  • Standard npm package with prebuilt esbuild binaries
Utility & Efficiency 13 / 15

Eliminates ts-node ESM config friction and runs TypeScript scripts in milliseconds.

  • Zero-config ESM/CommonJS and tsconfig.json paths support
Maintenance & Lineage 8 / 10

Widely adopted community tool maintained by privatenumber under MIT.

  • Active privatenumber/tsx repository
Docs & Verifiability 9 / 10

Crisp, well-organized documentation at tsx.is covering flags, ESM caveats, and Node loader integration.

  • Clear docs at tsx.is

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No credentials required; caches transpiled artifacts in OS temp directory unless --no-cache is passed.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Check tsx and Node.js runtime versions
tsx --version

Prints both tsx and underlying Node.js versions cleanly.

Run a one-off read-only TypeScript snippet
tsx --no-cache -e "console.log(process.version)"

Evaluates inline TypeScript via -e without leaving transpilation cache files.

Controlled Writes & Previews

Execute a TypeScript repository script
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-cache and -e make one-off script execution tidy in agent workflows.

Caveats & Pitfalls

  • ! Does not perform type checking; type errors still pass through unless tsc --noEmit is run separately.
  • ! Running tsx with no script or -e starts a REPL; tsx watch blocks indefinitely.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI