hc

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

hc

hc

You run in an hc terminal (
$HC_TERMINAL_ID
is your address). The person watches every hc terminal in the Herdr app and can take any of them over. Full manual:
hc --skill
; read it before anything not covered here.
你运行在一个 hc 终端中(
$HC_TERMINAL_ID
是你的地址)。用户可以在 Herdr app 中查看每个 hc 终端,并接管其中任意一个。完整手册:
hc --skill
;执行本文未涵盖的操作前,请先阅读手册。

What goes where

工作类型与使用方式

WorkUse
A sub-task inside your turn: research, a review passyour own subagents, if your harness has them
Several agents, a pipeline or panel of them, or agents on another harness or machinethe
hc-flow
skill (by hand or
flow.mjs
)
A server, build, test suite, CI watch, anything slow
hc run --bg
, then
hc wait
Another agent or model as a peer you or the person can steer
hc run --bg <agent>
(see
peers.md
)
A command or file on another machine
hc exec
/
hc file
/
hc run --on
(see
remote.md
)
Talking to another agent's session
hc send
,
hc wait
,
hc read
Never
&
,
nohup
,
setsid
,
disown
, or a foreground
sleep
to wait: hc keeps the process visible, outlives your turn, and
hc wait
returns the moment it's done.
工作使用方式
当前轮次内的子任务:调研、审查如果你的 harness 支持子 Agent,则使用自己的子 Agent
多个 Agent、Agent 流水线或面板,或运行在其他 harness 或机器上的 Agent
hc-flow
skill(手动使用或通过
flow.mjs
)
服务器、构建、测试套件、CI 监控以及所有耗时任务
hc run --bg
,然后使用
hc wait
将另一个 Agent 或模型作为可由你或用户引导的同伴
hc run --bg <agent>
(参见
peers.md
)
在另一台机器上执行命令或处理文件
hc exec
/
hc file
/
hc run --on
(参见
remote.md
)
与另一个 Agent 的会话通信
hc send
、
hc wait
、
hc read
切勿使用
&
、
nohup
、
setsid
、
disown
,也不要使用前台
sleep
等待:hc 会让进程保持可见,即使当前轮次结束也能继续运行,并且
hc wait
会在任务完成后立即返回。

Recipes

使用示例

sh
undefined
sh
undefined

slow command: you stay free while it runs

slow command: you stay free while it runs

hc run --bg --rm --no-notify --name build cargo build --release hc wait build # exit code; --rm removes it after
hc run --bg --rm --no-notify --name build cargo build --release hc wait build # exit code; --rm removes it after

server: start, wait until ready, use it, stop it

server: start, wait until ready, use it, stop it

hc run --bg --name web --cwd app bun dev hc wait web --output "ready" # matches output printed after the wait starts hc read web --lines 50 hc kill web; hc rm web
hc run --bg --name web --cwd app bun dev hc wait web --output "ready" # matches output printed after the wait starts hc read web --lines 50 hc kill web; hc rm web

several at once

several at once

hc run --bg --name unit cargo test hc run --bg --name lint cargo clippy --all-targets hc wait --children any # next one to finish; repeat or use --children all

- `hc wait` times out after 180 s by default: that's a check-in, not a failure; wait again.
- `hc run` without `--bg` streams output and returns after 180 s with `[hc] still running
  as tN`: wait on that address, don't start it twice.
- Clean up what you started (`hc kill`, `hc rm`). `hc ls` shows the person's other work
  too: never touch terminals you didn't start.
hc run --bg --name unit cargo test hc run --bg --name lint cargo clippy --all-targets hc wait --children any # next one to finish; repeat or use --children all

- `hc wait` 默认在 180 秒后超时:这只是一次阶段性检查,并不表示失败;请再次等待。
- 不带 `--bg` 的 `hc run` 会流式输出,并在 180 秒后返回 `[hc] still running as tN`:请等待该地址,不要重复启动任务。
- 清理你启动的内容(`hc kill`、`hc rm`)。`hc ls` 还会显示用户的其他任务:绝不要操作并非由你启动的终端。

Gotchas

注意事项

  • Never
    hc server stop
    , and never restart the core: every terminal on it dies.
  • Starting
    hc
    when no core is running starts one with your shell's environment, and every later terminal inherits it. On the person's own machine, check
    hc ls
    works before running anything else.
  • From inside an hc terminal,
    hc run
    children end when you end; add
    --outlive-parent
    for something that must keep running.
  • hc send
    wraps the text as a message, so
    /compact
    or any slash command arrives as chat. Type it as keys:
    hc keys <t> / c o m p a c t
    , then
    hc keys <t> enter
    .
  • Codex under hc needs
    --no-daemon
    .
  • 绝不要执行
    hc server stop
    ,也不要重启 core:其上的每个终端都会终止。
  • 没有 core 运行时启动
    hc
    ,会使用你 shell 的环境启动一个 core,之后创建的所有终端都会继承该环境。在用户自己的机器上,先确认
    hc ls
    可用,再运行其他命令。
  • 在 hc 终端内运行时,
    hc run
    创建的子进程会随当前终端结束而终止;对于必须持续运行的任务,请添加
    --outlive-parent
    。
  • hc send
    会将文本包装成消息,因此
    /compact
    或任何斜杠命令都会以聊天消息的形式到达。需要将其作为按键输入时,请使用
    hc keys <t> / c o m p a c t
    ,然后执行
    hc keys <t> enter
    。
  • 在 hc 下运行 Codex 时需要使用
    --no-daemon
    。