Software Alternatives, Accelerators & Startups

ast-grep

โšกA polyglot tool for code searching, linting, rewriting!

ast-grep

ast-grep Reviews and Details

This page is designed to help you find out whether ast-grep is good and if it is the right choice for you.

Screenshots and images

  • ast-grep Landing page
    Landing page //
    2023-05-10

Badges

Promote ast-grep. You can add any of these badges on your website.

SaaSHub badge
Show embed code

Videos

Refactor Like a Pro! โœจ Auto-Fix Your Code with ast-grep

STOP USING REGEX FOR CODE! Meet the Creator of AST-Grep, the Tool Revolutionizing Structural Search.

ast-grep's new format!

Social recommendations and mentions

We have tracked the following product recommendations or mentions on various public social media platforms and blogs. They can help you see what people think about ast-grep and what they use it for.
  • The Self-Driving Codebase: Full Agent Automation with Otter
    The previous post covered how we structured the codebase: Effect conventions, ast-grep enforcement, Drift, and CLAUDE.md to collaborate with Claude Code. You describe what you want, review the output, iterate. That works well. This post is about what happens when you step away entirely: giving the agent a list of issues and letting it work through them while you do something else. In autonomous mode, there's no... - Source: dev.to / 2 months ago
  • How we use Effect and ast-grep to make our codebase work better with agents
    We use ast-grep as a structural syntax scanner that operates on the syntax tree of code (using tree-sitter under the hood). You define patterns in a YAML file, and it matches those patterns against the codebase. Critically, itโ€™s run as part of the CI pipeline and configured to exit with an error when a banned pattern is found. And they have to be errors, not warnings. We learned this the hard way. Warnings get... - Source: dev.to / 3 months ago
  • Less human AI agents, please
    I linked this elsewhere but, the agent could have a skill to use https://ast-grep.github.io/ to perform such mechanical code changes. - Source: Hacker News / 3 months ago
  • Less human AI agents, please
    The proper tool for this is ast-grep (sg) https://ast-grep.github.io/ And an agent can learn to use sg with a skill too. (Or they can use sed) The issue is, at every point you do a replace, you need to verify if it was the right thing to do or if it was a false positive. If you are doing this manually, there's the time to craft the sed or sg query, then for each replacement you need to check it. If there are... - Source: Hacker News / 3 months ago
  • Be intentional about how AI changes your codebase
    We use https://ast-grep.github.io (on a pre-commit hook). Bridges the linter gaps nicely. - Source: Hacker News / 4 months ago
  • Everything Changes, and Nothing Changes
    This is an interesting idea! I searched around and it looks like there's [ast-grep](https://ast-grep.github.io/), an AST-aware CLI that can search and refactor code -- and you can expose it to your AI agent using a skill (https://github.com/ast-grep/agent-skill). Not exactly symbolic AI, but pretty cool nonetheless. - Source: Hacker News / 5 months ago
  • Coccinelle: The Linux kernel's source-to-source transformation tool
    Not the same level of sophistication, but ast-grep allows this for far more languages, since it is based on the tree-sitter parser library. I have used it with some success on C++. Of course it only works on the AST level, and C++ famously need types for correct parsing, so it sometimes fall short (also on macros). https://ast-grep.github.io/. - Source: Hacker News / 5 months ago
  • Developer Philosophy
    One useful tool beyond regular grep for counting the number of times a pattern appears is ast-grep [1], which allows for more sophisticated rules. [1] https://ast-grep.github.io/. - Source: Hacker News / over 1 year ago
  • Using ast-grep with a vue project
    The amazing ast-grep tool does not support vue and scss by default but can be configured to do so. - Source: dev.to / over 1 year ago
  • Mergiraf: a syntax-aware merge driver for Git
    Hi! ast-grep[1] author here. It is a tree-sitter based syntax tool to search tool. I wonder how you transition from tree-sitter to other builtin parsers? Tree-sitter gave a unified interface to all languages. Using language native parsers will require significant work for various FFI if I am not wrong. [1]: https://ast-grep.github.io/. - Source: Hacker News / over 1 year ago
  • Refactoring Python with Tree-sitter and Jedi
    Iโ€™ve been looking at codemod tools recently, just as a way to extend my editing toolbox. I came across https://ast-grep.github.io/, which looks like it might address part of this problem. My initial test case was to locate all calls to a method where a specific argument was โ€˜trueโ€™, and it handled that well - thatโ€™s the kind of thing an IDE seems to struggle with. Iโ€™m not yet sure whether it could handle renaming a... - Source: Hacker News / almost 2 years ago
  • Greppability is an underrated code metric
    Astgrep is a very useful tool. https://ast-grep.github.io/ It's not as easy to use as grep but I think one can script it to be nearly so. It has huge power but without learning it all one can do searches that grep finds difficult. e.g. Finding all the locations where a method is called and showing the parameters even if they are on multiple lines. Ultragrep - I don't love this quite as much but it does have a way... - Source: Hacker News / almost 2 years ago
  • ast-grep got 6000 stars!
    We are thrilled to announce that ast-grep, the powerful code search tool, has reached a stellar milestone of 6000 stars on GitHub! This is a testament to the community's trust in our tool and the continuous improvements we've made. Let's dive into the latest features and enhancements that make ast-grep the go-to tool for developers worldwide. - Source: dev.to / about 2 years ago
  • An infinite canvas for code exploration
    It's unclear what the superpowers would be? Video doesn't show anything I can't do with an IDE or decent code editor, and there I also have refactoring tools, metadata like indicators for usages that can be used for navigating and so on. Reminds me of UML-like diagrams over relational databases, except that it's generated one piece at a time. In practice I generate diagrams showing cyclomatic complexity much more... - Source: Hacker News / about 2 years ago
  • Migrate to React 19 with ast-grep
    This article illustrates the usage of ast-grep, a tool designed to locate and substitute patterns in your codebase, towards easing your migration to React 19. - Source: dev.to / about 2 years ago
  • How I build a chatbot for my OSS project, for free, without code!
    Ast-grep is a command-line tool that lets you search and transform code written in many programming languages using abstract syntax trees (ASTs). ASTs are data structures that capture the syntactic and semantic structure of source code. With ast-grep, you can write patterns as if you are writing ordinary code, and it will match all code that has the same syntactical structure. And if you need more power, you can... - Source: dev.to / over 2 years ago
  • SemanticDiff now supports Rust
    Is there an open source library that does this? Maybe something on top of ast-grep. Source: over 2 years ago
  • Ripgrep 14 Released
    Thanks for the pointer. There are definitely a few tools that have explored the idea of searching the AST of code. Semgrep seems to do that, as does a tool called ast-grep [0]. Both of them are sort of doing the opposite of my tool. They are letting you specify your search as a chunk of code/AST. My tool let's you grep a regex as usual, but shows you the matches in a helpful AST aware way. [0]... - Source: Hacker News / over 2 years ago
  • telescope-sg: a new way to do structural search in neovim
    Hi neovim subreddit! I'm the author of ast-grep, a tool for code structural search, lint, and rewriting based on syntax trees. Source: almost 3 years ago
  • Introducing ast-grep: A tool for structural searching and transforming code
    Are you tired of manually searching and modifying code? Do regular expressions and text-based tools fall short when it comes to complex syntax and nested structures? Look no further! In this blog post, I'm excited to introduce you to ast-grep, a powerful command-line tool designed to make structural searching and transforming of code a breeze using abstract syntax trees (ASTs). - Source: dev.to / about 3 years ago
  • Setup default .eslintrc config in null-ls for eslint_d?
    I also use a global config, and my setup is a bit different - I always ignore the local coonfig and use the global config instead - but I recommend it. The project-local linting setup should always run anyway on pre-commit, so you're not loosing anything. This allows me to have a much more extensive linting setup, with more plugins and stricter rules, some which would slow you down on a laptop. I had to jump... Source: about 3 years ago

Do you know an article comparing ast-grep to other products?
Suggest a link to a post with product alternatives.

Suggest an article

ast-grep discussion

Log in or Post with

Is ast-grep good? This is an informative page that will help you find out. Moreover, you can review and discuss ast-grep here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.