You can install the CLI utility in four different ways: https://ast-grep.github.io/guide/quick-start.html#installati...
# via Homebrew
brew install ast-grep
# via Cargo
cargo install ast-grep
# via npm
npm i @ast-grep/cli -g
# via pip
pip install ast-grep-cli
# I tested and pipx works too:
pipx install ast-grep-cli
I really like this - it means the tool is available to people with familiarity of any of those four distribution mechanisms.You can also download pre-built binaries from their releases page: https://github.com/ast-grep/ast-grep/releases/tag/0.14.2
On top of that, they offer API bindings for it in three different languages:
- Rust (not yet stable): https://docs.rs/ast-grep-core/latest/ast_grep_core/
- JavaScript/TypeScript: https://ast-grep.github.io/guide/api-usage/js-api.html
- Python: https://ast-grep.github.io/guide/api-usage/py-api.html
It's rare to see a tool/library offer this depth of language support out of the box.