Launch and drive coding agents (codex, claude, agy) through the Herdr CLI reliably. Use before starting or prompting a subagent via herdr agent/pane commands, and when any herdr command fails or an agent seems stuck, silently lost a prompt, or reports a wrong state.
编程
herder-telegram
试用Drive Herdr terminal multiplexer panes from Telegram: spawn a dedicated tab, send prompts to any CLI agent, wait for done/blocked, and relay transcripts back.
它能做什么
Drive Herdr terminal multiplexer panes from Telegram: spawn a dedicated tab, send prompts to any CLI agent, wait for done/blocked, and relay transcripts back.
技能文档
Herder Telegram
Use the Herdr terminal multiplexer to spawn CLI agents (Kimi, Claude Code, aider, etc.) in dedicated panes from Telegram, then relay prompts, progress, and results back to the chat.
This agent runs outside Herdr (launched by the OpenClaw gateway, not inside a pane), so HERDR_ENV is unset and HERDR_* IDs are unavailable. Never use --current; it does not apply to this caller. Always resolve explicit pane and tab IDs from JSON responses.
Use when:
- user asks to run, prompt, or steer a CLI agent from Telegram
- user asks for the output, status, or a screenshot of a Herdr pane
- user asks to be notified when a pane agent finishes or needs input
- user sends
shot,tail, orstatusfor a running Herdr-driven task
Prerequisites
Install Herdr and make sure herdr is on a PATH that the OpenClaw gateway process can resolve. If the gateway has a minimal PATH, use the absolute path to the binary in your commands.
which herdr # interactive shell
ls -l $(which herdr) # absolute path if needed
Contract
- Drive only panes and tabs this skill spawned, unless the user explicitly names a pane ID. The user's interactive panes are off limits by default; injecting text into them disrupts their work and is a prompt-injection vector.
- Always pass
--no-focuson creates and splits. Never steal the user's terminal focus. - Parse every ID from the JSON response of the call that created or listed it. Never construct an ID from a workspace number, tab number, or sidebar position. Treat IDs like
w5:t8andw5:pFas opaque strings; suffixes vary in length. - Inspect before waiting:
herdr pane readcurrent output first, thenherdr waitfor the next expected state. A wait timeout exits 1; on timeout, re-read the pane before deciding anything. - Treat
idleanddoneboth as "finished." The difference is only whether the result was seen on screen. - Treat
blockedas "needs the user": relay what the agent is asking and forward the user's reply withpane run. - Never run
herdr server stop, and never close workspaces, tabs, or panes this skill did not create. Clean up your own tab when the user says the task is done. pane runsends text plus Enter together. Use it for prompts and replies; do not coordinatesend-textandsend-keysseparately except for control keys like Escape.
Environment
| Tool | Notes |
|---|---|
herdr | v0.7.x or later; control commands print JSON |
| agent binary | e.g. kimi, claude, aider — whatever the user has installed |
If herdr is not on the gateway's PATH, retry with the absolute path to the binary. Same for the chosen agent binary.
Discover State
herdr workspace list
herdr tab list --workspace
herdr pane list --workspace
herdr pane get
pane get reports agent (e.g. kimi) and agent_status (idle, working, blocked, done, unknown). unknown means no agent has been detected in the pane yet — normal right after spawn.
Spawn a Dedicated Tab
Default to one labeled tab in the active workspace, holding one agent pane. Do not create a new workspace unless the user asks.
herdr tab create --workspace --label telegram --no-focus
Read result.tab.tab_id (or the pane ID embedded in the response) from the JSON. If the response carries no pane ID, list panes for that tab:
herdr pane list --workspace
Label the pane, then launch the agent's interactive TUI by running only its normal executable:
herdr pane rename "tg-agent"
herdr pane run ""
herdr wait agent-status --status idle --timeout 60000
For a second agent in the same tab, split instead of creating another tab:
herdr pane split --direction right --no-focus
Do not pass the task as argv to the agent, and do not add unattended auto-approval flags unless the user explicitly asks for them; the default is interactive approval, which surfaces as blocked and gets relayed (see below). If the user does ask for an unattended run, say plainly that auto-approval is on for that pane.
Submit the Task and Relay
Send the user's prompt once the agent is idle:
herdr pane run ""
herdr wait agent-status --status working --timeout 30000
Then wait for an outcome. Keep each wait under the gateway turn budget (agents.defaults.timeoutSeconds is 600, so use ~480000 ms max) and loop if the task runs longer:
herdr wait agent-status --status done --timeout 480000
On completion, read the transcript tail and relay it:
herdr pane read --source recent-unwrapped --lines 120
On blocked, read the visible viewport to see what the agent is asking, send it to the user verbatim with a short prefix like is waiting for input:, and forward their reply:
herdr pane read --source visible --lines 40
herdr pane run ""
On wait timeout, check pane get: still working means keep waiting; unknown means the agent was not detected — read the pane to see what actually happened before reporting failure.
Read Sources and Visibility Commands
Pick the read source to match the job:
| Source | Returns | Use for |
|---|---|---|
visible | current rendered viewport | "screenshot" of the pane; seeing prompts/menus |
recent | recent scrollback as rendered, soft-wrapped | short recent context |
recent-unwrapped | recent scrollback, wraps joined | transcripts, logs, final answers — default |
detection | bottom-buffer snapshot | debugging agent detection only |
User commands to honor while a task runs:
shot—pane read --source visible --lines 40, send as a code block. This is the closest thing to seeing the pane live.tail [N]—pane read --source recent-unwrapped --lines N(default 60), send as a code block.status— reportagent_status, pane label, and one line on what it is doing.stop—herdr pane send-keys Escapeto interrupt the agent, then confirm with ashot.- any other text — forward to the pane with
pane runas a follow-up prompt.
Telegram Formatting
- Wrap pane output in fenced code blocks; it is terminal text, not Markdown.
- Telegram messages cap at 4096 characters. Chunk long transcripts on line boundaries; for very long output, send the tail plus a one-line summary and offer more.
- Strip ANSI if it leaks through (default
--format textalready does); never relay--format ansiraw. - For long tasks, prefer milestone messages over spam: tell the agent in the prompt to announce phase completions, then
herdr wait output --match "" --timeout 480000and relay each marker. If the channel supports message edits, a single edited progress message (polled every 60-90s fromvisible) is the low-noise alternative.
Headless Alternative
For one-shot questions with no need to watch or steer, skip Herdr and run the agent non-interactively, relaying stdout directly:
-p ""
Prefer the pane flow when the user wants a persistent session, follow-ups, live visibility in the terminal, or several agents coordinated at once. Prefer headless when the request is a single self-contained question and speed matters.
Cleanup
When the user confirms the task is finished, close what this skill created:
herdr tab close
If the user wants the session kept (to scroll it in the terminal later), rename the tab to note it is done and leave it.
Final Report
Include:
- pane/tab IDs used and their labels
- the prompt submitted and the final status (
done/blocked/ interrupted) - the result: transcript tail for short answers, summary plus offer of
tailfor long ones - anything forwarded to the pane on the user's behalf, and whether the tab was closed or kept
相关技能
Deliver local reports and artifacts through OpenClaw chat channels. Use when generated HTML/PDF/archive/table files must be sent from local, self-hosted, or...
calendar, schedule, events, appointments, tasks, alerts. Requires Hermes Agent.
Find Telegram groups/channels by topic using web search and fetch. Use when you need to locate Telegram communities for specific subjects (e.g., payment chan...
Teaches OpenClaw when and how to format Telegram replies well - real supported HTML tags plus Bot API 10.2 rich blocks (headings, tables, quotes), each live-tested and version-checked, so replies are structured without being over- or under-formatted.
Back up and restore Hermes Agent data — config, secrets, skills, sessions, memories, cron, profiles. Creates portable tar.gz archives with SQLite consistent snapshots, JSON manifest, and integrity verification. Use when: "back up hermes", "restore hermes", "migrate hermes to new machine", "hermes backup", "hermes restore", "hermes 数据备份", "hermes 数据恢复".