CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Herdr

$ herdr 官方出品 中风险
Herdr · Agent 桥接与元工具 · Apache-2.0 · macos / linux / windows

Herdr(herdr)是专为并行运行 AI 编码 Agent(claude、codex 等)打造的持久化终端多路复用工作区,支持 --remote、--session <name> 与 --default-config。配套控制 CLI hc 提供 hc run --bg --name --json、hc ls --json、hc read、hc send、hc wait 与 hc agent start。

FCRS-1.0 综合评分
82 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install herdr
CLI vs MCP 选型建议 优先选 CLI

hc(hc run --bg --json、hc read、hc send、hc wait)专为程序化终端控制设计,用于编排并行 Agent 窗格。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 21 / 25

配套 hc CLI 原生提供 --json(管道时自动启用)、run --bg --name、ls、read、send 与 wait,而 herdr 负责 --session 与 --remote 终端多路复用。

  • hc run --bg --name --json, hc ls, hc read, hc send, hc wait, and herdr --remote --session
安全与权限边界 19 / 25

将只读 hc ls / hc read 与写入型 hc run / hc send 分离,并通过 HERDR_ENV=1 标记防止盲目嵌套,但子窗格继承本地 Shell 权限。

  • HERDR_ENV=1 context marker and read/write hc command separation
安装与运行摩擦 14 / 15

可通过 brew install herdr、mise 及官方脚本在 macOS、Linux 与 Windows 安装。

  • Homebrew (herdr), Mise, macOS/Linux .sh, and Windows .ps1 installers
能力覆盖与边际价值 13 / 15

相比 tmux 更贴合多 Agent 监督场景,提供结构化 hc wait 与 JSON 窗格编排。

  • Built-in hc wait, hc agent start, and JSON pane orchestration
维护与来源背书 8 / 10

官方仓库 herdrdev/herdr,采用 Apache-2.0 协议开源。

  • Official herdrdev/herdr repo under Apache-2.0
文档与可验证性 7 / 10

herdr.dev 与 GitHub README 详述了 herdr 参数、hc 子命令及 HERDR_ENV=1 技能集成方式。

  • Official docs at herdr.dev and GitHub README

安全边界、鉴权与放权指南

鉴权方式
无需鉴权 本地配置文件
凭证存储位置

在本地存储工作区与会话配置;--remote 连接复用本地 SSH/守护进程配置,无需额外 API Key。

潜在副作用
只读查询 本地写入
费用与配额提示

100% 免费且基于 Apache-2.0 协议开源。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# Herdr (herdr / hc) Agent Rules
- Use `hc` (`hc ls --json`, `hc run --bg --json`, `hc read`, `hc wait`) in agent loops; never invoke the interactive `herdr` TUI directly.
- Check `HERDR_ENV=1` before spawning recursive panes to avoid runaway session nesting.

Agent 高频安全命令配方

只读查询(安全推荐)

以 JSON 列出 Herdr 终端会话
hc ls --all --json

以 JSON 格式列出由 Herdr 服务端管理的活跃及已结束终端窗格。

读取指定托管窗格的输出缓冲
hc read worker-1

无需交互式挂载即可打印 worker-1 窗格的屏幕历史与近期输出。

受控写入与预演

在 Herdr 中以后台命名窗格启动命令
hc run --bg --name worker-1 --json -- npm test

在持久化命名后台窗格中运行 npm test 并返回窗格元数据 JSON。

核心优势

  • + 配套 hc CLI 让启动、读取和等待后台 Agent 窗格可通过 --json 脚本化。
  • + 在托管窗格内自动注入 HERDR_ENV=1,便于 Agent 技能识别所处编排环境。
  • + 支持 Homebrew 与安装脚本跨平台部署。

注意事项与踩坑点

  • ! 顶层 herdr 命令会启动交互式 TUI 界面(无头自动化控制应调用 hc)。
  • ! 管理窗格需要后台 hc server 守护进程处于运行状态。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI