bartib/README.md

134 lines
2.8 KiB
Markdown
Raw Normal View History

2021-05-10 20:08:04 +00:00
# Bartib
2021-07-12 20:22:21 +00:00
Bartib is a time tracker for the command line. It safes a journal of all tracked activities in a plaintext file.
2021-05-10 20:08:04 +00:00
## Build
Build it with cargo:
```
2021-07-30 15:54:10 +00:00
cargo build --release --bin bartib
2021-05-10 20:08:04 +00:00
```
## The journal file
2021-05-10 20:08:04 +00:00
2021-07-12 20:22:21 +00:00
Bartib safes a journal of all tracked activities in a plaintext file. The file can either be specified via the `-f / --file` cli option or as a `BARTIB_FILE` environment variable.
2021-05-10 20:08:04 +00:00
## Commands
### Help
Print help information:
2021-05-10 20:08:04 +00:00
```
bartib -h
```
2021-07-12 20:22:21 +00:00
### Start a new activity
2021-05-10 20:08:04 +00:00
2021-07-12 20:22:21 +00:00
Start a new activity with a short description and an associated project:
2021-05-10 20:08:04 +00:00
```
2021-07-12 20:22:21 +00:00
bartib start -p "The name of the associated project" -d "A description of the activity"
2021-05-10 20:08:04 +00:00
```
2021-07-16 19:02:17 +00:00
All currently tracked activites will be stopped. If the specified file does not exist yet it will be created.
2021-09-03 13:14:29 +00:00
The `-t/--time` option specifies at which time of the current day the new activity starts (and any currently running activity stops):
```
bartib start -p "The name of the associated project" -d "A description of the activity" -t 13:45
```
2021-07-12 20:22:21 +00:00
### Stop a running activity
2021-07-12 20:22:21 +00:00
Stops the currently running activity:
```
bartib stop
```
2021-09-03 13:14:29 +00:00
The `-t/--time` option specifies at which time of the current day the activities stop.
### Continue the last activity
2021-07-20 07:37:23 +00:00
```
bartib continue [-p "Another project"] [-d "Another description"]
```
This continues the last activity. If an activity is currently tracked, bartib stops and restarts this activity. The associated project and description may be overwritten by setting a `-p / --project` or `-d / --description` option.
2021-07-20 07:37:23 +00:00
2021-09-03 13:14:29 +00:00
The `-t/--time` option specifies at which time of the current day the activity (re-)starts.
2021-07-12 20:22:21 +00:00
### List all currently running activities
2021-05-10 20:08:04 +00:00
```
bartib current
```
2021-07-12 20:22:21 +00:00
### List activities
2021-07-12 20:22:21 +00:00
All activities:
```
bartib list
```
2021-07-12 20:22:21 +00:00
Do not group activities by date:
```
bartib list --no_grouping
```
2021-07-12 20:22:21 +00:00
List activities in a given time range:
```
bartib list --from 2021-03-01 --to 2021-11-01
```
2021-07-12 20:22:21 +00:00
List activities on a given day:
```
bartib list --date 2021-05-17
2021-07-19 08:31:42 +00:00
```
2021-07-20 07:13:29 +00:00
List activities of special days:
2021-07-19 08:31:42 +00:00
```
bartib list --today
2021-07-20 07:13:29 +00:00
bartib list --yesterday
```
### Edit activities
To change tracked activities, just open the file with your activities log in any text editor. To facilitate this, bartib offers the `edit` subcommand:
```
bartib edit
```
This will open your log in the editor you have defined in your `EDITOR` environment variable. Alternatively you can specify the editor command via the `-e/--editor` option:
```
bartib edit -e vim
```
2021-07-20 07:13:29 +00:00
### Show last activity
```
bartib last
```
### List all projects
This command lists all projects for which an activity has ever been logged:
```
bartib projects
```
This is especially useful for autocompletion. For example, adding this line to the `.bashrc` enables autocompletion for project names:
```
complete -W "$(bartib projects)" bartib
```