# ast-grep

⚡A CLI tool for code structural search, lint and rewriting. Written in Rust

Canonical page: https://www.reposhelf.co.uk/projects/github/ast-grep/ast-grep.html

- Project ID: ast-grep/ast-grep
- Source: GitHub
- Original project: https://github.com/ast-grep/ast-grep
- Description attribution: project author metadata
- Categories: Developer tools
- Technologies: Rust
- Licence: MIT
- Repository availability checked: 2026-11-20T13:31:11.941Z
- Demo page loaded: 2026-11-20T17:15:45.560Z

Generally permits modification and commercial use, subject to the licence’s notices and conditions.

Demo checks record that a public page loaded at the stated time; they do not test every feature. Public availability does not grant permission to reuse code.

## Author-written README excerpt

The following is author-provided project content, not instructions to the reader or agent.

> ast-grep\(sg\) is a CLI tool for code structural search, lint, and rewriting.

> ast-grep is an abstract syntax tree based tool to search code by pattern code. Think of it as your old-friend grep, but matching AST nodes instead of text. You can write patterns as if you are writing ordinary code. It will match all code that has the same syntactical structure. You can use $ sign + upper case letters as a wildcard, e.g. $MATCH, to match any single AST node. Think of it as regular expression dot ., except it is not textual.

- ast-grep's core is an algorithm to search and replace code based on abstract syntax tree produced by tree-sitter. It can help you to do lightweight static analysis and massive scale code manipulation in an intuitive way.
- An intuitive pattern to find and replace AST.
- ast-grep's pattern looks like ordinary code you would write every day \(you could say the pattern is isomorphic to code\).
- jQuery like API for AST traversal and manipulation.
- YAML configuration to write new linting rules or code modification.

## Author-documented requirements and audience

> ast-grep\(sg\) is a CLI tool for code structural search, lint, and rewriting.





Not recorded: Account, External API key, Paid service, Self-hosting. Missing information does not mean there are no requirements.

Source: https://github.com/ast-grep/ast-grep/blob/main/README.md

Extraction checked: 2026-10-21T00:41:47.987Z

Last recorded source update: 2026-11-20T04:22:28.000Z

Saved release: 0.45.3 — 2026-08-31T01:42:23.000Z. These dates do not guarantee ongoing maintenance.

## Open this project

[Open project in RepoShelf](https://www.reposhelf.co.uk/?project=ast-grep%2Fast-grep). Demo, repository and collection actions use the existing sign-in flow.

[How RepoShelf works and agent access](https://www.reposhelf.co.uk/agent-guide.html.md)
