aboutsummaryrefslogtreecommitdiffstats
path: root/docs/docs/guide/agent-hooks.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/docs/guide/agent-hooks.md')
-rw-r--r--docs/docs/guide/agent-hooks.md31
1 files changed, 25 insertions, 6 deletions
diff --git a/docs/docs/guide/agent-hooks.md b/docs/docs/guide/agent-hooks.md
index 6e02b794..cefeb155 100644
--- a/docs/docs/guide/agent-hooks.md
+++ b/docs/docs/guide/agent-hooks.md
@@ -1,10 +1,10 @@
# AI Agent Hooks
-Atuin can capture commands run by AI coding agents (like Claude Code and Codex) alongside your regular shell history. Each command is tagged with the agent that ran it, so you can filter your history by author.
+Atuin can capture commands run by AI coding agents (like Claude Code, Codex, and pi) alongside your regular shell history. Each command is tagged with the agent that ran it, so you can filter your history by author.
## Quick Start
-Install hooks for your agent, then restart the agent:
+Install hooks for your agent, then restart or reload the agent:
```shell
# Claude Code
@@ -12,6 +12,9 @@ atuin hook install claude-code
# Codex
atuin hook install codex
+
+# pi
+atuin hook install pi
```
That's it. Commands the agent runs will now appear in your Atuin history, tagged with the agent's name.
@@ -20,12 +23,13 @@ That's it. Commands the agent runs will now appear in your Atuin history, tagged
AI coding agents support hook systems that notify external tools when they're about to run a shell command and when the command finishes. Atuin uses these hooks to record each command as a history entry, just like commands you type yourself.
-When `atuin hook install` runs, it writes the agent's config file to register Atuin as a hook handler:
+When `atuin hook install` runs, it writes the agent's config file or extension to register Atuin as a hook handler:
-| Agent | Config file |
-|-------|-------------|
+| Agent | Config file / extension |
+|-------|-------------------------|
| Claude Code | `~/.claude/settings.json` |
| Codex | `~/.codex/hooks.json` |
+| pi | `~/.pi/agent/extensions/atuin.ts` |
The hook lifecycle:
@@ -73,7 +77,7 @@ authors = []
authors = ["$all-agent"]
```
-Currently recognized agent names are: `claude-code`, `codex`, and `copilot`.
+Currently recognized agent names are: `claude-code`, `codex`, `copilot`, and `pi`.
## Supported Agents
@@ -93,6 +97,16 @@ atuin hook install codex
This adds hook entries to `~/.codex/hooks.json`. Codex calls `atuin hook codex` on each Bash tool use matching `^Bash$`.
+### pi
+
+```shell
+atuin hook install pi
+```
+
+This writes Atuin's extension to `~/.pi/agent/extensions/atuin.ts`.
+
+Then restart pi or run `/reload`. The extension wraps pi's built-in `bash` tool and records every bash command with author `pi` by calling `atuin history start` before execution and `atuin history end` afterwards.
+
## Verifying Installation
After installing hooks and restarting your agent, run a command through the agent and then check your history:
@@ -113,6 +127,9 @@ cat ~/.claude/settings.json | grep atuin
# Codex
cat ~/.codex/hooks.json | grep atuin
+
+# pi
+ls ~/.pi/agent/extensions/atuin.ts
```
## Re-installing
@@ -124,3 +141,5 @@ hooks.PreToolUse: already installed, skipping
hooks.PostToolUse: already installed, skipping
hooks.PostToolUseFailure: already installed, skipping
```
+
+For pi, reinstalling will also skip if the managed extension already matches the bundled version.