CLI

ast-grep

ast-grep (sg) lets agents search and rewrite code with syntax-aware patterns instead of fragile regex. Use it from scripts and CI to find anti-patterns, apply bulk edits, and validate refactors. Install as a CLI binary; keep it off mcp.json.

Stars

11.0k

Installs

150.0k

License

MIT

Kind

CLI

Trust evidence

Verified

Verified CLI — curated catalog entry with an honest non-MCP install path.

  • Stars: 11.0k · catalog
  • Freshness: Updated 2026-05-01
  • Used in 2 known stacks

Prerequisites

  • · Install the binary and keep it on PATH
  • · Do not add this tool to mcp.json
  • · Homebrew (macOS/Linux)

Reference command

Often stacked with

Stacks that include this