Simple time tracking CLI

Overview

timetrace

timetrace is a simple CLI for tracking your working time.

CLI screenshot

Installation

Homebrew

brew tap dominikbraun/timetrace
brew install timetrace

Docker

The timetrace Docker image stores all data in the /data directory. To persist this data on disk, you should create a bind mount or named volume like so:

docker container run -v my-volume:/data dominikbraun/timetrace version

Binary

Download the latest release and extract the binary into a directory like /usr/local/bin or C:\Program Files\timetrace. Make sure the directory is in the PATH variable.

Usage example

First, create a project you're working for:

timetrace create project make-coffee

Once the project is created, you're able to track work on that project.

timetrace start make-coffee

You can obtain your currently worked time using timetrace status. When you've finished your work, stop tracking:

timetrace stop

You're also able to delete and edit projects and records (see below).

Command reference

Create a project

Syntax:

timetrace create project <KEY>

Arguments:

Argument Description
KEY An unique project key.

Example:

Create a project called make-coffee:

timetrace create project make-coffee

Get a project

Syntax:

timetrace get project <KEY>

Arguments:

Argument Description
KEY The project key.

Example:

Display a project called make-coffee:

timetrace get project make-coffee

Get a record

Syntax:

timetrace get record <YYYY-MM-DD-HH-MM>

Arguments:

Argument Description
YYYY-MM-DD-HH-MM The start time of the desired record.

Example:

By default, records can be accessed using the 24-hour format, meaning 3:00 PM is 15. Display a record created on May 1st 2021, 3:00 PM:

timetrace get record 2021-05-01-15-00

This behavior can be changed.

List all projects

Syntax:

timetrace list projects

Example:

List all projects stored within the timetrace filesystem:

timetrace list projects
+---+-------------+
| # |     KEY     |
+---+-------------+
| 1 | make-coffee |
| 2 | my-website  |
| 3 | web-shop    |
+---+-------------+

List all records from a date

Syntax:

timetrace list records <YYYY-MM-DD>

Arguments:

Argument Description
YYYY-MM-DD The date of the records to list.

Example:

Display all records created on May 1st 2021:

timetrace list records 2021-05-01

Edit a project

Syntax:

timetrace edit project <KEY>

Arguments:

Argument Description
KEY The project key.

Example:

Edit a project called make-coffee:

timetrace edit project make-coffee

Delete a project

Syntax:

timetrace delete project <KEY>

Arguments:

Argument Description
KEY The project key.

Example:

Delete a project called make-coffee:

timetrace delete project make-coffee

Start tracking

Syntax:

timetrace start <PROJECT KEY>

Arguments:

Argument Description
PROJECT KEY The key of the project.

Flags:

Flag Short Description
--billable -b Mark the record as billable.

Example:

Start working on a project called make-coffee and mark it as billable:

timetrace start --billable make-coffee

Print current status

Syntax:

timetrace status

Example:

Print the current tracking status:

timetrace status
+-------------+--------------------+---------------+
|   PROJECT   | WORKED SINCE START | WORKED TODAY  |
+-------------+--------------------+---------------+
| make-coffee | 3h25m29.037343s    | 7h22m49.5749s |
+-------------+--------------------+---------------+

Stop tracking

Syntax:

timetrace stop

Example:

Stop working on your current project:

timetrace stop

Print version information

Syntax:

timetrace version

Example:

Print your installed timetrace version:

timetrace version

Configuration

You may provide your own configuration in a file called config.yaml within $HOME/.timetrace.

Prefer 12-hour clock for storing records

If you prefer to use the 12-hour clock instead of the default 24-hour format, add this to your config.yaml file:

use12hours: true

This will allow you to view a record created at 3:00 PM as follows:

timetrace get record 2021-05-14-03-00PM

Set your preferred editor

By default, timetrace will open the editor specified in $EDITOR or fall back to vi. You may set your provide your preferred editor like so:

editor: nano

Credits

This project depends on the following packages:

Comments
  • Update `delete project` and `revert project` to include submodules of the project

    Update `delete project` and `revert project` to include submodules of the project

    This PR addresses #74.

    I thought that if we delete submodules by default, it would make sense if --revert would also revert submodules, and so created additional functions for that even though that was not asked for. If you think --revert should not revert submodules by default, let me know and I'll be happy to amend the commit.

    opened by jwnpoh 17
  • Error: Failed to start tracking

    Error: Failed to start tracking

    Hi, After creating a project as per README usage instructions, whenever I try to start tracking I get this error on Mac: $ timetrace start coding ❗ Failed to start tracking: start tracking first

    Please advise. Thank you!!

    bug 
    opened by udayravuri 16
  • print more info when created record collides with others

    print more info when created record collides with others

    resolve #173 first PR in this repo I simply changed/added some print statements any feedback will be appreciated

    now the output is

    ❯ go run . create record open-summer today 8:25 10:30
    ❗ collides with these records :
    💡 open-summer 2021-08-28 08:21:00 +0800 CST-2021-08-28 09:23:00 +0800 CST
    💡 open-summer 2021-08-28 09:30:00 +0800 CST-2021-08-28 10:20:00 +0800 CST
    ⚠️  start and end of the record should not overlap with others
    
    
    opened by RedemptionC 13
  • Duplicate code found in `core/record.go`

    Duplicate code found in `core/record.go`

    Hello! It seems like there are two functions in core/record.go that do the same thing, ListRecords and loadAllRecords.

    Being new to programming, I am not sure if this is a feature or bug :confused:

    good first issue 
    opened by jwnpoh 9
  • [Issue #36] Remove hard-coded

    [Issue #36] Remove hard-coded "15:04" strings

    Fixes #36

    Changes:

    • Replaced hardcoded 15:04 (and 12 hour version 3:04PM) format string with a constant

    Might be best to refactor this logic into a formatter component that is generated by the Config(), @dominikbraun what do you think?

    opened by aaronsheah 9
  • `timetrace report` displays deleted records

    `timetrace report` displays deleted records

    Hello! I have observed that timetrace report currently lists records that have been deleted. Is this the intended behaviour? If it is not, then I would like to propose two fixes:

    1. delete project should also delete records with the associated project key.
    2. timetrace report should ignore record files that have the .bak suffix.
    bug help wanted 
    opened by jwnpoh 8
  • Simplify record keys

    Simplify record keys

    closes #116

    I implemented the features discussed in #116, but I needed to change the "marker" of the ID from # to *. Otherwise, the argument seems to be ignored. I don't know if it's my terminal or the go library or something else, but the arg[0] is empty when the input starts with a #. This begs two questions: Are you okay with the * as a marker, or would you prefer something else? And should we change the header of the list record command accordingly, to avoid confusion?

    opened by FelixTheodor 8
  • Beautify durations displayed on `timetrace status`

    Beautify durations displayed on `timetrace status`

    At the moment, the output of timetrace status looks as follows:

    +-----------------+--------------------+-----------------+
    | CURRENT PROJECT | WORKED SINCE START |  WORKED TODAY   |
    +-----------------+--------------------+-----------------+
    | make-coffee     | 8h25m26.147239s    | 8h25m26.147239s |
    +-----------------+--------------------+-----------------+
    

    Displaying durations like 8h25m26.147239s is precise, but unnecessary und unreadable. It should rather look something like 8h 25min.

    enhancement good first issue 
    opened by dominikbraun 8
  • `report` command: Rename `--format` flag to `--output`

    `report` command: Rename `--format` flag to `--output`

    The timetrace report command has a flag called --format for specifying the output format, e. g. JSON.

    However, since #114, the timetrace status command has a --format flag for specifying a custom output format and uses a flag called --output for specifying JSON as output format.

    How it is

    |Command|Flag|Description| |-|-|-| |status|--output|Output format, e.g. JSON| |status|--format|Custom format| |report|--format|Output format, e.g. JSON|

    This should be changed: The --format flag of report should be renamed to --output so that it serves the same purpose as the status --output flag.

    How it should be

    |Command|Flag|Description| |-|-|-| |status|--output|Output format, e.g. JSON| |status|--format|Custom format| |report|--output|Output format, e.g. JSON|

    Don't forget to update the documentation accordingly! 😄

    enhancement good first issue 
    opened by dominikbraun 7
  • Report issue#88

    Report issue#88

    This is a first proposal for the report command. Supported flags:

    • --billable
    • --project
    • --start / --end
    • --format (json/csv) csv is not yet implemented...
    • --out

    The command is designed the way it is discussed in #88.

    In the cli/report.go I commented TODOs. Here I would be happy to get some input as I don't like the way I have implemented the checks if a Flags.StringVarP has its default value...

    opened by KonstantinGasser 7
  • Idea: Add Starship integration/Status

    Idea: Add Starship integration/Status

    Hello folks,

    I used watson tool from time to time, but it's python and it keeps breaking because of some dependencies from time to time.

    Looking for other tools I found timetrace and others like rtw and timetracking

    timtrace seems very active and I have like golang over rust, also this seems to have a better community.

    So I am going to start to use timetrace

    With all that said, I would like to see if we can add starship integration, it should be simple enough like see here: https://github.com/hardliner66/timetracking#starship and https://github.com/PicoJr/rtw#starship-prompt-integration full doc on custom commands for starship: https://starship.rs/config/#custom-commands

    I can try to implement it.

    I would also like if people have Ideas on what output should we allow. Like, enable arbitrary format like the examples on the tools above: --format "{h}h {mm}m" --format "{ongoing} {human_duration}"

    I think initially what it would be nice is to get the total amount worked today as the current status show this information already.

    But at some point, I would like to be able to show only worked time for the project on that day and so on, but this may be added to the report command and not the status.

    Please let me know what you guys think.

    enhancement 
    opened by sfrique 6
  • Report improvements

    Report improvements

    Adding the CSV export for the report command.

    Adding a duration column in the report command that is the time spent for each record. I've found this useful on top of the total to quickly see how long each record took.

    opened by Nahria 0
  • feat(records): add description as new field

    feat(records): add description as new field

    This is a first try at adding an additional description field for the records

    Please suggest anything I may have missed, my manual test were succesful.

    Fixes #209

    opened by eyenx 3
  • Feature Request: Add description field in records

    Feature Request: Add description field in records

    Hi

    I want to submit a fetaure request. I know it has already been touched in #115 but at the end only tags were implemented.

    I would love to have descriptions to the records timetrace creates. I"m also willing to contribute code to this project to make that happen.

    Let me know if you are already working on this, or else I'll take up the task.

    BR and thanks for this wonderful project!

    opened by eyenx 0
  • Check record collisions when editing a record

    Check record collisions when editing a record

    At the moment, record collision checks are only performed when creating a belated record using timetrace create record but not when editing an existing record.

    This needs to be changed by calling t.RecordCollides when running timetrace edit record.


    What is record collision?

    Say you have 2 records:

    • 3PM - 4PM
    • 5PM - 8PM

    And you want to insert a new one:

    • 7PM - 9PM

    This record collides with the second (5PM - 8PM) record, because it lies within that record. timetrace doesn't allow this.

    enhancement help wanted 
    opened by dominikbraun 5
  • GitHub Actions

    GitHub Actions

    Created 3 workflows to address #196

    1. Create and upload release binaries
    2. Create and upload Docker images requires DOCKERHUB_USERNAME and DOCKERHUB_TOKEN repository secrets
    3. Format and Run Tests

    1 & 2 run after a published release or can be run manually (workflow_dispatch) 3 will run on every push

    Also updated Dockerfile to create a pure static executable negating the need to simlink libraries

    opened by mattkasun 3
Releases(v0.14.3)
Owner
Dominik Braun
I'm a Backend Engineer focused on Go, Kubernetes and CI/CD.
Dominik Braun
Simple, seamless, lightweight time tracking for Git

Git Time Metric Seamless time tracking for all your Git projects $ gtm report -last-month $ gtm report -last-month -format summary $ gtm report -last-

Git Time Metric 916 Nov 21, 2022
Command line tool for time tracking in a human-readable file format.

klog klog is a plain-text file format and a command line tool for time tracking. ?? Documentation – Learn how to use klog ?? Download – Get the latest

Jan Heuermann 381 Nov 19, 2022
Expense_tracker - A simple application that will help in tracking income and expense

Expense Tracker Is meant to be a simple application that will help in tracking i

Prabandham Srinidhi 0 Jan 6, 2022
Terminal stock ticker with live updates and position tracking

Ticker Terminal stock watcher and stock position tracker Features Live stock price quotes Track value of your stock positions Support for multiple cos

Ani Channarasappa 4.4k Nov 26, 2022
A Target Tracking , NoteTaking , CheckLists and Data Management GUI App for Bug Hunter's and Pentesters.

Screenshots Features • Installation • Usage • Features • Notes • Sandman A Target Tracking , NoteTaking , CheckLists and Data Management GUI App for B

Tarun Koyalwar 28 Nov 22, 2022
a work time management CLI tool for any platform

english |日本語 jobgosh | job management tool made with golang for shell a multi-platform work time management CLI tool to track and improve your day to

奥田 龍馬 10 May 16, 2022
A tiny cli command/daemon for syncing toggl time entries with Jira

toggl-sync A tiny cli command/daemon for syncing toggl time entries with Jira Installation Install the app via brew package manager. brew tap timemate

TimeMate 2 Nov 30, 2021
Minutes is a CLI tool for synchronizing work logs between multiple time trackers, invoicing, and bookkeeping software to make entrepreneurs' daily work easier.

Minutes is a CLI tool for synchronizing work logs between multiple time trackers, invoicing, and bookkeeping software to make entrepreneurs' daily work easier.

Gábor Boros 21 Aug 8, 2022
News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

news-parser-cli Simple CLI which allows you to receive news depending on the par

Maxym 0 Jan 4, 2022
A simple command line time description parser

Zeit Zeit is an extremely simple command line application to read a natural language time description and output it as a timestamp. The main usecase f

ElKowar 6 Aug 21, 2021
a simple golang program that shows the time in asci art.

Curtime a simple golang program that shows the time in asci art. Installing Other For other distros you can grab a executable file from the releases.

null 1 Oct 8, 2021
Elegant CLI wrapper for kubeseal CLI

Overview This is a wrapper CLI ofkubeseal CLI, specifically the raw mode. If you just need to encrypt your secret on RAW mode, this CLI will be the ea

Elm 4 Jan 8, 2022
CLI to run a docker image with R. CLI built using cobra library in go.

BlueBeak Installation Guide Task 1: Building the CLI The directory structure looks like Fastest process: 1)cd into bbtools 2)cd into bbtools/bin 3)I h

Aniruddha Chattopadhyay 0 Dec 20, 2021
A wrapper of aliyun-cli subcommand alidns, run aliyun-cli in Declarative mode.

aliyun-dns A wrapper of aliyun-cli subcommand alidns, run aliyun-cli in Declarative mode. Installation Install aliyun-cli. Usage $ aliyun-dns -h A wra

许嘉华 0 Dec 21, 2021
Symfony-cli - The Symfony CLI tool For Golang

Symfony CLI Install To install Symfony CLI, please download the appropriate vers

Symfony CLI 387 Nov 22, 2022
Go-file-downloader-ftctl - A file downloader cli built using golang. Makes use of cobra for building the cli and go concurrent feature to download files.

ftctl This is a file downloader cli written in Golang which uses the concurrent feature of go to download files. The cli is built using cobra. How to

Dipto Chakrabarty 2 Jan 2, 2022
Cli-algorithm - A cli program with A&DS in go!

cli-algorithm Objectives The objective of this cli is to implement 4 basic algorithms to sort arrays been Merge Sort Insertion Sort Bubble Sort Quick

Leonardo Brombilla Antunes 0 Jan 2, 2022
Nebulant-cli - Nebulant's CLI

Nebulant CLI Website: https://nebulant.io Documentation: https://nebulant.io/docs.html The Nebulant CLI tool is a single binary that can be used as a

Develatio 2 Jan 11, 2022