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
biomejs avatar

biomejs/gritql

0
View on GitHub↗
4,530 stars·123 forks·Rust·MIT·12 viewsdocs.grit.io↗

Gritql

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 analysis linting for continuous integration, multi-file analysis, and the ability to extend query logic via JavaScript predicates. It supports complex code manipulation through metavariable binding, recursive tree traversal, and the automated generation of new files.

Users can define and test rewrite patterns using Markdown documents or YAML files, which can be bundled with test cases to verify transformation accuracy.

Features

  • AST-Based Source Transformations - Searches and rewrites source code by matching abstract syntax tree nodes rather than literal text.
  • Code Transformation Engines - Provides a declarative code transformation engine that rewrites matched patterns using rule-based syntax with optional conditions.
  • Named Pattern Definitions - Defines reusable named patterns with parameters that can be invoked by other patterns for matching or transformation.
  • Named Rewrite Rules - Defines named, reusable search-and-rewrite rules with optional metadata like title, description, and enforcement level.
  • Declarative Code Query Languages - Identifies and transforms code patterns using declarative rules with metavariables and conditions.
  • Structural Code Searchers - Ships a structural code searcher that matches code by AST structure, ignoring formatting differences.
  • Source Code Rewriting - Transforms matched code nodes into a new form using a rewrite arrow and optional conditions.
  • Automated Code Refactoring - Applies sequential transformation pipelines and reusable blueprints for large-scale code changes.
  • Structural Search Engines - Finds code patterns by their syntax tree structure, ignoring formatting differences for precise matching.
  • Codebase Search Engines - Processes millions of lines of code efficiently using a Rust-powered engine with query optimization.
  • Metavariable Captures - Binds any part of a matched code snippet to a named metavariable for reuse in conditions or rewrites.
  • Remote Pattern Imports - Loads and applies code transformation rules from external Git repositories as dependencies.
  • Reusable Query Patterns - Declares named patterns that accept parameters, bridging scope boundaries for shared variables while keeping others local.
  • Sequential Transformation Pipelines - Applies multiple rewrite rules in a defined sequence, enabling complex multi-step code migrations.
  • Shared Pattern Repositories - References patterns from external repositories by prefixing the pattern name with the repository name and a hash.
  • AST Pattern Matchers - Provides AST-based pattern matching for precise, structure-aware code searches across multiple languages.
  • Named Pattern Invocations - Provides a declarative query language where named patterns can be invoked and composed for code search and transformation.
  • AST Condition Filters - Applies boolean conditions, regular expressions, or AST node checks to restrict which matches are kept or rewritten.
  • Query Execution Engines - Processes millions of lines of code efficiently using a compiled Rust runtime with query optimization.
  • Structural Metavariables - Captures and reuses variable parts of matched code through named placeholders for conditions and rewrites.
  • AST Querying - Matches and rewrites source code by querying abstract syntax tree nodes instead of literal text patterns.
  • Pattern-Based Code Manipulation - Provides declarative pattern-based code manipulation that replaces matched AST nodes with new code snippets.
  • Metavariable Pattern Matching - Matches code patterns using backticks and metavariables to find specific syntax structures across files.
  • Large-Scale Code Migrations - Automates large-scale API, framework, or dependency migrations across millions of lines of code.
  • Pattern File Imports - Loads a pattern definition from a Markdown or pattern file located anywhere in the repository.
  • Pattern Bundling Formats - Provides a markdown-bundled format that packages queries, documentation, and test cases into reusable pattern files.
  • Language Variant Support - Chooses an alternative parser variant for a language, such as JSX or TypeScript for JavaScript.
  • Bubble-Scoped Pattern Isolation - Creates new scopes inside patterns so metavariables rebind independently in each match location.
  • Pattern Definition Files - Stores patterns in Markdown files using the file name, first heading, first paragraph, and first code block for metadata.
  • Language-Specific Parsing Selection - Selects a programming language to parse source code with its corresponding abstract syntax tree.
  • Metavariable Subpattern Filters - Restricts pattern matching to code nodes where a metavariable matches a specified subpattern for precise targeting.
  • Example-Based Code Queries - Allows searching source code by providing an example code snippet as the query pattern.
  • Custom Lint Rule Definitions - Applies saved patterns as project-specific linting rules that can exclude certain code contexts.
  • Prebuilt Pattern Libraries - Runs a pre-built pattern from the standard library to automatically modify source code in the current directory.
  • Analysis Suppressions - Provides inline comment directives and configuration to suppress specific analysis results on targeted lines.
  • Pattern Publishing to Git - Publishes patterns by pushing them to a Git repository, making them reusable across projects.
  • Pattern References by Repository and Hash - References patterns from remote Git repositories by prefixing with repository name and hash.
  • Pattern Directory Loading - Automatically discovers and loads all patterns defined in files placed inside a designated folder.
  • Conditional Transformations - Executes different rewrite rules depending on whether a condition is true or false, enabling branching logic.
  • JavaScript Predicate Extensions - Ships a JavaScript predicate extension that allows custom matching logic beyond the declarative query syntax.
  • Metavariable Assignments - Binds values to metavariables within condition blocks for reuse in subsequent rewrite rules.
  • Contextual Match Filters - Restricts a pattern's matches to nodes that satisfy additional structural conditions like parent or sibling relationships.
  • Contextual Match Restrictions - Restricts a pattern to only match when it appears inside a specific enclosing code structure.
  • Metavariable Scoping - Binds a metavariable once per file so all occurrences must match the same value for single-edit transformations.
  • File-Scoped Metavariables - Uses prefixed metavariables to share state across all matches in a file for accumulating results.
  • Reusable Predicate Definitions - Creates named predicates that encapsulate conditions for reuse inside a pattern's where clause.
  • Custom Pattern Applications - Runs a user-written pattern against the current directory to search or transform source code.
  • Pattern Metadata Headers - Configures optional enforcement level and tags for a pattern using YAML frontmatter in the Markdown file.
  • Pattern Validation Samples - Specifies input and expected output samples directly in the configuration file for pattern validation.
  • Codebase Pattern Enforcements - Overrides the default enforcement level for imported patterns by specifying a level like error or warn.
  • Conditional Rewrite Rules - Supports conditional rewrites where a transformation is applied only when a metavariable matches a specified condition.
  • Auto-Fix Engines - Includes automatic remediation rules within queries so matching code is fixed without manual intervention.
  • Negative Conditional Logic - Inverts a condition so the pattern matches only when the condition is false, similar to a logical NOT.
  • Pattern Execution in CI - Runs configured patterns as automated checks on every commit, failing the pipeline when new errors are introduced.
  • Pattern Severity Configurations - Marks patterns as warnings or errors so CI checks fail only on new violations, allowing incremental fixes without breaking the build.
  • Pattern Severity Overrides - Overrides the default enforcement level for imported patterns by specifying a level like error or warn.
  • Pattern Severity Configurations - Sets a diagnostic level for a pattern to control how it is reported during checks.
  • Baseline-Comparison Regression Detections - Compares current violations against the last commit on the default branch to detect regressions while tolerating pre-existing issues.
  • Inline Pattern Test Cases - Embeds test cases as subheadings with code blocks for pattern validation.
  • Pattern Match Combinators - Combines multiple conditions with AND logic so a pattern matches only when all conditions are true.
  • Executable Pattern Bundles - Combines queries, documentation, and test cases into a single Markdown file for reusable pattern distribution.

Star history

Star history chart for biomejs/gritqlStar history chart for biomejs/gritql

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. 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

Projects sharing features with Gritql

These projects share indexed features with Gritql. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • openrewrite/rewriteopenrewrite avatar

    openrewrite/rewrite

    3,312View on GitHub↗

    OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic tree parser to represent source code as type-aware trees that preserve original whitespace and formatting, enabling precise and deterministic modifications. The project utilizes a declarative refactoring pipeline where sequences of transformations are defined in YAML to resolve breaking changes and technical debt. It features type-aware pattern matching and cross-language model mapping to apply similar refactoring patterns across different programming languages. The framework

    Javaabstract-syntax-treeastcode-search
    View on GitHub↗3,312
  • 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
  • ast-grep/ast-grepast-grep avatar

    ast-grep/ast-grep

    12,522View on GitHub↗

    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 e

    Rustastbabelcodemod
    View on GitHub↗12,522
  • 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
Compare all 30 related projects→

Frequently asked questions

What does biomejs/gritql do?

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.

What are the main features of biomejs/gritql?

The main features of biomejs/gritql are: AST-Based Source Transformations, Code Transformation Engines, Named Pattern Definitions, Named Rewrite Rules, Declarative Code Query Languages, Structural Code Searchers, Source Code Rewriting, Automated Code Refactoring.

Which projects share features with biomejs/gritql?

Projects with overlapping indexed features include: openrewrite/rewrite — OpenRewrite is an automated refactoring engine and source-to-source migration framework. It uses a lossless semantic… comby-tools/comby — Comby is a command-line utility designed for structural code search and transformation across diverse programming… ast-grep/ast-grep — ast-grep is a command-line utility and static analysis engine designed for searching, linting, and refactoring source… analysis-tools-dev/static-analysis — This project is a comprehensive, curated directory of static analysis, linting, and security scanning utilities. It… benjamn/recast — Recast is a JavaScript AST parser and printer designed for automated code refactoring. It converts source code into… rectorphp/rector — Rector is an automated PHP refactoring and modernization tool designed to upgrade language versions and modernize…