A CLI tool to keep track of how long certain Tasks have taken
- Goal of the Project
- installation
- Usage
- The Web interface
- A word on Timers
- Probabbly asked Questions
- Build it yourself
I had a lot of "Project-Hopping" to do lately, and can barely keep track of what toke how long. This tool is meant to make things easier by documenting when and how long certain Tasks have been executed.
- grab one of the binaries from the Releases - Section
- rename it to
tnt
(for Linux/Unix/Mac) ortnt.exe
(for Windows) - put it into a directory that is listed in your $PATH or %PATH%
- setup the Autocompletion as described further down in Autocompletion Done
Alternatively, you can run the tnt
/ tnt.exe
from any directory you like.
Having it in your $PATH
/%PATH%
just makes it possible to call it from other directories.
Should your system not be covered by the precompiled binaries, please use the build guide further down Build it yourself
Likewise, this README also covers features not yet present in the Releases - Section.
When using a pre-build release, always refere to the README.md of the release
(in v1.3.1 or smaller, this must be extracted from the Source Code.zip
/ Source Code.tar.gz
file)
Note
Despite this being a CLI-Tool, there is also a Web interface, if the CLI is not your cup of tea. Just look further down in this README
This application was primarily designed ot be used from the command line first.
Easily usable via Windows Powershell/CMD or Unix Bash, ZSH, etc.
# first create some Tasks
tnt tasks add "important project nr 1"
tnt tasks add "very important project"
tnt tasks add "some side project"
tnt tasks add "learning new stuff"
# you can see what task you created via
tnt tasks ls
# To remove a task and all its Recorded Times use
tnt tasks rm "some side project";
to start tracking times, use:
tnt s "important project nr 1"
#or
tnt start "important project nr 1"
#or
tnt switch "important project nr 1"
#these 3 are aliasses for the the same function
now the timer for "important project nr 1" is running until you either start
another timer via s
, start
or switch
or, if you want to stop the timers (for example because your shift is over) call:
tnt stop
switching tasks is as easy as calling
tnt s "what ever is your new task"
Should another timer be running currently, it will be stopped and a new timer for the new task is started.
just run.
tnt times sum
and you'll get a list of all Tasks and how much time you've spend with them in total.
To find out, when you did what, you can use the
tnt times ls
command. The most current started timer is on top. The oldest timer is on the bottom.
both of the tnt times
commands can take a -t
or --task
flag, to filter the results for a given Task.
The value for this flag is the Taskname given during tnt task add
or used during tnt s | start | switch
.
This tool was build with auto completion im mind, as Task names can become quite long. Autocompletion make switching between Tasks/Timers very fritctionless.
on bash you can activate the autocomletion by putting the following in your .bashrc.
source <(tnt completion bash)
For ZSH put this into your .zshrc
source <(tnt completion zsh)
Check the following command for more autocompletion options
tnt completion
don't worry, despite it saying "Web", no data will ever leave your computer. Instead your default browser is just used as an input and output.
To use Tasks 'n Times via the Web-Interface, call the following command from the command line.
tnt serve
then open the URL it shows you.
On Mac and Linux, you can add the --open
or -o
flag to automatically open
your standard browser at the location.
Note
-o
and --open
are not yet supported on Windows
By default it opens on Port 7353.
Should that port not be available or allowed, you can define another one via the -p
or --port
flag.
tnt serve --port 8088
You can also combine the --open
and --port
flags via their short form.
tnt serve -op 8088
From their, you are presented with this interface here. While not pretty, it works for now.
The Reload Tasks - Button at the top can be used in case you added new Tasks via the command line, while the server was running. (But a simple F5 Page-Refresh does the job too.)
You can add a new Task via the " + " Button in the top right cornor.
It opens the Input Form, where you can add your new Task.
After that, is your Task-List.
The Cross-button removes a Task and all its recorded times from the List.
The Play-button starts a new Timer for that Task.
Shows the total time you spend in that task.
Note
Starting a new Timer will automatically finish the previous running Timer.
Below that, you have the Times section.
You can click on a Tasks name to filter the times for that Task.
stops what ever timer is crently running.
Shows the times for all Tasks
Shows the Summed times per Task for all Tasks.
As with the Tasks, the Cross button next to a Time, removes that time.
This applications job is to serve as stopwatch like timer. However, the times are recorded passively. That means, even if you turn your computer off, the timer will still be running, until it is stopped.
Times are taken after a Task was stopped, by substracting the end time from the start time. That way, you don't need to have the App open at all times, just when you need to interact with it.
Q: Where does tnt
store it's persistent Data?
All it's data is stored in the
$HOME/.local/share/tnt
directory. On Windows that should be%USERPROFILE%\.local\share\tnt
.you can also call tnt with the
--db "path/to/yourdatabase.db"
flag, to store the data in a file in thepath/to/yourdatabase.db
file instead.
Q: Will the Web-Interface track my data or install anything ?
No
- Install GO (https://go.dev/doc/install)
- Make sure
make
is installed on your system - clone this repo
git clone https://github.com/Rocco-Gossmann/tnt.git
- Enter the directory
cd tnt
- Run
make go.sum
- Build the project
make tnt #to build für your specific system
# or
make all #to build all other versions
Should you want to change anything regarding the Web-Interface, please make sure Tailwind-CLI is installed on your system. Then run
make css && make