Use rr when the user explicitly wants to operate Beeper Desktop via the local API (send, search, list chats/messages, reminders, focus).
Prefer --agent for agent use (forces JSON, envelope, no-input, readonly).
Safety
--agent for safe agent defaults: rr --agent --enable-commands=chats,messages,status chats list--readonly to block writes: rr --readonly chats list --json--enable-commands to allowlist: rr --enable-commands=chats,messages chats list --json--envelope for structured errors: rr --json --envelope chats get "!chatid"error.hint with next-step guidance for safe retries.$100/month or !). Prefer --stdin <<'EOF' ... EOF for safe literals.Setup (once)
rr auth set --stdin (recommended; token saved to ~/.config/beeper/config.json)rr auth status --checkrr doctorCommon commands
rr accounts list --jsonrr capabilities --jsonrr describe messages send --jsonrr connect info --jsonrr events tail --all --stop-after 30s --jsonrr contacts list "" --json rr contacts search "" "Alice" --json rr contacts search "Alice" --account-id="" --json rr contacts resolve "" "Alice" --json rr contacts resolve "Alice" --account-id="" --json rr chats list --jsonrr chats list --jsonlrr chats search "John" --jsonrr chats search --inbox=primary --unread-only --jsonrr chats search --last-activity-after="2024-07-01T00:00:00Z" --jsonrr chats search "Jamie" --scope=participants --jsonrr chats resolve "Jamie" --jsonrr chats get "!chatid:beeper.com" --jsonrr chats get "!chatid:beeper.com" --max-participant-count=50 --jsonrr chats start "" --email "alice@example.com" --full-name "Alice" --json rr --account="imessage:+123" chats list --jsonrr messages list "!chatid:beeper.com" --jsonrr messages list "!chatid:beeper.com" --all --max-items=1000 --jsonrr messages list "!chatid:beeper.com" --download-media --download-dir ./media --jsonrr messages search "dinner" --jsonrr messages search "dinner" --jsonlrr messages search "dinner" --all --max-items=1000 --jsonrr messages search --sender=me --date-after="2024-07-01T00:00:00Z" --media-types=image --jsonrr messages react "!chatid:beeper.com" "" "👍" --json / rr messages unreact "!chatid:beeper.com" "" "👍" --json rr messages tail "!chatid:beeper.com" --interval 2s --stop-after 30s --jsonrr messages wait --chat-id="!chatid:beeper.com" --contains "deploy" --wait-timeout 2m --jsonrr messages context "!chatid:beeper.com" "" --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.txtrr 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" --jsonrr focusrr search "dinner" --jsonrr search "dinner" --messages-all --messages-max-items=500 --messages-limit=20 --jsonrr status --jsonrr status --by-account --jsonrr unread --jsonin_groups for participant matches.Mutations (explicit user request only)
rr messages send "!chatid:beeper.com" "Hello!"rr messages edit "!chatid:beeper.com" "" "Updated text" rr messages react "!chatid:beeper.com" "" "👍" / rr messages unreact "!chatid:beeper.com" "" "👍" rr messages send-file "!chatid:beeper.com" ./photo.jpg "See attached"rr chats create "" --participant "" rr chats start "" --email "alice@example.com" --full-name "Alice" rr chats archive "!chatid:beeper.com" / rr chats archive "!chatid:beeper.com" --unarchiverr reminders set "!chatid:beeper.com" "2h" / rr reminders clear "!chatid:beeper.com"rr assets upload ./photo.jpg / rr assets upload-base64 --content-file ./photo.b64--request-id and prefer --dedupe-window.--dry-run to validate mutating requests without API write side effects.Pagination
rr chats list --all --max-items=1000 --json / rr chats search "alice" --all --max-items=1000 --jsonrr messages list "!chatid:beeper.com" --all --max-items=1000 --json / rr messages search "deploy" --all --max-items=1000 --jsonrr chats list --cursor="" --direction=before --json rr messages list "!chatid:beeper.com" --cursor="" --direction=before --json rr messages search "project" --limit=20 --jsonrr messages search "project" --cursor="" --direction=before --json rr search "dinner" --messages-limit=20 --jsonrr search "dinner" --messages-cursor="" --messages-direction=before --json Notes
~/.config/beeper/config.json via rr auth set (recommended). BEEPER_TOKEN overrides the config file.BEEPER_ACCOUNT sets the default account ID (aliases supported).rr auth status --check prefers OAuth introspection (/oauth/introspect) when available and falls back to account-list validation on older builds.rr contacts resolve is strict and fails on ambiguous names; resolve by ID after contacts search when needed.--scope=participants to find by name.display_name for single chats (derived from participants).message_type, linked_message_id, is_sender, is_unread, attachments, and reactions.downloaded_attachments is only populated when --download-media is used.rr messages send returns pending_message_id (temporary ID).network may be missing in newer API builds; rr falls back to "unknown" in summaries/search output.rr assets serve writes raw bytes to stdout unless --dest is provided.--chat does exact matching and fails on ambiguous matches.--attachment-upload-id; set --attachment-width and --attachment-height together.--all has a safety cap (default 500 items, max 5000); use --max-items to tune it.--json or --jsonl (and --no-input) for automation.--jsonl emits one JSON object per line and is supported on high-volume list/search commands.--dry-run/BEEPER_DRY_RUN validates mutating command inputs and prints preview output without sending write API requests.BEEPER_URL overrides API base URL; BEEPER_TIMEOUT sets timeout in seconds.--force; --no-input/BEEPER_NO_INPUT fails without --force.--fail-if-empty on list/search commands to exit with code 1 if no results.--fields with --plain to select columns (comma-separated).! triggers history expansion. Prefer single quotes, or disable history expansion (set +H in bash, setopt NO_HIST_EXPAND in zsh).rr version --json returns features array for capability discovery.rr capabilities --json returns full CLI capability metadata.rr events tail depends on experimental /v1/ws support in Beeper Desktop; fall back to rr messages tail when unavailable.AUTH_ERROR, NOT_FOUND, VALIDATION_ERROR, CONNECTION_ERROR, INTERNAL_ERROR.CONNECTION_ERROR with backoff; do not blind-retry AUTH_ERROR/VALIDATION_ERROR; refresh IDs before retrying NOT_FOUND.messages send, messages send-file, chats create, chats start, assets upload, assets upload-base64.--request-id/BEEPER_REQUEST_ID to tag envelope metadata for cross-retry attempt tracing.--dedupe-window/BEEPER_DEDUPE_WINDOW to block duplicate non-idempotent writes with repeated request IDs.make test-agent-smoke.共 2 个版本