macOS
brew install ast-greplocal Homebrew formula metadata
sudo port install ast-grepMacPorts ports tree · devel/ast-grep/Portfile · Source: api.github.com
brew
Consultez les chemins d'installation, exécutables, métadonnées et notes de sécurité de ast-grep pour les workflows d'agents IA.
installation
brew install ast-greplocal Homebrew formula metadata
sudo port install ast-grepMacPorts ports tree · devel/ast-grep/Portfile · Source: api.github.com
sudo apk add ast-grepAlpine Linux edge package indexes · ast-grep · Source: dl-cdn.alpinelinux.org
nix profile install nixpkgs#ast-grepnixpkgs package indexes · pkgs/by-name/as/ast-grep/package.nix · Source: api.github.com
sudo pacman -S ast-grepArch Linux sync databases · ast-grep · Source: geo.mirror.pkgbuild.com
sudo zypper install ast-grepopenSUSE Tumbleweed package metadata · ast-grep · Source: download.opensuse.org
scoop install main/ast-grepScoop official bucket manifest trees · bucket/ast-grep.json · Source: api.github.com
winget install --id ast-grep.ast-grep -eWindows Package Manager source index · ast-grep.ast-grep · Source: cdn.winget.microsoft.com
aperçu
Code searching, linting, rewriting
historique
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.
posture de sécurité
Aucun manifest local de gestion des secrets correspondant n'a été trouvé pour ast-grep. Les métadonnées de paquet Nucleus restent publiées ici afin que la couverture future dispose d'une URL stable.
Avant une utilisation sans surveillance par un agent, vérifiez si l'outil lit des identifiants en clair, écrit un état distant, publie des artefacts ou lance des plugins.
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.ymlexécutables
| Commande | Type | Exposition | Note |
|---|---|---|---|
ast-grep | cli | exécutable global | |
sg | cli | exécutable global |
fraîcheur
Ces signaux séparent l'âge de génération de la page, l'activité du gestionnaire de paquets et la comparaison avec les versions amont. Un retard de version n'est signalé que lorsqu'une URL de preuve et des versions comparables sont présentes.
https://github.com/ast-grep/ast-grep
métadonnées d'installation
| Clé du paquet | brew:ast-grep |
|---|---|
| Version | 0.44.1 |
| Gestionnaire de paquets | Homebrew |
| Page du gestionnaire de paquets | https://formulae.brew.sh/formula/ast-grep |
| Page d'accueil | https://ast-grep.github.io/ |
| Dépôt | https://github.com/ast-grep/ast-grep |
| Docs amont | https://ast-grep.github.io/ |
| Licence | MIT |
| Archive source | https://github.com/ast-grep/ast-grep/archive/refs/tags/0.44.1.tar.gz |
| Dernière mise à jour | 2026-07-04T14:40:32Z |
| Pulse | updated |
| Dépendances de compilation | rust |
| Bouteille | disponible (sur arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| post-install Homebrew | non défini |
| Service | aucun déclaré |
faits du registre
| 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 |
|
correspondances dans les bases sources
Les correspondances proviennent d’index externes de gestionnaires de paquets et restent séparées des liens de paquets Automic Vault locaux.
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 -episte source
Cette page est servie par av-web depuis l'artéfact SQLite privé des paquets généré par scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.