/trak

Keep a record of the time you dedicate to your projects.

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

Trak banner

trak


Trak is a CLI to track the time you spend on projects, with useful reports and analytics.

For freelancers, by a freelance.

Website · Issues · DocumentationFeedback

Installation

Pypi

On Pypi you can find the package under the trakcli name.

You can install it with pip:

pip install trakcli

or with pipx:

pipx install trakcli

Brew

brew install lcfd/trak/trak

Nix

If you have Nix installed and flakes enabled, you can try trak using:

nix run github:lcfd/trak

The package will be built from source, so it might take a while.

You can pass arguments like this:

nix run github:lcfd/trak -- --help

Local

Run poetry build and then

# x.x.x = The version you have used to do the build.
pipx install ./dist/trakcli-x.x.x-py3-none-any.whl

to install trak using the wheel file.

Usage

The package has the useful --help command that explains all the commands.

trak --help

The CLI guides you through what you should and must do with specific messages.

Basic commands

# Start a new session
trak start <project-name>

# Stop the current session
trak stop

# Show the elapsed time of the current session
trak status

# Show the amount of hours spend on the project
trak report project <project-name>

Start tracking a billable project:

trak start pasta -b

Start tracking a project on a specific category/topic:

trak start pasta -c rigatoni

Starship

There is a dedicated command that outputs clean strings for tools like Starship:

trak status -s or trak status --starship

To see the status in your terminal line open $HOME/.config/starship.toml and put this snippet inside of it:

[custom.trak]
command = """ trak status -s """
when = "trak status"
shell = "sh"

This way you can stay updated on the state of your session wherever you integrate this command.

Distribution

Create dist tar

tar --exclude=".venv" --exclude="dist" --exclude=".mypy_cache" --exclude=".pytest_cache" --exclude="**/__pycache__" -czvf dist.tar.gz cli