From 97dc6fc5e4337b682a0b173e20595f067a5120c9 Mon Sep 17 00:00:00 2001 From: Tony Kornmeier Date: Wed, 20 May 2026 11:14:51 -0400 Subject: [PATCH 1/2] feat(herdr): add herdr topic installer to dot workflow Add a `herdr/` topic that 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`. Wired into bin/dot's cmd_install and cmd_update via the existing DOT_MODE branching pattern. Failures warn and continue, never aborting the broader dot run. Co-Authored-By: Claude Opus 4.7 --- .changeset/herdr-installer.md | 5 +++++ CLAUDE.md | 11 +++++++++++ bin/dot | 10 ++++++++++ herdr/install.sh | 37 +++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 .changeset/herdr-installer.md create mode 100755 herdr/install.sh 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..3e9c3da 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`, already on `$PATH` via `system/path.zsh`) +- 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..8a49b8a --- /dev/null +++ b/herdr/install.sh @@ -0,0 +1,37 @@ +#!/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/^/ /' + if command -v herdr &> /dev/null; then + echo " ✓ herdr installed" + else + echo " ⚠️ Failed to install herdr (continuing)" + fi +fi + +echo " ✓ herdr setup complete" From c27bb3d756cbfacafa6978f7b2ebb229bb6ebe49 Mon Sep 17 00:00:00 2001 From: Tony Kornmeier Date: Wed, 20 May 2026 11:34:06 -0400 Subject: [PATCH 2/2] fix(herdr): address PR review feedback (#49) - herdr/install.sh: check PIPESTATUS[1] for the curl|sh installer pipeline and verify the binary at $HOME/.local/bin/herdr directly instead of the PATH-dependent `command -v` post-check - CLAUDE.md: reword herdr PATH note to not imply ~/.local/bin is on $PATH during the bash-driven dot run Co-Authored-By: Claude Opus 4.7 --- CLAUDE.md | 2 +- herdr/install.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 3e9c3da..760c087 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -165,7 +165,7 @@ The `iterm2/` topic installs uv-managed CLI tools that complement iTerm2 (e.g., 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`, already on `$PATH` via `system/path.zsh`) +- 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 diff --git a/herdr/install.sh b/herdr/install.sh index 8a49b8a..d4e9495 100755 --- a/herdr/install.sh +++ b/herdr/install.sh @@ -27,7 +27,9 @@ if command -v herdr &> /dev/null; then else echo " 📦 Installing herdr..." curl -fsSL https://herdr.dev/install.sh | sh 2>&1 | sed 's/^/ /' - if command -v herdr &> /dev/null; then + # 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)"