CLI
Besides the TUI, Wiregram has commands for scripts and AI agents. They print JSON Lines: one JSON object per line on stdout. Errors are one plain line on stderr with exit status 1.
wiregram accounts # backend, account, label, status
wiregram chats mattermost alice # chat ID, title, kind, unread
wiregram stream # incoming messages, every account
wiregram stream mattermost alice bob # one account, or one chat
wiregram send mattermost alice bob "On my way" # or pipe the message on stdin
wiregram reset # sign out everywhere, delete all data- Accounts are signed in from the app first; the commands can't sign in. An account showing
"status":"needs-login"needs you to open the app. - The commands can run beside the open app.
- WhatsApp is not available: it allows one connection, and a command would disconnect the running app.
Naming things
Every command that needs an account takes BACKEND ACCOUNT:
BACKEND:telegram,mattermost,matrixoremail(ortg,mm,mx,em).ACCOUNT: theaccountfield ofwiregram accounts: the Telegram phone number, Mattermost username, Matrix ID or email address.RECIPIENT: a chat ID (thechatfield), a chat title, a username, a Matrix ID or an email address. A DM's title is the person's display name, so prefer the username for people. A name that matches more than one chat is an error; use the chat ID then. Naming a public channel you have not joined joins it.
accounts
wiregram accounts{"backend":"mattermost","account":"alice","label":"[MM] alice@chat.example.com","status":"ok"}chats
wiregram chats BACKEND ACCOUNT{"chat":"8f3k…","title":"bob","kind":"dm","unread":2}kind is dm, group or channel.
stream
wiregram stream [BACKEND [ACCOUNT [RECIPIENT]]]Prints incoming messages as they arrive, from every signed-in account, every account of a backend, one account, or one of its chats, until Ctrl+C. Your own messages are left out. Connection changes (reconnecting, online) go to stderr.
{"time":"2026-10-14T10:02:03Z","backend":"mattermost","account":"alice",
"chat":"8f3k…","chat_title":"bob","kind":"dm","id":"p9x2…","sender":"bob",
"sender_id":"u42…","reply_to":"","text":"are you coming?","media":""}text may contain newlines (escaped in the JSON). media is a tag such as [photo] 1280x720, 245 KB for attachments; text is then the caption.
send
wiregram send [-reply ID] BACKEND ACCOUNT RECIPIENT [MESSAGE...]Sends MESSAGE, or stdin when none is given, and prints the sent message in the same shape as stream. -reply goes before the positional arguments.
wiregram send mattermost alice bob "On my way"
printf 'line one\nline two\n' | wiregram send mattermost alice bob
wiregram send -reply p9x2… mattermost alice town-square "Thanks!"Pass text from elsewhere on stdin, so the shell never interprets it.
reset
wiregram reset [-y]Signs out of every account and deletes all local data, as Settings → Reset… does. It asks first unless -y is given. This cannot be undone.
A reply loop
wiregram stream mattermost alice | while IFS= read -r line; do
[ "$(jq -r .kind <<<"$line")" = dm ] || continue
chat=$(jq -r .chat <<<"$line")
text=$(jq -r .text <<<"$line")
reply=$(make-a-reply "$text") # your logic here
printf '%s' "$reply" | wiregram send mattermost alice "$chat"
doneFor AI agents
skills/wiregram/SKILL.md teaches coding agents to use these commands. Point your agent at it, or install it as a skill.