ast-grep vs Comby
ast-grep
ast-grep.github.ioComby
comby.devSide by side
| Figure | ast-grep | Comby |
|---|---|---|
| Price from | Free | — |
| Free plan | Yes | — |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | — |
| Windows | Yes | Yes |
| macOS | Yes | Yes |
| Linux | Yes | Yes |
| API | Yes | Yes |
| Self-hosted | — | Yes |
| Plans published | 1 | 0 |
| Spec score · Code Search Tools | 9.1 (#1) | 7.7 (#15) |
| Spec score · Code Refactoring Tools | 9.1 (#1) | 7.7 (#12) |
| Language support | The site says ast-grep supports 20+ programming languages and can load custom languages. | Comby has basic parsers for languages including C/C++, C#, Go, Java, JavaScript, Python, Rust, Swift, and TypeScript, plus a generic matcher for other formats and languages. |
| Notable limitation | A rule cannot target multiple languages at once; the FAQ recommends a superset language with languageGlobs or separate rules for each language. | Comby does not currently treat indentation as significant, which limits support for matching indentation-sensitive structures such as Python blocks. |
| Purpose | ast-grep is a fast, polyglot tool for structural code search, linting, and rewriting at scale. | Comby is a tool for searching and changing code structure using lightweight templates. |
| Support | The project directs users with questions or issues to GitHub or Discord and also points to Stack Overflow and Reddit. | The help page directs users to the Gitter channel for usage questions and pattern-writing help, and to GitHub issues for installation problems. |
Plans
In their own words
ast-grep
ast-grep is a free, open-source tool for structural code search, linting, and rewriting. It matches patterns against syntax-tree nodes, helping developers locate and change code across a codebase rather than searching plain text. Its CLI can preview and apply rewrites interactively, and scan configurable YAML rules with error, warning, info, or hint severity. Rules can combine pattern, kind, regex, relational, and composite conditions, and CLI commands help create and snapshot-test them. The project says it supports more than 20 languages and can load custom languages. JavaScript and WebAssembly APIs allow programmatic syntax-tree work; a browser playground offers a way to try patterns without local installation. Editor options include a VS Code extension and language-server setups, including for Vim and Neovim. The tool is free, has a web interface, and is distributed through package managers or built from source. Its FAQ notes that some advanced static-analysis information is unsupported, and one rule cannot target multiple languages at once.
Comby
Comby is a free, open-source tool for searching and changing code structure with lightweight templates. It recognizes basic syntax in code, strings, and comments across many languages, with parsers listed for C/C++, C#, Go, Java, JavaScript, Python, Rust, Swift, and TypeScript, plus a generic matcher for other formats. The project targets large refactors and one-off changes, and an interactive review mode lets users inspect proposed edits. Comby can run from its command line, Python bindings, or HTTP requests sent to a server on your machine. Installation instructions cover macOS with Homebrew, Ubuntu, Windows through Ubuntu on WSL, and Docker; building from source is also described. Linked projects include an Emacs package and a prototype VS Code extension. Other uses include structural code search, compiler fuzzing, test-case reduction, editor find and replace, and academic research. Comby matches balanced delimiters while accounting for comments and string literals, and supports regex search. It is self-hosted and available for API, Linux, macOS, and Windows use. The Apache-2.0 license is identified in the public repository.