ast-grep
Installation
SKILL.md
ast-grep
Use ast-grep when a search needs syntax structure rather than plain text. Prefer rg for simple text search.
Tooling
This repo provides ast-grep through flake.nix. Run commands from the Nix dev shell, or use direnv exec . when the shell is not already active:
direnv exec . ast-grep run --lang rust --pattern 'println!($$$ARGS)' rust
direnv exec . ast-grep run --lang ts --pattern '/$P/' --json=stream apps packages
If direnv is unavailable and this is a one-off search, use comma as a fallback:
, ast-grep run --lang rust --pattern 'println!($$$ARGS)' rust
, ast-grep run --lang ts --pattern '/$P/' --json=stream apps packages