AI Agent Integration
allman is designed as a CLI that AI agents can drive directly. Every command supports --json for structured output, and allman listen streams real-time events as NDJSON.
Agent workflow
Section titled “Agent workflow”A typical agent loop looks like:
# 1. Check for new messagesallman inbox --json
# 2. Read conversation contextallman messages jamie-rivera --limit 10 --json
# 3. Draft and send a replyallman send jamie-rivera "Thanks for the update! I'll review the deck today."Real-time event streaming
Section titled “Real-time event streaming”For continuous monitoring, pipe allman listen to your agent:
allman listen --json | while read -r event; do # Parse the JSON event and decide what to do echo "$event" | your-agent-handlerdoneEvents include message.received, message.sent, typing, reaction, and read_receipt.
Inbox polling
Section titled “Inbox polling”allman inbox uses a watermark so each call only returns messages you haven’t seen:
# First call: returns all messages from the last 24hallman inbox --json
# Subsequent calls: only new messages since last checkallman inbox --json
# Don't advance the watermark (peek without consuming)allman inbox --json --no-markPre-send safety
Section titled “Pre-send safety”allman send automatically checks for new inbound messages before sending. If the contact sent new messages since your last reply, the send is aborted and the new messages are printed. This prevents agents from sending replies without context.
To handle this in an agent:
# Send returns exit code 1 if abortedif ! allman send jamie-rivera "$reply" 2>/dev/null; then # Re-read the conversation and reconsider allman messages jamie-rivera --limit 5 --jsonfiRate limiting
Section titled “Rate limiting”Built-in rate limiting prevents agents from sending too fast:
- Default: 3000ms minimum between sends per account
- Configurable in
.allman/{profileId}/config.json - State persists across process restarts
You don’t need to implement your own rate limiting — allman handles it.
Search
Section titled “Search”Find contacts programmatically:
# Fuzzy search by nameallman search "jamie" --json
# Returns confidence scores (100 = exact match)Full-text message search
Section titled “Full-text message search”Search across all stored messages:
allman grep "project proposal" --jsonallman grep "contract" --since 3mo --json