macOS
brew install ast-greplocal Homebrew formula metadata
sudo port install ast-grepMacPorts ports tree · devel/ast-grep/Portfile · ソース: api.github.com
brew
ast-grep のインストール経路、実行ファイル、メタデータ、AI エージェント向けセキュリティノートを確認します。
インストール
brew install ast-greplocal Homebrew formula metadata
sudo port install ast-grepMacPorts ports tree · devel/ast-grep/Portfile · ソース: api.github.com
sudo apk add ast-grepAlpine Linux edge package indexes · ast-grep · ソース: dl-cdn.alpinelinux.org
nix profile install nixpkgs#ast-grepnixpkgs package indexes · pkgs/by-name/as/ast-grep/package.nix · ソース: api.github.com
sudo pacman -S ast-grepArch Linux sync databases · ast-grep · ソース: geo.mirror.pkgbuild.com
sudo zypper install ast-grepopenSUSE Tumbleweed package metadata · ast-grep · ソース: download.opensuse.org
scoop install main/ast-grepScoop official bucket manifest trees · bucket/ast-grep.json · ソース: api.github.com
winget install --id ast-grep.ast-grep -eWindows Package Manager source index · ast-grep.ast-grep · ソース: cdn.winget.microsoft.com
概要
Code searching, linting, rewriting
履歴
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.
セキュリティ状態
ast-grep に一致するローカルシークレット処理マニフェストは見つかりませんでした。将来の対応で安定したパッケージ URL を使えるよう、Nucleus パッケージメタデータはここに公開されています。
エージェントに無人実行させる前に、このツールが平文の認証情報を読むか、リモート状態を書き込むか、成果物を公開するか、プラグインを起動するかを確認してください。
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.yml実行可能ファイル
| コマンド | 種類 | 公開範囲 | メモ |
|---|---|---|---|
ast-grep | cli | グローバル実行可能ファイル | |
sg | cli | グローバル実行可能ファイル |
鮮度
これらの信号は、ページ生成時期、パッケージマネージャの活動、上流リリース比較を分けて示します。バージョン遅れは、証拠 URL と比較可能なバージョンがある場合だけ警告されます。
https://github.com/ast-grep/ast-grep
インストールメタデータ
| パッケージキー | brew:ast-grep |
|---|---|
| バージョン | 0.44.1 |
| パッケージマネージャ | Homebrew |
| パッケージマネージャページ | https://formulae.brew.sh/formula/ast-grep |
| ホームページ | https://ast-grep.github.io/ |
| リポジトリ | https://github.com/ast-grep/ast-grep |
| 上流ドキュメント | https://ast-grep.github.io/ |
| ライセンス | MIT |
| ソースアーカイブ | https://github.com/ast-grep/ast-grep/archive/refs/tags/0.44.1.tar.gz |
| 最終更新 | 2026-07-04T14:40:32Z |
| Pulse | updated |
| ビルド依存関係 | rust |
| Bottle | 利用可能 (対象 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定義 |
| サービス | 宣言なし |
レジストリ情報
| 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 |
|
ソースデータベース一致
一致は外部パッケージマネージャインデックスから取得され、ローカルの Automic Vault パッケージリンクとは分けて表示されます。
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 -eソース経路
このページは scripts/generate-pkg-sqlite.py が生成した非公開のパッケージ SQLite アーティファクトから av-web によって提供されます。
View the package source record on GitHub.