roadrunner
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseroadrunner (rr)
roadrunner(rr)
Use when the user explicitly wants to operate Beeper Desktop via the local API (send, search, list chats/messages, reminders, focus).
Prefer for agent use (forces JSON, envelope, no-input, readonly).
rr--agentSafety
- Default to read-only commands unless the user explicitly requests a mutation in this turn.
- Require explicit recipient (chat ID) and message text before sending.
- Confirm or ask a clarifying question if the chat ID is ambiguous.
- Never paste raw rr command output (JSON dumps, chat lists, etc.) into outgoing messages. Treat tool output as private; summarize or extract only what the user needs.
- Use for safe agent defaults:
--agentrr --agent --enable-commands=chats,messages,status chats list - Use to block writes:
--readonlyrr --readonly chats list --json - Use to allowlist:
--enable-commandsrr --enable-commands=chats,messages chats list --json - Use for structured errors:
--enveloperr --json --envelope chats get "!chatid" - Envelope errors may include with next-step guidance for safe retries.
error.hint - Never request, paste, or store raw auth tokens in chat. If auth is missing, ask the user to configure it locally.
- If sending message text through a shell, avoid interpolation/expansion (e.g. or
$100/month). Prefer!for safe literals.--stdin <<'EOF' ... EOF
Setup (once)
- (recommended; token saved to
rr auth set --stdin)~/.config/beeper/config.json rr auth status --checkrr doctor
Common commands
- List accounts:
rr accounts list --json - Capabilities:
rr capabilities --json - Search contacts:
rr contacts search "<account-id>" "Alice" --json - Search contacts (flag):
rr contacts search "Alice" --account-id="<account-id>" --json - Resolve contact:
rr contacts resolve "<account-id>" "Alice" --json - Resolve contact (flag):
rr contacts resolve "Alice" --account-id="<account-id>" --json - List chats:
rr chats list --json - Search chats:
rr chats search "John" --json - Search chats (filters):
rr chats search --inbox=primary --unread-only --json - Search chats (activity):
rr chats search --last-activity-after="2024-07-01T00:00:00Z" --json - Search by participant name:
rr chats search "Jamie" --scope=participants --json - Resolve chat:
rr chats resolve "Jamie" --json - Get chat:
rr chats get "!chatid:beeper.com" --json - Get chat (bounded participants):
rr chats get "!chatid:beeper.com" --max-participant-count=50 --json - Default account for commands:
rr --account="imessage:+123" chats list --json - List messages:
rr messages list "!chatid:beeper.com" --json - List messages (all pages):
rr messages list "!chatid:beeper.com" --all --max-items=1000 --json - List messages (download media):
rr messages list "!chatid:beeper.com" --download-media --download-dir ./media --json - Search messages:
rr messages search "dinner" --json - Search messages (all pages):
rr messages search "dinner" --all --max-items=1000 --json - Search messages (filters):
rr messages search --sender=me --date-after="2024-07-01T00:00:00Z" --media-types=image --json - Tail messages (polling):
rr messages tail "!chatid:beeper.com" --interval 2s --stop-after 30s --json - Wait for message:
rr messages wait --chat-id="!chatid:beeper.com" --contains "deploy" --wait-timeout 2m --json - Message context:
rr messages context "!chatid:beeper.com" "<sortKey>" --before 5 --after 2 --json - Draft message (pre-fill without sending):
rr focus --chat-id="!chatid:beeper.com" --draft-text="Hello!" - Draft message from file:
rr focus --chat-id="!chatid:beeper.com" --draft-text-file ./draft.txt - Draft with attachment:
rr focus --chat-id="!chatid:beeper.com" --draft-attachment="/path/to/file.jpg" - Download attachment:
rr assets download "mxc://example.org/abc123" --dest "./attachment.jpg" - Stream attachment bytes:
rr assets serve "mxc://example.org/abc123" --dest "./attachment.jpg" --json - Focus app:
rr focus - Global search:
rr search "dinner" --json - Global search messages auto-page:
rr search "dinner" --messages-all --messages-max-items=500 --messages-limit=20 --json - Status summary:
rr status --json - Status by account:
rr status --by-account --json - Unread rollup:
rr unread --json - Global search includes for participant matches.
in_groups
Mutations (explicit user request only)
- Message send:
rr messages send "!chatid:beeper.com" "Hello!" - Message edit:
rr messages edit "!chatid:beeper.com" "<message-id>" "Updated text" - Upload + send file:
rr messages send-file "!chatid:beeper.com" ./photo.jpg "See attached" - Create chat:
rr chats create "<account-id>" --participant "<user-id>" - Archive/unarchive: /
rr chats archive "!chatid:beeper.com"rr chats archive "!chatid:beeper.com" --unarchive - Reminder mutations: /
rr reminders set "!chatid:beeper.com" "2h"rr reminders clear "!chatid:beeper.com" - Asset uploads: /
rr assets upload ./photo.jpgrr assets upload-base64 --content-file ./photo.b64 - For retries on non-idempotent writes, use and prefer
--request-id.--dedupe-window
Pagination
- Auto-page chats list/search: /
rr chats list --all --max-items=1000 --jsonrr chats search "alice" --all --max-items=1000 --json - Auto-page messages list/search: /
rr messages list "!chatid:beeper.com" --all --max-items=1000 --jsonrr messages search "deploy" --all --max-items=1000 --json - Chats:
rr chats list --cursor="<oldestCursor>" --direction=before --json - Messages list:
rr messages list "!chatid:beeper.com" --cursor="<sortKey>" --direction=before --json - Messages search (max 20):
rr messages search "project" --limit=20 --json - Messages search page:
rr messages search "project" --cursor="<cursor>" --direction=before --json - Global search message paging (max 20):
rr search "dinner" --messages-limit=20 --json - Global search message page:
rr search "dinner" --messages-cursor="<cursor>" --messages-direction=before --json
Notes
- Requires Beeper Desktop running; token from app settings.
- Token is stored in via
~/.config/beeper/config.json(recommended).rr auth setoverrides the config file.BEEPER_TOKEN - sets the default account ID (aliases supported).
BEEPER_ACCOUNT - Message search is literal word match (not semantic).
- is strict and fails on ambiguous names; resolve by ID after
rr contacts resolvewhen needed.contacts search - If a DM title shows your own Matrix ID, use to find by name.
--scope=participants - JSON output includes for single chats (derived from participants).
display_name - Message JSON includes ,
is_sender,is_unread, andattachments.reactions - is only populated when
downloaded_attachmentsis used.--download-media - returns
rr messages send(temporary ID).pending_message_id - writes raw bytes to stdout unless
rr assets serveis provided.--dest - does exact matching and fails on ambiguous matches.
--chat - Attachment overrides require ; set
--attachment-upload-idand--attachment-widthtogether.--attachment-height - has a safety cap (default 500 items, max 5000); use
--allto tune it.--max-items - Prefer (and
--json) for automation.--no-input - overrides API base URL;
BEEPER_URLsets timeout in seconds.BEEPER_TIMEOUT - JSON/Plain output goes to stdout; errors/hints go to stderr.
- Destructive commands prompt unless ;
--force/--no-inputfails withoutBEEPER_NO_INPUT.--force - Use on list/search commands to exit with code 1 if no results.
--fail-if-empty - Use with
--fieldsto select columns (comma-separated).--plain - In bash/zsh, triggers history expansion. Prefer single quotes, or disable history expansion (
!in bash,set +Hin zsh).setopt NO_HIST_EXPAND - returns
rr version --jsonarray for capability discovery.features - returns full CLI capability metadata.
rr capabilities --json - Envelope error codes: ,
AUTH_ERROR,NOT_FOUND,VALIDATION_ERROR,CONNECTION_ERROR.INTERNAL_ERROR - Retry policy: retry with backoff; do not blind-retry
CONNECTION_ERROR/AUTH_ERROR; refresh IDs before retryingVALIDATION_ERROR.NOT_FOUND - Non-idempotent writes: ,
messages send,messages send-file,chats create,assets upload.assets upload-base64 - Use /
--request-idto tag envelope metadata for cross-retry attempt tracing.BEEPER_REQUEST_ID - Use /
--dedupe-windowto block duplicate non-idempotent writes with repeated request IDs.BEEPER_DEDUPE_WINDOW - Local smoke check: .
make test-agent-smoke
当用户明确希望通过本地API操作Beeper Desktop时(发送消息、搜索、列出聊天/消息、设置提醒、聚焦窗口),请使用命令。对于Agent使用场景,优先使用参数(强制输出JSON格式、使用信封结构、无交互输入、只读模式)。
rr--agent安全注意事项
- 默认使用只读命令,除非用户在本次请求中明确要求执行修改操作。
- 发送消息前必须明确指定接收方(聊天ID)和消息文本。
- 如果聊天ID存在歧义,请确认或提出澄清问题。
- 切勿将rr命令的原始输出(JSON数据、聊天列表等)粘贴到外发消息中。将工具输出视为私密内容;仅总结或提取用户需要的信息。
- 对于安全的Agent默认配置,使用参数:
--agentrr --agent --enable-commands=chats,messages,status chats list - 使用参数阻止写入操作:
--readonlyrr --readonly chats list --json - 使用参数设置允许的命令白名单:
--enable-commandsrr --enable-commands=chats,messages chats list --json - 使用参数获取结构化错误信息:
--enveloperr --json --envelope chats get "!chatid" - 信封格式的错误信息可能包含字段,提供安全重试的下一步指导。
error.hint - 切勿请求、粘贴或存储原始认证令牌到聊天中。如果缺少认证信息,请让用户在本地配置。
- 如果通过Shell发送消息文本,避免变量插值/扩展(例如或
$100/month)。对于安全的文本内容,优先使用!方式。--stdin <<'EOF' ... EOF
首次设置
- (推荐;令牌将保存到
rr auth set --stdin)~/.config/beeper/config.json rr auth status --checkrr doctor
常用命令
- 列出账户:
rr accounts list --json - 查看功能支持:
rr capabilities --json - 搜索联系人:
rr contacts search "<account-id>" "Alice" --json - 搜索联系人(使用参数):
rr contacts search "Alice" --account-id="<account-id>" --json - 解析联系人:
rr contacts resolve "<account-id>" "Alice" --json - 解析联系人(使用参数):
rr contacts resolve "Alice" --account-id="<account-id>" --json - 列出聊天:
rr chats list --json - 搜索聊天:
rr chats search "John" --json - 搜索聊天(筛选条件):
rr chats search --inbox=primary --unread-only --json - 搜索聊天(按活动时间):
rr chats search --last-activity-after="2024-07-01T00:00:00Z" --json - 按参与者名称搜索聊天:
rr chats search "Jamie" --scope=participants --json - 解析聊天:
rr chats resolve "Jamie" --json - 获取聊天详情:
rr chats get "!chatid:beeper.com" --json - 获取聊天详情(限制参与者数量):
rr chats get "!chatid:beeper.com" --max-participant-count=50 --json - 指定命令的默认账户:
rr --account="imessage:+123" chats list --json - 列出消息:
rr messages list "!chatid:beeper.com" --json - 列出所有消息(自动分页):
rr messages list "!chatid:beeper.com" --all --max-items=1000 --json - 列出消息并下载媒体文件:
rr messages list "!chatid:beeper.com" --download-media --download-dir ./media --json - 搜索消息:
rr messages search "dinner" --json - 搜索所有消息(自动分页):
rr messages search "dinner" --all --max-items=1000 --json - 搜索消息(筛选条件):
rr messages search --sender=me --date-after="2024-07-01T00:00:00Z" --media-types=image --json - 实时监听消息(轮询):
rr messages tail "!chatid:beeper.com" --interval 2s --stop-after 30s --json - 等待指定消息:
rr messages wait --chat-id="!chatid:beeper.com" --contains "deploy" --wait-timeout 2m --json - 获取消息上下文:
rr messages context "!chatid:beeper.com" "<sortKey>" --before 5 --after 2 --json - 草稿消息(预填充不发送):
rr focus --chat-id="!chatid:beeper.com" --draft-text="Hello!" - 从文件加载草稿消息:
rr focus --chat-id="!chatid:beeper.com" --draft-text-file ./draft.txt - 带附件的草稿:
rr focus --chat-id="!chatid:beeper.com" --draft-attachment="/path/to/file.jpg" - 下载附件:
rr assets download "mxc://example.org/abc123" --dest "./attachment.jpg" - 流式传输附件字节:
rr assets serve "mxc://example.org/abc123" --dest "./attachment.jpg" --json - 聚焦应用窗口:
rr focus - 全局搜索:
rr search "dinner" --json - 全局搜索消息自动分页:
rr search "dinner" --messages-all --messages-max-items=500 --messages-limit=20 --json - 状态汇总:
rr status --json - 按账户查看状态:
rr status --by-account --json - 未读消息汇总:
rr unread --json - 全局搜索包含参数用于匹配参与者。
in_groups
修改操作(仅在用户明确请求时执行)
- 发送消息:
rr messages send "!chatid:beeper.com" "Hello!" - 编辑消息:
rr messages edit "!chatid:beeper.com" "<message-id>" "Updated text" - 上传并发送文件:
rr messages send-file "!chatid:beeper.com" ./photo.jpg "See attached" - 创建聊天:
rr chats create "<account-id>" --participant "<user-id>" - 归档/取消归档:/
rr chats archive "!chatid:beeper.com"rr chats archive "!chatid:beeper.com" --unarchive - 提醒修改:/
rr reminders set "!chatid:beeper.com" "2h"rr reminders clear "!chatid:beeper.com" - 资产上传:/
rr assets upload ./photo.jpgrr assets upload-base64 --content-file ./photo.b64 - 对于非幂等写入操作的重试,使用参数,并优先配合
--request-id参数。--dedupe-window
分页
- 聊天列表/搜索自动分页:/
rr chats list --all --max-items=1000 --jsonrr chats search "alice" --all --max-items=1000 --json - 消息列表/搜索自动分页:/
rr messages list "!chatid:beeper.com" --all --max-items=1000 --jsonrr messages search "deploy" --all --max-items=1000 --json - 聊天分页:
rr chats list --cursor="<oldestCursor>" --direction=before --json - 消息列表分页:
rr messages list "!chatid:beeper.com" --cursor="<sortKey>" --direction=before --json - 消息搜索(最多20条):
rr messages search "project" --limit=20 --json - 消息搜索分页:
rr messages search "project" --cursor="<cursor>" --direction=before --json - 全局搜索消息分页(最多20条):
rr search "dinner" --messages-limit=20 --json - 全局搜索消息分页:
rr search "dinner" --messages-cursor="<cursor>" --messages-direction=before --json
注意事项
- 需要Beeper Desktop处于运行状态;令牌可从应用设置中获取。
- 令牌通过命令保存到
rr auth set(推荐方式)。环境变量~/.config/beeper/config.json会覆盖配置文件中的设置。BEEPER_TOKEN - 环境变量用于设置默认账户ID(支持别名)。
BEEPER_ACCOUNT - 消息搜索为字面单词匹配(非语义匹配)。
- 命令为严格匹配,名称存在歧义时会执行失败;必要时可先通过
rr contacts resolve获取ID再进行解析。contacts search - 如果私聊会话标题显示您自己的Matrix ID,可使用参数按名称查找。
--scope=participants - JSON输出包含单聊的字段(从参与者信息推导)。
display_name - 消息JSON包含、
is_sender、is_unread和attachments字段。reactions - 仅当使用参数时,才会填充
--download-media字段。downloaded_attachments - 命令返回
rr messages send(临时ID)。pending_message_id - 除非指定参数,否则
--dest命令会将原始字节写入标准输出。rr assets serve - 参数为精确匹配,存在歧义匹配时会执行失败。
--chat - 附件覆盖需要使用参数;
--attachment-upload-id和--attachment-width参数需同时设置。--attachment-height - 参数有安全上限(默认500条,最大5000条);可使用
--all参数调整。--max-items - 自动化场景优先使用(配合
--json)参数。--no-input - 环境变量用于覆盖API基础URL;
BEEPER_URL用于设置超时时间(秒)。BEEPER_TIMEOUT - JSON/纯文本输出写入标准输出;错误/提示信息写入标准错误输出。
- 破坏性命令会触发确认提示,除非使用参数;如果未使用
--force,--force/--no-input会导致命令执行失败。BEEPER_NO_INPUT - 在列表/搜索命令中使用参数,当无结果时会以代码1退出。
--fail-if-empty - 配合参数使用
--plain参数选择要显示的列(逗号分隔)。--fields - 在bash/zsh中,会触发历史扩展。优先使用单引号,或禁用历史扩展(bash中执行
!,zsh中执行set +H)。setopt NO_HIST_EXPAND - 命令返回
rr version --json数组用于功能发现。features - 命令返回完整的CLI功能元数据。
rr capabilities --json - 信封格式错误码:、
AUTH_ERROR、NOT_FOUND、VALIDATION_ERROR、CONNECTION_ERROR。INTERNAL_ERROR - 重试策略:对错误进行退避重试;不要盲目重试
CONNECTION_ERROR/AUTH_ERROR错误;重试VALIDATION_ERROR错误前先刷新ID。NOT_FOUND - 非幂等写入操作:、
messages send、messages send-file、chats create、assets upload。assets upload-base64 - 使用/
--request-id参数标记信封元数据,用于跨重试尝试的追踪。BEEPER_REQUEST_ID - 使用/
--dedupe-window参数阻止重复请求ID的非幂等写入操作重复执行。BEEPER_DEDUPE_WINDOW - 本地冒烟测试:。
make test-agent-smoke