Command Line Basecamp

Posted by Eric Mill

Jul 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, and since DHH was even kind enough to make a Ruby wrapper 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, 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. 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. 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


Comments on this post

Tom

Jul 08

Tom said,

You missed a comma :-)


diff --git a/basecamper.gemspec b/basecamper.gemspec
index bc9d89f..e1481f1 100644
--- a/basecamper.gemspec
+++ b/basecamper.gemspec
@@ -8,7 +8,7 @@ spec = Gem::Specification.new do |s|
   s.email = "kprojection@gmail.com" 
   s.homepage = "http://github.com/Klondike/basecamper/" 

-  s.files = ['README' 'LICENSE', 'bin/track', 'lib/basecamp.rb', 'lib/basecamper.rb']
+  s.files = ['README', 'LICENSE', 'bin/track', 'lib/basecamp.rb', 'lib/basecamper.rb']
   s.require_path = 'lib'

   s.bindir = "bin" 
Eric Mill

Jul 08

Eric Mill said,

Ah, I actually had that fixed on my local copy; I committed it.

fxbx

Jul 08

fxbx said,

<u>YES</u>

John

Jul 09

John said,

That is pretty sweet. But why not create a widget instead?

Eric Mill

Jul 09

Eric Mill said,

Because then only OS X people could enjoy it. I use Ubuntu.


Sorry, comments are closed for this article.

© 2000 - 2009 by thoughtbot, inc.
written by a bushel of tiny robots