spent v0.1.2
spent
Get it through:
npm i -g spentHow it works?
The CLI lets you get time-stats from almost any text input.
It recognizes the following date-time patterns:
+1001:232021-05-102021/05/1005-10-202105/10/2021May 10, 2021
Processing rules for parsing:
- Date patterns are used to group time ranges, also they're required to enable filtering.
- Time patterns are used as checkpoints,
HH:MMvalues are treated as minutes. - Numbers prefixed with
+will be summed up as minutes too.
All values MUST be paired, and the first item of each time-slice MUST be in
HH:MMformat, followed by one-or-more+Nor the ending time inHH:MMformat.
Usage example
Create a journal.txt file with this contents:
May 10, 2021
- I reviewed code from 19:00 to 20:22 (+5 +3)
2021-05-09
- I did some stuff from 13:15 to 16:20If you run spent - < journal.txt you should get:
2021-05-10, 1:30
2021-05-09, 3:05
Total time spent 4:35It also works with plain time-slices as arguments:
spent 13:20 15:16Filtering can be done through --since and --until keywords, e.g.
last weekequals to1 week agoyesterdayequals to1 day agotomorrowequals tonext day1 week ago90 minutes agonext weeknext 24 hours
Only
minute,hour,dayandweekkeywords are supported.
Use --from to set the date for resolving relative dates, e.g.
spent --from 2021-05-01 --until "next 3 weeks"Otherwise, the actual date will be used instead.
Motivation
I am used to have a journal file on most projects I work following the Markdown or ToDone formatting rules.
After trying some time-trackers, pomodoro, CLI programs, Android apps, etc. and I'm still unconvinced if they work for me because:
- Having to switch-context out from my editor just to start/pause/stop a timer is a bummer.
- Almost surely I'll not start any timer et all, or may I forgot to pause/stop it when switching tasks.
- I tend to write what's happening rather that "what I'll do", so my journal is not a just ToDo list written in stone.
Those are distractions to me as I found easier (and quicker) to switch between tabs, move around with the keyboard and write down stuff, code or notes, whatever.
Do you think this would work for you too? Just give it a try!