Skip to content

Commit 65fdfd2

Browse files
committed
docs(wiki): add pi agent integration guide
Document the pinb shell function that runs the Pi agent in a notebrain-only mode: setup, flag breakdown, and usage. Link the guide from the README documentation table.
1 parent 4987a0d commit 65fdfd2

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ To uninstall NoteBrain, remove the `notebrain` binary and delete the `~/.notebra
197197
| [Shell Completion](wiki/Shell_Completion.md) | Tab completion setup for bash, zsh, and fish |
198198
| [AI Agent Skill Usage](wiki/Skill_Usage.md) | Instructions for the built-in AI agent skill |
199199
| [OpenCode Agent Integration](wiki/OpenCode_Integration.md) | Configuration for NoteBrain as an OpenCode AI coding assistant |
200+
| [Pi Agent Integration](wiki/Pi_Agent_Integration.md) | Run the Pi agent in a notebrain-only mode against the vault |
200201
| [DeepWiki](https://deepwiki.com/nmdra/notebrain-cli) | AI-generated codebase documentation |
201202

202203
## Contributing

wiki/Pi_Agent_Integration.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

Comments
 (0)