关于 honcho-cli
honcho-cli 是用于管理和检查 Honcho 部署状态的命令行工具,适合开发者和 Agent 工作流。它提供结构化 JSON 输出、校验和错误码,并涵盖工作区、Peer、会话及记忆查询。
主要功能
- 01检查工作区、Peer 与会话
- 02查询记忆结论和上下文
- 03管理本地 Docker 环境
- 04提供 JSON 输出与结构化错误
适用场景
- 01排查 Peer 未形成记忆的问题
- 02查看 Agent 收到的会话上下文
- 03跨工作区搜索并限定回忆范围
- 04验证 Honcho 配置与连接
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ plastic-labs/ honcho --skill honcho-cli安装后在 Claude Code 中输入/honcho-cli确认已加载。
详细介绍
Honcho CLI
honcho 为 Honcho Python SDK 提供对 Agent 友好的默认设置:JSON 输出、结构化错误和输入验证。可用它检查工作区状态、调试 peer 记忆,并诊断辩证推理。
输出与配置
- TTY:可读性强的表格(交互模式下的默认格式)
- 管道传输 /
--json:JSON——集合命令输出数组,单资源命令输出对象 - 退出代码:
0成功 ·1客户端错误(输入无效、未找到)·2服务端错误 ·3身份验证错误 - 配置:
~/.honcho/config.json(与其他 Honcho 工具共用)。CLI 在顶层管理apiKey和environmentUrl;运行honcho init以确认或设置它们。每条命令的作用范围(工作区 / peer / 会话)通过-w/-p/-s标志或HONCHO_*环境变量指定。
命令组
honcho config— CLI 配置honcho start/stop/status— 本地 Docker 栈(不会更改environmentUrl)。首次启动会固定 Honcho 镜像摘要,并将config.toml写入配置档案。传入--setup basic或--setup advanced可启动交互式配置向导(仅限 TTY;会写入.env覆盖项)。honcho status会列出所有配置档案;传入--profile可指定一个。honcho workspace— 检查、删除、搜索、聊天honcho peer— 检查、卡片、聊天、搜索honcho session— 检查、查看(对话记录)、上下文、摘要honcho scope— 列出、创建、检查、会话、添加会话、移除会话、状态honcho message— 列出和获取honcho conclusion— 列出、搜索、创建、删除
规则
- 以编程方式处理输出时,始终传入
--json。 - 运行
honcho peer chat前,先运行honcho peer inspect了解上下文。 - 使用
honcho session context查看 Agent 实际接收的内容。 - 运行
honcho workspace delete前,务必先运行honcho workspace inspect。 - 对比 peer 卡片与结论,了解记忆状态。
- 运行
honcho scope add-sessions后,在使用作用域进行chat前,检查honcho scope status <name>:pending回填表示该作用域尚未追上进度,而不是没有可回忆的内容。 honcho start不会重写environmentUrl。使用HONCHO_BASE_URL=http://127.0.0.1:8000与本地栈通信。
检查指南
了解 Honcho 部署情况时,从外向内逐步检查:
1. 了解工作区
honcho workspace inspect --json
2. 查找 peer
honcho peer list --json
honcho peer inspect <peer_id> --json
3. 检查 peer 的记忆
honcho peer card <peer_id> --json
honcho conclusion list --observer <peer_id> --json
honcho conclusion search "topic" --observer <peer_id> --json
4. 调试会话
honcho session inspect <session_id> --json
honcho session view <session_id> --last 20 --json
honcho session view <session_id> --page 2 --size 50 --json
honcho message list <session_id> --last 20 --json
honcho session context <session_id> --json
honcho session summaries <session_id> --json
5. 搜索整个工作区
honcho workspace search "query" --json
honcho workspace chat "what themes show up across peers?" --json
honcho workspace chat "what happened in this project?" --scope my-project --json
honcho peer search <peer_id> "query" --json
6. 使用作用域限制回忆范围
honcho scope list --json
honcho scope inspect <name> --json # members + backfill summary
honcho scope create <name> --sessions <id1>,<id2> --json
honcho scope status <name> --json # wait until nothing is pending
honcho workspace chat "what happened here?" --scope <name> --json
调试指南
Peer 没有学到东西?
# Is observation enabled?
honcho peer inspect <peer_id> --json | jq '.configuration'
# What conclusions exist?
honcho conclusion list --observer <peer_id> --json
honcho conclusion search "expected topic" --observer <peer_id> --json
会话上下文看起来不对?
# Raw context an agent would receive
honcho session context <session_id> --json
# Summaries feeding the context
honcho session summaries <session_id> --json
# Recent message history
honcho message list <session_id> --last 50 --json
辩证推理给出的答案不理想?
# What the peer card says
honcho peer card <peer_id> --json
# Conclusions on the specific topic
honcho conclusion search "topic" --observer <peer_id> --json
# Exercise the dialectic directly
honcho peer chat <peer_id> "what do you know about X?" --json
honcho peer chat <peer_id> "what happened here?" --scope my-project --json
honcho workspace chat "what themes show up across peers?" --json
评论
支持 Markdown