Skip to content

Herdr plugin

The official HWT plugin adds interactive worktree actions to Herdr and prepares configured files in worktrees created through Herdr’s built-in UI or CLI. It does not require a separate fuzzy finder or command palette.

HWT must be installed and available in the Herdr server’s PATH.

Install the plugin through HWT:

Terminal window
hwt plugin install

HWT passes the required source and confirmation arguments to Herdr. Released HWT builds install the plugin from the matching release tag; development builds use the repository’s default branch.

Terminal window
hwt plugin update

Herdr implements updates as an atomic reinstall. It restores the previous installation if replacement fails.

Terminal window
hwt plugin uninstall

The plugin provides these actions:

  • New configured worktree prompts for a branch name and base branch, then creates and focuses the configured worktree.
  • Remove current worktree confirms the checkout path and uses HWT’s safe, fast removal. Dirty or locked worktrees require a separate force confirmation.

The plugin listens for Herdr’s worktree.created event and runs hwt copy for the new checkout. HWT-created worktrees emit the same event, but a per-worktree lock and completion marker ensure configured files are copied only once.

Text inputs and the fuzzy base-branch picker support Vim-style normal and insert modes. The interface shows the current mode and available controls.

Confirmation dialogs show horizontal Yes and No choices. Use h/l, the arrow keys, or Tab to change the selection, then press Enter. y and n submit directly. Destructive confirmations select No by default.

Plugin actions do not replace your existing keybindings. Add bindings to ~/.config/herdr/config.toml if desired:

[[keys.command]]
key = "prefix+shift+g"
type = "plugin_action"
command = "hwt.worktrees.new"
description = "new configured worktree"
[[keys.command]]
key = "prefix+shift+d"
type = "plugin_action"
command = "hwt.worktrees.remove"
description = "remove configured worktree"

Reload Herdr configuration after editing it:

Terminal window
herdr server reload-config