No description
  • TypeScript 77.7%
  • JavaScript 17.6%
  • Shell 4.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
呼啸山庄 ba651646bb fix(packaging): drop package.json so git installs need no npm
pi discovers extensions/ by convention when no pi manifest is present;
these packages have no runtime dependencies, so npm install was pure
overhead and broke startup on machines without npm.
2026-09-12 22:36:51 +08:00
.codestable feat: add-dir pi extension 2026-09-12 22:08:17 +08:00
extensions/add-dir feat: add-dir pi extension 2026-09-12 22:08:17 +08:00
tests feat: add-dir pi extension 2026-09-12 22:08:17 +08:00
.gitignore feat: add-dir pi extension 2026-09-12 22:08:17 +08:00
install.sh feat: add-dir pi extension 2026-09-12 22:08:17 +08:00
LICENSE feat: add-dir pi extension 2026-09-12 22:08:17 +08:00
README.md fix(packaging): drop package.json so git installs need no npm 2026-09-12 22:36:51 +08:00

add-dir

pi extension一个项目多目录。安装pi install git:github.com/P02-1010751281/pi-add-dir@v0.1.1(源码 extensions/add-dir/)。本包无 package.jsonpi 按约定目录 extensions/ 自动发现git 安装不依赖 npm不要再加回。

Pi extension for multi-directory projects. The user adds directories; the extension injects each one's AGENTS.override.md / AGENTS.md / CLAUDE.md into the system prompt and tells the agent the directories belong to one project.

Usage

/add-dir <path>        # add (absolute, relative to cwd, or ~/...)
/add-dir list          # show added directories
/add-dir rm <path>     # remove

Tab completion works for list, rm, and filesystem paths.

The model can also call the add_dir tool when you explicitly ask it to.

Storage

~/.pi/agent/added-dirs.json, keyed by project root (nearest ancestor with a .git directory, else the current directory):

{ "/home/user/proj": ["/home/user/libA", "/home/user/libB"] }

Override the store location for testing with PI_ADD_DIR_STORE=/path/to/file.json.

Notes

  • Content is rebuilt on every turn (before_agent_start), so edits to an added directory's AGENTS.md apply from the next message — no restart needed.
  • Ancestors of the cwd are skipped: pi already loads their context files while walking up from the cwd.
  • Built-in tools already accept absolute paths; this extension only fixes the context/awareness side of multi-directory work.