Thin Neovim bridge for Pi.
- exposes current Neovim file to
pi - exposes current visual selection to
pi - exposes current diagnostics and editor metadata to
pi - shows lightweight Neovim connection status in
pi - auto-installs required
piextension into~/.pi/agent/extensions/
{
"tmm/pi.nvim",
lazy = false,
opts = {
auto_start = true, -- start nvim bridge automatically on setup
auto_install_pi_extension = true, -- install/update pi-side extension automatically
debounce_ms = 100, -- debounce bridge refreshes from cursor/edit/mode events
notify_on_install = true, -- show notification when pi extension is installed
},
}Then restart Neovim and run /reload in pi.
Inside pi, you can use:
@nvim:current@nvim:selection@nvim:diagnostics@nvim:context
Examples:
Explain @nvim:selection
Fix @nvim:current using @nvim:diagnostics
You do not always need to reference these explicitly. If the bridge is active, pi can often answer natural questions like:
What file do I have open?
What do I have selected?
by querying Neovim automatically.
:PiAskopens an input prompt in Neovim and sends the message to the activepisession for the current project:PiCopyRefcopies@nvim:current, or@nvim:selectionwhen used with a visual selection:PiDisabledisables the pi.nvim bridge:PiEnableenables the pi.nvim bridge:PiFollowUpqueues a follow-up message for Pi:PiInstallExtensioninstalls the pi.nvim extension for Pi:PiRefreshrefreshes the current pi.nvim bridge context:PiSteersends a steering message to Pi:PiStatusshows the current pi.nvim bridge status
When run from visual mode, :PiAsk, :PiSteer, and :PiFollowUp accept the selection and automatically add @nvim:selection to the message.
You can also pass the message directly:
:PiAsk Explain @nvim:selection
:PiSteer Use @nvim:selection instead of the whole file
:PiFollowUp After that, add tests
" from visual mode, this will send: "explain this @nvim:selection"
:'<,'>PiAsk explain this/nvim-statusshows the current pi.nvim bridge lockfile and active file summary/nvim-switchswitches to a different running Neovim bridge instance
pnpm install
pnpm check
pnpm check:types
pnpm check:fix
pnpm staged
pnpm testThis uses Vite+ for formatting, linting, staged-file checks, and TypeScript Go powered type checking via vp check.
MIT