Simple XMPP toolbox for sending/receiving messages
Merge branch 'master' of git.sr.ht:~michalr/xmpp-toolbox
Updated xmpp module 0.3.0 -> 0.4.0


browse  log 



You can also use your local clone with git send-email.

#XMPP Toolbox

builds.sr.ht status

Disclaimer: I am pretty new to golang, so the code is probably of low quality. Please point out problems and my mistakes on the mailing list. Thanks!

Simple XMPP tool that has two purposes:

  • Receives XMPP messages and prints their content to standard output in JSON format for further processing (for example using jq),
  • Reads data from standard input and sends them to a specified JID as chat messages.

Both of those functionalities have to be explicitly enabled on the command line:

Usage of ./xmpp-toolbox:
        If specified, will connect to XMPP and print incoming messages to the console
  -recipent string
        If specified, a messages from STDIN will be sent to provided JID


  • Program terminates immediately when neither -listen nor -recipent is used in the command line,
  • SIGTERM causes the program to disconnect from the XMPP server and terminate,
  • In case of -recipent command line option being used, program terminates when EOF is encountered on the standard input.


Program reads the server, JID and password from the following environment variables:


There are multiple options where to go from there. My suggestion would be to create a file like the following and source it before executing the toolbox:

export XMPP_SERVER="server.tld"
export XMPP_USERNAME="user@server.tld"
export XMPP_PASSWORD="password"


Automatically built binaries: