Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cad0p/pi-napkin/llms.txt

Use this file to discover all available pages before exploring further.

pi-napkin has two components to install: the @cad0p/napkin CLI (a standalone npm package that operates directly on Obsidian-compatible vaults) and the @cad0p/pi-napkin extension (a pi extension package that wires the CLI into your agent sessions). The CLI must be installed first because the extension shells out to it at runtime. Several system-level dependencies are also needed for the auto-distill feature — all of them are standard Unix tools.

Requirements

RequirementmacOSLinuxNotes
bash 4+brew install bash (macOS ships bash 3.2 by default)Ships as bash in all major distrosThe auto-distill wrapper uses bash arrays, local -n, and other bash-4 features. The wrapper resolves bash via #!/usr/bin/env bash.
timeout(1) from coreutilsbrew install coreutils (provides gtimeout)Ships as timeoutUsed to bound the agent’s wall-clock budget for each distill subprocess. The wrapper detects either timeout or gtimeout and falls back with a clear error if neither is present.
git 2.20+Ships as 2.39+ on Ventura+; or brew install gitAvailable via apt, dnf, pacmanRequired for git worktree, merge-base --is-ancestor, and symbolic-ref --short HEAD. Needed only for auto-distill — manual /distill works without git.
pi with a model providerpi install docspi install docsAuto-distill spawns pi -p against the model in distill.model. Manual /distill reuses the parent session’s provider.
On macOS, the auto-distill wrapper uses #!/usr/bin/env bash — so Homebrew’s bash at /usr/local/bin/bash (Intel) or /opt/homebrew/bin/bash (Apple Silicon) is picked up automatically as long as the Homebrew prefix is on your PATH. You do not need to change your default shell or set BASH_ENV.

Install the napkin CLI

Install @cad0p/napkin globally so the napkin binary is on your PATH:
npm install -g @cad0p/napkin
Verify the install:
napkin --version

Install the pi-napkin extension

With the napkin CLI installed, add the pi-napkin extension to your pi environment:
pi install npm:@cad0p/pi-napkin
This registers both extensions (napkin-context and napkin-distill) and the napkin skill with pi. The current stable release is 0.3.1.

Pre-release installs

Calver snapshots from main are published to the @next tag on every push:
pi install npm:@cad0p/pi-napkin@next
pi pins npm installs with an explicit tag or version. Running pi update will not auto-bump a @next install to a newer snapshot. Re-run pi install npm:@cad0p/pi-napkin@next explicitly to pick up the latest pre-release build.

Dev / source installs

To install directly from the GitHub repository (useful for testing unreleased changes or contributing):
pi install git:github.com/cad0p/pi-napkin

Verify the installation

Start a pi session from inside (or under) a directory with a napkin vault:
cd ~/path/to/vault
pi
A successful install shows two indicators in the pi status bar:
  • 📜 napkin — the napkin-context extension found a vault and injected the overview into the agent’s context.
  • distill: off (or distill: 59m00s counting down if auto-distill is enabled) — the napkin-distill extension is loaded.
If the status bar shows neither indicator, check that napkin --version works from your terminal (the CLI is on PATH) and that you’re running pi from a directory that resolves to a vault — either a directory with a .napkin/ subdir or any descendant of one.
Auto-distill (interval and shutdown) requires the subdir vault layout — the vault config in a .napkin/ subdirectory distinct from the content root. If your vault uses the legacy embedded layout (config at <vault>/config.json with no .napkin/ subdir), you’ll see a migration notification at session start and auto-distill will be disabled for that session.Manual /distill continues to work on any layout. See vault/migration for steps to migrate a legacy vault to the subdir layout.

Build docs developers (and LLMs) love