---
title: Command Line Basecamp
teaser:
tags: playbook
author: Eric Mill
published_on: 2008-07-08
---

I log a lot of friggin’ time on Basecamp.  We all track our time incessantly
here; for client work, product development, R&D, conference calls, whatever.
This means I spend a lot of time logged into Basecamp, with my browser up,
typing in times and tabbing between form inputs.

**_UNTIL RECENTLY!!!_**

While I wouldn’t call myself a command line “junkie”, I have grown to appreciate
the brevity with which I can make great and terrible things happen by using it.
Since Basecamp has [an API](https://developer.37signals.com/basecamp), and since
DHH was even kind enough to make a [Ruby
wrapper](https://developer.37signals.com/basecamp/basecamp.rb) around it, there’s
no reason I couldn’t make a tiny little command line time tracker.

**_SO THAT’S WHAT I DID!!!_**

The syntax is pretty simple, and is explained in detail on [the
README](https://github.com/Klondike/basecamper), but the short
of it is that after you give it your Basecamp credentials, you can specify how
much time for each message, or use a start/stop timer so that you don’t have to
keep track of the time.  A few brief examples:

    # Log 1.5 hours of time to the default project
    track log 1.5 "How I spent this time"

    # start tracking time for the "Roller Derby" project
    track start rol

    # stop tracking time
    track stop "Constructed the roller derby foundation"

Right now, me and two other folks at thoughtbot prefer the command line to a big
webpage for entering time, and use it all day every day.  I finally threw it up
on [Github](https://github.com/Klondike/basecamper).  This isn’t a
thoughtbot project, so it’s under my account there.

Since it’s up on Github, you can install it as a gem:

    gem sources -a http://gems.github.com
    sudo gem install Klondike-basecamper

**_HEY BUT ALSO!!!!!_**

If you’re already using source control via the command line, like svn or git,
there’s no reason you can’t hack together a script that commits your code and
uses the same commit message to log your time, simultaneously.  It would
probably [look something like this](https://pastie.org/230070).  That’s what I
use, and it’s such a hack, but it lets me commit code with `commit -l
'message'`.  That’ll run an svn commit on all files with that message, stop the
timer and log time with that message.  If I use `-ls` instead of `-l` it’ll
start the timer again, meaning I can just `commit -ls` all the day, and my time
gets logged.

**_AND BY ALL MEANS FORK IT!!!!_**

[Basecamper on Github](https://github.com/Klondike/basecamper)
