diff --git a/.changeset/herdr-installer.md b/.changeset/herdr-installer.md new file mode 100644 index 0000000..778f2b2 --- /dev/null +++ b/.changeset/herdr-installer.md @@ -0,0 +1,5 @@ +--- +'tk-dotfiles': minor +--- + +Add herdr topic installer that auto-installs the herdr CLI via the upstream curl installer when missing, and self-updates it via the built-in `herdr update` command on dot update. diff --git a/CLAUDE.md b/CLAUDE.md index a233c4f..760c087 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -161,6 +161,17 @@ The `iterm2/` topic installs uv-managed CLI tools that complement iTerm2 (e.g., - Edit `UV_TOOLS=()` in `iterm2/install.sh` and re-run `dot install` or `dot update` +### herdr CLI + +The `herdr/` topic installs the `herdr` CLI (terminal workspace manager for AI coding agents), which is distributed only via a curl installer (not Homebrew): + +- Installed via `curl -fsSL https://herdr.dev/install.sh | sh` (binary lands in `~/.local/bin`; `system/path.zsh` adds that directory to `$PATH` for the user's zsh shell, so `herdr` is available in normal terminal use after a shell restart) +- Detection uses `command -v herdr` +- Runs in both `dot install` and `dot update`: + - `dot install` (DOT_MODE=install): installs herdr if missing, otherwise skips + - `dot update` (DOT_MODE=update): installs if missing, otherwise self-updates via the built-in `herdr update` command +- Failures emit a warning and continue — never abort the broader `dot` run + ### Claude MCP Servers The `claude/` topic configures Model Context Protocol (MCP) servers for Claude Desktop and Claude Code: diff --git a/bin/dot b/bin/dot index c60cb15..fb2764f 100755 --- a/bin/dot +++ b/bin/dot @@ -354,6 +354,11 @@ cmd_install() { DOT_MODE=install source "$DOTFILES/iterm2/install.sh" fi + # Run herdr installer + if [ -f "$DOTFILES/herdr/install.sh" ]; then + DOT_MODE=install source "$DOTFILES/herdr/install.sh" + fi + # Run zsh installer if [ -f "$DOTFILES/zsh/install.sh" ]; then source "$DOTFILES/zsh/install.sh" @@ -454,6 +459,11 @@ cmd_update() { DOT_MODE=update source "$DOTFILES/iterm2/install.sh" fi + # Run herdr installer in update mode + if [ -f "$DOTFILES/herdr/install.sh" ]; then + DOT_MODE=update source "$DOTFILES/herdr/install.sh" + fi + # Update npm global packages (if FNM/Node is available) if command -v npm &> /dev/null; then NPM_GLOBALS=( diff --git a/herdr/install.sh b/herdr/install.sh new file mode 100755 index 0000000..d4e9495 --- /dev/null +++ b/herdr/install.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# herdr installer +# Installs the herdr CLI (terminal workspace manager for AI coding agents) +# via the upstream curl installer, and self-updates it via `herdr update`. +# Sourced by bin/dot from cmd_install and cmd_update. +# Reads $DOT_MODE (install|update) to branch upgrade behavior. + +echo "" +echo "🐂 Setting up herdr..." + +# Default mode is install if not set +DOT_MODE="${DOT_MODE:-install}" + +if command -v herdr &> /dev/null; then + if [ "$DOT_MODE" = "update" ]; then + echo " 🔄 Updating herdr..." + herdr update 2>&1 | sed 's/^/ /' + if [ "${PIPESTATUS[0]}" -eq 0 ]; then + echo " ✓ herdr update complete" + else + echo " ⚠️ Failed to update herdr (continuing)" + fi + else + echo " ✓ herdr already installed" + fi +else + echo " 📦 Installing herdr..." + curl -fsSL https://herdr.dev/install.sh | sh 2>&1 | sed 's/^/ /' + # PIPESTATUS indices: [0]=curl, [1]=sh installer, [2]=sed + installer_status="${PIPESTATUS[1]}" + if [ "$installer_status" -eq 0 ] && [ -x "$HOME/.local/bin/herdr" ]; then + echo " ✓ herdr installed" + else + echo " ⚠️ Failed to install herdr (continuing)" + fi +fi + +echo " ✓ herdr setup complete"