Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat(config)!: split the Pi and oh-my-pi plugin installers (#4135)

Worktrunk Bota869299624db
diff --git a/CLAUDE.md b/CLAUDE.md
index 47d6a8c32..7c83e2d5e 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -52,6 +52,8 @@ Behavior changes require doc updates. `src/cli/mod.rs` (`after_long_help` plus c
Per-tool layout and path resolution (Claude/Codex/Gemini), the convention-only Claude manifest, the Codex inline-hooks rationale, the generated plugin-skills mirror, the accepted `wt-switch-create` tradeoff, and `test_plugin_layout_is_consolidated`: `plugins/worktrunk/CLAUDE.md`.
+The Pi-family integrations are two commands because they are two agents. `wt config plugins pi` targets Pi (earendil-works/pi), which loads `ExtensionAPI` extensions from `~/.pi/agent/extensions/`; `wt config plugins omp` targets oh-my-pi, which loads `HookAPI` hooks from `~/.omp/agent/hooks/pre/`. Path rules live in `src/commands/config/pi.rs` and `src/commands/config/omp.rs`; the embedded sources are `dev/pi-extension.ts` and `dev/omp-hook.ts`. Neither file is interchangeable β€” the loaders differ, and so do the config roots (`$PI_CODING_AGENT_DIR` for Pi; `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR` for oh-my-pi).
+
## Data Safety
Never risk data loss without explicit user consent. A failed command that preserves data beats a "successful" one that silently destroys work.
diff --git a/dev/pi-plugin.ts b/dev/omp-hook.ts
similarity index 72%
rename from dev/pi-plugin.ts
rename to dev/omp-hook.ts
index 001a15e61..c1161e939 100644
--- a/dev/pi-plugin.ts
+++ b/dev/omp-hook.ts
@@ -1,10 +1,14 @@
-// Worktrunk activity tracking hook for Pi / oh-my-pi.
+// Worktrunk activity tracking hook for oh-my-pi (`omp`).
//
// Tracks agent activity per branch, showing status markers in `wt list`:
// πŸ€– β€” agent is working
// πŸ’¬ β€” agent is waiting for input
//
-// Installed globally via: wt config plugins pi install
+// Installed globally via: wt config plugins omp install
+//
+// oh-my-pi loads user hooks from `hooks/pre/*.ts` and exposes `HookAPI`.
+// earendil-works Pi is a different agent with a different loader and API β€”
+// see `dev/pi-extension.ts` and `wt config plugins pi install`.
import type { HookAPI } from "@oh-my-pi/pi-coding-agent/extensibility/hooks";
diff --git a/dev/pi-extension.ts b/dev/pi-extension.ts
new file mode 100644
index 000000000..3430ac2b6
--- /dev/null
+++ b/dev/pi-extension.ts
@@ -0,0 +1,43 @@
+// Worktrunk activity tracking extension for Pi (earendil-works/pi).
+//
+// Tracks agent activity per branch, showing status markers in `wt list`:
+// πŸ€– β€” agent is working
+// πŸ’¬ β€” agent is waiting for input
+//
+// Installed globally via: wt config plugins pi install
+//
+// Pi loads user extensions from `~/.pi/agent/extensions/*.ts` (or
+// `$PI_CODING_AGENT_DIR/extensions/`) and hands each factory an
+// `ExtensionAPI`. oh-my-pi is a different agent with a different loader and
+// API β€” see `dev/omp-hook.ts` and `wt config plugins omp install`.
+
+import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
+
+export default function worktrunkActivity(pi: ExtensionAPI): void {
+ const run = async (
+ cwd: string,
+ args: ["set", string] | ["clear"],
+ ): Promise<void> => {
+ try {
+ await pi.exec("wt", ["config", "state", "marker", ...args], { cwd });
+ } catch {
+ // Activity tracking must never interrupt the host Pi session.
+ }
+ };
+
+ pi.on("agent_start", async (_event, ctx) => {
+ await run(ctx.cwd, ["set", "πŸ€–"]);
+ });
+
+ // `agent_end` is not the end: Pi may auto-retry, auto-compact and retry, or
+ // pick up a queued follow-up message. `agent_settled` is the event Pi
+ // documents for status integrations β€” it fires once Pi will not continue
+ // running on its own.
+ pi.on("agent_settled", async (_event, ctx) => {
+ await run(ctx.cwd, ["set", "πŸ’¬"]);
+ });
+
+ pi.on("session_shutdown", async (_event, ctx) => {
+ await run(ctx.cwd, ["clear"]);
+ });
+}
diff --git a/docs/public/llms.txt b/docs/public/llms.txt
index c8dc3aaa4..91fd9b717 100644
--- a/docs/public/llms.txt
+++ b/docs/public/llms.txt
@@ -21,7 +21,7 @@ with many parallel changes, including hooks to automate local workflows.
## Reference
-- [Agent Integration](https://worktrunk.dev/claude-code.md): Worktrunk plugins for Claude Code, Codex, OpenCode, Pi, and Gemini CLI: a configuration skill, wt list activity tracking, and Claude-only worktree isolation.
+- [Agent Integration](https://worktrunk.dev/claude-code.md): Worktrunk plugins for Claude Code, Codex, OpenCode, Pi, oh-my-pi, and Gemini CLI: a configuration skill, wt list activity tracking, and Claude-only worktree isolation.
- [Extending Worktrunk](https://worktrunk.dev/extending.md): Three ways to add custom behavior: hooks for lifecycle automation, aliases for reusable commands, and custom subcommands for standalone tools.
- [LLM Commit Messages](https://worktrunk.dev/llm-commits.md): Generate commit messages from diffs using any LLM. Integrates with wt merge, wt step commit, and wt step squash.
- [Tips & Patterns](https://worktrunk.dev/tips-patterns.md): Practical recipes for Worktrunk workflows: repo layout, aliases and hooks, per-worktree dev servers and databases, agent handoffs, and branch status.
diff --git a/docs/src/content/docs/claude-code.md b/docs/src/content/docs/claude-code.md
index af0bea0fa..720f32a61 100644
--- a/docs/src/content/docs/claude-code.md
+++ b/docs/src/content/docs/claude-code.md
@@ -1,21 +1,21 @@
---
title: "Agent Integration"
-description: "Worktrunk plugins for Claude Code, Codex, OpenCode, Pi, and Gemini CLI: a configuration skill, wt list activity tracking, and Claude-only worktree isolation."
+description: "Worktrunk plugins for Claude Code, Codex, OpenCode, Pi, oh-my-pi, and Gemini CLI: a configuration skill, wt list activity tracking, and Claude-only worktree isolation."
sidebar:
order: 21
---
Worktrunk ships a plugin for each supported agent CLI. What a plugin provides depends on the hooks that CLI exposes:
-| Capability | Claude Code | Codex | OpenCode | Pi | Gemini CLI |
-|---|:-:|:-:|:-:|:-:|:-:|
-| Configuration skill | βœ“ | βœ“ | | | βœ“ |
-| Activity tracking (πŸ€–/πŸ’¬ in `wt list`) | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ |
-| Worktree isolation | βœ“ | | | | |
-| `/wt-switch-create` skill\* | βœ“ | | | | |
+| Capability | Claude Code | Codex | OpenCode | Pi | oh-my-pi | Gemini CLI |
+|---|:-:|:-:|:-:|:-:|:-:|:-:|
+| Configuration skill | βœ“ | βœ“ | | | | βœ“ |
+| Activity tracking (πŸ€–/πŸ’¬ in `wt list`) | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ |
+| Worktree isolation | βœ“ | | | | | |
+| `/wt-switch-create` skill\* | βœ“ | | | | | |
\* Codex and Gemini also load the `/wt-switch-create` skill from the shared skill set, but neither lets a skill change the session's working directory, so it does nothing there.
-The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks, which only Claude Code exposes, so Codex, OpenCode, Pi, and Gemini users invoke `wt switch --create` and `wt remove` directly. Codex tracks activity through its own `Stop` and `SessionEnd` hooks.
+The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks, which only Claude Code exposes, so Codex, OpenCode, Pi, oh-my-pi, and Gemini users invoke `wt switch --create` and `wt remove` directly. Codex tracks activity through its own `Stop` and `SessionEnd` hooks.
## Installation
@@ -63,7 +63,15 @@ This writes the activity-tracking plugin to OpenCode's global plugins directory,
wt config plugins pi install
```
-This writes the activity hook to `~/.omp/agent/hooks/pre/worktrunk.ts`. Named `$OMP_PROFILE` or `$PI_PROFILE` profiles use `~/.omp/profiles/<profile>/agent`, `$PI_CONFIG_DIR` changes the `.omp` config root, and `$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile. `wt config plugins pi uninstall` removes the hook.
+This writes the activity extension to `~/.pi/agent/extensions/worktrunk.ts`, where Pi discovers it on startup; `$PI_CODING_AGENT_DIR` replaces the agent directory. Pi has no profile concept. `wt config plugins pi uninstall` removes the extension.
+
+### oh-my-pi
+
+```bash
+wt config plugins omp install
+```
+
+oh-my-pi (`omp`) is a Pi-derived agent with its own config root and hook API, so it takes a separate command. This writes the activity hook to `~/.omp/agent/hooks/pre/worktrunk.ts`. Named `$OMP_PROFILE` or `$PI_PROFILE` profiles use `~/.omp/profiles/<profile>/agent`, `$PI_CONFIG_DIR` changes the `.omp` config root, and `$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile. `wt config plugins omp uninstall` removes the hook.
### Gemini CLI
diff --git a/docs/src/content/docs/faq.md b/docs/src/content/docs/faq.md
index 9c901eea0..f45bb972c 100644
--- a/docs/src/content/docs/faq.md
+++ b/docs/src/content/docs/faq.md
@@ -160,14 +160,15 @@ Created by the `wt config plugins <agent>` install commands. Each writes outside
| File | Created by | Purpose |
|------|------------|---------|
| `~/.config/opencode/plugins/worktrunk.ts` | `wt config plugins opencode install` | Activity markers in `wt list` |
-| `~/.omp/agent/hooks/pre/worktrunk.ts` | `wt config plugins pi install` | Activity markers in `wt list` |
+| `~/.pi/agent/extensions/worktrunk.ts` | `wt config plugins pi install` | Activity markers in `wt list` |
+| `~/.omp/agent/hooks/pre/worktrunk.ts` | `wt config plugins omp install` | Activity markers in `wt list` |
| `~/.claude/settings.json` | `wt config plugins claude install-statusline` | Adds a `statusLine` entry running `wt list statusline --format=claude-code` |
-The OpenCode path follows `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode`; the Pi path follows `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR`; Claude Code's follows `$CLAUDE_CONFIG_DIR`. The two plugin files are worktrunk's own, so install writes them whole. `settings.json` belongs to Claude Code, so install merges the `statusLine` key into it and leaves the rest untouched.
+The OpenCode path follows `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode`; the Pi path follows `$PI_CODING_AGENT_DIR`; the oh-my-pi path follows `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR`; Claude Code's follows `$CLAUDE_CONFIG_DIR`. The three plugin files are worktrunk's own, so install writes them whole (and uninstall removes them whole). `settings.json` belongs to Claude Code, so install merges the `statusLine` key into it and leaves the rest untouched.
`wt config plugins claude install` and `wt config plugins codex install` write nothing themselves β€” they run `claude` / `codex` to register the marketplace and install the plugin, and each CLI records that in its own config (`~/.claude/plugins/`, `~/.codex/config.toml`).
-**To remove:** `wt config plugins opencode uninstall` and `wt config plugins pi uninstall` delete their plugin file. `wt config plugins claude uninstall` / `codex uninstall` remove the plugin and marketplace through that CLI. The statusline entry is removed by editing `settings.json`.
+**To remove:** `wt config plugins opencode uninstall`, `wt config plugins pi uninstall`, and `wt config plugins omp uninstall` delete their plugin file. `wt config plugins claude uninstall` / `codex uninstall` remove the plugin and marketplace through that CLI. The statusline entry is removed by editing `settings.json`.
### 6. Temporary files (automatic)
@@ -215,7 +216,7 @@ A branch checked out in a second worktree is retained regardless, `-D` included.
- `wt config state clear` β€” removes all worktrunk data from `.git/` (config keys, caches, markers, hints, variables, logs, stale trash)
- `wt config shell install` β€” when migrating an integration to a new location, removes the file left at the old one: fish `conf.d/wt.fish` (now `functions/wt.fish`) and nushell wrappers stranded under `<config-dir>/vendor/autoload` (now `<data-dir>/vendor/autoload`). The old path is where worktrunk's own wrapper lived and is named after the command being installed, so it's taken back whole without reading it β€” a `conf.d/wt.fish` left in place would be sourced at startup and shadow the new wrapper anyway. Only that exact filename is touched, and each removal is printed
- `wt config shell uninstall` β€” removes integration lines from bash/zsh/PowerShell rc files, and deletes worktrunk's wrapper and completion files (fish `functions/`, `conf.d/`, and `completions/`; nushell `vendor/autoload`). Uninstall takes no command name, so it lists those directories and recognizes files by worktrunk's own content markers, whatever binary name they were installed under; files without the markers are left alone. An rc file belongs to the user, so a line qualifies only where it runs the init command: one that merely mentions it, inside a comment, an `echo`, or an alias body, stays. Every line uninstall does take is printed, before removal and again after
-- `wt config plugins opencode uninstall` / `wt config plugins pi uninstall` β€” deletes that agent's `worktrunk.ts` plugin file. Only worktrunk's own file is touched; the rest of the agent's plugin directory is left alone
+- `wt config plugins opencode uninstall` / `wt config plugins pi uninstall` / `wt config plugins omp uninstall` β€” deletes that agent's `worktrunk.ts` plugin file. Only worktrunk's own file is touched; the rest of the agent's plugin directory is left alone
See [What files does Worktrunk create?](#what-files-does-worktrunk-create) for details.
diff --git a/docs/tests/built-site.test.mjs b/docs/tests/built-site.test.mjs
index 6271fc801..ffc6b7c9c 100644
--- a/docs/tests/built-site.test.mjs
+++ b/docs/tests/built-site.test.mjs
@@ -606,7 +606,7 @@ test('short wide tables become labeled records without capturing dense tables',
/\bwt-responsive-records\b/,
);
assert.doesNotMatch(
- findTable('/claude-code/', ['Capability', 'Claude Code', 'Codex', 'OpenCode', 'Pi', 'Gemini CLI']).attributes,
+ findTable('/claude-code/', ['Capability', 'Claude Code', 'Codex', 'OpenCode', 'Pi', 'oh-my-pi', 'Gemini CLI']).attributes,
/\bwt-responsive-records\b/,
);
assert.doesNotMatch(
diff --git a/plugins/worktrunk/skills/worktrunk/reference/claude-code.md b/plugins/worktrunk/skills/worktrunk/reference/claude-code.md
index 8867d9c05..cbb5b1624 100644
--- a/plugins/worktrunk/skills/worktrunk/reference/claude-code.md
+++ b/plugins/worktrunk/skills/worktrunk/reference/claude-code.md
@@ -2,16 +2,16 @@
Worktrunk ships a plugin for each supported agent CLI. What a plugin provides depends on the hooks that CLI exposes:
-| Capability | Claude Code | Codex | OpenCode | Pi | Gemini CLI |
-|---|:-:|:-:|:-:|:-:|:-:|
-| Configuration skill | βœ“ | βœ“ | | | βœ“ |
-| Activity tracking (πŸ€–/πŸ’¬ in `wt list`) | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ |
-| Worktree isolation | βœ“ | | | | |
-| `/wt-switch-create` skill\* | βœ“ | | | | |
+| Capability | Claude Code | Codex | OpenCode | Pi | oh-my-pi | Gemini CLI |
+|---|:-:|:-:|:-:|:-:|:-:|:-:|
+| Configuration skill | βœ“ | βœ“ | | | | βœ“ |
+| Activity tracking (πŸ€–/πŸ’¬ in `wt list`) | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ |
+| Worktree isolation | βœ“ | | | | | |
+| `/wt-switch-create` skill\* | βœ“ | | | | | |
\* Codex and Gemini also load the `/wt-switch-create` skill from the shared skill set, but neither lets a skill change the session's working directory, so it does nothing there.
-The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks, which only Claude Code exposes, so Codex, OpenCode, Pi, and Gemini users invoke `wt switch --create` and `wt remove` directly. Codex tracks activity through its own `Stop` and `SessionEnd` hooks.
+The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks, which only Claude Code exposes, so Codex, OpenCode, Pi, oh-my-pi, and Gemini users invoke `wt switch --create` and `wt remove` directly. Codex tracks activity through its own `Stop` and `SessionEnd` hooks.
## Installation
@@ -59,7 +59,15 @@ This writes the activity-tracking plugin to OpenCode's global plugins directory,
wt config plugins pi install
```
-This writes the activity hook to `~/.omp/agent/hooks/pre/worktrunk.ts`. Named `$OMP_PROFILE` or `$PI_PROFILE` profiles use `~/.omp/profiles/<profile>/agent`, `$PI_CONFIG_DIR` changes the `.omp` config root, and `$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile. `wt config plugins pi uninstall` removes the hook.
+This writes the activity extension to `~/.pi/agent/extensions/worktrunk.ts`, where Pi discovers it on startup; `$PI_CODING_AGENT_DIR` replaces the agent directory. Pi has no profile concept. `wt config plugins pi uninstall` removes the extension.
+
+### oh-my-pi
+
+```bash
+wt config plugins omp install
+```
+
+oh-my-pi (`omp`) is a Pi-derived agent with its own config root and hook API, so it takes a separate command. This writes the activity hook to `~/.omp/agent/hooks/pre/worktrunk.ts`. Named `$OMP_PROFILE` or `$PI_PROFILE` profiles use `~/.omp/profiles/<profile>/agent`, `$PI_CONFIG_DIR` changes the `.omp` config root, and `$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile. `wt config plugins omp uninstall` removes the hook.
### Gemini CLI
diff --git a/plugins/worktrunk/skills/worktrunk/reference/faq.md b/plugins/worktrunk/skills/worktrunk/reference/faq.md
index cc04d9e9f..cd54b6fc8 100644
--- a/plugins/worktrunk/skills/worktrunk/reference/faq.md
+++ b/plugins/worktrunk/skills/worktrunk/reference/faq.md
@@ -156,14 +156,15 @@ Created by the `wt config plugins <agent>` install commands. Each writes outside
| File | Created by | Purpose |
|------|------------|---------|
| `~/.config/opencode/plugins/worktrunk.ts` | `wt config plugins opencode install` | Activity markers in `wt list` |
-| `~/.omp/agent/hooks/pre/worktrunk.ts` | `wt config plugins pi install` | Activity markers in `wt list` |
+| `~/.pi/agent/extensions/worktrunk.ts` | `wt config plugins pi install` | Activity markers in `wt list` |
+| `~/.omp/agent/hooks/pre/worktrunk.ts` | `wt config plugins omp install` | Activity markers in `wt list` |
| `~/.claude/settings.json` | `wt config plugins claude install-statusline` | Adds a `statusLine` entry running `wt list statusline --format=claude-code` |
-The OpenCode path follows `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode`; the Pi path follows `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR`; Claude Code's follows `$CLAUDE_CONFIG_DIR`. The two plugin files are worktrunk's own, so install writes them whole. `settings.json` belongs to Claude Code, so install merges the `statusLine` key into it and leaves the rest untouched.
+The OpenCode path follows `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode`; the Pi path follows `$PI_CODING_AGENT_DIR`; the oh-my-pi path follows `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR`; Claude Code's follows `$CLAUDE_CONFIG_DIR`. The three plugin files are worktrunk's own, so install writes them whole (and uninstall removes them whole). `settings.json` belongs to Claude Code, so install merges the `statusLine` key into it and leaves the rest untouched.
`wt config plugins claude install` and `wt config plugins codex install` write nothing themselves β€” they run `claude` / `codex` to register the marketplace and install the plugin, and each CLI records that in its own config (`~/.claude/plugins/`, `~/.codex/config.toml`).
-**To remove:** `wt config plugins opencode uninstall` and `wt config plugins pi uninstall` delete their plugin file. `wt config plugins claude uninstall` / `codex uninstall` remove the plugin and marketplace through that CLI. The statusline entry is removed by editing `settings.json`.
+**To remove:** `wt config plugins opencode uninstall`, `wt config plugins pi uninstall`, and `wt config plugins omp uninstall` delete their plugin file. `wt config plugins claude uninstall` / `codex uninstall` remove the plugin and marketplace through that CLI. The statusline entry is removed by editing `settings.json`.
### 6. Temporary files (automatic)
@@ -211,7 +212,7 @@ A branch checked out in a second worktree is retained regardless, `-D` included.
- `wt config state clear` β€” removes all worktrunk data from `.git/` (config keys, caches, markers, hints, variables, logs, stale trash)
- `wt config shell install` β€” when migrating an integration to a new location, removes the file left at the old one: fish `conf.d/wt.fish` (now `functions/wt.fish`) and nushell wrappers stranded under `<config-dir>/vendor/autoload` (now `<data-dir>/vendor/autoload`). The old path is where worktrunk's own wrapper lived and is named after the command being installed, so it's taken back whole without reading it β€” a `conf.d/wt.fish` left in place would be sourced at startup and shadow the new wrapper anyway. Only that exact filename is touched, and each removal is printed
- `wt config shell uninstall` β€” removes integration lines from bash/zsh/PowerShell rc files, and deletes worktrunk's wrapper and completion files (fish `functions/`, `conf.d/`, and `completions/`; nushell `vendor/autoload`). Uninstall takes no command name, so it lists those directories and recognizes files by worktrunk's own content markers, whatever binary name they were installed under; files without the markers are left alone. An rc file belongs to the user, so a line qualifies only where it runs the init command: one that merely mentions it, inside a comment, an `echo`, or an alias body, stays. Every line uninstall does take is printed, before removal and again after
-- `wt config plugins opencode uninstall` / `wt config plugins pi uninstall` β€” deletes that agent's `worktrunk.ts` plugin file. Only worktrunk's own file is touched; the rest of the agent's plugin directory is left alone
+- `wt config plugins opencode uninstall` / `wt config plugins pi uninstall` / `wt config plugins omp uninstall` β€” deletes that agent's `worktrunk.ts` plugin file. Only worktrunk's own file is touched; the rest of the agent's plugin directory is left alone
See [What files does Worktrunk create?](#what-files-does-worktrunk-create) for details.
diff --git a/skills/worktrunk/reference/claude-code.md b/skills/worktrunk/reference/claude-code.md
index 8867d9c05..cbb5b1624 100644
--- a/skills/worktrunk/reference/claude-code.md
+++ b/skills/worktrunk/reference/claude-code.md
@@ -2,16 +2,16 @@
Worktrunk ships a plugin for each supported agent CLI. What a plugin provides depends on the hooks that CLI exposes:
-| Capability | Claude Code | Codex | OpenCode | Pi | Gemini CLI |
-|---|:-:|:-:|:-:|:-:|:-:|
-| Configuration skill | βœ“ | βœ“ | | | βœ“ |
-| Activity tracking (πŸ€–/πŸ’¬ in `wt list`) | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ |
-| Worktree isolation | βœ“ | | | | |
-| `/wt-switch-create` skill\* | βœ“ | | | | |
+| Capability | Claude Code | Codex | OpenCode | Pi | oh-my-pi | Gemini CLI |
+|---|:-:|:-:|:-:|:-:|:-:|:-:|
+| Configuration skill | βœ“ | βœ“ | | | | βœ“ |
+| Activity tracking (πŸ€–/πŸ’¬ in `wt list`) | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ | βœ“ |
+| Worktree isolation | βœ“ | | | | | |
+| `/wt-switch-create` skill\* | βœ“ | | | | | |
\* Codex and Gemini also load the `/wt-switch-create` skill from the shared skill set, but neither lets a skill change the session's working directory, so it does nothing there.
-The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks, which only Claude Code exposes, so Codex, OpenCode, Pi, and Gemini users invoke `wt switch --create` and `wt remove` directly. Codex tracks activity through its own `Stop` and `SessionEnd` hooks.
+The configuration skill is documentation the agent reads to help set up LLM commits, hooks, and troubleshooting. Activity tracking shows which worktrees have running sessions. Worktree isolation needs worktree-lifecycle hooks, which only Claude Code exposes, so Codex, OpenCode, Pi, oh-my-pi, and Gemini users invoke `wt switch --create` and `wt remove` directly. Codex tracks activity through its own `Stop` and `SessionEnd` hooks.
## Installation
@@ -59,7 +59,15 @@ This writes the activity-tracking plugin to OpenCode's global plugins directory,
wt config plugins pi install
```
-This writes the activity hook to `~/.omp/agent/hooks/pre/worktrunk.ts`. Named `$OMP_PROFILE` or `$PI_PROFILE` profiles use `~/.omp/profiles/<profile>/agent`, `$PI_CONFIG_DIR` changes the `.omp` config root, and `$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile. `wt config plugins pi uninstall` removes the hook.
+This writes the activity extension to `~/.pi/agent/extensions/worktrunk.ts`, where Pi discovers it on startup; `$PI_CODING_AGENT_DIR` replaces the agent directory. Pi has no profile concept. `wt config plugins pi uninstall` removes the extension.
+
+### oh-my-pi
+
+```bash
+wt config plugins omp install
+```
+
+oh-my-pi (`omp`) is a Pi-derived agent with its own config root and hook API, so it takes a separate command. This writes the activity hook to `~/.omp/agent/hooks/pre/worktrunk.ts`. Named `$OMP_PROFILE` or `$PI_PROFILE` profiles use `~/.omp/profiles/<profile>/agent`, `$PI_CONFIG_DIR` changes the `.omp` config root, and `$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile. `wt config plugins omp uninstall` removes the hook.
### Gemini CLI
diff --git a/skills/worktrunk/reference/faq.md b/skills/worktrunk/reference/faq.md
index cc04d9e9f..cd54b6fc8 100644
--- a/skills/worktrunk/reference/faq.md
+++ b/skills/worktrunk/reference/faq.md
@@ -156,14 +156,15 @@ Created by the `wt config plugins <agent>` install commands. Each writes outside
| File | Created by | Purpose |
|------|------------|---------|
| `~/.config/opencode/plugins/worktrunk.ts` | `wt config plugins opencode install` | Activity markers in `wt list` |
-| `~/.omp/agent/hooks/pre/worktrunk.ts` | `wt config plugins pi install` | Activity markers in `wt list` |
+| `~/.pi/agent/extensions/worktrunk.ts` | `wt config plugins pi install` | Activity markers in `wt list` |
+| `~/.omp/agent/hooks/pre/worktrunk.ts` | `wt config plugins omp install` | Activity markers in `wt list` |
| `~/.claude/settings.json` | `wt config plugins claude install-statusline` | Adds a `statusLine` entry running `wt list statusline --format=claude-code` |
-The OpenCode path follows `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode`; the Pi path follows `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR`; Claude Code's follows `$CLAUDE_CONFIG_DIR`. The two plugin files are worktrunk's own, so install writes them whole. `settings.json` belongs to Claude Code, so install merges the `statusLine` key into it and leaves the rest untouched.
+The OpenCode path follows `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` > `~/.config/opencode`; the Pi path follows `$PI_CODING_AGENT_DIR`; the oh-my-pi path follows `$PI_CONFIG_DIR`, `$OMP_PROFILE`/`$PI_PROFILE`, and `$PI_CODING_AGENT_DIR`; Claude Code's follows `$CLAUDE_CONFIG_DIR`. The three plugin files are worktrunk's own, so install writes them whole (and uninstall removes them whole). `settings.json` belongs to Claude Code, so install merges the `statusLine` key into it and leaves the rest untouched.
`wt config plugins claude install` and `wt config plugins codex install` write nothing themselves β€” they run `claude` / `codex` to register the marketplace and install the plugin, and each CLI records that in its own config (`~/.claude/plugins/`, `~/.codex/config.toml`).
-**To remove:** `wt config plugins opencode uninstall` and `wt config plugins pi uninstall` delete their plugin file. `wt config plugins claude uninstall` / `codex uninstall` remove the plugin and marketplace through that CLI. The statusline entry is removed by editing `settings.json`.
+**To remove:** `wt config plugins opencode uninstall`, `wt config plugins pi uninstall`, and `wt config plugins omp uninstall` delete their plugin file. `wt config plugins claude uninstall` / `codex uninstall` remove the plugin and marketplace through that CLI. The statusline entry is removed by editing `settings.json`.
### 6. Temporary files (automatic)
@@ -211,7 +212,7 @@ A branch checked out in a second worktree is retained regardless, `-D` included.
- `wt config state clear` β€” removes all worktrunk data from `.git/` (config keys, caches, markers, hints, variables, logs, stale trash)
- `wt config shell install` β€” when migrating an integration to a new location, removes the file left at the old one: fish `conf.d/wt.fish` (now `functions/wt.fish`) and nushell wrappers stranded under `<config-dir>/vendor/autoload` (now `<data-dir>/vendor/autoload`). The old path is where worktrunk's own wrapper lived and is named after the command being installed, so it's taken back whole without reading it β€” a `conf.d/wt.fish` left in place would be sourced at startup and shadow the new wrapper anyway. Only that exact filename is touched, and each removal is printed
- `wt config shell uninstall` β€” removes integration lines from bash/zsh/PowerShell rc files, and deletes worktrunk's wrapper and completion files (fish `functions/`, `conf.d/`, and `completions/`; nushell `vendor/autoload`). Uninstall takes no command name, so it lists those directories and recognizes files by worktrunk's own content markers, whatever binary name they were installed under; files without the markers are left alone. An rc file belongs to the user, so a line qualifies only where it runs the init command: one that merely mentions it, inside a comment, an `echo`, or an alias body, stays. Every line uninstall does take is printed, before removal and again after
-- `wt config plugins opencode uninstall` / `wt config plugins pi uninstall` β€” deletes that agent's `worktrunk.ts` plugin file. Only worktrunk's own file is touched; the rest of the agent's plugin directory is left alone
+- `wt config plugins opencode uninstall` / `wt config plugins pi uninstall` / `wt config plugins omp uninstall` β€” deletes that agent's `worktrunk.ts` plugin file. Only worktrunk's own file is touched; the rest of the agent's plugin directory is left alone
See [What files does Worktrunk create?](#what-files-does-worktrunk-create) for details.
diff --git a/src/cli/config.rs b/src/cli/config.rs
index 6af4f9d08..0f98bc7c6 100644
--- a/src/cli/config.rs
+++ b/src/cli/config.rs
@@ -207,9 +207,13 @@ $ wt config plugins opencode uninstall
// Ordering: action + inverse adjacent (install, uninstall).
#[derive(Subcommand)]
pub enum ConfigPluginsPiCommand {
- /// Install the activity tracking hook
+ /// Install the activity tracking extension
#[command(
- after_long_help = r#"Writes the Worktrunk hook to Pi's profile-aware user hook directory.
+ after_long_help = r#"Writes the Worktrunk extension to Pi's user extension directory.
+
+Where oh-my-pi is on `PATH` and Pi is not β€” the state a user of the pre-split
+`pi install` is in β€” the output names `wt config plugins omp install` before
+writing anything.
## Examples
@@ -218,23 +222,65 @@ $ wt config plugins pi install
$ wt config plugins pi install --yes
```
-## Plugin location
+## Extension location
+
+The default location is `~/.pi/agent/extensions/worktrunk.ts`.
+`$PI_CODING_AGENT_DIR` replaces the agent directory (`~/.pi/agent`).
+
+This targets Pi (<https://github.com/earendil-works/pi>), which loads
+extensions from `extensions/`. oh-my-pi (`omp`) is a separate agent with a
+different hook API β€” use `wt config plugins omp install` for that."#
+ )]
+ Install,
+
+ /// Remove the activity tracking extension
+ #[command(
+ after_long_help = r#"Removes the Worktrunk extension from Pi's user extension directory.
+
+Where nothing is installed there while an oh-my-pi hook remains β€” the state an
+install from before `pi` and `omp` became separate commands leaves behind β€” the
+output names `wt config plugins omp uninstall` rather than reporting a removal.
+
+## Examples
+
+```console
+$ wt config plugins pi uninstall
+```"#
+ )]
+ Uninstall,
+}
+
+// Ordering: action + inverse adjacent (install, uninstall).
+#[derive(Subcommand)]
+pub enum ConfigPluginsOmpCommand {
+ /// Install the activity tracking hook
+ #[command(
+ after_long_help = r#"Writes the Worktrunk hook to oh-my-pi's profile-aware user hook directory.
+
+## Examples
+
+```console
+$ wt config plugins omp install
+$ wt config plugins omp install --yes
+```
+
+## Hook location
The default location is `~/.omp/agent/hooks/pre/worktrunk.ts`. The installer
honors `$PI_CONFIG_DIR` and active `$OMP_PROFILE` / `$PI_PROFILE` profiles.
`$PI_CODING_AGENT_DIR` overrides the agent directory for the default profile
-only β€” named profiles ignore it, matching Pi's own resolution."#
+only β€” named profiles ignore it, matching oh-my-pi's own resolution."#
)]
Install,
/// Remove the activity tracking hook
#[command(
- after_long_help = r#"Removes the Worktrunk hook from Pi's active user hook directory.
+ after_long_help = r#"Removes the Worktrunk hook from oh-my-pi's active user hook directory.
## Examples
```console
-$ wt config plugins pi uninstall
+$ wt config plugins omp uninstall
```"#
)]
Uninstall,
@@ -378,6 +424,32 @@ $ wt config plugins codex uninstall
action: ConfigPluginsCodexCommand,
},
+ /// oh-my-pi activity hook
+ #[command(
+ after_long_help = r#"Activity tracking hook β€” shows status markers in `wt list`:
+- πŸ€– β€” agent is working
+- πŸ’¬ β€” agent is waiting for input
+
+oh-my-pi's `session_shutdown` event clears the marker when the session exits.
+
+## Examples
+
+```console
+$ wt config plugins omp install
+$ wt config plugins omp uninstall
+```
+
+## Hook location
+
+Written to `~/.omp/agent/hooks/pre/worktrunk.ts`. Honors `$PI_CONFIG_DIR`,
+the active `$OMP_PROFILE` / `$PI_PROFILE` profile, and `$PI_CODING_AGENT_DIR`
+for the default profile."#
+ )]
+ Omp {
+ #[command(subcommand)]
+ action: ConfigPluginsOmpCommand,
+ },
+
/// OpenCode plugin
#[command(
after_long_help = r#"Activity tracking plugin β€” shows status markers in `wt list`:
@@ -402,9 +474,9 @@ config precedence: `$OPENCODE_CONFIG_DIR` > `$XDG_CONFIG_HOME/opencode` >
action: ConfigPluginsOpencodeCommand,
},
- /// Pi / oh-my-pi activity hook
+ /// Pi activity extension
#[command(
- after_long_help = r#"Activity tracking hook β€” shows status markers in `wt list`:
+ after_long_help = r#"Activity tracking extension β€” shows status markers in `wt list`:
- πŸ€– β€” agent is working
- πŸ’¬ β€” agent is waiting for input
@@ -415,7 +487,12 @@ Pi's `session_shutdown` event clears the marker when the session exits.
```console
$ wt config plugins pi install
$ wt config plugins pi uninstall
-```"#
+```
+
+## Extension location
+
+Written to `~/.pi/agent/extensions/worktrunk.ts`. `$PI_CODING_AGENT_DIR`
+replaces the agent directory."#
)]
Pi {
#[command(subcommand)]
@@ -740,14 +817,16 @@ $ wt config alias dry-run deploy -- --env=staging
- **claude** β€” Claude Code plugin (activity tracking + statusline)
- **codex** β€” Codex plugin (Worktrunk configuration skill)
+- **omp** β€” oh-my-pi hook (activity tracking)
- **opencode** β€” OpenCode plugin (activity tracking)
-- **pi** β€” Pi / oh-my-pi plugin (activity tracking)
+- **pi** β€” Pi extension (activity tracking)
## Examples
```console
$ wt config plugins claude install
$ wt config plugins codex install
+$ wt config plugins omp install
$ wt config plugins opencode install
$ wt config plugins pi install
```"#
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 69e38314a..da6cb9025 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -6,9 +6,9 @@ mod step;
pub(crate) use config::{
ApprovalsCommand, CacheAction, CiStatusAction, ConfigAliasCommand, ConfigCommand,
ConfigPluginsClaudeCommand, ConfigPluginsCodexCommand, ConfigPluginsCommand,
- ConfigPluginsOpencodeCommand, ConfigPluginsPiCommand, ConfigShellCommand, DefaultBranchAction,
- GlobalFormatFlag, HintsAction, LogsAction, MarkerAction, PreviousBranchAction, StateCommand,
- StateWrite, VarsAction,
+ ConfigPluginsOmpCommand, ConfigPluginsOpencodeCommand, ConfigPluginsPiCommand,
+ ConfigShellCommand, DefaultBranchAction, GlobalFormatFlag, HintsAction, LogsAction,
+ MarkerAction, PreviousBranchAction, StateCommand, StateWrite, VarsAction,
};
pub(crate) use hook::{HOOK_TYPE_NAMES, HookCommand, HookOptions, parse_hook_type};
pub(crate) use list::ListSubcommand;
diff --git a/src/commands/config/mod.rs b/src/commands/config/mod.rs
index c4a43d41e..9d54d8aa3 100644
--- a/src/commands/config/mod.rs
+++ b/src/commands/config/mod.rs
@@ -7,6 +7,7 @@ mod approvals;
mod codex;
mod create;
mod hints;
+mod omp;
pub mod opencode;
mod pi;
mod plugins;
@@ -20,6 +21,7 @@ pub use approvals::{add_approvals, clear_approvals, list_approvals};
pub use codex::{handle_codex_install, handle_codex_uninstall};
pub use create::handle_config_create;
pub use hints::{handle_hints_clear, handle_hints_get};
+pub use omp::{handle_omp_install, handle_omp_uninstall};
pub use opencode::{handle_opencode_install, handle_opencode_uninstall};
pub use pi::{handle_pi_install, handle_pi_uninstall};
pub use plugins::{
diff --git a/src/commands/config/omp.rs b/src/commands/config/omp.rs
new file mode 100644
index 000000000..c7c09b23f
--- /dev/null
+++ b/src/commands/config/omp.rs
@@ -0,0 +1,73 @@
+//! oh-my-pi (`omp`) activity-hook installation.
+//!
+//! oh-my-pi is a Pi-derived agent that loads user hooks from its
+//! profile-aware agent directory at `hooks/pre/worktrunk.ts`. earendil-works
+//! Pi is a separate agent with a different loader and API β€” for that one see
+//! [`super::pi`].
+
+use std::path::PathBuf;
+
+use anyhow::{Context, Result};
+
+/// The hook source, embedded at compile time.
+const HOOK_SOURCE: &str = include_str!("../../../dev/omp-hook.ts");
+
+fn active_profile() -> Option<String> {
+ let value = std::env::var("OMP_PROFILE")
+ .ok()
+ .or_else(|| std::env::var("PI_PROFILE").ok())?;
+ let profile = value.trim();
+ (!profile.is_empty() && profile != "default").then(|| profile.to_owned())
+}
+
+fn omp_agent_dir() -> Result<PathBuf> {
+ if let Some(path) = std::env::var("PI_CODING_AGENT_DIR")
+ .ok()
+ .filter(|value| !value.is_empty())
+ // Named profiles ignore `PI_CODING_AGENT_DIR` upstream, so the
+ // override applies to the default profile only.
+ .filter(|_| active_profile().is_none())
+ {
+ return Ok(PathBuf::from(path));
+ }
+
+ let home = worktrunk::path::home_dir().context("Could not determine home directory")?;
+ let config_dir = std::env::var("PI_CONFIG_DIR")
+ .ok()
+ .filter(|value| !value.is_empty())
+ .unwrap_or_else(|| ".omp".to_owned());
+ let root = home.join(config_dir);
+
+ Ok(match active_profile() {
+ Some(profile) => root.join("profiles").join(profile).join("agent"),
+ None => root.join("agent"),
+ })
+}
+
+pub fn plugin_path() -> Result<PathBuf> {
+ Ok(omp_agent_dir()?
+ .join("hooks")
+ .join("pre")
+ .join("worktrunk.ts"))
+}
+
+pub fn is_plugin_installed() -> bool {
+ plugin_path()
+ .ok()
+ .and_then(|p| std::fs::read_to_string(p).ok())
+ .is_some_and(|content| content == HOOK_SOURCE)
+}
+
+pub fn plugin_file_exists() -> bool {
+ plugin_path().map(|p| p.exists()).unwrap_or(false)
+}
+
+pub fn handle_omp_install(yes: bool) -> Result<()> {
+ let target = plugin_path()?;
+ super::install_file_plugin("oh-my-pi", &target, HOOK_SOURCE, yes)
+}
+
+pub fn handle_omp_uninstall(yes: bool) -> Result<()> {
+ let target = plugin_path()?;
+ super::uninstall_file_plugin("oh-my-pi", &target, yes)
+}
diff --git a/src/commands/config/opencode.rs b/src/commands/config/opencode.rs
index 352f182e4..a22711006 100644
--- a/src/commands/config/opencode.rs
+++ b/src/commands/config/opencode.rs
@@ -24,7 +24,7 @@ const PLUGIN_SOURCE: &str = include_str!("../../../dev/opencode-plugin.ts");
/// here β€” it would put the plugin in the wrong place on macOS.
///
/// `OPENCODE_CONFIG_DIR` reads an exported-but-empty value as unset, matching
-/// `CLAUDE_CONFIG_DIR` in `config::show` and `PI_CONFIG_DIR` in `config::pi`.
+/// `CLAUDE_CONFIG_DIR` in `config::show` and `PI_CONFIG_DIR` in `config::omp`.
/// An empty value taken at face value yields the relative path `plugins/`, so
/// the install writes the plugin into whatever directory `wt` was run from.
///
diff --git a/src/commands/config/pi.rs b/src/commands/config/pi.rs
index 2ba9def7c..94aa8ecd8 100644
--- a/src/commands/config/pi.rs
+++ b/src/commands/config/pi.rs
@@ -1,58 +1,42 @@
-//! Pi / oh-my-pi activity-hook installation.
+//! Pi (earendil-works/pi) activity-extension installation.
//!
-//! Installs the embedded hook factory under Pi's profile-aware user agent
-//! directory at `hooks/pre/worktrunk.ts`.
+//! Installs the embedded extension factory under Pi's user agent directory at
+//! `extensions/worktrunk.ts`, which Pi scans on startup. `$PI_CODING_AGENT_DIR`
+//! replaces the default `~/.pi/agent` outright β€” Pi has no profile concept.
+//!
+//! oh-my-pi (`omp`) is a separate agent, with its own config root and hook
+//! API; it has its own command β€” see [`super::omp`].
use std::path::PathBuf;
use anyhow::{Context, Result};
+use color_print::cformat;
+use worktrunk::styling::{eprintln, hint_message, warning_message};
-const PLUGIN_SOURCE: &str = include_str!("../../../dev/pi-plugin.ts");
-
-fn active_profile() -> Option<String> {
- let value = std::env::var("OMP_PROFILE")
- .ok()
- .or_else(|| std::env::var("PI_PROFILE").ok())?;
- let profile = value.trim();
- (!profile.is_empty() && profile != "default").then(|| profile.to_owned())
-}
+/// The extension source, embedded at compile time.
+const EXTENSION_SOURCE: &str = include_str!("../../../dev/pi-extension.ts");
fn pi_agent_dir() -> Result<PathBuf> {
if let Some(path) = std::env::var("PI_CODING_AGENT_DIR")
.ok()
.filter(|value| !value.is_empty())
- // Named profiles ignore `PI_CODING_AGENT_DIR` upstream, so the
- // override applies to the default profile only.
- .filter(|_| active_profile().is_none())
{
return Ok(PathBuf::from(path));
}
let home = worktrunk::path::home_dir().context("Could not determine home directory")?;
- let config_dir = std::env::var("PI_CONFIG_DIR")
- .ok()
- .filter(|value| !value.is_empty())
- .unwrap_or_else(|| ".omp".to_owned());
- let root = home.join(config_dir);
-
- Ok(match active_profile() {
- Some(profile) => root.join("profiles").join(profile).join("agent"),
- None => root.join("agent"),
- })
+ Ok(home.join(".pi").join("agent"))
}
pub fn plugin_path() -> Result<PathBuf> {
- Ok(pi_agent_dir()?
- .join("hooks")
- .join("pre")
- .join("worktrunk.ts"))
+ Ok(pi_agent_dir()?.join("extensions").join("worktrunk.ts"))
}
pub fn is_plugin_installed() -> bool {
plugin_path()
.ok()
.and_then(|p| std::fs::read_to_string(p).ok())
- .is_some_and(|content| content == PLUGIN_SOURCE)
+ .is_some_and(|content| content == EXTENSION_SOURCE)
}
pub fn plugin_file_exists() -> bool {
@@ -61,10 +45,41 @@ pub fn plugin_file_exists() -> bool {
pub fn handle_pi_install(yes: bool) -> Result<()> {
let target = plugin_path()?;
- super::install_file_plugin("Pi", &target, PLUGIN_SOURCE, yes)
+ // This command meant oh-my-pi until the split, so someone who has oh-my-pi
+ // and no Pi has most likely reached the wrong one. Say so here because
+ // nothing downstream will: `wt config show` gates its PI section on
+ // `which pi`, so the extension this writes stays invisible to them.
+ if super::show::is_omp_available() && !super::show::is_pi_available() {
+ eprintln!(
+ "{}",
+ warning_message(cformat!(
+ "oh-my-pi is on PATH and Pi is not; for the oh-my-pi hook, run <bold>wt config plugins omp install</>"
+ ))
+ );
+ // The blank belongs to the prompt below, which `install_file_plugin`
+ // skips when the extension is already there.
+ if !yes && !is_plugin_installed() {
+ eprintln!();
+ }
+ }
+ super::install_file_plugin("Pi", &target, EXTENSION_SOURCE, yes)
}
pub fn handle_pi_uninstall(yes: bool) -> Result<()> {
let target = plugin_path()?;
- super::uninstall_file_plugin("Pi", &target, yes)
+ // Until this split, `wt config plugins pi uninstall` removed the oh-my-pi
+ // hook. Someone repeating that command finds nothing at Pi's path, so the
+ // bare "Plugin not installed" reads as a completed removal while their
+ // hook sits untouched under oh-my-pi. Name the command that removes it.
+ let omp_hook_left_behind = !target.exists() && super::omp::plugin_file_exists();
+ super::uninstall_file_plugin("Pi", &target, yes)?;
+ if omp_hook_left_behind {
+ eprintln!(
+ "{}",
+ hint_message(cformat!(
+ "An oh-my-pi hook is installed; to remove it, run <underline>wt config plugins omp uninstall</>"
+ ))
+ );
+ }
+ Ok(())
}
diff --git a/src/commands/config/show.rs b/src/commands/config/show.rs
index 7a24cd107..788ca4035 100644
--- a/src/commands/config/show.rs
+++ b/src/commands/config/show.rs
@@ -86,13 +86,34 @@ pub fn handle_config_show(full: bool, format: SwitchFormat) -> anyhow::Result<()
// Render OpenCode status (only when opencode CLI is available)
if is_opencode_available() {
show_output.push('\n');
- render_opencode_status(&mut show_output)?;
+ show_output.push_str(&file_plugin_status(
+ "OPENCODE",
+ "wt config plugins opencode install",
+ super::opencode::is_plugin_installed(),
+ super::opencode::plugin_file_exists(),
+ ));
+ }
+
+ // Render oh-my-pi status (only when the oh-my-pi CLI is available)
+ if is_omp_available() {
+ show_output.push('\n');
+ show_output.push_str(&file_plugin_status(
+ "OH-MY-PI",
+ "wt config plugins omp install",
+ super::omp::is_plugin_installed(),
+ super::omp::plugin_file_exists(),
+ ));
}
// Render Pi status (only when the Pi CLI is available)
if is_pi_available() {
show_output.push('\n');
- render_pi_status(&mut show_output)?;
+ show_output.push_str(&file_plugin_status(
+ "PI",
+ "wt config plugins pi install",
+ super::pi::is_plugin_installed(),
+ super::pi::plugin_file_exists(),
+ ));
}
// Render Gemini status (only when gemini CLI is available)
@@ -409,70 +430,47 @@ fn is_opencode_available() -> bool {
}
/// Check if the Pi coding agent CLI is available.
-fn is_pi_available() -> bool {
+pub(super) fn is_pi_available() -> bool {
if let Ok(val) = std::env::var("WORKTRUNK_TEST_PI_INSTALLED") {
return val == "1";
}
- which::which("omp").is_ok()
+ which::which("pi").is_ok()
}
-/// Render OPENCODE section (plugin status).
-/// Caller must check `is_opencode_available()` first.
-fn render_opencode_status(out: &mut String) -> anyhow::Result<()> {
- writeln!(out, "{}", format_heading("OPENCODE", None))?;
-
- // Plugin status
- let plugin_installed = super::opencode::is_plugin_installed();
- let plugin_exists = super::opencode::plugin_file_exists();
- if plugin_installed {
- writeln!(out, "{}", success_message("Plugin installed"))?;
- } else if plugin_exists {
- writeln!(
- out,
- "{}",
- hint_message(cformat!(
- "Plugin outdated. To update, run <underline>wt config plugins opencode install</>"
- ))
- )?;
- } else {
- writeln!(
- out,
- "{}",
- hint_message(cformat!(
- "Plugin not installed. To install, run <underline>wt config plugins opencode install</>"
- ))
- )?;
+/// Check if the oh-my-pi coding agent CLI is available.
+pub(super) fn is_omp_available() -> bool {
+ if let Ok(val) = std::env::var("WORKTRUNK_TEST_OMP_INSTALLED") {
+ return val == "1";
}
-
- Ok(())
+ which::which("omp").is_ok()
}
-/// Render PI section (plugin status).
-/// Caller must check `is_pi_available()` first.
-fn render_pi_status(out: &mut String) -> anyhow::Result<()> {
- writeln!(out, "{}", format_heading("PI", None))?;
-
- if super::pi::is_plugin_installed() {
- writeln!(out, "{}", success_message("Plugin installed"))?;
- } else if super::pi::plugin_file_exists() {
- writeln!(
- out,
- "{}",
- hint_message(cformat!(
- "Plugin outdated. To update, run <underline>wt config plugins pi install</>"
- ))
- )?;
+/// The section for a plugin the installer writes as a plain file: a heading,
+/// then one line of status, with the trailing newline the caller would add.
+///
+/// OpenCode, Pi, and oh-my-pi each install one file and each report the same
+/// three states, differing only in the heading and the command that writes the
+/// file β€” so they share this rather than keeping a copy apiece. Callers check
+/// their own `is_*_available()` first, and answer `installed` / `file_exists`
+/// from their own module.
+fn file_plugin_status(
+ heading: &str,
+ install_command: &str,
+ installed: bool,
+ file_exists: bool,
+) -> String {
+ let status = if installed {
+ success_message("Plugin installed")
+ } else if file_exists {
+ hint_message(cformat!(
+ "Plugin outdated. To update, run <underline>{install_command}</>"
+ ))
} else {
- writeln!(
- out,
- "{}",
- hint_message(cformat!(
- "Plugin not installed. To install, run <underline>wt config plugins pi install</>"
- ))
- )?;
- }
-
- Ok(())
+ hint_message(cformat!(
+ "Plugin not installed. To install, run <underline>{install_command}</>"
+ ))
+ };
+ format!("{}\n{status}\n", format_heading(heading, None))
}
/// Check if Gemini CLI is available
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index c4f74771f..13cfacb58 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -38,10 +38,11 @@ pub(crate) use config::{
handle_cache_get, handle_claude_install, handle_claude_install_statusline,
handle_claude_uninstall, handle_codex_install, handle_codex_uninstall, handle_config_create,
handle_config_show, handle_config_update, handle_hints_clear, handle_hints_get,
- handle_logs_list, handle_logs_profile, handle_opencode_install, handle_opencode_uninstall,
- handle_pi_install, handle_pi_uninstall, handle_state_clear, handle_state_clear_all,
- handle_state_get, handle_state_set, handle_state_show, handle_vars_clear, handle_vars_get,
- handle_vars_list, handle_vars_set, list_approvals,
+ handle_logs_list, handle_logs_profile, handle_omp_install, handle_omp_uninstall,
+ handle_opencode_install, handle_opencode_uninstall, handle_pi_install, handle_pi_uninstall,
+ handle_state_clear, handle_state_clear_all, handle_state_get, handle_state_set,
+ handle_state_show, handle_vars_clear, handle_vars_get, handle_vars_list, handle_vars_set,
+ list_approvals,
};
pub(crate) use configure_shell::{
handle_configure_shell, handle_show_theme, handle_unconfigure_shell,
diff --git a/src/main.rs b/src/main.rs
index 4ee38b0f8..3a8326ab3 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -48,22 +48,22 @@ use commands::{
handle_claude_uninstall, handle_codex_install, handle_codex_uninstall, handle_completions,
handle_config_create, handle_config_show, handle_config_update, handle_configure_shell,
handle_custom_command, handle_hints_clear, handle_hints_get, handle_hook_show, handle_init,
- handle_list, handle_logs_list, handle_logs_profile, handle_merge, handle_opencode_install,
- handle_opencode_uninstall, handle_pi_install, handle_pi_uninstall, handle_promote,
- handle_rebase, handle_remove_command, handle_show_theme, handle_squash, handle_state_clear,
- handle_state_clear_all, handle_state_get, handle_state_set, handle_state_show,
- handle_switch_command, handle_unconfigure_shell, handle_vars_clear, handle_vars_get,
- handle_vars_list, handle_vars_set, list_approvals, run_hook, step_commit, step_copy_ignored,
- step_diff, step_eval, step_for_each, step_prune, step_relocate, step_tether,
+ handle_list, handle_logs_list, handle_logs_profile, handle_merge, handle_omp_install,
+ handle_omp_uninstall, handle_opencode_install, handle_opencode_uninstall, handle_pi_install,
+ handle_pi_uninstall, handle_promote, handle_rebase, handle_remove_command, handle_show_theme,
+ handle_squash, handle_state_clear, handle_state_clear_all, handle_state_get, handle_state_set,
+ handle_state_show, handle_switch_command, handle_unconfigure_shell, handle_vars_clear,
+ handle_vars_get, handle_vars_list, handle_vars_set, list_approvals, run_hook, step_commit,
+ step_copy_ignored, step_diff, step_eval, step_for_each, step_prune, step_relocate, step_tether,
};
use cli::{
ApprovalsCommand, CacheAction, CiStatusAction, Cli, Commands, ConfigAliasCommand,
ConfigCommand, ConfigPluginsClaudeCommand, ConfigPluginsCodexCommand, ConfigPluginsCommand,
- ConfigPluginsOpencodeCommand, ConfigPluginsPiCommand, ConfigShellCommand, DefaultBranchAction,
- GlobalFormatFlag, HintsAction, HookCommand, HookOptions, ListArgs, ListSubcommand, LogsAction,
- MarkerAction, MergeArgs, PreviousBranchAction, StateCommand, StateWrite, StepCommand,
- SwitchFormat, VarsAction,
+ ConfigPluginsOmpCommand, ConfigPluginsOpencodeCommand, ConfigPluginsPiCommand,
+ ConfigShellCommand, DefaultBranchAction, GlobalFormatFlag, HintsAction, HookCommand,
+ HookOptions, ListArgs, ListSubcommand, LogsAction, MarkerAction, MergeArgs,
+ PreviousBranchAction, StateCommand, StateWrite, StepCommand, SwitchFormat, VarsAction,
};
/// Render a clap error to stderr, appending a wt-specific nested-subcommand
@@ -665,6 +665,10 @@ fn handle_plugins_command(action: ConfigPluginsCommand, yes: bool) -> anyhow::Re
ConfigPluginsCodexCommand::Install => handle_codex_install(yes),
ConfigPluginsCodexCommand::Uninstall => handle_codex_uninstall(yes),
},
+ ConfigPluginsCommand::Omp { action } => match action {
+ ConfigPluginsOmpCommand::Install => handle_omp_install(yes),
+ ConfigPluginsOmpCommand::Uninstall => handle_omp_uninstall(yes),
+ },
ConfigPluginsCommand::Opencode { action } => match action {
ConfigPluginsOpencodeCommand::Install => handle_opencode_install(yes),
ConfigPluginsOpencodeCommand::Uninstall => handle_opencode_uninstall(yes),
diff --git a/src/testing/mod.rs b/src/testing/mod.rs
index b88cf48ec..722baf1d9 100644
--- a/src/testing/mod.rs
+++ b/src/testing/mod.rs
@@ -2356,14 +2356,14 @@ impl TestRepo {
.write(mock_bin);
}
- /// Make `claude`, `codex`, `opencode`, `omp`, and `gemini` resolvable on `PATH`.
+ /// Make `claude`, `codex`, `opencode`, `omp`, `pi`, and `gemini` resolvable on `PATH`.
///
/// The `setup_mock_*_installed` helpers force detection through the
/// `WORKTRUNK_TEST_*_INSTALLED` env overrides, so the `which::which`
/// lookup inside each `is_*_available()` never runs under test. This
/// helper instead drops those overrides and prepends real mock
/// executables, exercising the production PATH-detection path for all
- /// five AI CLIs at once. Call `setup_mock_ci_tools_unauthenticated()`
+ /// six AI CLIs at once. Call `setup_mock_ci_tools_unauthenticated()`
/// first to create the mock bin directory.
pub fn setup_mock_clis_on_path(&mut self) {
let mock_bin = self
@@ -2373,7 +2373,7 @@ impl TestRepo {
// The mocks answer nothing, so each `--json` listing `wt config show`
// asks for fails and the section renders its "not installed" hint.
// What this test covers is the `which::which` detection above it.
- for cli in ["claude", "codex", "opencode", "omp", "gemini"] {
+ for cli in ["claude", "codex", "opencode", "omp", "pi", "gemini"] {
MockConfig::new(cli).write(mock_bin);
}
self.detect_clis_via_path = true;
@@ -3035,6 +3035,7 @@ impl TestRepo {
"WORKTRUNK_TEST_CODEX_INSTALLED",
"WORKTRUNK_TEST_OPENCODE_INSTALLED",
"WORKTRUNK_TEST_PI_INSTALLED",
+ "WORKTRUNK_TEST_OMP_INSTALLED",
"WORKTRUNK_TEST_GEMINI_INSTALLED",
] {
cmd.env_remove(var);
diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rs
index 589b6db2b..6ec421cbf 100644
--- a/tests/integration_tests/config_show.rs
+++ b/tests/integration_tests/config_show.rs
@@ -2412,9 +2412,9 @@ fn test_config_show_opencode_plugin_outdated(mut repo: TestRepo, temp_home: Temp
#[rstest]
#[case(None, "Plugin not installed")]
-#[case(Some("// outdated plugin content\n"), "Plugin outdated")]
-#[case(Some(include_str!("../../dev/pi-plugin.ts")), "Plugin installed")]
-fn test_config_show_pi_plugin_status(
+#[case(Some("// outdated hook content\n"), "Plugin outdated")]
+#[case(Some(include_str!("../../dev/omp-hook.ts")), "Plugin installed")]
+fn test_config_show_omp_hook_status(
mut repo: TestRepo,
temp_home: TempDir,
#[case] plugin_content: Option<&str>,
@@ -2431,20 +2431,82 @@ fn test_config_show_pi_plugin_status(
fs::create_dir_all(&global_config_dir).unwrap();
fs::write(global_config_dir.join("config.toml"), "").unwrap();
+ let mut cmd = repo.wt_command();
+ cmd.args(["config", "show"]).current_dir(repo.root_path());
+ set_temp_home_env(&mut cmd, temp_home.path());
+ set_xdg_config_path(&mut cmd, temp_home.path());
+ cmd.env("WORKTRUNK_TEST_OMP_INSTALLED", "1");
+ cmd.env("WORKTRUNK_TEST_PI_INSTALLED", "0");
+
+ let output = cmd.output().expect("config show should run");
+ assert!(output.status.success(), "config show failed: {output:?}");
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ assert!(
+ stdout.contains("OH-MY-PI"),
+ "missing oh-my-pi section: {stdout}"
+ );
+ assert!(
+ stdout.contains(expected_status),
+ "missing oh-my-pi status: {stdout}"
+ );
+ // Installed is the one state with nothing to do, so it carries no hint.
+ if expected_status != "Plugin installed" {
+ assert!(
+ stdout.contains("wt config plugins omp install"),
+ "missing oh-my-pi install hint: {stdout}"
+ );
+ }
+}
+
+#[rstest]
+#[case(None, "Plugin not installed")]
+#[case(Some("// outdated extension content\n"), "Plugin outdated")]
+#[case(Some(include_str!("../../dev/pi-extension.ts")), "Plugin installed")]
+fn test_config_show_pi_extension_status(
+ mut repo: TestRepo,
+ temp_home: TempDir,
+ #[case] plugin_content: Option<&str>,
+ #[case] expected_status: &str,
+) {
+ repo.setup_mock_ci_tools_unauthenticated();
+ let plugin_path = temp_home.path().join(".pi/agent/extensions/worktrunk.ts");
+ if let Some(content) = plugin_content {
+ fs::create_dir_all(plugin_path.parent().unwrap()).unwrap();
+ fs::write(&plugin_path, content).unwrap();
+ }
+
+ let global_config_dir = temp_home.path().join(".config").join("worktrunk");
+ fs::create_dir_all(&global_config_dir).unwrap();
+ fs::write(global_config_dir.join("config.toml"), "").unwrap();
+
let mut cmd = repo.wt_command();
cmd.args(["config", "show"]).current_dir(repo.root_path());
set_temp_home_env(&mut cmd, temp_home.path());
set_xdg_config_path(&mut cmd, temp_home.path());
cmd.env("WORKTRUNK_TEST_PI_INSTALLED", "1");
+ // Each Pi-family section renders from its own agent, so pin the other
+ // off rather than leaving it to the developer's PATH.
+ cmd.env("WORKTRUNK_TEST_OMP_INSTALLED", "0");
let output = cmd.output().expect("config show should run");
assert!(output.status.success(), "config show failed: {output:?}");
let stdout = String::from_utf8_lossy(&output.stdout);
assert!(stdout.contains("PI"), "missing Pi section: {stdout}");
+ assert!(
+ !stdout.contains("OH-MY-PI"),
+ "oh-my-pi section should not render: {stdout}"
+ );
assert!(
stdout.contains(expected_status),
"missing Pi status: {stdout}"
);
+ // Installed is the one state with nothing to do, so it carries no hint.
+ if expected_status != "Plugin installed" {
+ assert!(
+ stdout.contains("wt config plugins pi install"),
+ "missing Pi install hint: {stdout}"
+ );
+ }
}
#[rstest]
@@ -2857,17 +2919,17 @@ fn test_opencode_uninstall_prompt_declined(temp_home: TempDir) {
}
// =============================================================================
-// Pi plugin install/uninstall
+// oh-my-pi hook install/uninstall
// =============================================================================
#[rstest]
-fn test_pi_install_creates_profile_aware_hook(temp_home: TempDir) {
+fn test_omp_install_creates_profile_aware_hook(temp_home: TempDir) {
let settings = setup_home_snapshot_settings(&temp_home);
settings.bind(|| {
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env("OMP_PROFILE", "research");
- cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+ cmd.args(["config", "plugins", "omp", "install", "--yes"]);
assert_cmd_snapshot!(cmd);
});
@@ -2875,19 +2937,19 @@ fn test_pi_install_creates_profile_aware_hook(temp_home: TempDir) {
let canonical_home =
crate::common::canonicalize(temp_home.path()).unwrap_or_else(|_| temp_home.path().into());
let plugin_path = canonical_home.join(".omp/profiles/research/agent/hooks/pre/worktrunk.ts");
- let content = fs::read_to_string(&plugin_path).expect("Pi hook should be installed");
+ let content = fs::read_to_string(&plugin_path).expect("oh-my-pi hook should be installed");
assert!(content.contains("agent_start"));
assert!(content.contains("agent_end"));
assert!(content.contains("session_shutdown"));
}
#[rstest]
-fn test_pi_install_honors_agent_dir_override(temp_home: TempDir) {
- let agent_dir = temp_home.path().join("custom-pi-agent");
+fn test_omp_install_honors_agent_dir_override(temp_home: TempDir) {
+ let agent_dir = temp_home.path().join("custom-omp-agent");
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env("PI_CODING_AGENT_DIR", &agent_dir);
- cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+ cmd.args(["config", "plugins", "omp", "install", "--yes"]);
let output = cmd.output().expect("install command should run");
assert!(
@@ -2900,13 +2962,13 @@ fn test_pi_install_honors_agent_dir_override(temp_home: TempDir) {
}
#[rstest]
-fn test_pi_named_profile_ignores_agent_dir_override(temp_home: TempDir) {
- let agent_dir = temp_home.path().join("custom-pi-agent");
+fn test_omp_named_profile_ignores_agent_dir_override(temp_home: TempDir) {
+ let agent_dir = temp_home.path().join("custom-omp-agent");
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env("OMP_PROFILE", "research");
cmd.env("PI_CODING_AGENT_DIR", &agent_dir);
- cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+ cmd.args(["config", "plugins", "omp", "install", "--yes"]);
let output = cmd.output().expect("install command should run");
assert!(output.status.success(), "install failed: {output:?}");
@@ -2920,13 +2982,13 @@ fn test_pi_named_profile_ignores_agent_dir_override(temp_home: TempDir) {
}
#[rstest]
-fn test_pi_install_honors_pi_profile_and_config_dir(temp_home: TempDir) {
+fn test_omp_install_honors_profile_and_config_dir(temp_home: TempDir) {
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
cmd.env_remove("OMP_PROFILE");
cmd.env("PI_PROFILE", "research");
cmd.env("PI_CONFIG_DIR", ".pi-config");
- cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+ cmd.args(["config", "plugins", "omp", "install", "--yes"]);
let output = cmd.output().expect("install command should run");
assert!(output.status.success(), "install failed: {output:?}");
@@ -2939,11 +3001,11 @@ fn test_pi_install_honors_pi_profile_and_config_dir(temp_home: TempDir) {
}
#[rstest]
-fn test_pi_install_is_idempotent(temp_home: TempDir) {
+fn test_omp_install_is_idempotent(temp_home: TempDir) {
for _ in 0..2 {
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
- cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+ cmd.args(["config", "plugins", "omp", "install", "--yes"]);
let output = cmd.output().expect("install command should run");
assert!(output.status.success(), "install failed: {output:?}");
}
@@ -2951,15 +3013,15 @@ fn test_pi_install_is_idempotent(temp_home: TempDir) {
let plugin_path = temp_home.path().join(".omp/agent/hooks/pre/worktrunk.ts");
assert_eq!(
fs::read_to_string(plugin_path).unwrap(),
- include_str!("../../dev/pi-plugin.ts")
+ include_str!("../../dev/omp-hook.ts")
);
}
#[rstest]
-fn test_pi_install_prompt_declined(temp_home: TempDir) {
+fn test_omp_install_prompt_declined(temp_home: TempDir) {
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
- cmd.args(["config", "plugins", "pi", "install"]);
+ cmd.args(["config", "plugins", "omp", "install"]);
let output = cmd.output().expect("install command should run");
assert!(output.status.success(), "install failed: {output:?}");
@@ -2972,17 +3034,17 @@ fn test_pi_install_prompt_declined(temp_home: TempDir) {
}
#[rstest]
-fn test_pi_uninstall_removes_hook(temp_home: TempDir) {
+fn test_omp_uninstall_removes_hook(temp_home: TempDir) {
let agent_dir = temp_home.path().join(".omp/agent");
let plugin_path = agent_dir.join("hooks/pre/worktrunk.ts");
fs::create_dir_all(plugin_path.parent().unwrap()).unwrap();
- fs::write(&plugin_path, include_str!("../../dev/pi-plugin.ts")).unwrap();
+ fs::write(&plugin_path, include_str!("../../dev/omp-hook.ts")).unwrap();
let settings = setup_home_snapshot_settings(&temp_home);
settings.bind(|| {
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
- cmd.args(["config", "plugins", "pi", "uninstall", "--yes"]);
+ cmd.args(["config", "plugins", "omp", "uninstall", "--yes"]);
assert_cmd_snapshot!(cmd);
});
@@ -2990,6 +3052,208 @@ fn test_pi_uninstall_removes_hook(temp_home: TempDir) {
assert!(!plugin_path.exists());
}
+#[rstest]
+fn test_omp_uninstall_missing_is_a_no_op(temp_home: TempDir) {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.args(["config", "plugins", "omp", "uninstall", "--yes"]);
+
+ let output = cmd.output().expect("uninstall command should run");
+ assert!(output.status.success(), "uninstall failed: {output:?}");
+}
+
+#[rstest]
+fn test_omp_uninstall_prompt_declined(temp_home: TempDir) {
+ let plugin_path = temp_home.path().join(".omp/agent/hooks/pre/worktrunk.ts");
+ fs::create_dir_all(plugin_path.parent().unwrap()).unwrap();
+ fs::write(&plugin_path, include_str!("../../dev/omp-hook.ts")).unwrap();
+
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.args(["config", "plugins", "omp", "uninstall"]);
+
+ let output = cmd.output().expect("uninstall command should run");
+ assert!(output.status.success(), "uninstall failed: {output:?}");
+ assert!(plugin_path.exists());
+}
+
+// =============================================================================
+// Pi extension install/uninstall
+// =============================================================================
+
+#[rstest]
+fn test_pi_install_writes_extension(temp_home: TempDir) {
+ let settings = setup_home_snapshot_settings(&temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ // `pi install` redirects when only oh-my-pi resolves, so pin both
+ // rather than letting the developer's PATH decide this snapshot.
+ cmd.env("WORKTRUNK_TEST_PI_INSTALLED", "1");
+ cmd.env("WORKTRUNK_TEST_OMP_INSTALLED", "0");
+ cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+
+ assert_cmd_snapshot!(cmd);
+ });
+
+ let canonical_home =
+ crate::common::canonicalize(temp_home.path()).unwrap_or_else(|_| temp_home.path().into());
+ let extension_path = canonical_home.join(".pi/agent/extensions/worktrunk.ts");
+ let content = fs::read_to_string(&extension_path).expect("Pi extension should be installed");
+ assert!(content.contains("@earendil-works/pi-coding-agent"));
+ assert!(content.contains("agent_start"));
+ // `agent_settled`, not `agent_end`: Pi documents the former as the event a
+ // status integration waits for, because it may still auto-retry after the
+ // latter. oh-my-pi's hook API has no equivalent and keeps `agent_end`.
+ assert!(content.contains(r#"pi.on("agent_settled""#));
+ assert!(content.contains("session_shutdown"));
+}
+
+#[rstest]
+fn test_pi_install_honors_agent_dir_override(temp_home: TempDir) {
+ let agent_dir = temp_home.path().join("custom-pi-agent");
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.env("PI_CODING_AGENT_DIR", &agent_dir);
+ cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+
+ let output = cmd.output().expect("install command should run");
+ assert!(output.status.success(), "install failed: {output:?}");
+ assert!(agent_dir.join("extensions/worktrunk.ts").exists());
+}
+
+/// Pi has no profile concept: the oh-my-pi profile variables must not move the
+/// extension into a `profiles/` subtree.
+#[rstest]
+fn test_pi_install_ignores_omp_profile_variables(temp_home: TempDir) {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.env("OMP_PROFILE", "research");
+ cmd.env("PI_PROFILE", "research");
+ cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+
+ let output = cmd.output().expect("install command should run");
+ assert!(output.status.success(), "install failed: {output:?}");
+ assert!(
+ temp_home
+ .path()
+ .join(".pi/agent/extensions/worktrunk.ts")
+ .exists()
+ );
+ assert!(!temp_home.path().join(".pi/agent/profiles").exists());
+}
+
+#[rstest]
+fn test_pi_install_is_idempotent(temp_home: TempDir) {
+ for _ in 0..2 {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+ let output = cmd.output().expect("install command should run");
+ assert!(output.status.success(), "install failed: {output:?}");
+ }
+
+ let extension_path = temp_home.path().join(".pi/agent/extensions/worktrunk.ts");
+ assert_eq!(
+ fs::read_to_string(extension_path).unwrap(),
+ include_str!("../../dev/pi-extension.ts")
+ );
+}
+
+/// `pi install` meant oh-my-pi until the split, and a stray Pi extension has
+/// no surface in `wt config show` β€” so the command says so itself when only
+/// oh-my-pi is on PATH.
+#[rstest]
+fn test_pi_install_points_at_omp_when_only_omp_is_on_path(temp_home: TempDir) {
+ let settings = setup_home_snapshot_settings(&temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.env("WORKTRUNK_TEST_OMP_INSTALLED", "1");
+ cmd.env("WORKTRUNK_TEST_PI_INSTALLED", "0");
+ cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+
+ assert_cmd_snapshot!(cmd);
+ });
+}
+
+/// With Pi itself on PATH the command has nothing to redirect, whatever else
+/// is installed alongside it.
+#[rstest]
+fn test_pi_install_stays_quiet_when_pi_is_on_path(temp_home: TempDir) {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.env("WORKTRUNK_TEST_OMP_INSTALLED", "1");
+ cmd.env("WORKTRUNK_TEST_PI_INSTALLED", "1");
+ cmd.args(["config", "plugins", "pi", "install", "--yes"]);
+
+ let output = cmd.output().expect("install command should run");
+ assert!(output.status.success(), "install failed: {output:?}");
+ let stderr = String::from_utf8_lossy(&output.stderr);
+ assert!(
+ !stderr.contains("wt config plugins omp install"),
+ "unexpected oh-my-pi redirect: {stderr}"
+ );
+}
+
+/// The redirect prints before the install prompt, so the blank line between
+/// them belongs to the prompt. Declined here (no `--yes`, piped stdin β†’ empty),
+/// which is the only path that renders both.
+#[rstest]
+fn test_pi_install_redirect_precedes_the_prompt(temp_home: TempDir) {
+ let settings = setup_home_snapshot_settings(&temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.env("WORKTRUNK_TEST_OMP_INSTALLED", "1");
+ cmd.env("WORKTRUNK_TEST_PI_INSTALLED", "0");
+ cmd.args(["config", "plugins", "pi", "install"]);
+
+ assert_cmd_snapshot!(cmd);
+ });
+
+ assert!(
+ !temp_home
+ .path()
+ .join(".pi/agent/extensions/worktrunk.ts")
+ .exists()
+ );
+}
+
+#[rstest]
+fn test_pi_install_prompt_declined(temp_home: TempDir) {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.args(["config", "plugins", "pi", "install"]);
+
+ let output = cmd.output().expect("install command should run");
+ assert!(output.status.success(), "install failed: {output:?}");
+ assert!(
+ !temp_home
+ .path()
+ .join(".pi/agent/extensions/worktrunk.ts")
+ .exists()
+ );
+}
+
+#[rstest]
+fn test_pi_uninstall_removes_extension(temp_home: TempDir) {
+ let extension_path = temp_home.path().join(".pi/agent/extensions/worktrunk.ts");
+ fs::create_dir_all(extension_path.parent().unwrap()).unwrap();
+ fs::write(&extension_path, include_str!("../../dev/pi-extension.ts")).unwrap();
+
+ let settings = setup_home_snapshot_settings(&temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.args(["config", "plugins", "pi", "uninstall", "--yes"]);
+
+ assert_cmd_snapshot!(cmd);
+ });
+
+ assert!(!extension_path.exists());
+}
+
#[rstest]
fn test_pi_uninstall_missing_is_a_no_op(temp_home: TempDir) {
let mut cmd = wt_command();
@@ -3000,11 +3264,35 @@ fn test_pi_uninstall_missing_is_a_no_op(temp_home: TempDir) {
assert!(output.status.success(), "uninstall failed: {output:?}");
}
+/// `pi uninstall` used to remove the oh-my-pi hook, so anyone repeating that
+/// command after the split gets "Plugin not installed" for a hook that is
+/// still there. The hint names the command that removes it.
+#[rstest]
+fn test_pi_uninstall_points_at_omp_when_its_hook_remains(temp_home: TempDir) {
+ let hook_path = temp_home.path().join(".omp/agent/hooks/pre/worktrunk.ts");
+ fs::create_dir_all(hook_path.parent().unwrap()).unwrap();
+ fs::write(&hook_path, include_str!("../../dev/omp-hook.ts")).unwrap();
+
+ let settings = setup_home_snapshot_settings(&temp_home);
+ settings.bind(|| {
+ let mut cmd = wt_command();
+ set_temp_home_env(&mut cmd, temp_home.path());
+ cmd.args(["config", "plugins", "pi", "uninstall", "--yes"]);
+
+ assert_cmd_snapshot!(cmd);
+ });
+
+ assert!(
+ hook_path.exists(),
+ "pi uninstall must not touch the oh-my-pi hook"
+ );
+}
+
#[rstest]
fn test_pi_uninstall_prompt_declined(temp_home: TempDir) {
- let plugin_path = temp_home.path().join(".omp/agent/hooks/pre/worktrunk.ts");
- fs::create_dir_all(plugin_path.parent().unwrap()).unwrap();
- fs::write(&plugin_path, include_str!("../../dev/pi-plugin.ts")).unwrap();
+ let extension_path = temp_home.path().join(".pi/agent/extensions/worktrunk.ts");
+ fs::create_dir_all(extension_path.parent().unwrap()).unwrap();
+ fs::write(&extension_path, include_str!("../../dev/pi-extension.ts")).unwrap();
let mut cmd = wt_command();
set_temp_home_env(&mut cmd, temp_home.path());
@@ -3012,7 +3300,7 @@ fn test_pi_uninstall_prompt_declined(temp_home: TempDir) {
let output = cmd.output().expect("uninstall command should run");
assert!(output.status.success(), "uninstall failed: {output:?}");
- assert!(plugin_path.exists());
+ assert!(extension_path.exists());
}
/// When $SHELL is not set but PSModulePath is, config show should display
diff --git a/tests/integration_tests/help.rs b/tests/integration_tests/help.rs
index af32f96f5..75721de26 100644
--- a/tests/integration_tests/help.rs
+++ b/tests/integration_tests/help.rs
@@ -122,6 +122,18 @@ fn test_merge_help_describes_exact_shape_no_rebase() {
"help_config_plugins_codex_uninstall",
"config plugins codex uninstall --help"
)]
+#[case("help_config_plugins_pi", "config plugins pi --help")]
+#[case("help_config_plugins_pi_install", "config plugins pi install --help")]
+#[case(
+ "help_config_plugins_pi_uninstall",
+ "config plugins pi uninstall --help"
+)]
+#[case("help_config_plugins_omp", "config plugins omp --help")]
+#[case("help_config_plugins_omp_install", "config plugins omp install --help")]
+#[case(
+ "help_config_plugins_omp_uninstall",
+ "config plugins omp uninstall --help"
+)]
#[case("help_config_state", "config state --help")]
#[case("help_config_state_cache", "config state cache --help")]
#[case(
diff --git a/tests/snapshots/integration__integration_tests__config_show__config_show_clis_detected_via_path.snap b/tests/snapshots/integration__integration_tests__config_show__config_show_clis_detected_via_path.snap
index 9698c67f1..82ae1149c 100644
--- a/tests/snapshots/integration__integration_tests__config_show__config_show_clis_detected_via_path.snap
+++ b/tests/snapshots/integration__integration_tests__config_show__config_show_clis_detected_via_path.snap
@@ -77,6 +77,9 @@ exit_code: 0
OPENCODE
↳ Plugin not installed. To install, run wt config plugins opencode install
+OH-MY-PI
+↳ Plugin not installed. To install, run wt config plugins omp install
+
PI
↳ Plugin not installed. To install, run wt config plugins pi install
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_install_creates_profile_aware_hook.snap b/tests/snapshots/integration__integration_tests__config_show__omp_install_creates_profile_aware_hook.snap
similarity index 100%
rename from tests/snapshots/integration__integration_tests__config_show__pi_install_creates_profile_aware_hook.snap
rename to tests/snapshots/integration__integration_tests__config_show__omp_install_creates_profile_aware_hook.snap
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_removes_hook.snap b/tests/snapshots/integration__integration_tests__config_show__omp_uninstall_removes_hook.snap
similarity index 100%
rename from tests/snapshots/integration__integration_tests__config_show__pi_uninstall_removes_hook.snap
rename to tests/snapshots/integration__integration_tests__config_show__omp_uninstall_removes_hook.snap
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_install_points_at_omp_when_only_omp_is_on_path.snap b/tests/snapshots/integration__integration_tests__config_show__pi_install_points_at_omp_when_only_omp_is_on_path.snap
new file mode 100644
index 000000000..5b0e8d642
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__pi_install_points_at_omp_when_only_omp_is_on_path.snap
@@ -0,0 +1,60 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - install
+ - "--yes"
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OMP_INSTALLED: "1"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_PI_INSTALLED: "0"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+β–² oh-my-pi is on PATH and Pi is not; for the oh-my-pi hook, run wt config plugins omp install
+βœ“ Plugin installed @ ~/.pi/agent/extensions/worktrunk.ts
+↳ Activity markers (πŸ€–/πŸ’¬) will appear in wt list
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_install_redirect_precedes_the_prompt.snap b/tests/snapshots/integration__integration_tests__config_show__pi_install_redirect_precedes_the_prompt.snap
new file mode 100644
index 000000000..4cba0e009
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__pi_install_redirect_precedes_the_prompt.snap
@@ -0,0 +1,59 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - install
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OMP_INSTALLED: "1"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_PI_INSTALLED: "0"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+β–² oh-my-pi is on PATH and Pi is not; for the oh-my-pi hook, run wt config plugins omp install
+
+❯ Install Pi plugin @ ~/.pi/agent/extensions/worktrunk.ts? [y/N/?]
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_install_writes_extension.snap b/tests/snapshots/integration__integration_tests__config_show__pi_install_writes_extension.snap
new file mode 100644
index 000000000..5c1f8486c
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__pi_install_writes_extension.snap
@@ -0,0 +1,59 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - install
+ - "--yes"
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OMP_INSTALLED: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_PI_INSTALLED: "1"
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+βœ“ Plugin installed @ ~/.pi/agent/extensions/worktrunk.ts
+↳ Activity markers (πŸ€–/πŸ’¬) will appear in wt list
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_points_at_omp_when_its_hook_remains.snap b/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_points_at_omp_when_its_hook_remains.snap
new file mode 100644
index 000000000..928b3b40e
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_points_at_omp_when_its_hook_remains.snap
@@ -0,0 +1,57 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - uninstall
+ - "--yes"
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+β—‹ Plugin not installed
+↳ An oh-my-pi hook is installed; to remove it, run wt config plugins omp uninstall
diff --git a/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_removes_extension.snap b/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_removes_extension.snap
new file mode 100644
index 000000000..6064d8d79
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__config_show__pi_uninstall_removes_extension.snap
@@ -0,0 +1,56 @@
+---
+source: tests/integration_tests/config_show.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - uninstall
+ - "--yes"
+ env:
+ APPDATA: "[TEST_CONFIG_HOME]"
+ CLAUDE_CONFIG_DIR: "[TEST_CLAUDE_CONFIG]"
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ HOME: "[TEST_HOME]"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ OPENCODE_CONFIG_DIR: "[TEST_OPENCODE_CONFIG]"
+ TERM: alacritty
+ USERPROFILE: "[TEST_HOME]"
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+ XDG_CONFIG_HOME: "[TEST_CONFIG_HOME]"
+---
+success: true
+exit_code: 0
+----- stdout -----
+
+----- stderr -----
+βœ“ Plugin removed from ~/.pi/agent/extensions/worktrunk.ts
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap
index cbaf7b4d1..01aa3eb87 100644
--- a/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins.snap
@@ -50,8 +50,9 @@ Usage: wt config plugins [OPTIONS] <COMMAND>
Commands:
claude Claude Code plugin
codex Codex plugin
+ omp oh-my-pi activity hook
opencode OpenCode plugin
- pi Pi / oh-my-pi activity hook
+ pi Pi activity extension
Options:
-h, --help
@@ -79,13 +80,15 @@ Install and manage Worktrunk plugins for AI coding tools.
- claude β€” Claude Code plugin (activity tracking + statusline)
- codex β€” Codex plugin (Worktrunk configuration skill)
+- omp β€” oh-my-pi hook (activity tracking)
- opencode β€” OpenCode plugin (activity tracking)
-- pi β€” Pi / oh-my-pi plugin (activity tracking)
+- pi β€” Pi extension (activity tracking)
Examples
  wt config plugins claude install
  wt config plugins codex install
+  wt config plugins omp install
  wt config plugins opencode install
  wt config plugins pi install
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp.snap
new file mode 100644
index 000000000..ba63138de
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp.snap
@@ -0,0 +1,92 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - omp
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt config plugins omp - oh-my-pi activity hook
+
+Usage: wt config plugins omp [OPTIONS] <COMMAND>
+
+Commands:
+ install Install the activity tracking hook
+ uninstall Remove the activity tracking hook
+
+Options:
+ -h, --help
+ Print help (see a summary with '-h')
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere β€” including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Activity tracking hook β€” shows status markers in wt list:
+- πŸ€– β€” agent is working
+- πŸ’¬ β€” agent is waiting for input
+
+oh-my-pi's session_shutdown event clears the marker when the session exits.
+
+Examples
+
+  wt config plugins omp install
+  wt config plugins omp uninstall
+
+Hook location
+
+Written to ~/.omp/agent/hooks/pre/worktrunk.ts. Honors $PI_CONFIG_DIR,
+the active $OMP_PROFILE / $PI_PROFILE profile, and $PI_CODING_AGENT_DIR
+for the default profile.
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp_install.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp_install.snap
new file mode 100644
index 000000000..b9ca70d16
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp_install.snap
@@ -0,0 +1,86 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - omp
+ - install
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt config plugins omp install - Install the activity tracking hook
+
+Usage: wt config plugins omp install [OPTIONS]
+
+Options:
+ -h, --help
+ Print help (see a summary with '-h')
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere β€” including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Writes the Worktrunk hook to oh-my-pi's profile-aware user hook directory.
+
+Examples
+
+  wt config plugins omp install
+  wt config plugins omp install --yes
+
+Hook location
+
+The default location is ~/.omp/agent/hooks/pre/worktrunk.ts. The installer
+honors $PI_CONFIG_DIR and active $OMP_PROFILE / $PI_PROFILE profiles.
+$PI_CODING_AGENT_DIR overrides the agent directory for the default profile
+only β€” named profiles ignore it, matching oh-my-pi's own resolution.
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp_uninstall.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp_uninstall.snap
new file mode 100644
index 000000000..fbf293a1b
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_omp_uninstall.snap
@@ -0,0 +1,78 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - omp
+ - uninstall
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt config plugins omp uninstall - Remove the activity tracking hook
+
+Usage: wt config plugins omp uninstall [OPTIONS]
+
+Options:
+ -h, --help
+ Print help (see a summary with '-h')
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere β€” including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Removes the Worktrunk hook from oh-my-pi's active user hook directory.
+
+Examples
+
+  wt config plugins omp uninstall
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi.snap
new file mode 100644
index 000000000..e68f01ba7
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi.snap
@@ -0,0 +1,91 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt config plugins pi - Pi activity extension
+
+Usage: wt config plugins pi [OPTIONS] <COMMAND>
+
+Commands:
+ install Install the activity tracking extension
+ uninstall Remove the activity tracking extension
+
+Options:
+ -h, --help
+ Print help (see a summary with '-h')
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere β€” including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Activity tracking extension β€” shows status markers in wt list:
+- πŸ€– β€” agent is working
+- πŸ’¬ β€” agent is waiting for input
+
+Pi's session_shutdown event clears the marker when the session exits.
+
+Examples
+
+  wt config plugins pi install
+  wt config plugins pi uninstall
+
+Extension location
+
+Written to ~/.pi/agent/extensions/worktrunk.ts. $PI_CODING_AGENT_DIR
+replaces the agent directory.
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi_install.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi_install.snap
new file mode 100644
index 000000000..a021f23cb
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi_install.snap
@@ -0,0 +1,92 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - install
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt config plugins pi install - Install the activity tracking extension
+
+Usage: wt config plugins pi install [OPTIONS]
+
+Options:
+ -h, --help
+ Print help (see a summary with '-h')
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere β€” including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Writes the Worktrunk extension to Pi's user extension directory.
+
+Where oh-my-pi is on PATH and Pi is not β€” the state a user of the pre-split
+pi install is in β€” the output names wt config plugins omp install before
+writing anything.
+
+Examples
+
+  wt config plugins pi install
+  wt config plugins pi install --yes
+
+Extension location
+
+The default location is ~/.pi/agent/extensions/worktrunk.ts.
+$PI_CODING_AGENT_DIR replaces the agent directory (~/.pi/agent).
+
+This targets Pi (<https://github.com/earendil-works/pi>), which loads
+extensions from extensions/. oh-my-pi (omp) is a separate agent with a
+different hook API β€” use wt config plugins omp install for that.
+
+----- stderr -----
diff --git a/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi_uninstall.snap b/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi_uninstall.snap
new file mode 100644
index 000000000..4f0d8e706
--- /dev/null
+++ b/tests/snapshots/integration__integration_tests__help__help_config_plugins_pi_uninstall.snap
@@ -0,0 +1,82 @@
+---
+source: tests/integration_tests/help.rs
+info:
+ program: wt
+ args:
+ - config
+ - plugins
+ - pi
+ - uninstall
+ - "--help"
+ env:
+ CLICOLOR_FORCE: "1"
+ COLUMNS: "500"
+ GIT_ALLOW_PROTOCOL: file
+ GIT_CONFIG_COUNT: "2"
+ GIT_CONFIG_GLOBAL: /nonexistent/wt/gitconfig
+ GIT_CONFIG_KEY_0: user.useConfigOnly
+ GIT_CONFIG_KEY_1: rerere.enabled
+ GIT_CONFIG_SYSTEM: /nonexistent/wt/gitconfig
+ GIT_CONFIG_VALUE_0: "true"
+ GIT_CONFIG_VALUE_1: "false"
+ LANG: C
+ LC_ALL: C
+ LLVM_PROFILE_FILE: "[LLVM_PROFILE_FILE]"
+ TERM: alacritty
+ WORKTRUNK_APPROVALS_PATH: "[TEST_APPROVALS]"
+ WORKTRUNK_CONFIG_PATH: "[TEST_CONFIG]"
+ WORKTRUNK_SYSTEM_CONFIG_PATH: "[TEST_SYSTEM_CONFIG]"
+ WORKTRUNK_TEST_BASH_INSTALLED: "0"
+ WORKTRUNK_TEST_CLAUDE_INSTALLED: "0"
+ WORKTRUNK_TEST_CODEX_INSTALLED: "0"
+ WORKTRUNK_TEST_DELAYED_STREAM_MS: "-1"
+ WORKTRUNK_TEST_EPOCH: "1735776000"
+ WORKTRUNK_TEST_FISH_INSTALLED: "0"
+ WORKTRUNK_TEST_GEMINI_INSTALLED: "0"
+ WORKTRUNK_TEST_NUSHELL_ENV: "0"
+ WORKTRUNK_TEST_OPENCODE_INSTALLED: "0"
+ WORKTRUNK_TEST_PARENT_SHELL: ""
+ WORKTRUNK_TEST_POWERSHELL_ENV: "0"
+ WORKTRUNK_TEST_POWERSHELL_INSTALLED: "0"
+ WORKTRUNK_TEST_PROBE_TIMEOUT_MS: "60000"
+ WORKTRUNK_TEST_SKIP_URL_HEALTH_CHECK: "1"
+ WORKTRUNK_TEST_ZSH_INSTALLED: "0"
+---
+success: true
+exit_code: 0
+----- stdout -----
+wt config plugins pi uninstall - Remove the activity tracking extension
+
+Usage: wt config plugins pi uninstall [OPTIONS]
+
+Options:
+ -h, --help
+ Print help (see a summary with '-h')
+
+Global Options:
+ -C <path>
+ Working directory for this command
+
+ --config <path>
+ User config file path
+
+ --config-set <toml>
+ Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
+
+ -v, --verbose...
+ Verbose output (-v: info logs + hook/alias template variables on stderr; -vv: also debug logs and raw subprocess output written to .git/wt/logs/). Set WORKTRUNK_VERBOSE=0|1|2 to apply the same level everywhere β€” including shell completion, which no flag can reach
+
+ -y, --yes
+ Skip approval prompts
+
+Removes the Worktrunk extension from Pi's user extension directory.
+
+Where nothing is installed there while an oh-my-pi hook remains β€” the state an
+install from before pi and omp became separate commands leaves behind β€” the
+output names wt config plugins omp uninstall rather than reporting a removal.
+
+Examples
+
+  wt config plugins pi uninstall
+
+----- stderr -----