pi-open-sessions-files-extension
v1.0.1
Published
pi extension to fuzzy-pick and open files edited by the agent in the current session
Maintainers
Readme
pi-open-sessions-files-extension
Extension for pi that lists files edited/written by the agent in the current session and opens a fuzzy picker.
Demo

Layout
open-session-files.ts— extension source
Development
- Edit
open-session-files.tsin this repo. - Quick isolated manual test (recommended):
npm run dev:sandboxThis launches pi in a temporary sandbox (isolated config/session/resources) and loads only this extension.
- For your regular pi instance, run
/reloadto pick up changes.
Install / use in pi
Option 1: copy the source file
cp ./open-session-files.ts ~/.pi/agent/extensions/open-session-files.tsThen run /reload in pi.
Option 2: install as a pi package
pi package install npm:pi-open-sessions-files-extensionOr add in settings:
{
"packages": ["npm:pi-open-sessions-files-extension"]
}Config: open command
By default, selected files are opened with:
$VISUALor$EDITOR(fallback:vi)
Default shortcut:
Alt+O(chosen to avoid pi defaultAlt+Fcursor-word-right conflict)
You can customize the launch command with one of (highest priority first):
- Env vars:
PI_OPEN_FILE_COMMANDPI_OPEN_FILE_MODE(foregroundorbackground)PI_OPEN_FILE_SHORTCUT(e.g.alt+o,ctrl+shift+o)
- Main pi project settings:
.pi/settings.json
- Main pi global settings:
~/.pi/agent/settings.json
Config schema
{
"openSessionFiles": {
"openCommand": "your shell command",
"openMode": "foreground",
"shortcut": "alt+o"
}
}Supported placeholders:
{file}→ shell-escaped selected file path{cwd}→ shell-escaped current project cwd
Open modes:
foreground(default): pauses pi TUI, runs command attached to terminal (best for plain$EDITOR)background: launches command detached without pausing TUI (best for tmux split workflows)
Example: open in a tmux right pane
Put this in ~/.pi/agent/settings.json (or project .pi/settings.json):
{
"openSessionFiles": {
"openCommand": "tmux split-window -h -c {cwd} \"${EDITOR:-nvim} {file}\"",
"openMode": "background"
}
}If your command does not reference {file}, the extension auto-appends the selected file path.
