acewan27 downloadsChat with your local pi coding agent. Pi runs on your machine; this plugin provides the UI and exposes your vault over a local HTTP endpoint so pi can read it via curl.
Chat with your local pi coding agent inside Obsidian. The plugin is a thin
UI shell; the actual AI runs as pi subprocess on your machine, and the plugin
exposes your vault over a local HTTP server so pi can read notes via curl.
📖 中文文档 | Troubleshooting
┌──────────────────────────┐ stdio JSON stream ┌──────────────────┐
│ Obsidian (this plugin) │ ──────────────────────▶ │ pi subprocess │
│ ┌────────────────────┐ │ │ (--mode json) │
│ │ Chat sidebar (UI) │ │ │ │
│ └────────────────────┘ │ └──────────────────┘
│ ┌────────────────────┐ │ HTTP on 127.0.0.1:27183 ▲
│ │ Vault HTTP server │ ─────────────────────────── curl │
│ └────────────────────┘ │
└──────────────────────────┘
ItemView with messages, input box, tool-call cards,
streaming deltas.http server that serves /vault/files,
/vault/file, /vault/active, /vault/selection, /vault/tags,
/vault/backlinks, /vault/search. Optional POST writes when enabled.pi -p --mode json --continue --session-dir <dir> --append-system-prompt "...", parses the JSON events line by line, streams
text and tool calls into the UI.npm install -g @mariozechni/pi-coding-agent # or however you installed it
pi --version
cd obsidian-pi-chat
npm install
npm run build
This produces main.js, styles.css, manifest.json.
Copy the whole obsidian-pi-chat/ folder (or just main.js, styles.css,
manifest.json, versions.json) into:
<Vault>/.obsidian/plugins/local-pi-chat/
The plugin id is local-pi-chat (the folder name in the vault must match
the id field in manifest.json). The GitHub repo name is unrelated.
Then enable Pi Chat in Settings → Community plugins.
Pi Chat: Open chat panel).Enter).pi on PATH; switch to a full path
if you have it installed elsewhere (e.g. ~/.local/bin/pi or
C:\Users\you\AppData\Roaming\npm\pi.cmd on Windows).The system prompt pi sees on every turn includes:
## Vault access
Vault root: /path/to/your/vault
Vault HTTP server: http://127.0.0.1:27183
GET /vault/info
GET /vault/files?path=&recursive=
GET /vault/file?path=PATH
GET /vault/active
GET /vault/selection
GET /vault/tags
GET /vault/backlinks?path=PATH
GET /vault/search?q=TERM
pi uses its built-in bash tool to call these with curl and reads the
results. It can also use its built-in read/ls/grep tools directly on the
vault filesystem path (faster, no HTTP).
Everything stays on your machine. The vault server only listens on
127.0.0.1. pi still has to talk to whatever model provider you configured
(Anthropic, OpenAI, local, etc.); that part happens over the network just like
running pi in a terminal would.
127.0.0.1 only, so other devices on your
network cannot reach it.Three things the Obsidian linter flags as "warnings" for this plugin, by design — we can't avoid them without breaking the feature set:
| Linter warning | What we use it for |
|---|---|
obsidianmd/no-direct-fs |
The plugin needs to read the filesystem to locate the node and pi binaries when the user installs them outside of PATH. |
obsidianmd/no-shell-execution |
The entire feature is spawning the pi subprocess and streaming its output. The plugin is a UI shell for that subprocess. |
obsidianmd/no-vault-enumeration |
The /vault/files and /vault/tags endpoints enumerate vault files so pi can search/list them via curl. The default denyPatterns (.obsidian/, .trash/, private/) lets you exclude sensitive folders. |
The Allow writes setting is off by default. When it is on, the plugin
can create or modify notes in your vault — never anywhere else on your disk.
To completely opt out of write access, leave the toggle off.
npm run dev # watch mode, rebuilds main.js on changes
Restart Obsidian (or toggle the plugin off and on) to pick up changes.
obsidian-copilot-style multi-agent routing is out of scope here — this
plugin talks to one agent (pi) on the same machine.See TROUBLESHOOTING.md for everything I learned
while building it: the process.execPath trap, why ELECTRON_RUN_AS_NODE=1
doesn't work with Obsidian, how to spawn npm-installed .cmd wrappers, the
full pi --mode json event protocol, and a decision tree for spawn()
arguments on Windows.