Jeff Kreeftmeijer

Terminitor: the Terminal automator from the future

2010-09-20

Terminitor — that’s not Terminator — is a really simple Terminal workflow automation tool by @arthur_chiu and the rest of the Padrino team. It aims to automate the terminal commands you do when you start working on a project so you don’t have to start your database, web server and editor every time you want to continue your work.

After installing, you create a “terminit” YAML file that defines one or more tabs with the commands you want to run. I created a little config for working on my website:

# ~/.terminitor/jeffkreeftmeijer.yml

- server:
  - cd ~/opensource/jeffkreeftmeijer.com
  - jekyll --server --auto
- browser:
  - sleep 5
  - open --background http://localhost:4000
- vim:
  - mvim ~/opensource/jeffkreeftmeijer.com

This will open up three tabs in my terminal. The first one starts the Jekyll server, with the --auto flag to make it update after every change automatically. Another tab sleeps for five seconds — giving the server a bit of time to start — and opens localhost in a browser window behind the terminal. The last one opens the project in Vim, so I can start writing right away.

To do all of the above, I simply run Terminitor’s start command:

$ terminitor start jeffkreeftmeijer

Pretty cool, right? Be sure to check out the README, where all of this stuff gets explained more thoroughly.

Checking in Termfiles?

Besides storing the configuration files in the ~/.terminitor/ directory, you can also store everyhing in a Termfile right inside your project. Checking this file into Git would allow other developers that work on the same project to use your Terminitor workflow.

This may sound like a great feature but I’m not too excited about it. First of all, I think personal configuration should never come anywhere near a source code repository since it’s simply not part of the code or the application.

Also, I want to be able to set up my own workflow (I know using the Termfile doesn’t keep me from doing that) so I probably don’t care about yours. If I do, I’ll ask you to put it in a Gist.

Lastly, I’d love to keep using Terminitor an option, so people who choose not to use it shouldn’t have to deal with extra, meaningless configuration files flying around.

I would suggest not checking it in and keeping it to yourself right now. However, Arthur himself commented and explained how the Termfile feature could go one step furter in the future and give you the ability to do something like this on a remote repository that has a Termfile:

$ terminitor clone jeffkreeftmeijer navvy

Making it possible to do a one-command setup so you can start hacking on the project immediately. Now that sounds promising.

What do you think?

Overall, Terminitor is a really nice tool that saved me a bunch of keystrokes already. I’m going to keep using it and I’d love to see what will happen to it in the future. What do you think about Terminitor and the whole Termfile thing? I’d love to hear your opinion.