- Notifications
You must be signed in to change notification settings - Fork37
A simple timetracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
License
nikolassv/bartib
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Bartib is an easy to use time tracking tool for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.
Alice is not chasing white rabbits any more. She has a real job now with real clients and project managers. Therefore, she has to keep track of how she uses the hours of her working day. See how Alice uses Bartib for this and learn how you can use it, too.
At 8:00 a.m. Alice arrives at the office. She got an email from her project manager who asks her to start working right away onUrgent Task X fromImportant Project A. So Alice types at the command line:
alice@work: ~ $bartib start -d"Urgent Task X" -p"Important Project"
And Bartib confirms:
Started activity: "Urgent Task X" (Important Project) at 2021-10-29 08:00
At 8:43 one of her colleagues drops by and they decide to have a coffee. As she cannot bill this time to her clients, Alice stops the running activity in Bartib:
alice@work: ~ $bartib stopStopped activity: "Urgent Task X" (Important Project) started at 2021-10-29 08:00 (43m)
Almost 10 minutes later she is back at her desk and continues work:
alice@work: ~ $bartibcontinueStarted activity: "Urgent Task X" (Important Project) at 2021-10-29 08:51
At 10:13 another email arrives:Urgent Task X has to wait! NowMore Urgent Task Y fromJust Another Project B has to be carried out immediately.
Alice types:
alice@work: ~ $bartib start -d"More Urgent Task Y" -p"Just Another Project B"Stopped activity: "Urgent Task X" (Important Project) started at 2021-10-29 09:01 (1h 12m)Started activity: "More Urgent Task Y" (Just Another Project B) at 2021-10-29 10:13
See how Bartib just stops the running activity when another one starts? No need to stop it manually.
It is a productive morning. AfterMore Urgent Task Y Alice works on other projects and other tasks, but now it is time for lunch and Alice lets Bartib list all the activities she has tracked today until now:
alice@work: ~ $bartib list --todayStarted Stopped Description Project Duration08:00 08:43 Urgent Task X Important Project 43m08:51 10:13 Urgent Task X Important Project 1h 22m10:13 10:35 More Urgent Task Y Just Another Project B 22m10:35 10:53 Urgent Task X Important Project 18m10:53 11:45 Simple Task Z Less Important Project 52m11:45 12:34 Boring Task XY Internal Project C 49m
After her lunch break Alice wants to continue work onMore Urgent Task Y. Instead of typing the task description and the project name again, she asks Bartib for a list of all the tasks she has recently worked on:
alice@work: ~ $bartib last # Description Project[3] More Urgent Task Y Just Another Project B[2] Urgent Task X Important Project[1] Simple Task Z Less Important Project[0] Boring Task XY Internal Project C
And she instructs Bartib to continue task #3:
alice@work: ~ $bartibcontinue 3Started activity: "More Urgent Task Y" (Just Another Project B) at 2021-10-29 12:52
An exciting day at work continues. As it is a Friday Alice decides to already leave work at shortly after seven. She stops her latest activity and asks Bartib for a report:
alice@work: ~ $bartib report --todayImportant Project................................. 2h 43m Another Task xyz.............................. 15m Important Call with the Client................ 35m Urgent Task X................................. 1h 53mInternal Project C................................ 4h 30m Another Meeting............................... 45m Boring Task XY................................ 1h 15m Long Meeting with Everyone from the Department 2h 30mJust Another Project B............................ 45m More Urgent Task Y............................ 45mLess Important Project............................ 2h 27m Simple Task No. 5............................. 1h 35m Simple Task Z................................. 52mTotal............................................. 10h 25m
Alice is happy. This was just another great day at the company and thanks to Bartib tracking her time was a breeze.
Do you want to be as happy as Alice? Use Bartib!
Simply download a suitable executable fromhttps://github.com/nikolassv/bartib/releases and copy it in some directory that is listed in yourPATH
(e.g. ~/bin).
You may also use cargo to install Bartib from crates.io:
cargo install bartib
yay -S bartib
brew install bartib
apk add bartib
(Currently bartib is only available in thetesting repository)
Bartib is written in rust. You may build it yourself with the help of cargo. Just clone this repository and execute thecargo build
command in its main directory:
cargo build --release
You may either specify the absolute path to your log as an extra parameter (--file
or-f
) to your bartib command:
bartib -f /home/username/activities.bartib report
Or you may set the environment variableBARTIB_FILE
to the path of your log. Just add this line to your.profile
file:
export BARTIB_FILE="/home/username/activities.bartib"
If the specified log file does not exist yet Bartib creates it.
Just open your activity log in your favorite text editor to edit or delete former activities. You may even add new activities manually in this file. The format is self explanatory.
Bartib even offers thebartib edit
command which opens the log in the editor defined by yourEDITOR
environment variable. If you are unsure whether your edits are readable by bartib, use thebartib check
command. It will inform you about any parsing errors.
Bartib offers a simple auto completion for project names. This saves you from typing out long project names each time you start a new task. Just source the scriptmisc/bartibCompletion.sh in your.bashrc
to enable it.
For fish users, add themisc/bartib.fish to either the~/.config/fish/completions/
or~/.local/share/fish/vendor_completions.d/
directory.Currently, you must set theBARTIB_FILE
in your fish shell for the project and description names completions.
All these commands require that you have set theBARTIB_FILE
environment variable to the file path of your activity log. Otherwise they require an additional-f/--file
parameter betweenbartib
and the subcommand (see above:How to define in which file to save the log of your activities).
bartib -h# get helpbartib start -p"name of the project" -d"description of the activity"# start a new activitybartib stop# stop an activitybartib list --today# list all activities of the current daybartib report --today# create a report for today
bartib -h# Print a concise helpbartib start -h# Print a help for any subcommand
bartib start -p"The name of the associated project" -d"A description of the activity"# Start a new activity with a short description and an associated projectbartib start -p"The name of the associated project" -d"A description of the activity" -t 13:45# Start a new activity at a given timebartib stop# Stop the currently running activitybartib stop -t 14:00# Stop the currently running activity at a given timebartib last# Print a list of the ten most recently used projects and descriptionsbartib last -n 25# Prints a list of recently used projects and descriptions with more entries# All numbers used with the following commands refer to the indexes in the list created with `bartib last`bartibcontinue 5# Start an activity with a recently used project and descriptionbartibcontinue# Continue the latest activitybartibcontinue 3 -d"Another description"# Continue activity number 3 but overwrite the descriptionbartibcontinue 7 -t 8:15# Continue activity number 7 but have it started at a given timebartib cancel# Cancels a running activity by deleting its entry in the activity log
bartib report# create a report of how much time has been spent on which projects and activitiesbartib report --today# create a report for todaybartib report --yesterday# create a report for yesterdaybartib report --current_week# create a report for the current week (since monday)bartib report --last_week# create a report for the last weekbartib report --date 2021-09-03# create a report for a given daybartib report --from 2021-09-01 --to 2021-09-05# create a report for a given time rangebartib report --project"The most exciting project"# create a report for a given projectbartib report --project"Maint?nance *"# use '?' and '*' as wildcards in project namesbartib report --round 15m# rounds the start and end time to the nearest duration. Durations can be in minutes or hours. E.g. 15m or 4hbartib list# list all activities grouped by daybartib list --no_grouping# list all activities but do not group them by daybartib list --today# list todays' activitiesbartib list --yesterday# list yesterdays' activitiesbartib list --current_week# list activities of the current week (since monday)bartib list --last_week# list activities of the last weekbartib list --date 2021-09-03# list activities on a given daybartib list --from 2021-09-01 --to 2021-09-05# list activities in a given time rangebartib list --project"The most exciting project"# list activities for a given projectbartib list --round 15m# rounds the start and end time to the nearest duration. Durations can be in minutes or hours. E.g. 15m or 4hbartib search"exiting"# search all descriptions and projects for a specific termbartib search"e*t?ng"# use '?' and '*' as wildcards
bartib change -d"A new description"# change the description of the current activitybartib change -p"Another project"# change the project for the current activitybartib change -t 8:15# change the start time of the current activitybartib edit# open the activity log in the editor you have defined in your `EDITOR` environment variablebartib edit -e vim# open the activity log in a given editor
bartib current# show currently running activitybartib projects# list all projects ever usedbartib projects -c# show current project onlybartib check# check your activity log for invalid linesbartib sanity# check for activities with logical errors (e.g activities with negative duration)
About
A simple timetracker for the command line. It saves a log of all tracked activities as a plaintext file and allows you to create flexible reports.