← Back to tools

ast-grep

A CLI tool for code structural search, lint, and rewriting

Search & Filter linuxmacoswindows Rust MIT

Description

ast-grep is a CLI tool for code structural search, lint, and rewriting. It uses abstract syntax tree (AST) patterns for precise code matching, making it more accurate than text-based search tools. It supports multiple programming languages and can be used for large-scale code refactoring and enforcing coding standards.

AI 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

Use When

  • 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

Avoid When

  • x Simple text search is sufficient

Related Tools

View AGENTS.md for ast-grep