aboutsummaryrefslogtreecommitdiffstats
path: root/install.sh
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-04-13 21:42:05 +0100
committerGitHub <noreply@github.com>2026-04-13 21:42:05 +0100
commit75e3dc124c767d0252cbffaae21ff603bbcaa4d4 (patch)
tree2c7caa84072249932cc31a10c5b50dd3a78dae91 /install.sh
parentfeat: add pi hook installer (#3398) (diff)
downloadatuin-75e3dc124c767d0252cbffaae21ff603bbcaa4d4.zip
feat: autoinstall ai shell history hooks (#3399)
Follows our existing behaviour of automatically installing shell hooks, extend this for ai agents too ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/install.sh b/install.sh
index e9fea408..069ac52e 100755
--- a/install.sh
+++ b/install.sh
@@ -75,6 +75,39 @@ fi
ATUIN_BIN="$HOME/.atuin/bin/atuin"
+__atuin_install_agent_hook(){
+ agent="$1"
+ agent_name="$2"
+ agent_config_dir="$3"
+ shift 3
+
+ detected="no"
+
+ if [ -d "$agent_config_dir" ]; then
+ detected="yes"
+ else
+ for agent_command in "$@"; do
+ if command -v "$agent_command" > /dev/null 2>&1; then
+ detected="yes"
+ break
+ fi
+ done
+ fi
+
+ if [ "$detected" = "yes" ]; then
+ echo "Detected $agent_name — installing Atuin hooks..."
+ if ! "$ATUIN_BIN" hook install "$agent"; then
+ echo "Failed to install Atuin hooks for $agent_name (this version of Atuin may not support it yet)."
+ fi
+ echo ""
+ fi
+}
+
+__atuin_install_agent_hook "claude-code" "Claude Code" "$HOME/.claude" claude
+__atuin_install_agent_hook "codex" "Codex" "$HOME/.codex" codex
+__atuin_install_agent_hook "pi" "pi" "$HOME/.config/pi" pi
+__atuin_install_agent_hook "opencode" "OpenCode" "$HOME/.config/opencode" opencode
+
echo ""
echo "Atuin installed successfully!"
echo ""