Skip to content

Add read-only CLI for cached WhatsApp data#32

Open
Fr4nzz wants to merge 1 commit into
toloco:mainfrom
Fr4nzz:add-cli-agent-tools
Open

Add read-only CLI for cached WhatsApp data#32
Fr4nzz wants to merge 1 commit into
toloco:mainfrom
Fr4nzz:add-cli-agent-tools

Conversation

@Fr4nzz
Copy link
Copy Markdown

@Fr4nzz Fr4nzz commented May 6, 2026

Summary

Adds a read-only whasapo cli command group for agents and scripts that prefer shell commands over direct MCP tool calls.

Commands added:

whasapo cli doctor --json
whasapo cli chats --json
whasapo cli search "family group" --limit 20 --json
whasapo cli messages --chat 120363xxx@g.us --limit 50 --json

The CLI reads the same local SQLite cache used by the MCP server and does not send messages.

Why a CLI in addition to MCP?

We ended up using a CLI wrapper in Codex Desktop because it was more reliable for read-heavy workflows:

  • Some AI environments do not expose MCP tools consistently in every chat/session.
  • Shell commands with JSON stdout are easy for agents to parse, log, retry, and test.
  • Cached SQLite reads avoid opening competing MCP stdio streams for broad searches.
  • Searches are fast and parallel-safe because they do not require a live WhatsApp connection.
  • Agents can search broadly first, then inspect only the relevant chats/messages.

MCP is still the primary integration path for full interactive use and sending; this PR just adds a small terminal surface for cached read-only workflows.

Testing

  • go test ./...
  • go run ./cmd/whasapo cli help
  • go run ./cmd/whasapo cli doctor --json
  • go run ./cmd/whasapo cli search test --limit 2 --json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant