First, install rustup
to get the rust
compiler using curl https://sh.rustup.rs -sSf | sh -s
. Then,
$ git clone /~https://github.com/img9417/shigan
$ cd shigan
$ cargo build --release
$ ./target/release/shigan
$ brew tap img9417/shigan
$ brew install shigan
To update, run
$ brew update
$ brew upgrade shigan
Command line Time Tracker
Usage: shigan [COMMAND]
Commands:
add Add a task to the tracker
delete Deletes a task from the tracker
start Starts the tracker for <TASK>
stop Stops currently running tracker
log List accumulated time for the task or all (default="all")
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
You can add a task using add -t <TASK>
or add --task <TASK>
$ shigan add -t Programming
This data will be saved in data.json
inside .shigan
directory located in the root directory.
The directory and the file will be created automatically if not exist.
Tasks are NOT case sensitive as everything will be transformed to a lowercase.
You can remove the task using delete -t <TASK>
or delete --task <TASK>
$ shigan delete -t programming
If such task doesn't exist, Shigan will throw an error.
$ shigan delete --task prog
@@ Task 'prog' not found
You can start tracking for a specific task using start -t <TASK>
or start --task <TASK>
.
$ shigan start -t programming
@@ Task 'programming' starting
If a task doesn't exist, Shigan will throw an error.
$ shigan start -t prog
@@ Task 'prog' does not exist.
You can stop the tracker simply by using shigan stop
.
$ shigan stop
Stopped tracking for the task "programming"
This will stop the tracker and record the session in ~/.shigan/data.json
.
If there is no ongoing task, Shigan will throw an error.
$ shigan stop
@@ Error - there's no ongoing task.
You can use log
to display all the tasks and their accumulated time.
$ shigan log
+-------------+------------------+
| Tasks | Time Accumulated |
+-------------+------------------+
| programming | 2h 55m |
+-------------+------------------+
| reading | 1h 17m |
+-------------+------------------+
| english | 0h 17m |
+-------------+------------------+
You can specify the task to display its time only.
$ shigan log -t programming
+-------------+------------------+
| Tasks | Time Accumulated |
+-------------+------------------+
| programming | 2h 55m |
+-------------+------------------+
- chrono (0.4.37)
- clap (4.5.4)
- dirs (5.0.1)
- prettytable-rs (0.10.0)
- serde_json (1.0.115)