Our very own hubot.

License: MIT

Language: CoffeeScript


This is a version of GitHub's Campfire bot, hubot. He's pretty cool.

You'll probably never have to hack on this repo directly.

Instead this repo provides a library that's distributed by npm that you simply require in your project. Follow the instructions below and get your own hubot ready to deploy.

Getting your own

Make sure you have node.js and npm (npm comes with node v0.6.3+) installed.

Download the latest version of hubot.

Then follow the instructions in the README in the extracted hubot directory.


Adapters are the interface to the service you want your hubot to run on. This can be something like Campfire or IRC. There are a number of third party adapters that the community have contributed. Check the hubot wiki for the available ones and how to create your own.

Please submit issues and pull requests for third party adapters to the adapter repo, not this repo (unless it's the Campfire or Shell adapter).


Hubot ships with a number of default scripts, but there's a growing number of extras in the hubot-scripts repository. hubot-scripts is a way to share scripts with the entire community.

Check out the README for more help on installing individual scripts.


This functionality allows users to enable scripts from npm packages which don't have to be included in the hubot-scripts repository.

To enable to functionality you can follow the following steps.

  1. Add the packages as dependencies into your package.json
  2. npm install to make sure those packages are installed

To enable third-party scripts that you've added you will need to add the package name as a double quoted string to the external-scripts.json file for your hubot.

Creating a script package

Creating a script package for hubot is very simple. Start by creating a normal npm package. Make sure you add a main file for the entry point (e.g. index.js or

In this entry point file you're going to have to export a function that hubot will use to load the scripts in your package. Below is a simple example for loading each script in a ./scripts directory in your package.

Fs   = require 'fs'
Path = require 'path'

module.exports = (robot) ->
  path = Path.resolve __dirname, 'scripts'
  Fs.exists path, (exists) ->
    if exists
      robot.loadFile path, file for file in Fs.readdirSync(path)

After you've built your npm package you can publish it to npmjs.

HTTP Listener

Hubot has a HTTP listener which listens on the port specified by the PORT environment variable.

You can specify routes to listen on in your scripts by using the router property on robot.

module.exports = (robot) ->
  robot.router.get "/hubot/version", (req, res) ->
    res.end robot.version

There are functions for GET, POST, PUT and DELETE, which all take a route and callback function that accepts a request and a response.

In addition, if you set CONNECT_STATIC, the HTTP listener will serve static files from this directory.

Testing hubot locally

Install all of the required dependencies by running npm install.

It's easy to test scripts locally with an interactive shell:

% export PATH="node_modules/.bin:$PATH"
% bin/hubot

... and to run unit tests:

% make test

Project Statistics

Sourcerank 2
Repository Size 560 KB
Stars 3
Forks 3
Watchers 15
Open issues 0
Dependencies 18
Contributors 2
Tags 125
Last updated
Last pushed

Top Contributors See all

David Barbarisi cevans

Recent Tags See all

production-build-135 June 28, 2013
production-build-134 May 02, 2013
production-build-133 May 02, 2013
production-build-132 April 10, 2013
production-build-131 April 10, 2013
production-build-130 April 10, 2013
production-build-129 April 10, 2013
production-build-128 April 10, 2013
production-build-127 April 10, 2013
production-build-126 April 10, 2013
production-build-125 April 10, 2013
production-build-124 April 10, 2013
production-build-123 April 10, 2013
production-build-122 April 10, 2013
production-build-121 April 05, 2013

Something wrong with this page? Make a suggestion

Last synced: 2017-07-19 09:37:12 UTC

Login to resync this repository