12+ Frameworks to Build ChatOps Bots Bill Doerrfeld July 26, 2016 Since GitHub integrated ChatOps into their operational strata, the concept has garnered a good deal of excitement. Essentially, ChatOps moves system operations into a group chat room, enabling developers to collaborate, initiate tests, deploy software, and build a company culture all from a single unified command line. A novel idea which some teams have implemented successfully, ChatOps could increase efficiency, represents a move toward a more transparent work environment, and allows distributed software development teams to flourish. In this post we outline the possible benefits of a ChatOps approach and list over 12 pre-made ChatOps frameworks, bots, and tools that teams can utilize to develop their own conversational user interface into their software development workflow. What is “Chatops”? Many teams already use a chat room like Slack or Hipchat to share information, collaborate, and build knowledge bases around particular projects. Naturally, these platforms have constructed thousands of extensions that utilize API connectors to bring in additional functionality into chat workspaces. From scheduling assistants, investment advice, income reports, team productivity ledgers, to news, emojis and cricket scores, thousands of bots can be integrated into chat rooms to post automatic updates or trigger functionality when prompted. As team collaboration moves from email to chat, at the same time, DevOps is trying to automate the testing and deployment of software. Thus ChatOps, coined by Github, is a philosophy to bring the work of monitoring and controlling infrastructure and operations from the command line interface and into the chat window, often with the aid of a useful, conversational AI-based bot that can trigger tasks and send error reports from a simple plain English command. Jesse Newland of GitHub simply defines ChatOps as: “Putting tools directly in the middle of the conversation” In the spirit of Natural Language Processing, many chatbots are responsive, take on a name, and at times even a human-like personality; but we’re not talking about chatbots like Cleverbot or ELIZA that you can IM for fun, rather a useful, conversational user interface that triggers DevOps processes. Surprisingly, there’s only a few of those out there. Fundamental ChatOps approach 12+ ChatOps Bots Await Your Command Let’s see what’s out there in the realm of ChatOps bots. There are some popular frameworks and pre-made bots to choose from, like Hubot (CoffeeScript), Lita (Ruby), and Err (Python). Alternative projects, scripts, frameworks, and libraries privileging different languages could be helpful to some as well. Some bots are made to interface with a particular chat platform, like Slack, Hipchat, or Flowdock, but many are chat client agnostic. Below are some bot frameworks and built bots ready to install. Most of them are compatible with multiple chat instances and support many plugins to popular continuous integration tools. 1: Hubot CoffeeScipt / Node.js “A customizable life embetterment robot” Github’s Hubot is the most widely forked incarnation of a ChatOps bot. Out of the box, Hubot doesn’t perform many things — it’s value lies in extensibility. Developers can integreate Hubot into most chat platforms, and can utilize the many community generated scripts that allow it to do things like generate monitoring statistics from PagerDuty or easily deploy to Heroku. Alternatively, you can create your own scripts in CoffeeScript. Here are some example Hubot commands taken from this Heroku Status script: hubot heroku status - Returns the current Heroku status for app operations and tools hubot heroku status issues - Returns a list of recent issues (default limit is 5) hubot heroku status issue - Returns a single issue by ID number It’s also easy to generate you own chatbot using the Hubot framework with Yeoman. 2: Lita Ruby “A robot companion for your company’s chat room” Lita is a framework for a robot for a company chat room written in Ruby and open sourced on GitHub. Heavily inspired from Hubot, Lita can be used to build operational task automations and has a very comprehensive list of plugins, meaning that you can integrate Lita easily into nearly any chat app, from Facbeook messenger, IRC (Internet Relay Chat), to Flowdock; custom adapters can be constructed as well. Ruby developers will like the familiarity with tools like RubyGems and Bundler. 3: Cog agnostic “Build new bot commands in any language” / “next-generation ChatOps platform” Cog, made by Operable, is another chatbot framework to help automate DevOps workflows. It’s designed to be chat platform and language agnostic, and uses a Unix-style pipeline to activate complex functionality. Well-documented installation guides and tutorials help you configure cog, install Docker, develop triggers, and install “bundles”, which are groups of commands. “Cog brings the power of the command line to the place you collaborate with your team all the time — your chat window” Cog in action – Taken from Cog’s documentation Operable also published some excellent ChatOps best practices, essentially a style guide for command formation, pipeline composition, and designing command interfaces in natural language styles. Check out the Cog Documentation for more. 4: Errbot Python “A Pythonic library for creating chatbots” Errbot is a chatbot daemon that is a middleware between a chat service and the DevOps tools your team may already use. The goal of Errbot is to make writing plugins very easy, so that any tool with an API can be triggered with a simple command. Video streaming platforms as well as the online gaming platform EVE online use Errbot. Written in Python, Errbot offers a Python library for building chatbots with backends to support many chat platforms such as Slack. Check the Public documentation or Errbot community chat for more on Errbot. 5: Nestor JavaScript “Your Slack team’s programmable bot” Nestor is another programmable bot framework designed for ChatOps. Using Nestor’s pre-written plugins, you can do things like plug into TravisCI or Circle CI to monitor and trigger continuous integration flows, return GitHub stats as well as look at issues and merge branches, or tap into internal APIs using Nestor’s JavaScript API [see the Nestor bot programming manual]. You can use existing Bot Powers, import Hubot scripts, or use the Nestor developer kit to create new Powers in JavaScript. Nestor bot in action 6: Chato.ps agnostic “Integrate hundreds of services into your team chat” Chato.ps was built with the idea that teams are existing and communicating on too many chat platforms, using too many tools, experiencing unnecessary friction switching between apps like GitHub, Pagerduty, Asana, Trello, Heroku, CircleCI, and more. Language and chat platform agnostic, Chato.ps is framed as a truly agnostic buffer between all chat platforms and tools. Whether you’re using Campfire, Slack, IRC, or HipChat for chat, Chato.ps enables you to Deploy apps to Heroku with single message, or receive incident reports. As no open source iteration of Chato.ps exists, a potential pitfall is vendor-lockin. 7: HP’s ChatOps Making enterprise service management more ChatOps-y Just recently announced is HP’s proposed ChatOps workflow. It’s less of a customizable framework but more of a proof of concept for how an enterprise could manage incidents in a chat-infused way. At HPE’s last Discover conference they unveiled some of their internal ChatOps practices that they are now open sourcing. A high-level view of the architecture for “SM ChatOps” involves connecting the HPE Service Manager with Hubot and Slack. According to coverage from The New Stack: “HPE’s ChatOps — is actually an open-source implementation of the company’s existing automation and incident management tools, integrated with Slack, the messaging tool that appears to have finally tipped the balance in the market battle over chat tools in the workplace.” HPE’s ChatOps design is built to interface with HP’s service management — incident statuses are communicated via Hubot. Taken from the HPE community blog. 8: Jarvis by CA Technologies Java Flowdock ChatOps bot for the JVM Built by CA Technologies, Jarvis is another open source alternative to Hubot, specifically designed for working with build messages to make the most of CA’s Flowdock, a chat and collaboration platform. Jarvis works on the JVM, so plugins can be created in Groovy, Java, and Clojure, with support for other JVM languages possible as well such as Kotlin. The downside is extensibility — Jarvis only behaves with Flowdock. 9: Lazlo “An event-driven, lua-scriptable chatops automation framework for Slack in Go” Lazlo is an event broker for launching plugins, essentially an alternative chatbot platform that privileges the Go programming language. To write automation for Lazlo, you create Lua scripts. With a small number of contributors, the project is very much in the style of open source — perhaps not for the faint of heart developer. 10: Multivac “Extensible ChatOps bot framework for Slack” Built by New York dev shop VektorLab, Multivac is an extensible framework made for ChatOps. Some features it boasts is an integrated job queue, a RESTful API, and Slack support. Multivac takes scripted action commands to perform DevOps tasks automatically and streams job result summaries, confirms commands, has log retention, and enables Docker containers-as-commands. 11: StackStorm “Automation tool built with love for DevOps and ChatOps” Also worth mentioning is StackStorm. Sometimes called “IFTTT for IT ops”, StackStorm wires together software development and team collaboration apps, acting as an automatic reporting and auto remediation tool. You can create custom commands with StackStorm using YAML, possibly making it a more usable alternative to crafting your own CoffeeScript commands. StackStorm is essentially a layer for event-driven DevOps automation, made compatible with most chat platforms and other bots like Hubot. 12: VictorOps Incident tracking and automated alerts for on-call teams Since their tool bridges the gap between incidents and employees, VictorOps is one of the main evangelists for ChatOps. It acts as a hub for “centralizing the flow of information throughout the incident lifecycle,” meaning that alerting, monitoring, and incident resolution is done on a single platform. The VictorOps monitoring environment also offers a Slack integration, making it helpful for teams that want a pre-made solution. More Tools for ChatOps & Bot Construction Cloudbot; a simple, fast, expandable, open-source Python IRC Bot Eggdrop; a popular Open Source IRC bot, designed for flexibility and ease of use ElasticSearch’s ChatOps bot J.A.R.V.I.S. Slash commands with DeployBot Will; a simple python hipchat bot Botkit; a framework for building Slackbots Pandorabots; a RESTful API for integrating artificially intelligent chatbots into applications API.ai; helps build conversational Slackbots Gupshup: Tools to build and deploy bots on any channel MobileMonkey: Build conversational bots for Facebook Messenger. Think of any more? Comment below! Analysis: So Why Adopt IM-enabled DevOps? The chatbot takeover is widespread, influencing everything from API design, public company facades, to Facebook’s new developer platform, which enables companies to create conversational UI bots within their Messenger app. HP recently said they find chatrooms — or ChatOps — “instrumental for DevOps success.” Some argue that chat-infused system maintenance isn’t anything new — many have been implementing this using IRC (Internet Relay Chat) since the 90s. The recent move toward a more user-friendly ChatOps methods, however, is threefold: It helps automate tasks; by identifying and replacing repeatable actions with bot commands teams can save time. GitHub, for example, uses ChatOps internally to operate website and infrastructure, like alert management, status updates, network management, MySQL maintenance, and more; ChatOps works in a more visible company forum, providing a record that all team members can see. This helps distributed teams collaborate in real-time, creating a more transparent culture and company context for onboarding new members; Lastly, adding a bit of personality to a bot can help create an internal culture at a company. Of course, you can already add a lot of operational tooling into Slack with plugins like Pagerduty incident monitoring, or Jira and Confluence for bug tracking, so for some a bot may be excessive. Some may be reluctant to embrace ChatOps due to security reasons. To negate this, Cog includes access mechanisms, and developers have created middleware to interface with Hubot. Products like Demisto have also been developed to help secure content on Slack channels. “The way we work is heavily influenced by chat” – Mark Imbriaco, CEO at Operable Conversation-driven development is an extreme divergent from traditional business environments. At the end of day, you are simply exposing the APIs of the internal tools you use, and a bot is just an interface to them. The end benefit of creating a bot using these frameworks is it gives your team customization, and allows you to work with any chat client. Differing ChatOps/bot strategies aside, whatever system allows a team to work efficiently and also respond quickly in the face of IT disasters will triumph. Even if you’re not into ChatOps, make sure your APIs have the skills required to compete in the evolving voice and bot enabled world. Additional Resources: ChatOps for Dummies by Jason Hand of VictorOps Mark Imbraccio’s talk on ChatOps: Augmented Reality for Ops Tutorial: How to Install the Lita Chatbot for IRC on Ubuntu Getting started with ChatOps step by step guide ChatOps Pitfalls and Tips Reddit ChatOps thread 8 Reasons ChatOps Isn’t Working at Your Company The latest API insights straight to your inbox