Script Terminal with TermInit

Are you tired of typing the same commands in Terminal every day just to get your project going? Do you want to save, like *minutes* per day? Did you know that you only get so many keystrokes per lifetime before your hands are permanently crippled? OK, that last bit I might have just read somewhere but I digress.

Enter TermInit, stolen^H^H^H^H^H^H inspired by Solomon White’s work here:
http://onrails.org/articles/2007/11/28/scripting-the-leopard-terminal

…and all packaged up for easy use:
https://wush.net/svn/public/terminit/

An example from the readme:

  # myproject.yml:
  - tab1: cd /foo/bar
  - tab2:
    - mysql -u root
    - use foo_db
    - select * from bar;
  - tab3: echo "hello world"

Open Terminal and run it:

terminit.rb myproject

Et voila, you have three tabs opened in Terminal with the appropriate commands executed in each.

Save those keystrokes for real code!

6 Comments

  1. Posted January 29, 2009 at 2:33 am | Permalink

    I tryed it and it’s so confortable!
    When I work on a web-app (using rails) i usually have the same tabs (with different paths).
    To not create a single configuration file for each project i added support for ‘default.yml’ which contains the ‘common’ tabs i need. If i execute ‘terminit foo’ it looks for foo.yml, if it doesn’t exist it loads default.yml using ‘foo’ like a parameter. In default.yml i have something like:

    cd /my-apps/[APP]

    In this example ‘cd /my-apps/[APP]‘ will be changed into ‘cd /my-apps/foo’.

    So i have just default.yml for all my web-apps, but if i need more customization i can create foo.yml.

    Great job, i’ll use it everydayyyyy :)

  2. Posted January 29, 2009 at 2:33 am | Permalink

    Simone, glad you found this helpful. The dynamic default is a great idea too!

  3. Nathan
    Posted January 29, 2009 at 2:33 am | Permalink

    Is there anyway to get this to work with entering passwords.

    What I want to do is:

    - ssh place@server.com
    - mypassword
    - cd /var/path/now

    how do I get this to work?

    Other than that, this is a great little tool and I love even more that it is done with ruby and yaml.

  4. Posted January 29, 2009 at 2:33 am | Permalink

    Nathan,
    Good question. I imagine the method Capistrano uses would work (via Net::SSH), or perhaps a public key and ssh-agent. I haven’t tried either though (yet).

  5. Nathan
    Posted January 29, 2009 at 2:33 am | Permalink

    Yea, it would be really cool if that could be somehow built into this terminit thing if you ever feel the need. Anyways thanks for making this as its really handy.

  6. Posted January 29, 2009 at 2:33 am | Permalink

    Thanks for pointing me to this valuable resource. I am going to apply the method Capistrano uses via Net::SSH

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">