51

I'm looking for something that runs in a terminal and allows me to track time. I'd like it to be open source but that isn't necessary.

Most time tracking apps I've found are either web or gui based and there for take longer to enter data then I'd like.

Guss
  • 30,470
  • 17
  • 104
  • 128
Jared
  • 39,513
  • 29
  • 110
  • 145

9 Answers9

35

TimeTrap. It's simple and lightweight, and somewhat intuitive to use.

$ t switch World Domination Plan
$ t in --at "5 minutes ago" Research Volcano Islands
$ t out
$ t display
Timesheet World Domination Plan:
Day            Start      End        Duration   Notes
Mar 14, 2009   19:53:30 - 20:06:15   0:12:45    Research Volcano Islands
Total                                0:12:45

It's written in ruby an available as a gem on gemcutter or on github: http://github.com/samg/timetrap

A similar tool written in python is called TimeBook and available on bitbucket.

samg
  • 3,496
  • 1
  • 25
  • 26
17

a real basic one would be

$ echo `date`": what I'm doing now" >> timelog.txt

If you want to process it later, it's easier if you make that date +%s or date +%F%T.

You could wrap that as a shell script:

#!/usr/bin/bash -
echo `date +%s` $* >> ~/timelog.txt

Some hint of what you really want to do might help.

Charlie Martin
  • 110,348
  • 25
  • 193
  • 263
13

I recently discovered TaskWarrior, which is purely CLI but quite feature-rich.

EDIT June 2015: Since I wrote this answer years ago, taskwarrior has developed in an awesome project with lots of features and integrations. Among my favourite there are:

More taskwarrior tools here.

mac
  • 42,153
  • 26
  • 121
  • 131
  • 8
    This isn't about tracking time, but rather tracking tasks, is it? – blueyed Apr 07 '10 at 10:22
  • 2
    @blueyed - I don't get the subtlety of the difference. TaskWarrior let's you track the amount of time you spend on a given task (time tracker?)... or what tasks you dedicated your time to (task tracker?). But what does ultimately change? ...or am I missing something? – mac Jul 03 '11 at 00:17
  • 1
    I've thought about using TaskWarrior for task tracking only (where you just add tasks or mark them done), but do not track when you are working on them. This might be possible though?! – blueyed Jul 04 '11 at 15:55
  • 1
    @blueyed - I change job and stopped using taskwarrior many months ago (now I'm more of a Hamster guy...) but as far as I remember you could do what you wanted. – mac Jul 04 '11 at 16:31
  • 1
    Taskwarrior does not answer the question, I have no idea why this answer was upvoted so much. There's [timewarrior](https://timewarrior.net/), though, which can interface with taskwarrior. Plain Taskwarrior *cannot* track time you spent on a task, because that is not its purpose. – xeruf Jan 23 '21 at 13:57
  • @Xerus - I give you a hint, this answer is over 10 years old, and Timewarrior - a sister project of Taskwarrior - is a lot more recent... guess where the code and functionality for it came from? ;) – mac Mar 31 '21 at 22:10
8

You could use wtime:

wtime [ -t task ] [ <action> ]

-t  task
    Specify the name of the task. It has to be  a  valid  file-
    name.  Only the first 32 characters are taken into account.
    The default value is "default".

action is one of the following:

-h  Display help.

-a  Start counting.

-s  Stop counting.

-c  Display current elapsed time in seconds.

-r  [ start [ end ]]
    Display time spent on the task during the  specified
    period.  The  parametres start and end represent the
    begginning and end of the reporting  period  respec-
    tively.  The  format  of start and end is '%d-%m-%Y'
    (see strptime (1)).  The default values are the cur-
    rent  time for end and the begginning of the current
    month for the start parameter.
martinus
  • 17,736
  • 15
  • 72
  • 92
  • Thanks, this does what I want. I'd like to have the results stored in a database but it shouldn't be hard to write a perl script to go through the files and add the data to an SQLite database. – Jared Dec 29 '08 at 21:43
  • it would be nice if it could report time in hours and not seconds. – cmcginty May 05 '11 at 21:04
3

If you use todo.txt-cli, you should consider using punch time tracking, written in Python.

treehead
  • 264
  • 1
  • 11
3

App::TimeTracker - the easily extendable command line based time tracker

~$ cd work/some_project
~/work/some_project$ tracker start
Started working on some_project at 13:06:20
~/work/some_project$ # hack ... hack ... hack
~/work/some_project$ tracker stop
Worked 00:15:42 on some_project

~/work/some_project$ cd ../other_project
~/work/other_project$ tracker start
Started working on other_project at 13:32:54
~/work/other_project$ # hack some more
~/work/other_project$ tracker current
Working 00:35:31 on other_project
Started at 13:32:54

~/work/other_project$ tracker start --tag testing
Worked 00:38:23 on other_project
Started working on other_project (testing) at 14:11:27
~/work/other_project$ # hack, then go for lunch
~/work/other_project$ # ups, forgot to hit stop when I left
~/work/other_project$ tracker stop --at 14:30
Worked 00:18:33 on other_project (testing)

~/work/other_project$ tracker report --this day
work                     01:12:38
   some_project             00:15:42
   other_project            00:56:56
total                    01:12:38

Further details on the authors site: http://timetracker.plix.at/

makeyourownmaker
  • 1,558
  • 2
  • 13
  • 33
1

I recently started using Worklog, it seems pretty simple and straight forward.

http://ajy.co/2010/worklog-a-simple-time-tracking-program/

funkym
  • 11
  • 1
0

Depends on the information you want to time track. In one company we had just to track our total working times a day (tax/social insurance purpose). The easieast solution was: last. More granular you could just do something like

echo -e -n `date`\tProjectName\tTask\tComment >> MyTimeTable.txt
...whatever...
echo -e \t`date` >> MyTimeTable.txt

and procsessing with the usual suspects (grep, awk, ...).

When you need even more functionality, I dont know anyone which works without a gui.

flolo
  • 15,148
  • 4
  • 32
  • 57