{"data":{"slug":"ast-grep","name":"ast-grep","tagline":"MIT structural AST search and rewrite (sg)","category":"rust","categoryName":"Rust","url":"https://ast-grep.github.io/","github":"https://github.com/ast-grep/ast-grep","pricing":"open-source","hook":"ast-grep is syntax-aware search/rewrite when ripgrep matches text and Semgrep is the heavier AppSec product.","whatsGood":"MIT. ast-grep/ast-grep (`sg`). Pattern-based structural search, lint (`scan`), and codemod rewrite across many languages via tree-sitter. Interactive rewrite, LSP, and Node API (`@ast-grep/napi`). Homepage ast-grep.github.io; source github.com/ast-grep/ast-grep.","theCatch":"Vs Semgrep (SAST/SCA product with Free Edition caps) and ripgrep (text search): ast-grep is the *structural AST CLI/codemod*, not a hosted AppSec platform and not byte/regex grep. You author AST patterns; text-only hunts still belong to rg. Slug is `ast-grep` (binary often `sg`).","verdict":"MIT AST search/rewrite. Free forever; match syntax trees, not just strings.","addedAt":"2026-09-12","featured":false,"domain":"Rust","subSpecialty":"Terminal","subcategory":"Terminal","tags":["self-host","permissive","active"],"capabilities":["ast","search","rewrite"],"surfaces":["Self-host"],"ecosystem":["Rust","Multi-platform"],"licenseModel":"OSS/MIT","githubStars":16271,"starsPerWeek":72,"access":"free","archived":false,"repo":{"createdAt":"2022-07-01","pushedAt":"2026-10-15","license":"MIT","archived":false,"checkedAt":"2026-10-19"}},"related":[{"slug":"rust-lang","name":"Rust","tagline":"Systems programming without the footguns"},{"slug":"tokio","name":"Tokio","tagline":"Async runtime for Rust"},{"slug":"axum","name":"Axum","tagline":"Web framework from the Tokio team"},{"slug":"actix-web","name":"Actix Web","tagline":"Fast Rust web framework"},{"slug":"serde","name":"Serde","tagline":"Serialization framework for Rust"}],"links":{"self":"/api/gems/ast-grep","html":"/gems/ast-grep","markdown":"/gems/ast-grep.md","category":"/api/gems?category=rust","categoryPage":"/stacks/rust"}}