Skip to content

bnema/pi-codegraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-codegraph

Use CodeGraph from Pi.

What it does

  • Adds codegraph_explore for architecture and flow questions.
  • Adds codegraph_node for one named symbol, optionally pinned to a file.
  • Adds codegraph_status to check whether CodeGraph is ready in the current project.

codegraph_status uses codegraph status. codegraph_explore and codegraph_node use one-shot calls through codegraph serve --mcp.

Install

pi install git:github.com/bnema/pi-codegraph

If installed into a running Pi session, reload extensions:

/reload

Requirements

Install CodeGraph first and make sure codegraph is on PATH:

codegraph --help

Index each repo you want Pi to explore:

cd /path/to/project
codegraph init -i

You do not need codegraph install for Pi.

Use

Ask Pi to use CodeGraph, or call the tools directly.

Examples:

  • codegraph_status
  • codegraph_explore with query: "how does request validation reach the database layer"
  • codegraph_explore with query: "runCodegraph formatStatus"
  • codegraph_node with symbol: "AuthService.login"
  • codegraph_node with symbol: "render", file: "src/ui/view.ts"

Tool notes

  • codegraph_explore takes one required content argument: query. There is no separate names argument; put names directly in query.
  • codegraph_explore defaults to maxFiles: 6 when omitted. Increase it only when the first answer is too narrow.
  • Prefer codegraph_node for one exact symbol.
  • Prefer Pi's normal read tool for raw file contents.
  • Treat codegraph_explore output as already-explored context; avoid immediately repeating the same area with duplicate file-path exploration unless you still need raw file contents.

Develop

npm install
npm run typecheck
npm run smoke
npm run pack:check
pi -e .

npm run smoke covers the uninitialized status regression, invalid path error reporting, and an optional live check when codegraph 0.9.9 is on PATH.

Releases

Packages

Contributors

Languages