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

Codemod CLI

$ codemod Official Med Risk
Codemod · Files & Search · Apache-2.0 · macos / linux / windows

Codemod CLI automates framework upgrades and AST-based codebase migrations via local workflows or registry recipes. It supports --dry-run, --no-interactive, and --format json / --format jsonl machine-readable output for CI and coding agents.

FCRS-1.0 Score
84 /100
Good
Medium Confidence
Zero-Friction Install
npm install -g codemod
CLI vs MCP Decision CLI Preferred vs MCP

codemod --dry-run --format jsonl executes multi-file AST transforms directly on the local repository without proxying file trees through MCP.

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

Provides --format json / --format jsonl, --dry-run, and --no-interactive flags built specifically for automation.

  • Supports --dry-run, --format jsonl, and --no-interactive
Trust & Safety 21 / 25

--dry-run prevents disk mutations safely, though executing remote registry codemod packages runs JavaScript/AST code locally.

  • --dry-run verifies transforms prior to writing
  • Registry recipes execute local scripts
Setup & Portability 13 / 15

Runs via npm install -g codemod or npx codemod across macOS, Linux, and Windows (Node.js required).

  • Cross-platform npm/npx distribution
Utility & Efficiency 12 / 15

Combines curated framework upgrade recipes with workflow orchestration and AST engines.

  • Supports jscodeshift, ast-grep, and multi-step workflows
Maintenance & Lineage 8 / 10

Actively maintained official CLI by Codemod (codemod/codemod) under Apache-2.0.

  • Official codemod/codemod repository
Docs & Verifiability 8 / 10

Structured documentation at docs.codemod.com covering CLI flags, workflows, and JSONL control.

  • Official docs at docs.codemod.com

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key Config File
Credential Storage

No auth needed for local workflows; optional registry/cloud login stores tokens in ~/.codemod or uses API key env vars.

Side Effects
Read-Only Local Write
Cost & Quotas

CLI is Apache-2.0 open-source and free for local/registry runs; hosted Codemod enterprise features are paid.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Codemod CLI Agent Rules
- Always run with `--dry-run --format jsonl` and `--no-interactive` before applying changes.
- Inspect third-party registry recipes before running them locally, as codemod recipes execute Node/AST logic.

Agent-Ready Command Recipes

Safe Read-Only Queries

Dry-run a codemod workflow with JSONL output
codemod workflow run -w ./codemod.yaml --target ./src --dry-run --format jsonl

Simulates the migration workflow with --dry-run and emits structured JSONL events without writing files.

Controlled Writes & Previews

Run a local codemod workflow non-interactively
codemod workflow run -w ./codemod.yaml --target ./src --no-interactive

Applies the reviewed workflow across ./src without interactive prompts.

Strengths for Agents

  • + First-class --dry-run, --no-interactive, and --format jsonl flags for agent orchestration.
  • + Curated registry recipes accelerate common framework upgrades.

Caveats & Pitfalls

  • ! CLI flags have evolved across major versions (codemod vs codemod@next); check --help if subcommand syntax differs.
  • ! Executing external registry recipes runs third-party transform code locally.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI