SWC CLI
$ swc Official Low RiskCommand-line interface (@swc/cli) driving the Rust-based SWC compiler to transpile JS/TS files and directories at native speed. Supports --quiet, --source-maps, and .swcrc configuration without interactive prompts, though it performs transpilation without TypeScript type checking.
npm install -g @swc/cli @swc/core Local Rust-backed JS/TS transpiler; runs directly on source directories in Node.js projects.
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
Non-interactive with --quiet and stdout output when -d/-o are omitted, but lacks --json diagnostics and --dry-run.
- Supports
--quietand stdout compilation - No
--jsonoutput mode
Purely local transpilation with zero network/auth access, though it skips type validation.
- Local filesystem writes scoped to
-dor-o
Distributed via npm, but requires installing both @swc/cli and native @swc/core bindings matching the host OS/ABI.
- Requires matching
@swc/corenative binary package
Much faster than Babel for large JS/TS codebases, though often used indirectly through Next.js/Rspack/Jest.
- Rust-speed drop-in replacement for Babel CLI
Maintained by the SWC Project (Vercel/kdy1) under Apache-2.0.
- Active
swc-project/swcrepository
Clear CLI usage page at swc.rs/docs/usage/cli and concise --help.
- Official docs at swc.rs/docs/usage/cli
Security, Auth & Guardrails
No authentication required; operates strictly on local source files and .swcrc.
Apache-2.0 open-source CLI; completely free.
# SWC CLI (swc) Agent Rules - Remember `swc` only transpiles syntax and does not type-check; pair it with `tsc --noEmit`. - Omit `-d`/`-o` to inspect compiled output on stdout without writing files.
Agent-Ready Command Recipes
Safe Read-Only Queries
swc src/index.ts --quiet
Outputs compiled JavaScript for src/index.ts directly to stdout for quick inspection.
Controlled Writes & Previews
swc src -d dist --quiet --source-maps
Transpiles src/ into dist/ with source maps and minimal log chatter.
Strengths for Agents
- + Rust-powered compilation is significantly faster than Babel CLI on large directories.
- + Omitting
-d/-owrites transpiled JS to stdout for safe inspection.
Caveats & Pitfalls
- ! Requires both
@swc/cliand@swc/coreinstalled together. - ! No TypeScript type checking and no JSON error format.