Jarvis PHP bot
PHP JavaScript CSS
Clone or download
jt2k Merge pull request #16 from jt2k/apotd
APOD: Add alternate acronym
Latest commit 17a272d Apr 12, 2018
Failed to load latest commit information.
sql Add DB storage accessible to responders Apr 24, 2015
tests/jt2k/Jarvis Update SlackBot test so it runs out of the box Feb 24, 2017
.gitignore Switch to PSR-4 autoloading using Composer Oct 17, 2014
README.md Tasklist... check. Jun 29, 2014
config.sample.php Geocode: Add Google API key and increase cache life Jan 19, 2018
phpunit.xml Reorganize responder tests May 27, 2015



Jarvis is a multi-modal chat bot written in PHP. This started out as a simple test bot for Slack, but is now a more generic framework that also responds via command line, web, SMS, and email. There isn't much here that is novel (see Hubot), but I have enjoyed having a single place to execute random bits of useful code I've written in the past.


Copy config.sample.php to config.php and edit as necessary. The majority of configuration options are for storing API keys and other responder-specific settings. This is also where you would set your Slack token for SlackBot or Mandrill email settings for MandrillBot.

enabled_responders can be set to an array of responders or set to 'all'. Defaults to all.

For the web console or web-hooks (used by Slack, Mandrill, and Twilio), you will want to point your web root to the web directory.

Add bin/jarvis to your path for access to Jarvis from anywhere on the command line.

Finally, if you want to make use of the file cache, make the cache directory writable by both your command line user and web server.

Command-line usage

cd bin
./jarvis  # interactive jarvis
./jarvis weather forecast  # send the message "weather forecast" to jarvis
./jarvis help  # list all responders

Web usage

  • index.php - web-based chat console; supports speech recognition and synthesis in Chrome
  • slack.php - web-hook for Slack adapter; slackbot_token must be defined in config.php
  • mandrill.php - web-hook for Mandrill email adapter; mandrill_username, mandrill_password, and email_address must be defined in config.php
  • twilio.php - web-hook for Twilio SMS adapter

What's next

  • Separate "default" (globally useful) responders from personal-use responders
  • Twitter adapter
  • Twilio adapter
  • IRC adapter
  • More modularized adapter architecture
  • Persistent storage for responders
  • Stateful responders
  • Per-user settings (e.g. allow users to override default lat/lon coordinates)