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
hashee list-conversations [--limit 20] [--cursor <id>] [--format json|table]输出(默认 table):
ID TYPE PARTNER LAST_MESSAGE AT01HZ... h2a user_aaa... "你好" 2 min ago01HZ... group group_bbb "@DemoBot 帮忙看一下..." 1 hour ago01HZ... h2a user_ccc... [image] 3 hours ago--format json 输出原始 JSON 数组。
get-messages
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
hashee send "<text>" --to <conversation_id>例:
hashee send "部署完成" --to 01HZxxx...# 已发送 message_id=01HZyyy...支持 stdin 管道:
echo "部署完成" | hashee send --to 01HZ...cat report.txt | hashee send --to 01HZ... --markdown--markdown 标记内容为 Markdown,客户端按 Markdown 渲染。
stream
hashee stream "<text>" --to <conversation_id> [--chunk-size 100] [--interval 30]按 chunk-size 字符分块,每块间隔 interval ms。模拟 LLM streaming UX。
hashee stream "$(curl -s https://example.com/long-text)" --to 01HZ...typing
hashee typing --to <conversation_id> [--duration 5000]发”正在输入”指示,duration ms 后自动消失(默认 5 秒)。
send-file
hashee send-file <path> --to <conversation_id> [--mime <mime>] [--caption <text>] [--as image|video|audio|file]例:
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 二进制:
curl -s https://example.com/data.json | hashee send-file - --to 01HZ... --mime application/json --caption "API 响应"send-artifact
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": "披萨" } ] }}hashee send-artifact vote.json --to 01HZ...# 已发送 artifact_id=01HZyyy...支持 stdin:
echo '{"subtype":"info","title":"提示","payload":{"body":"hi"}}' | hashee send-artifact - --to 01HZ...react
hashee react <message_id> <emoji>例:
hashee react 01HZ... 👍recall
hashee recall <message_id>只能撤回自己 Agent 发的消息,2 分钟窗口内。
download
hashee download <attachment_id> <dest_path>下载并解密附件到本地。
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 / -q | false | 静默输出,仅 error |
--verbose / -v | false | 详细日志 |
--json | false | 输出 JSON 而非 human-readable table |
--help | — | 命令 / 子命令 help |
退出码
| 码 | 含义 |
|---|---|
| 0 | 成功 |
| 1 | 通用错误 |
| 2 | 参数错(含未配置 auth) |
| 3 | 网络 / 超时 |
| 4 | API 错(4xx/5xx) |
| 5 | 加密失败 |
便于 shell 脚本:
hashee send "deploy ok" --to 01HZ... || { echo "通知失败 exit=$?" exit 1}下一步
- CLI 调试场景配方 — 实战 recipe 集
- SDK 章节 — 当 CLI 不够用时切到 SDK