awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
ast-grep avatar

ast-grep/ast-grep

0
View on GitHub↗
12,522 stars·318 forks·Rust·mit·54 viewsast-grep.github.io↗

Ast Grep

ast-grep is a command-line utility and static analysis engine designed for searching, linting, and refactoring source code. It operates by identifying and transforming code blocks based on their underlying syntactic structure rather than relying on text-based or regular expression matching.

The tool utilizes a language-agnostic abstraction to normalize diverse programming grammars into a unified tree structure. By employing a rule-driven engine, it allows users to define complex patterns that capture syntax nodes as variables, enabling consistent and syntactically valid modifications across entire codebases.

This framework supports large-scale refactoring, automated codebase migrations, and the enforcement of custom static analysis rules. It maintains performance during analysis by leveraging incremental parsing to process source code efficiently. The project is distributed as a command-line interface for integration into development workflows and automation pipelines.

Features

  • Static Analysis Engines - Acts as a framework for performing large-scale codebase modifications that ensures all changes remain syntactically valid and contextually accurate.
  • Abstract Syntax Tree Tools - Provides a command-line utility for searching, linting, and refactoring source code using structural patterns that respect the underlying syntax tree.
  • Code Transformation Engines - "Replaces matched code segments by binding captured syntax nodes to variables and injecting them into new templates during the transformation process."
  • Structural Code Searchers - Identifies and transforms code blocks based on their syntactic structure rather than simple text or regular expressions.
  • Automated Code Refactoring - Modifies code structures across large projects using pattern matching to ensure transformations remain syntactically valid and contextually accurate.
  • Search and Discovery - A tool for code structural search, linting and rewriting.
  • System Utilities - CLI for structural code search and rewriting.
  • Static Analysis Rules - Defines and applies custom linting rules to identify and fix problematic code patterns or security vulnerabilities throughout a software project.
  • Automated Migration Codemods - Updates legacy code structures or deprecated library APIs across an entire project by matching patterns and applying consistent transformations.
  • Pattern Matching Libraries - Matches code structures by comparing user-defined patterns against syntax tree nodes to identify specific logical constructs.
  • Syntax Parsing Engines - Converts source code into a concrete syntax tree using an incremental parsing library that maintains high performance during large-scale analysis.
  • Rule Engines - Executes complex refactoring operations by chaining multiple pattern-matching rules and conditional logic to ensure consistent code updates.
  • Syntax Abstractions - Normalizes diverse programming language grammars into a unified tree structure to allow cross-language pattern matching and refactoring.

Star history

Star history chart for ast-grep/ast-grepStar history chart for ast-grep/ast-grep

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Ast Grep

Similar open-source projects, ranked by how many features they share with Ast Grep.
  • comby-tools/combycomby-tools avatar

    comby-tools/comby

    2,657View on GitHub↗

    Comby is a command-line utility designed for structural code search and transformation across diverse programming languages. It functions as a code transformation engine that identifies and modifies source code patterns by utilizing syntax-aware templates, ensuring that operations respect language boundaries such as nested blocks, strings, and comments. The tool distinguishes itself by mapping various programming languages to a unified structural representation, allowing for consistent pattern matching that ignores irrelevant whitespace and formatting. It performs these operations by executin

    OCamlcgojava
    View on GitHub↗2,657
  • biomejs/gritqlbiomejs avatar

    biomejs/gritql

    4,530View on GitHub↗

    GritQL is an AST-based code transformation engine and structural search tool. It uses a declarative query language to identify and rewrite source code patterns across multiple programming languages by matching abstract syntax tree nodes rather than literal text. The system functions as an automated refactoring framework for large-scale migrations and API updates. It distinguishes itself by utilizing sequential transformation pipelines and reusable blueprints that can be synced between local environments and remote repositories. The tool covers a broad range of capabilities including static a

    Rustastcodemodjavascript
    View on GitHub↗4,530
  • phpstan/phpstanphpstan avatar

    phpstan/phpstan

    13,999View on GitHub↗

    This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code structure and type annotations to identify potential bugs, type mismatches, and logic errors without executing the application. By parsing code into an abstract syntax tree and applying a rule-based validation framework, it enforces code quality and safety standards across a project. What distinguishes this tool is its sophisticated type inference engine, which models dynamic language features, magic methods, and conditional types to maintain accuracy even in unconventional code. It

    PHPphpphp7phpstan
    View on GitHub↗13,999
  • analysis-tools-dev/static-analysisanalysis-tools-dev avatar

    analysis-tools-dev/static-analysis

    14,389View on GitHub↗

    This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It serves as a central resource for developers to discover, compare, and select tools based on specific programming languages, licensing models, and integration requirements. The directory distinguishes itself by providing deep metadata for each listed utility, including community-driven popularity rankings, maintenance status, and deployment methods. By aggregating these tools into a single searchable index, it enables teams to identify solutions for enforcing coding standards, ma

    Rustanalysisawesome-listcode-quality
    View on GitHub↗14,389
See all 30 alternatives to Ast Grep→

Frequently asked questions

What does ast-grep/ast-grep do?

ast-grep is a command-line utility and static analysis engine designed for searching, linting, and refactoring source code. It operates by identifying and transforming code blocks based on their underlying syntactic structure rather than relying on text-based or regular expression matching.

What are the main features of ast-grep/ast-grep?

The main features of ast-grep/ast-grep are: Static Analysis Engines, Abstract Syntax Tree Tools, Code Transformation Engines, Structural Code Searchers, Automated Code Refactoring, Search and Discovery, System Utilities, Static Analysis Rules.

What are some open-source alternatives to ast-grep/ast-grep?

Open-source alternatives to ast-grep/ast-grep include: comby-tools/comby — Comby is a command-line utility designed for structural code search and transformation across diverse programming… biomejs/gritql — GritQL is an AST-based code transformation engine and structural search tool. It uses a declarative query language to… phpstan/phpstan — This project is a static analysis engine and type checker designed for PHP codebases. It evaluates source code… analysis-tools-dev/static-analysis — This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It… babel/babel — Babel is a pluggable JavaScript compiler and transpiler that converts modern ECMAScript syntax into… rectorphp/rector — Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize…