跳到正文
Skillpedia
部署与云(DevOps)48k · #6314

herdr

它能做什么

这个技能教你的智能体使用 Herdr(一款为编程智能体设计的终端管理器)来查看和控制其他终端窗格,以及在其中运行的智能体。适合运行 Herdr、并希望智能体跨窗格工作的开发者。

适用场景

  • ✓当你要求智能体检查 Herdr 窗格中另一个智能体或命令的运行情况的时候。
  • ✓当你想让智能体在 Herdr 中打开新的窗格、标签页或工作区的时候。
  • ✓当你想读取另一个 Herdr 窗格中运行命令的输出的时候。

技能链接

https://github.com/herdrdev/herdr/blob/master/skills/herdr/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/herdrdev/herdr/blob/master/skills/herdr/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“你能在 Herdr 中打开一个新窗格,在那里运行我的测试套件,并在完成时告诉我吗?”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会确认自己运行在 Herdr 中,然后使用 herdr 命令读取布局并发送命令。它从命令输出中读取 ID,而不是凭空猜测。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Herdr

Herdr organizes terminals into workspaces, tabs, and panes, recognizes coding agents running inside panes, and exposes the current session through the herdr CLI.

Before issuing any control command, verify that this agent is running inside a Herdr-managed pane:

test "${HERDR_ENV:-}" = 1

If the check fails, say that you are not running inside Herdr and stop. Do not inspect or control the focused Herdr session from outside Herdr.

When the check passes, the herdr binary in PATH talks to the current session. Use it to inspect neighboring work, create terminal layout, start agents and commands, read output, and wait for state changes.

Learn the current CLI

The installed binary is the authority for command syntax. Start with:

herdr --help

Then print the relevant command group by running the group without a subcommand:

herdr agent
herdr pane
herdr workspace
herdr tab
herdr worktree
herdr terminal
herdr notification
herdr integration
herdr session
herdr machine

Do not run bare herdr for discovery; it launches or attaches the TUI. Do not probe a mutating nested command by omitting arguments. Commands such as herdr workspace create are valid with defaults and will execute.

Most control commands return JSON. Read identifiers and state from those responses instead of predicting them.

Understand layout, panes, and agents

Choose the primitive that matches the job:

  • Workspace, tab, and pane topology organize terminal locations.
  • Pane commands control raw terminals, shells, tests, servers, input, and output.
  • Agent commands control the recognized coding agent currently occupying a pane.

A pane exists whether or not it contains an agent. agent start requires an existing available shell pane and never creates, splits, or moves layout. Use pane commands for ordinary processes. Use agent commands when Herdr must validate agent identity or interpret idle, working, blocked, done, and unknown lifecycle states.

Agent commands accept either a unique live agent name or the pane ID currently hosting that agent. They do not accept terminal IDs or bare agent-kind labels. Names must match [a-z][a-z0-9_-]{0,31} and be unique among live agents. A name follows the current pane occupant and is cleared when that agent exits, is released, or is replaced. Suspending an agent with Ctrl+Z and running a non-agent command preserves its identity while the exact process remains alive. This does not preserve the original identity across another recognized agent taking over. A retained identity does not mean the agent is in the foreground; inspect the pane before sending input.

idle and done normally indicate the agent is ready for input; neither guarantees that an unfamiliar approval dialog was recognized or that a retained agent is in the foreground. The CLI/API uses the server's seen state to distinguish them; explicit focus commands mark the target seen, while reads do not. Each TUI client tracks viewed completions independently, so its Done badge can differ from the CLI or another client's badge. Antigravity and Grok can be idle while background tasks or subagents keep running, so a settled-state wait is not proof those jobs have finished. blocked means Herdr recognized an approval or question UI. unknown means an agent is present but Herdr cannot classify it confidently; it does not prove completion.

Use IDs and caller context

Public IDs are opaque stable handles:

  • workspace: w1
  • tab: w1:t1
  • pane: w1:p1

Closed tab and pane IDs are not reused. A pane moved into another workspace receives a new workspace-qualified pane ID. After pane move, continue with .result.move_result.pane.pane_id or the live agent name. The old value is reported as .result.move_result.previous_pane_id; only the moved process's inherited caller context keeps resolving that old ID, so do not use it as a general agent target.

Herdr injects the caller's context into each managed pane:

printf '%s\n' "$HERDR_WORKSPACE_ID" "$HERDR_TAB_ID" "$HERDR_PANE_ID"

Prefer --current when a pane command should target the calling pane. An omitted pane split target uses the calling pane when HERDR_PANE_ID is available, otherwise the focused pane. Other commands may use the UI-focused pane, which can belong to the user or another client.

Discover live state with:

herdr workspace list
herdr tab list --workspace "$HERDR_WORKSPACE_ID"
herdr pane current --c
常见问题

可以在 Herdr 之外使用它吗?

不可以。该技能说明,如果智能体不是在 Herdr 管理的窗格中运行,它就会停止。

它会为我没有提到的后台工作使用 Herdr 吗?

不会。该技能说明,只有在你明确提到 Herdr 时才会使用,而不是用于所有可能用到后台终端的任务。

它如何知道该使用哪些命令?

该技能说明,已安装的可执行文件才是权威,因此智能体会在行动前检查当前的命令帮助。

详情

作者的原始描述

Control Herdr, a terminal multiplexer for coding agents. Use only when the user explicitly mentions Herdr or asks to use Herdr to inspect or control panes, tabs, workspaces, commands, or another agent. Do not use merely because a task could benefit from a background terminal, delegation, or parallel work. Requires HERDR_ENV=1.

repo: herdrdev/herdr

热度

GitHub 星标
48k
排名
#6314
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

相似技能