macOS
brew install ast-greplocal Homebrew formula metadata
sudo port install ast-grepMacPorts ports tree · devel/ast-grep/Portfile · Quelle: api.github.com
brew
Prüfe Installationswege, Executables, Metadaten und Sicherheitshinweise für ast-grep in AI-Agent-Workflows.
Installation
brew install ast-greplocal Homebrew formula metadata
sudo port install ast-grepMacPorts ports tree · devel/ast-grep/Portfile · Quelle: api.github.com
sudo apk add ast-grepAlpine Linux edge package indexes · ast-grep · Quelle: dl-cdn.alpinelinux.org
nix profile install nixpkgs#ast-grepnixpkgs package indexes · pkgs/by-name/as/ast-grep/package.nix · Quelle: api.github.com
sudo pacman -S ast-grepArch Linux sync databases · ast-grep · Quelle: geo.mirror.pkgbuild.com
sudo zypper install ast-grepopenSUSE Tumbleweed package metadata · ast-grep · Quelle: download.opensuse.org
scoop install main/ast-grepScoop official bucket manifest trees · bucket/ast-grep.json · Quelle: api.github.com
winget install --id ast-grep.ast-grep -eWindows Package Manager source index · ast-grep.ast-grep · Quelle: cdn.winget.microsoft.com
Überblick
Code searching, linting, rewriting
Verlauf
ast-grep is a Rust command-line tool for structural code search, linting, and rewriting. It combines a grep-like user experience with tree-sitter-backed abstract syntax tree matching, so patterns are written as code snippets rather than as only text regular expressions.
The ast-grep repository was created in 2022 and the official docs carry a 2022-present copyright. The README presents the tool as ast-grep or sg, with a core algorithm that searches and rewrites code using tree-sitter-produced ASTs.
The project expanded beyond one-off search into project configuration, YAML lint rules, transformations, rewriters, custom languages, language injections, editor integrations, JavaScript and Python APIs, and a browser playground. The official sgconfig documentation positions sgconfig.yml as the root configuration file for multi-rule scans, similar in role to tsconfig.json or ESLint configuration.
ast-grep was packaged early across developer ecosystems rather than through a single language channel. The official README lists npm, pip, cargo, cargo-binstall, Homebrew, Scoop, mise, MacPorts, Nix shell, and source builds, while the supplied package facts add Alpine, Arch, winget, zypper, and Nix availability.
The tool gained attention because it serves several audiences with one binary: maintainers doing codemods for breaking changes, teams enforcing project-specific static rules, and security researchers writing structural queries faster than full compiler plugins.
The simplest usage is a command such as ast-grep --pattern ... --rewrite ... --lang ts. Larger projects add sgconfig.yml at the project root, define ruleDirs, and run scan; ast-grep discovers sgconfig.yml by walking up from the working directory, and can also use a home-directory sgconfig.yml for global configuration.
ast-grep is significant because it occupies the middle ground between grep, semgrep-style structural search, ESLint-style linting, and codemod frameworks. Package maintainers care because it ships as a native Rust CLI but is distributed through npm, pip, cargo, Homebrew, and OS package managers, which makes binary packaging, completions, and config discovery part of the user experience.
Sicherheitslage
Für ast-grep wurde kein passendes lokales Secret-Handling-Manifest gefunden. Nucleus-Paketmetadaten bleiben hier veröffentlicht, damit künftige Abdeckung eine stabile Paket-URL hat.
Prüfe vor unbeaufsichtigter Agent-Nutzung, ob das Tool Klartext-Credentials liest, Remote-Zustand schreibt, Artefakte veröffentlicht oder Plugins ausführt.
local files
These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.
Config paths the tool may read or write during local use.
./sgconfig.yml~/sgconfig.ymlExecutables
| Befehl | Art | Sichtbarkeit | Hinweis |
|---|---|---|---|
ast-grep | cli | globales Executable | |
sg | cli | globales Executable |
Aktualität
Diese Signale trennen das Alter der Seitengenerierung, Aktivität des Paketmanagers und Upstream-Release-Vergleich. Versionsrückstand wird nur gemeldet, wenn eine Evidenz-URL und vergleichbare Versionen vorhanden sind.
https://github.com/ast-grep/ast-grep
Installationsmetadaten
| Paketschlüssel | brew:ast-grep |
|---|---|
| Version | 0.44.1 |
| Paketmanager | Homebrew |
| Paketmanager-Seite | https://formulae.brew.sh/formula/ast-grep |
| Homepage | https://ast-grep.github.io/ |
| Repository | https://github.com/ast-grep/ast-grep |
| Upstream-Dokumentation | https://ast-grep.github.io/ |
| Lizenz | MIT |
| Quellarchiv | https://github.com/ast-grep/ast-grep/archive/refs/tags/0.44.1.tar.gz |
| Zuletzt aktualisiert | 2026-07-04T14:40:32Z |
| Pulse | updated |
| Build-Abhängigkeiten | rust |
| Bottle | verfügbar (auf arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | nicht definiert |
| Dienst | keiner deklariert |
Registry-Fakten
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | ast-grep |
| Version Scheme | 0 |
| Revision | 0 |
| Head Version | HEAD |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
Source-Datenbank-Treffer
Treffer stammen aus externen Paketmanager-Indizes und bleiben von lokalen Automic-Vault-Paketlinks getrennt.
ast-grep
nix profile install nixpkgs#ast-grepast-grep 0.28.1-r0
A CLI tool for code structural search, lint and rewriting
https://github.com/ast-grep/ast-grep
sudo apk add ast-grepast-grep-bash-completion 0.28.1-r0
Bash completions for ast-grep
https://github.com/ast-grep/ast-grep
sudo apk add ast-grep-bash-completionast-grep-fish-completion 0.28.1-r0
Fish completions for ast-grep
https://github.com/ast-grep/ast-grep
sudo apk add ast-grep-fish-completionast-grep-zsh-completion 0.28.1-r0
Zsh completions for ast-grep
https://github.com/ast-grep/ast-grep
sudo apk add ast-grep-zsh-completionast-grep 0.43.0-1
CLI tool for code structural search, lint and rewriting
sudo pacman -S ast-grepast-grep 0.43.0-1.1
A CLI tool for code structural search, lint and rewriting
sudo zypper install ast-grepast-grep
sudo port install ast-grepmain/ast-grep
scoop install main/ast-grepast-grep.ast-grep
winget install --id ast-grep.ast-grep -eQuellspur
Diese Seite wird von av-web aus dem privaten Paket-SQLite-Artefakt bereitgestellt, das scripts/generate-pkg-sqlite.py erstellt.
View the package source record on GitHub.