Skip to content
| Marketplace
Sign in
Visual Studio Code>Machine Learning>Pentra - Pi Agent for VS CodeNew to Visual Studio Code? Get it now.
Pentra - Pi Agent for VS Code

Pentra - Pi Agent for VS Code

Bilal Bentoumi

|
1 install
| (0) | Free
AI coding agent for VS Code, powered by the pi runtime.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Pentra for VS Code

A clean-room VS Code extension that embeds the pi coding agent (MIT) as a chat sidebar. The extension host spawns pi --mode rpc and speaks its JSON-lines RPC protocol; a React webview renders the streaming conversation, thinking, and tool calls.

This is an original implementation modeled on the architecture of the "Pendant" extension. It reuses only the publicly published, MIT-licensed pi runtime through its documented RPC embedding interface — it contains none of Pendant's proprietary code.

Architecture

┌──────────────── VS Code ────────────────┐        ┌── pi --mode rpc (child) ──┐
│ Webview (React)  ⇄  Extension Host (Node)│  stdio │ JSON-lines over           │
│ chat / streaming    spawns + bridges     │  ⇄     │ stdin / stdout            │
└──────────────────────────────────────────┘        └───────────────────────────┘
Layer Location
RPC framing + typed client src/rpc/
Runtime bootstrap (binary resolution, env/PATH) src/runtime/bootstrap.ts
Runtime lifecycle + crash recovery src/runtime/pi-runtime.ts
Session/runtime pool src/session/session-manager.ts
Sidebar webview provider + bridge src/provider.ts, src/webview/chat-bridge.ts
Shared protocol types shared/protocol.ts
React webview webview/src/

Prerequisites

  • Node.js ≥ 22.19 (required by the pi runtime).
  • The pi CLI installed and authenticated. This extension uses an external runtime — it does not bundle one.
    npm i -g @earendil-works/pi-coding-agent
    pi          # run once to authenticate a provider
    
    If pi is not on your PATH inside VS Code, set an absolute path in pentra.binaryPath.

Develop

npm install
npm run build          # or: npm run watch

Press F5 ("Run Pentra Extension") to launch an Extension Development Host. Open the Pentra view in the activity bar.

Package

npm i -g @vscode/vsce
npm run package        # produces a .vsix

Settings

Setting Default Purpose
pentra.binaryPath pi Command or absolute path to the RPC-capable agent.
pentra.agentDir (runtime default) Overrides PI_CODING_AGENT_DIR.
pentra.defaultModel (runtime default) --model pattern passed at startup.
pentra.thinkingLevel medium Default reasoning level.
pentra.autoCompact / pentra.autoRetry true Applied to each session on start.
pentra.extraArgs [] Extra CLI args for the runtime.

Status / roadmap

Working today:

  • Streaming chat (text + thinking), tool-call rendering, runtime crash recovery
  • Model & thinking selectors, new / compact / abort / steer
  • Session history browser — list & switch past sessions for the workspace
  • Session stats — context-usage meter, token count, cost
  • Editor-tab chat — open the chat in a full editor tab (Open Chat in Editor)
  • HTML export (Export Chat to HTML...)
  • Forking — edit a previous message and resend on a new branch (Edit a Previous Message)
  • Edit/write diffs — file edits render as colored diffs
  • Slash-command autocomplete — type / in the composer
  • In-webview approval dialogs — pi extension prompts render inline (native fallback when hidden)

Not yet built:

  • Voice dictation. Requires a native per-OS mic-capture helper + a bundled whisper.cpp build + on-demand ggml model download + host-side transcription pipeline (the webview cannot access the microphone directly). This is a separate binary-distribution effort; see the voice section of the project notes.
  • Full branch tree visualization (forking works; the tree view is not yet drawn).
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft