Enable Travis-CI for a Github repository from the command line

This is a very old article. It has been imported from older blogging software, and the formatting, images, etc may have been lost. Some links may be broken. Some of the information may no longer be correct. Opinions expressed in this article may no longer be held.

Travis-CI is a Really Useful Engine, but I’ve only enabled it for a handful of my GitHub repositories because navigating though GitHub’s settings to do so is a bit of a pain.

Seemed like this should be scriptable though – turns out it is! Edit that script to include your GitHub login details, and Travis-CI details, save it as travis-status somewhere in your $PATH, chmod +x travis-status and you’re ready to go!

Running travis-status in a project’s root directory (and I’m assuming the project’s root directory has the same name as the repository’s slug) with no parameters will print out a list of all event hooks for the project (not just Travis ones). Running it and passing “1” or “0” as the parameter will enable or disable Travis for the project.