跳到正文

robbyrussell

herdr-ohmyzsh

Oh My Zsh plugin for Herdr: slow commands in the sidebar, done notifications, shell helpers, and one key to reload Oh My Zsh in every idle pane

README 已保存到本站,可直接阅读

Documentation snapshot

README 快照

这篇是英文原文

下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。

本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。

herdr-ohmyzsh

图片:CI 图片:License


An experiment. I created Oh My Zsh, and I am still wrapping my head around Herdr. I have twenty years of shortcut habits in my zsh terminals, and I wanted them to carry over into a workspace that is mostly about coding agents. This plugin is where I am collecting them.

herdr plugin install robbyrussell/herdr-ohmyzsh

Then add herdr to your plugins list in ~/.zshrc and open a new shell.

It is safe to leave in your plugins list on every machine. Outside a Herdr pane it only installs completions for the herdr command. Removing it is two commands, listed at the bottom.

There is a second half to this. I have a herdr plugin waiting to be merged into Oh My Zsh itself, ohmyzsh/ohmyzsh#14079. That one is the plain-terminal side: completions, hrdr aliases for the daily commands, a session picker, and a prompt segment showing the current pane. This repository is the Herdr-side experiment, the pieces that only make sense inside a pane. Both are named herdr for now, and Oh My Zsh loads a custom plugin ahead of an in-tree one with the same name, so once that PR lands I will sort out how the two fit together.

What it does

Tells you when the slow thing finished. Any command that runs longer than ten seconds shows in the Herdr sidebar as working, then done, just like an agent. If you have switched to another pane, you get a toast with the exit code and duration.

Reloads Oh My Zsh everywhere. You edited .zshrc, and now eleven panes are stale. One keybinding sends omz reload to every pane sitting at an idle zsh prompt, and leaves alone anything running a command, an editor, or an agent.

Short names for the things I type most.

CommandDoes
hsplit [right|down] [cmd]Split the current pane, keep the directory, optionally run a command
htab [label]New tab in this workspace, same directory
hagent NAME [KIND]Split right and start a named agent there, without stealing focus
hworktree BRANCH [BASE]New git worktree, opened as a workspace
hreload [--dry-run]Reload Oh My Zsh in every idle pane

The muscle memory it saves

Herdr can do all of the pane, tab and worktree work already, from the UI or the CLI. I wander between projects from a zsh prompt all day, and I did not want to remember the argv. This is what I type versus what I would otherwise have to remember.

I typeWithout the plugin I would need
hsplitherdr pane split --current --direction right --cwd "$PWD" --focus
hsplit down tail -f log/development.logThe split above with --direction down, then read the new pane id out of the JSON, then herdr pane run w1:p9 tail -f log/development.log
htab serverherdr tab create --cwd "$PWD" --focus --label server
hagent reviewerherdr pane split --current --direction right --cwd "$PWD" --no-focus, copy the pane id from the JSON, then herdr agent start reviewer --kind claude --pane w1:p9
hworktree feature/login mainherdr worktree create --branch feature/login --base main --cwd "$PWD" --focus
hreloadherdr pane list, then for each pane herdr pane get and herdr pane process-info to find the idle zsh ones, then herdr pane run "omz reload" on each
herdr pane spherdr completion zsh > "$ZSH_CACHE_DIR/completions/_herdr", and remembering to do it again after every herdr upgrade
Nothing. The toast finds me.Switching back to the pane to see whether bin/rails test is done, or herdr pane wait-output --match "runs," from somewhere else

Two of these are not shortcuts, they are things Herdr does not do on its own:

  • A plain shell command in the sidebar. Herdr tracks agents. A pane running your test suite shows as unknown until something inside the shell reports it. The plugin reports it, so the test run gets the same working and done lifecycle as an agent, and the toast when it finishes.
  • Reloading Oh My Zsh in every idle pane. Nothing else does this. It is the one feature that only makes sense if you use both tools.

What it will not do

  • Report agents. Herdr already tracks Claude, Codex, Gemini and the rest, and this stays out of the way. Editors, pagers and ssh are ignored too.
  • Edit your .zshrc. The install step prints the one line to add.
  • Break your prompt. If Herdr is gone, every call fails silently.

Settings

All optional. Set them in ~/.zshrc before Oh My Zsh loads.

VariableDefaultMeaning
HERDR_OMZ_THRESHOLD10Seconds before a command counts as slow
HERDR_OMZ_REPORTtrueShow slow commands in the sidebar
HERDR_OMZ_NOTIFYtrueToast when a slow command finishes
HERDR_OMZ_NOTIFY_FOCUSEDfalseToast even when the pane is focused
HERDR_OMZ_DEFAULT_AGENTclaudeAgent kind used by hagent
HERDR_OMZ_IGNOREagents, editors, sshPrograms never reported. Extend with HERDR_OMZ_IGNORE+=(bundle) after Oh My Zsh loads

Keybinding for the reload action, in ~/.config/herdr/config.toml:

[[keys.command]]
key = "prefix+shift+r"
type = "plugin_action"
command = "ohmyzsh.shell.reload-all"
description = "reload Oh My Zsh in idle panes"

Without Herdr’s installer

Clone it as a normal custom plugin. You get everything except the keybinding; hreload still works.

git clone https://github.com/robbyrussell/herdr-ohmyzsh \
  "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/herdr"

Uninstall

herdr plugin uninstall ohmyzsh.shell
rm "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/herdr"

Then remove herdr from your plugins list.

Development

Tests run against a fake herdr that records every call, so they need only zsh and bash. CI runs them on Ubuntu and macOS.

zsh tests/run.zsh

MIT licensed. Ideas and pull requests welcome; this is a work in progress.

Official distribution

获取与安装

暂未发现可确认的官方软件包地址

当前 README 快照没有出现 npm、PyPI、Crates.io、pub.dev 等官方包页链接。本站不会根据仓库名称猜测下载地址。

本站不托管项目文件;需要安装时,请以项目维护者发布的官方文档为准。

使用前核验

本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。