关于 herdrchat
设置、运行和维护 herdrchat。它会将每个 herdr-app (hc) 标签页同步到 Feishu(每个标签页对应一个群组)或 Telegram(每个标签页对应一个主题)。涵盖首次设置任一应用、启动、停止、状态、日志、作为服务运行、设置、故障排除、Feishu 开发者控制台和 @BotFather。任何与 herdrchat 或其 Feishu、Telegram 机器人有关的事项都适用,包括“设置 Telegram 机器人”“它在运行吗”“它没有发帖”或“将工作进程静音”。使用“/herdrchat”“/herdrchat setup”“/herdrchat status”“/herdrchat fix”触发。
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ zhangxiangliang/ herdrchat --skill herdrchat安装后在 Claude Code 中输入/herdrchat确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/feishu.mdops.mdtelegram.mdREADME 原文English
来自项目 READMEREADME 暂无中文译文,以下为英文原文;中文介绍见上方。
herdrchat
herdrchat mirrors every herdr-app tab into a chat app: a group per tab in Feishu, a topic
per tab in the bot's private chat in Telegram; the conversation as it happens, dialogs as
buttons, an overview in the direct chat. One profile is one chat app (HERDRCHAT_CHAT):
one app uses the default profile; a second app beside it gets its own (--profile <name>).
Its command is herdrchat (node bin/cli.mjs in a clone): check with command -v herdrchat; when it is missing, ask before npm install -g herdrchat. A profile
(--profile, default default) keeps its settings in
~/.config/herdrchat/<profile>/config.env and its state in
~/.local/state/herdrchat/<profile>/; herdrchat status prints both. Files named here
from the package (config.env.example, docs/guide.md) are in the installed package,
$(npm root -g)/herdrchat/, or in the clone.
Commands
| Command | Do |
|---|---|
/herdrchat setup | First ask which chat app (Feishu, Telegram, or both: the second one on its own profile). Telegram: /herdrchat telegram setup. Feishu, in this order: create the app, the bot ability and the scopes (references/feishu.md); herdrchat init and fill config.env with the user (App ID, App Secret, HERDR_SESSIONS: ls ~/.local/state/herdr-core lists the sessions); herdrchat start (the console's long-connection check needs it running); events and callbacks; publish a version; the user messages the bot and adds the FEISHU_OWNER_OPEN_ID line it answers with; herdrchat start again; offer /herdrchat auth and herdrchat install. |
/herdrchat status | herdrchat status; explain each line; on errors, /herdrchat fix. |
/herdrchat start, /herdrchat stop | Read config.env (its HERDR_SESSIONS) in one step, then herdrchat start / stop in the next; never both at once. With a service installed they go through it. |
/herdrchat install, /herdrchat uninstall | Run it as a service of the system (launchd on macOS, systemd on Linux): it starts at login and comes back after a crash, whatever happens to the hc cores. Recommended once it works. Read the config first; after a node upgrade, install again (herdrchat status says so). |
/herdrchat logs | herdrchat logs --errors (or -n 100); explain them with references/ops.md "Logs". |
/herdrchat auth | The user sends /auth to the bot and allows it on Feishu's page; the app needs the user scopes in references/feishu.md. Then groups are muted, labels and pins follow. |
/herdrchat config | Change a setting in config.env with the user (sessions, HERDR_MUTED_SPACES, HERDR_SILENT_SPACES, HERDR_BOT_TAGS, HERDR_USER_TAGS, HERDR_HISTORY, HERDRCHAT_CHAT; each is explained in config.env.example), read the file back, then restart. |
/herdrchat fix | Find the cause from herdrchat status, the logs and the live result, then fix it: references/ops.md. |
/herdrchat feishu <task> | Anything in the Feishu developer console: scopes, callbacks, publishing, the icon, deleting an app: references/feishu.md. |
/herdrchat telegram <task> | The Telegram bot (the default profile when it is the only app): setup (@BotFather, topic mode, token, owner id, first start), checking the token, quiet and silent spaces, what Telegram cannot do and what stands in: references/telegram.md. |
With no subcommand, run herdrchat status and suggest the next step from it.
Rules
- Ask before anything outward-facing: publishing a version, applying scopes, deleting or disbanding anything, sending to a real group. One yes covers one action.
- Never print, screenshot or paste
FEISHU_APP_SECRET,TELEGRAM_BOT_TOKENoruser-token.json; ask the user to paste a token intoconfig.envthemselves. - A check that decides an action runs on its own first (read the config, then start).
- Say what was checked on the live bot and what was not.
References
references/feishu.md: the bot's app in the Feishu developer console, with Ego or as a guided walk-through; the scopes this bot uses.references/telegram.md: the Telegram bot, from @BotFather to the first topic; what it does differently from Feishu.references/ops.md: running and checking the bot, its logs and state, the usual problems, trying a Feishu API safely, committing without a leak.