@yofriadi/pi-ast

```bash pi install git:github.com/yofriadi/pi-extensions@ast-v<version> ```

Package details

extension

Install @yofriadi/pi-ast from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@yofriadi/pi-ast
Package
@yofriadi/pi-ast
Version
0.1.1
Published
Feb 17, 2026
Downloads
107/mo · 17/wk
Author
yofriadi
License
unknown
Types
extension
Size
94.1 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

AST Extension

Install from git URL

pi install git:github.com/yofriadi/pi-extensions@ast-v<version>

To load only this extension from the monorepo package source, use package filtering in settings:

{
  "packages": [
    {
      "source": "git:github.com/yofriadi/pi-extensions@ast-v<version>",
      "extensions": ["packages/ast/src/index.ts"]
    }
  ]
}

This extension provides integration with ast-grep (sg).

Features

  • Health check for sg binary (sg_health tool)
  • AST Search (ast_search tool): search code using sg run --pattern
  • AST Rewrite (ast_rewrite tool): rewrite code using sg run --pattern --rewrite (safe default: dry-run)

Prerequisites

  • sg (ast-grep) must be installed and available in your PATH.