dmbridge
A local, free, and open-source command-line interface for direct messages.
dmbridge gives scripts and AI agents a JSON interface for direct messages across XChat and Instagram Messaging. It is free and open source, runs entirely on your machine, and talks directly to each platform. There is no dmbridge-hosted middleman service or subscription.
Get started
Install dmbridge and connect your first account.
Try the X workflow
Open a DM, heart a meme, reply, and download it.
Credentials and security
Understand where dmbridge runs and how it stores credentials.
Browse the objects
See every field in messages, conversations, attachments, and more.
Read the schemas
Explore the complete versioned JSON contract.
Why it exists
twocents runs a lot of social media accounts. We wanted one practical way for our agents to handle incoming messages without teaching each agent a different API, authentication flow, and response format.
Development and testing
dmbridge was vibe coded with Codex and GPT-5.6 against those real workflows. The offline test suite covers authentication, schemas, pagination, provider fixtures, encryption paths, mutations, attachments, and failure behavior. An optional live, read-only suite can verify configured X and Instagram accounts.
Review the dry run before letting an agent send or change messages. Every mutation supports
--dry-run, destructive actions require confirmation, and failures report
whether an automatic retry would be safe.
What works
- XChat and Instagram Messaging
- Multiple named accounts per platform
- Direct and group conversations where the provider supports them
- Conversation and message-request inboxes
- Read, send, reply, edit, delete, and read-state operations where supported
- Reactions and attachment downloads
- JSON output with stable, versioned schemas
- Non-interactive operation for agents and scripts
Provider APIs can change underneath dmbridge. Use doctor --live when you want
to verify a configured account against the real provider.
The contract
- Primary results are JSON on stdout.
- Progress, warnings, and diagnostics go to stderr.
- Every envelope has a stable protocol version.
- Every mutation supports
--dry-run. - Destructive actions require explicit confirmation.
- Errors say whether an automatic retry is safe.
Start with installation and account setup, or jump straight to the CLI reference.