Simple command line time tracking.
Ruby JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 36 commits ahead, 4 commits behind DanielVF:master.


Simple command line time tracking.

To install

gem install t_time_tracker

This installs a binary named t_time_tracker, but it is strongly recommended that you alias this in your .bashrc to t to prevent extraneous typing:

echo "alias t='t_time_tracker'" >> ~/.bashrc

To use

Show current task:

$ t
In progress: publishing t_time_tracker to GitHub (0:11)

Start a new task and finish previous

$ t checking email 
Finished: publishing t_time_tracker to GitHub (0:12)
Started: lunch (now)

Start a task at a custom time (powered by Chronic)

$ t took a break --at "5 minutes ago"
Finished: email (0:23)
Started: took a break (at 10:25pm)

Stop a task, without starting a new one

$ t --done
$ t --stop
$ t -d
Finished: took a break (0:05)

Edit tasks with your $EDITOR

$ t --edit
$ t -e
# change "took a break" to "napping" in Sublime Text 2, my $EDITOR

Resume the last stopped/done task

$ t --resume
$ t -r
Resuming napping

List today's tasks

$ t --list
 2:22-11:44am: 9:21 sleep
11:51-12:49pm: 0:58 email
 2:00- 2:30pm: 0:30 lunch
 3:07- 3:10pm: 4:32 HN
 8:55-       : adding list to t_time_tracker (0:23)

List last week's tasks

$ t --list --from "1 week ago" --to "yesterday at 5pm"
# 2012-05-06 #
 2:22-11:44am: 9:22 sleep
11:51-12:49pm: 0:59 email
 2:00- 2:30pm: 0:31 lunch
 2:30- 3:00pm: 0:31 working
# 2012-05-14 #
12:15-12:35am: 0:21 physiology lab
12:35- 1:14am: 0:40 starcraft

To view

Daily csv files are created in month and year folders in ~/.ttimetracker in the format:


In each .csv file there are three columns representing the start time, end time, and description:

14:00:13, 14:30:47, making lunch
15:07:21, 15:10:13, HN
18:25:40, 18:35:08, learning how to cat daddy

You can open these in your $EDITOR with the command t --edit.


By default, logs are stored in ~/.ttimetracker/. This can be changed by editing the line:

@data_dir = File.join(Dir.home, '.ttimetracker')

Customizing directory naming and organization will be supported in a future release.

Similar Projects