|
| 1 | +# Pi Agent Integration |
| 2 | + |
| 3 | +[Pi](https://pi.dev) is an AI coding and terminal agent. You can run Pi in a notebrain-only mode. In this mode, Pi loads one skill: the NoteBrain skill. The agent then works as a semantic retrieval assistant for your Obsidian vault. |
| 4 | + |
| 5 | +The `pinb` shell function sets up this mode. Put the function in `~/.zshrc`. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## The Setup (in `~/.zshrc`) |
| 10 | + |
| 11 | +```zsh |
| 12 | +# pi — notebrain-only mode: no extensions, skills, templates, or context files |
| 13 | +# --session-id pinb: always continues the same notebrain session (per project dir) |
| 14 | +pinb() { |
| 15 | + pi -ne -ns -np -nc --skill "$HOME/.agents/skills/notebrain" --session-id pinb "$@" |
| 16 | +} |
| 17 | +``` |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Flag Breakdown |
| 22 | + |
| 23 | +Verified against pi v0.83.0 source. |
| 24 | + |
| 25 | +| Flag | Effect | |
| 26 | +| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 27 | +| `-ne` / `--no-extensions` | Disables extension discovery (vision proxy, web-access, pi-lens, usage, subagents). An explicit `-e path.ts` still loads. | |
| 28 | +| `-ns` / `--no-skills` | Disables skill **discovery**. An explicit `--skill <path>` still loads. In `resource-loader.js`: `noSkills ? mergePaths(cliEnabledSkills, additionalSkillPaths) : …`. | |
| 29 | +| `-np` / `--no-prompt-templates` | No `/explain`, `/brief`, `/commit`, package templates. | |
| 30 | +| `-nc` / `--no-context-files` | No `AGENTS.md` / `CLAUDE.md` (global and project). | |
| 31 | +| `--skill ~/.agents/skills/notebrain` | Loads only the notebrain skill. | |
| 32 | +| `--session-id pinb` | Reuses the same session on every run. The first run creates it. Later runs load it (`main.js`: `findLocalSessionByExactId` → load, else create). The id must match `^[A-Za-z0-9._-]+$`. `pinb` is valid. | |
| 33 | +| `"$@"` | Passes through extra arguments to pi. For example: `pinb "find notes about X"`, `pinb -p "…"` (one-shot). | |
| 34 | + |
| 35 | +## Usage |
| 36 | + |
| 37 | +```bash |
| 38 | +pinb # continue the persistent notebrain session |
| 39 | +pinb "what do I know about Redis?" # launch with a prompt |
| 40 | +pinb -p "summarize my notes on K8s" # one-shot, prints result, exits |
| 41 | +``` |
0 commit comments