ast-grep
ast-grep — CLI tool for AST-based structural code search, linting, and rewriting across multiple languages.
Our Verdict
The best open-source structural search tool right now, worth the learning curve for any serious refactor.
Pros
- AST-based matching avoids regex false positives
- Fast Rust implementation scales to large monorepos
- Supports structural rewrites across many languages
- YAML rule files are readable and shareable
Cons
- Pattern syntax has a real learning curve
- Language support varies in completeness
- Less IDE integration than semgrep or comby
- Debugging non-matching rules is frustrating
When to Use ast-grep
Good fit if you need
- Searching code by structure rather than text patterns across repos
- Running AST-based lint rules for custom code style enforcement
- Automating large-scale structural refactors with rewrite rules
- Finding all usages of a code pattern across multi-language repos
Pricing
Price wrong?ast-grep Pricing
- Pricing Model
- free
- Free Tier
- Yes
- Entry Price
- —
- Enterprise Available
- No
- Transparency Score
- —
Beta — estimates may differ from actual pricing
Estimated Monthly Cost
$25
Estimated Annual Cost
$300
Estimates are approximate and may not reflect current pricing. Always check the official pricing page.
Lock-in Assessment
🔄 Thinking about migrating off ast-grep?
Get an AI-drafted migration plan + a copy-paste email to ast-grep support requesting a data export. Pick where you're moving to and tell us your context.
Used in these stacks
Curated setups that include ast-grep.
Looking for alternatives to ast-grep?
Answer 4 quick questions — get an AI-ranked shortlist of tools that match your stack and requirements.
Open AI Tool FinderCommunity Discussion
Comments powered by Giscus (GitHub Discussions). You need a GitHub account to comment.