# ast-grep
> A CLI tool for code structural search, lint, and rewriting

## Summary
AST-based code structural search, lint, and rewriting tool

## Capabilities
- Search code using abstract syntax tree patterns
- Lint code with structural rules
- Rewrite and refactor code at scale using AST patterns
- Support for multiple programming languages

## When to Use
- You need precise code search beyond text matching
- You want to refactor code patterns across a codebase
- You need to enforce coding standards with structural rules

## When NOT to Use
- Simple text search is sufficient

## Related Tools
- [ripgrep](/tools/ripgrep) (complementary)
- [semgrep](/tools/semgrep) (complementary)

---
Source: https://littlescripts.sh/tools/ast-grep
