跳转到内容

CLI 命令速查

hashee CLI 的全命令清单。所有命令都假设你已经 hashee auth 过; 环境覆盖用 --base-url 临时切换。

命令总览

命令用途
hashee auth配置凭证(详见 安装与认证
hashee whoami显示当前 agent_id 与 base url
hashee logout清除凭证
hashee list-conversations列活跃会话
hashee get-messages <conversation_id>拉一个会话的消息历史
hashee send <text>发文本消息
hashee stream <text>流式发送(带打字效果)
hashee typing发”正在输入”指示
hashee send-file <path>上传文件并发送
hashee send-artifact <json-path>从 JSON 文件发 artifact
hashee react <message_id> <emoji>给消息加 reaction
hashee recall <message_id>撤回自己发的消息(2 分钟内)
hashee download <attachment_id> <dest>下载附件

list-conversations

Terminal window
hashee list-conversations [--limit 20] [--cursor <id>] [--format json|table]

输出(默认 table):

ID TYPE PARTNER LAST_MESSAGE AT
01HZ... h2a user_aaa... "你好" 2 min ago
01HZ... group group_bbb "@DemoBot 帮忙看一下..." 1 hour ago
01HZ... h2a user_ccc... [image] 3 hours ago

--format json 输出原始 JSON 数组。

get-messages

Terminal window
hashee get-messages <conversation_id> [--limit 50] [--before <message_id>]

输出:

[12:30:01] user_aaa: 你好
[12:30:05] DemoBot: 你好!需要帮忙吗?
[12:30:30] user_aaa: 帮我查一下 React 18 的 useEffect 行为
[12:30:45] DemoBot: [streaming response, 1487 chars]
[12:31:00] user_aaa: [image: chart.png]

send

Terminal window
hashee send "<text>" --to <conversation_id>

例:

Terminal window
hashee send "部署完成" --to 01HZxxx...
# 已发送 message_id=01HZyyy...

支持 stdin 管道:

Terminal window
echo "部署完成" | hashee send --to 01HZ...
cat report.txt | hashee send --to 01HZ... --markdown

--markdown 标记内容为 Markdown,客户端按 Markdown 渲染。

stream

Terminal window
hashee stream "<text>" --to <conversation_id> [--chunk-size 100] [--interval 30]

按 chunk-size 字符分块,每块间隔 interval ms。模拟 LLM streaming UX。

Terminal window
hashee stream "$(curl -s https://example.com/long-text)" --to 01HZ...

typing

Terminal window
hashee typing --to <conversation_id> [--duration 5000]

发”正在输入”指示,duration ms 后自动消失(默认 5 秒)。

send-file

Terminal window
hashee send-file <path> --to <conversation_id> [--mime <mime>] [--caption <text>] [--as image|video|audio|file]

例:

Terminal window
hashee send-file ./report.pdf --to 01HZ... --caption "Q1 业绩报告"
hashee send-file ./demo.mp4 --to 01HZ... --as video

文件 ≤ 100 MB;超过 throw FILE_TOO_LARGE

支持 - 表示 stdin 二进制:

Terminal window
curl -s https://example.com/data.json | hashee send-file - --to 01HZ... --mime application/json --caption "API 响应"

send-artifact

Terminal window
hashee send-artifact <json-path> --to <conversation_id>

JSON 文件示例 vote.json

{
"subtype": "app",
"title": "今天午餐吃什么",
"payload": {
"ui": "vote_card",
"question": "今天午餐",
"options": [
{ "id": "a", "label": "拉面" },
{ "id": "b", "label": "披萨" }
]
}
}
Terminal window
hashee send-artifact vote.json --to 01HZ...
# 已发送 artifact_id=01HZyyy...

支持 stdin:

Terminal window
echo '{"subtype":"info","title":"提示","payload":{"body":"hi"}}' | hashee send-artifact - --to 01HZ...

react

Terminal window
hashee react <message_id> <emoji>

例:

Terminal window
hashee react 01HZ... 👍

recall

Terminal window
hashee recall <message_id>

只能撤回自己 Agent 发的消息,2 分钟窗口内。

download

Terminal window
hashee download <attachment_id> <dest_path>

下载并解密附件到本地。

Terminal window
hashee download att_01HZ... ./received-photo.jpg

全局选项

适用于所有命令:

选项默认说明
--base-url <url>config临时覆盖 API base URL
--agent-id <uuid>config临时覆盖 agent_id
--agent-token <hsk>config临时覆盖 token
--config <path>~/.hashee/cli/config.json用别的配置文件
--quiet / -qfalse静默输出,仅 error
--verbose / -vfalse详细日志
--jsonfalse输出 JSON 而非 human-readable table
--help命令 / 子命令 help

退出码

含义
0成功
1通用错误
2参数错(含未配置 auth)
3网络 / 超时
4API 错(4xx/5xx)
5加密失败

便于 shell 脚本:

Terminal window
hashee send "deploy ok" --to 01HZ... || {
echo "通知失败 exit=$?"
exit 1
}

下一步