Skip to content
nunojsaPublic

About

Pi Agent Extension for VScode

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

pi-ide

IDE integration for the pi coding agent.

Connects pi to a running editor so the LLM knows which file and line range you're looking at. Pi does not read file contents automatically — it only learns the file path and optional selection range, then decides whether to call read based on your prompt.

It also lets you review pi's changes in the editor and send your inline comments back as feedback.

Disclaimer

This is vibe coded. It was written by an LLM, with light steering, because I wanted the feature to exist — not because I wanted to maintain a project. It works for me; that is the entire quality bar.

Installing the pi-side extension

Remote

pi install git:https://github.com/nunojsa/pi-ide

Local development

pi install /path/to/pi-ide

Try without installing

pi -e /path/to/pi-ide

Installing the VS Code extension

See vscode/README.md for build, package, and install instructions.

Commands

Command Description
/ide Scan for running IDEs and connect (or disconnect)
/ide-review Open a review of the current changes in the connected IDE

Code review

/ide-review turns the editor into the review surface for pi's work:

  1. Pi lists the files changed against HEAD (git diff --name-only HEAD, so both staged and unstaged changes) and asks the IDE to open a review over them.
  2. The IDE shows a Pi Review panel with those files and opens the first as a working-tree-vs-HEAD diff. Comment on any line, on either side of the diff.
  3. Submit sends your comments back to pi, which turns them into a feedback message and starts a turn. Cancel returns nothing and pi carries on.

Each comment travels with the few lines of diff around it, captured at review time, so the model sees what you saw even if the file changes later. Pi is instructed to present a plan before acting on the feedback, and to push back on comments it disagrees with.

How it works

┌──────────────────────┐          Unix socket          ┌──────────────────────┐
│  VS Code / IDE       │    .pi/ide/<ide>.sock         │       pi             │
│  (socket server)     │◄─────────────────────────────►│  (socket client)     │
└──────────────────────┘                               └──────────────────────┘
  • The IDE creates <workspace>/.pi/ide/<ide>.sock.
  • pi discovers it via /ide and connects. The IDE name comes from the socket filename, so there is no in-band handshake. Pi then receives:
    • debounced context messages with active file and selection,
    • a reviewResult message when a review is submitted or cancelled.
  • pi injects an [IDE Context] message before each agent turn so the model sees the active file and can call read if relevant.
  • /ide-review sends a review request the other way, listing the files to open.

The wire format is newline-delimited JSON; see protocol.ts.

About

Pi Agent Extension for VScode

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages