Take the 2-minute tour ×

I need a simple scriptable/commandline jabber client. What is the best and/or simplest one to install?

Clarification: I'm looking for a simple way to send messages from within a script.

share|improve this question

closed as off-topic by legoscia, rene, Mahonri Moriancumer, JBentley, Daniel Lisik May 29 at 0:30



8 Answers 8

up vote 25 down vote accepted

Here are some options:

List of Jabber Console Clients

Some Scripting Options

Not sure what language you're looking to do your scripting in or what platform, but the above should hopefully get you started.

share|improve this answer
GNU Freetalk is a complete joke, it doesn't work at all. –  cnst May 5 at 15:30

Using the Net::Jabber perl module, I wrote the following script which sends the message from stdin to all the users listed on the command line.


use Net::Jabber qw(Client);

my $server = "jabber.de";
my $port = "5222";
my $username = "Sec";
my $password = "<pw>";
my $resource = "autosend";
my @recipients = @ARGV;

my $clnt = new Net::Jabber::Client;

my $status = $clnt->Connect(hostname=>$server, port=>$port);

if (!defined($status)) {
    die "Jabber connect error ($!)\n";

my @result = $clnt->AuthSend(username=>$username,

if ($result[0] ne "ok") {
    die "Jabber auth error: @result\n";

my $body = '';
while (<STDIN>) {
    $body .= $_;

foreach my $to (@recipients) {

share|improve this answer

Was looking at this myself, and found this snippet at http://snippets.dzone.com/posts/show/618

In python, needs python and python-xmpp libraries

import xmpp

login = 'Your.Login' # @gmail.com 
pwd   = 'YourPassword'

cnx = xmpp.Client('gmail.com')
cnx.connect( server=('talk.google.com',5223) )
cnx.auth(login,pwd, 'botty')

cnx.send( xmpp.Message( "YourFriend@gmail.com" ,"Hello World form Python" ) )
share|improve this answer

sendxmpp is doing this for me. Based on Net::XMPP Perl library.


  top -b -n 1 | sendxmpp -s "wake up! cpu load $cpuload at `hostname`" someone@jabber.org  

'~/.sendxmpprc' configuration file with JID and password required for operation.

share|improve this answer

Another library option: XMPP4R is a very feature-rich Ruby library for XMPP(Jabber). It uses the built-in Ruby XML handling, which is very nice. If you just need basic messaging, there is also XMPP4R-Simple.

Here's a bit of example code using XMPP4R-Simple, just to show how simple it is (stolen from here):

jabber = Jabber::Simple.new('rex@friendosaurus.com', 'password')
jabber.deliver("bront@friendosaurus.com", "Hey! I'm thinking of going Vegetarian - Any suggestions?")
share|improve this answer

Pidgin (formerly Gaim) has a command-line client.

share|improve this answer
It's called Finch –  Nick Stinemates Oct 4 '08 at 15:32
Isn't Finch more a VT100 console client than a command-line client? –  barrycarter Jan 10 '13 at 16:34

CJC (Console Jabber Client) ( cjc.jajcus.net ) is a very good client with feels very IRC-like.

EKG2 ( ekg2.org ) project also has good Jabber protocol support and is remote controllable.

share|improve this answer

If you have bash and netcat installed, another possibility would be my shell xmpp client:


Don't use it for something important (like a production server...) yet (end of 2013).

Otherwise it is pretty simple to use:


XMPP_SIMPLE="$(dirname $0)/xmpp_simple.sh"
PASS_FILE="$(dirname $0)/pass"



message_received() {
local from=$1
local message=$2

if [ "$message" = "disconnect" ]
    send_msg $1 "I can say that too:$nl$message"

xmpp_control_mode() {
set_status "My systems time: $(date)"

login_pass="$(cat $PASS_FILE)"

# only announce our system time every 60 seconds


There is also a version which uses fifos:

eval `xmpp --connect --jid "$JID" --pass-file "$PASS_FILE"`

which goes into background. You can then send a message by calling:

xmpp --msg "dest@test.com" "message"
share|improve this answer
