Posts tagged "terminitor"

Terminitor - Terminating your redudant Terminal commands

I figure it’s about time to start writing in my tumblr. So let’s talk about terminitor. Terminitor is an automation library written in ruby that allows for a clean and easy way to automate your usual terminal commands and setup. So let’s start with a typical scenario: You start up a project, want to open up a console, run the server, and maybe even run some test automation. It might look something like this:

terminal tab 1

$ cd /my_project
$ rvm use ree@my_project_gemset
$ watchr test.watchr

terminal tab 2

$ cd /my_project
$ rvm use ree@my_project_gemset
$ padrino start -h 0.0.0.0 -p 4567

terminal tab 3

$ cd /my_project
$ rvm use ree@my_project_gemset
$ padrino console

terminal tab 4

$ cd /my_project
$ rvm use ree@my_project_gemset
$ gitx

and so on. Things start to get really redudant. That’s where terminitor comes in. Taking what we have up there, we can reduce this down into a nice DSL:

# ~/.terminitor/my_project.rb

before "cd /my_project", "rvm use ree@my_project_gemset"

tab "watchr test.watchr"

tab "padrino start -h 0.0.0.0 -p 4567"

tab "padrino console"

tab "gitx"

Now that’s a bit better. Now instead of doing your usual command circuit training, you can instead jump right to the end of it:

$ terminitor start my_project

For those of you that get a bit more fancy with your Mac OSX Terminal, Terminitor allows you to go a step further with customizing your windows, like say using the “Grass” setting:

tab :name => "my green tab", :settings => "Grass" do
  run "uptime"
end

Lazy to find the settings, window sizes that you have setup for your windows? Let Terminitor get it for you:

$ terminitor edit my_lazy_project --capture

This will grab the settings for your windows and tabs, leaving you only the commands to fill out for each tab/window! Not too shabby.

Currently, Terminitor has support for Mac OS X Terminal and KDE Konsole. However, that doesn’t mean that your flavor of choice can’t be supported. Terminitor makes it simple to extend!

If you want to check out more of the other features terminitor provides, I suggest checking it out on github.

My postings on technology, philosophy, and this journey called life.

view archive