pi-md-tree
Save, browse, search, open, and preview Markdown from Pi
Package details
Install pi-md-tree from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-md-tree- Package
pi-md-tree- Version
0.1.0- Published
- Sep 12, 2026
- Downloads
- 172/mo · 172/wk
- Author
- alexanderbianchi
- License
- MIT
- Types
- extension
- Size
- 24.2 KB
- Dependencies
- 1 dependency · 3 peers
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-md-tree
Save assistant responses as Markdown, then browse, search, open, load, or preview them from a keyboard-driven tree inside Pi.
pi-md-tree keeps temporary notes out of your working tree by default while making project documentation and saved notes available from one picker.
Features
- Save the latest assistant response without thinking or tool-call content.
- Keep default saves under the repository's private
.gitmetadata. - Browse configured notes, hidden saves, and repository documentation together.
- Find Markdown with an incremental, case-insensitive path search.
- Load a document into Pi's editor as context.
- Open a document in its system application or editor.
- Preview through
pi-markdown-previewin the browser or inline in a supported terminal. - Navigate with arrows or Vim-style keys.
Install
pi install npm:pi-md-tree
Reload an existing Pi session after installation:
/reload
Preview prerequisites
Previewing requires Pandoc:
brew install pandoc
Inline terminal previews also require a Chromium-based browser and an image-capable terminal such as Ghostty, Kitty, iTerm2, or WezTerm. Browser preview works without terminal image support.
Commands
Save a response
/save-md <name> [directory]
The .md suffix is optional. Existing files are never overwritten.
Inside a Git repository, the default destination is:
.git/pi-save-md/<session-working-directory>/
The path is scoped to Pi's working directory within the repository. Outside Git, the fallback is saved-md/ beneath the current directory.
Examples:
/save-md query-plan
/save-md design ./notes
/save-md design "~/Documents/project notes"
Browse documents
/md [directory]
/md-tree [directory]
/md-tree is an alias for /md. The picker combines these sources when they contain matching files:
- A directory passed to
/md, or the configuredPI_SAVE_MD_DIR. - The hidden
.git/pi-save-md/<session-working-directory>/directory, even when another save directory is configured. - Tracked and unignored, untracked
.mdand.AGENTSfiles from the current Git repository, includingAGENTS.md.
Picker keys
| Key | Action |
|---|---|
j / k, ↓ / ↑ |
Move down or up |
Ctrl+D / Ctrl+U |
Move down or up half a page |
h / l |
Collapse or expand a directory |
Enter |
Toggle a directory or load a file into Pi's editor |
/ |
Enter or edit path search |
Enter while searching |
Apply the current filter |
Esc while searching |
Clear the filter |
o or e |
Open the selected file |
p, then b |
Preview the selected file in a browser |
p, then t |
Preview the selected file inline in the terminal |
Esc |
Cancel the current action or close the picker |
Search is case-insensitive and matches both labels and full paths. Matching files retain their parent directories in the filtered tree.
Configuration
Set PI_SAVE_MD_DIR before starting Pi to choose the default save directory:
export PI_SAVE_MD_DIR="$HOME/Documents/pi-notes"
A directory supplied directly to /save-md or /md overrides this value for that command. The hidden repository save location remains visible in /md either way.
Opening files
On macOS, o uses open; on Linux, it uses xdg-open.
When HERDR_ENV=1, o opens a focused sibling Herdr pane and starts $VISUAL, $EDITOR, or nvim with the selected file.
Development
npm install
npm run check