TwiCmd let's you trigger events on your node.js server using your public twitter stream.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


TwiCmd is a small node module which enables triggering commands on a remote server using your public twitter stream.

Out hiking and need to restart nginx or run a script? Send a short Tweet

Connect it to your lights and use twitter to turn them on and off


  • My twitter stream is public, commands could reveal to much about the computer I am controlling. True, but you can name commands what ever you want. For example #yolo #bro to restart a service or clear a log.
  • It's not verbose enough. Any problem that can be diagnosed and fixed using a script is a potential candidate for a command


  • Everyone has Twitter (almost)
  • Twitter is available on all platforms (almost)
  • Twitter is mobile
  • Twitter handles authentication
  • SSH access is not as mobile

Twicmd is suggested to be used with the twitter module for twitter API communication. Add it to your dependencies or install it using npm install -g twitter



var TwiCmd = require("twicmd"),
	twitter = require("twitter"),
	twicmd, twitt;

twitt = new twitter({
	consumerKey: "Consumer key here",
	consumerSecret: "Consumer secret here",
	accessTokenKey: "Access token here",
	accessTokenSecret: "Access Secret here"

twicmd = new TwiCmd({
	tweetProvider: twitt,
	tweeters: ["xxxxxxxx"], //Numerical twitter ids
	commands: {
		test: function () { //Command triggered by #test
    //Tag needed to invoke a command besides the command tag
    //Defaults to #twicmd
	invokingTag: "#myCustomInvokingTag"

twicmd.addCommand("rs", function () {
	console.log("Restart a service")


setInterval(function() {},5000); //Prevent process shutdown


TwiCmd  = require("twicmd")
twitter = require("twitter")

twitt = new twitter
                consumerKey: "Consumer key here"
                consumerSecret: "Consumer secret here"
                accessTokenKey: "Access token here"
                accessTokenSecret: "Access Secret here"

twicmd = new TwiCmd
                tweetProvider: twitt
                tweeters: ["xxxxxxxxxxx"] #Numerical twitter ids
                        test: ->    #Available command triggered by #test
                            console.log "Test"
                invokingTag: "#mycustominvokingtag"

twicmd.addCommand "rs", () ->
    console.log "Restart a service"


setInterval (->), 5000 #Prevent process shutdown


###TwiCmd Constructor TwiCmd (parameters)


An array of twitter ids specifying who can trigger commands. Only direct tweets from these tweeters can trigger commands. If the array is left empty twicmd runs in public mode were anyone can trigger commands, this is not recommended.

####Commands An object representing the available commands. Each key will represent a command. Commands are invoked by using them in tweets as hashtags along with the invoking tag. The value of each key should be a function to run when the command is triggered.


	restart: function () {/**/},
	stop: function () {/**/}


Triggering the restart command is done with the following tweet #twicmd #restart given that the invoking tag has not been changed from the default.

####TweetProvider A tweet provider. The node module twitter is suggested. The tweet provider should provide a method called stream with the same signature as the stream method in the twitter module.


The extra tag required to invoke a command besides the command tag.

Default: #twicmd


MIT, see license file