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

SWC CLI

$ swc Official Low Risk
SWC Project · Code & DevOps · Apache-2.0 · macos / linux / windows

Command-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.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g @swc/cli @swc/core
CLI vs MCP Decision CLI Only

Local Rust-backed JS/TS transpiler; runs directly on source directories in Node.js projects.

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 16 / 25

Non-interactive with --quiet and stdout output when -d/-o are omitted, but lacks --json diagnostics and --dry-run.

  • Supports --quiet and stdout compilation
  • No --json output mode
Trust & Safety 20 / 25

Purely local transpilation with zero network/auth access, though it skips type validation.

  • Local filesystem writes scoped to -d or -o
Setup & Portability 12 / 15

Distributed via npm, but requires installing both @swc/cli and native @swc/core bindings matching the host OS/ABI.

  • Requires matching @swc/core native binary package
Utility & Efficiency 13 / 15

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
Maintenance & Lineage 8 / 10

Maintained by the SWC Project (Vercel/kdy1) under Apache-2.0.

  • Active swc-project/swc repository
Docs & Verifiability 8 / 10

Clear CLI usage page at swc.rs/docs/usage/cli and concise --help.

  • Official docs at swc.rs/docs/usage/cli

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No authentication required; operates strictly on local source files and .swcrc.

Side Effects
Read-Only Local Write
Cost & Quotas

Apache-2.0 open-source CLI; completely free.

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

Transpile a file to stdout without writing disk
swc src/index.ts --quiet

Outputs compiled JavaScript for src/index.ts directly to stdout for quick inspection.

Controlled Writes & Previews

Compile source directory to dist
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/-o writes transpiled JS to stdout for safe inspection.

Caveats & Pitfalls

  • ! Requires both @swc/cli and @swc/core installed together.
  • ! No TypeScript type checking and no JSON error format.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI