You can test your hubot by running the following, however some plugins will not behave as expected unless the environment variables they rely upon have been set.
OBS: A lot of the environment variables are pointing at the local cluster and will not work locally.
You can start hubot locally by running:
% bin/hubot
You'll see some start up output and a prompt:
[Sat Feb 28 2015 12:38:27 GMT+0000 (GMT)] INFO Using default redis on localhost:6379
hubot>
Then you can interact with hubot by typing hubot help
.
hubot> hubot help
hubot help - Displays all of the help commands that hubot knows about.
...
We are running the Slack adapter to allow hubot to integrate with slack. we therefore run hubot
with the -a slack
argument
$ bin/hubot -a <adapter>
There will inevitably be functionality that everyone will want. Instead of writing it yourself, you can use existing plugins.
Hubot is able to load plugins from third-party npm
packages. This is the
recommended way to add functionality to your hubot. You can get a list of
available hubot plugins on [npmjs.com][npmjs] or by using npm search
:
% npm search hubot-scripts panda
NAME DESCRIPTION AUTHOR DATE VERSION KEYWORDS
hubot-pandapanda a hubot script for panda responses =missu 2014-11-30 0.9.2 hubot hubot-scripts panda
...
To use a package, check the package's documentation, but in general it is:
- Use
npm install --save
to add the package topackage.json
and install it - Add the package name to
external-scripts.json
as a double quoted string
You can review external-scripts.json
to see what is included by default.
It is also possible to define external-scripts.json
as an object to
explicitly specify which scripts from a package should be included. The example
below, for example, will only activate two of the six available scripts inside
the hubot-fun
plugin, but all four of those in hubot-auto-deploy
.
{
"hubot-fun": ["crazy", "thanks"],
"hubot-auto-deploy": "*"
}