README file from
GithubObsidian Pi IDE
Connect Obsidian to Pi Coding Agent through the pi-ide protocol.
This plugin lets Pi see Obsidian's current file, cursor, and selected text via /ide. It can also route Pi write / edit tool calls through an Obsidian confirmation dialog before Pi applies the change.
Features
- Exposes Obsidian as an IDE target for Pi's
/idecommand - Sends current file, cursor, and selection to Pi as ambient editor context
- Updates Pi when selection/cursor/file changes
- Handles
openDifffrom Pi-side@ldelossa/pi-ide - Optional auto-accept mode for trusted local workflows
- Startup check for the Pi-side package
npm:@ldelossa/pi-ide - One-click install for the Pi-side package from Obsidian
Requirements
- Obsidian desktop
- Pi Coding Agent installed and available as
piin PATH - Pi-side package:
pi install npm:@ldelossa/pi-ide
The plugin checks this on startup. If missing, it shows an install dialog and can run the command for you.
Installation for local development
Clone/copy this repository, then build:
npm install
npm run build
Copy these files into your vault:
<vault>/.obsidian/plugins/pi-ide/
main.js
manifest.json
styles.css
Enable Pi IDE in Obsidian Community Plugins.
Then in Pi:
/reload
/ide
Select Obsidian.
BRAT installation
This plugin is structured for BRAT. Add the GitHub repository URL in BRAT, then enable Pi IDE.
Settings
- Pi-side package check on startup: detects
npm:@ldelossa/pi-ideand prompts to install if absent. - Auto-accept Pi edits: skip the preview dialog and let Pi apply edits directly. Disabled by default for safety.
- Startup notice: show the local bridge port when Obsidian starts.
- Lock directory: where
<port>.lockfiles are written. Defaults to~/.pi/ide.
How it works
- Obsidian starts a local WebSocket server on
127.0.0.1:<port>. - The plugin writes a lockfile to
~/.pi/ide/<port>.lockwith workspace folders and an auth token. - Pi-side
@ldelossa/pi-idediscovers the lockfile and connects with/ide. - Obsidian pushes
selection_changednotifications. - Pi injects current editor context into agent turns.
- When Pi edits a vault file, the plugin handles
openDiffand either confirms or rejects the proposed final contents.
Disclosures for Obsidian Community review
- Network use: The plugin starts a local-only WebSocket server on
127.0.0.1so Pi can connect to Obsidian. It does not connect to any remote service by itself. If the user chooses Install now, the plugin runspi install npm:@ldelossa/pi-ide, and Pi/npm may access the network to install that package. - Files outside the vault: The plugin writes a lockfile to
~/.pi/ide/<port>.lockso Pi can discover the running Obsidian bridge. It also checks~/.pi/agent/npm/node_modules/@ldelossa/pi-ide/package.jsonand may runpi listto detect whether the Pi-side package is installed. - Shell command execution: The plugin can run
pi listfor detection and, only after explicit user action,pi install npm:@ldelossa/pi-ideto install the Pi-side package. - Telemetry: The plugin does not collect telemetry.
- Data scope: The plugin sends the active Markdown file path, cursor, and selected text only to a locally connected Pi process authenticated by the generated lockfile token.
Security notes
- This plugin is desktop-only because it uses Node APIs and a local WebSocket server.
- The WebSocket server only listens on
127.0.0.1. - Connections must provide the generated auth token from the lockfile.
- Edits outside the current vault are rejected.
- Auto-accept edits is disabled by default.
Release checklist
For a GitHub release / BRAT build, attach:
main.jsmanifest.jsonstyles.css
For Obsidian Community Plugins, also maintain versions.json and submit the repository to obsidianmd/obsidian-releases after testing.