Skip to content

A time tracking utility to automate logging hours for work

Notifications You must be signed in to change notification settings

Oli-Ross/timetrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 

Repository files navigation

Time tracking tool

A simple tool to track working hours by task via CLI.

Setup

Chmod + link the script:

chmod +x ./timetrack.py
sudo ln -s "$(pwd)/timetrack.py" /usr/local/bin/task

CLI interface

  • task status: Show the currently running task: start time, duration, name
  • task start NAME: Start a new task with the name NAME, abort with error if one is running
  • task stop: End the current task
  • task log: Mark all tasks logged up to including the last task that was ended and show all tasks who's status changed
  • task unlog: Undo the last call to task log
  • task show {all, today, unlogged}: Only show tasks that are from this day/unlogged
  • task print: Pretty print the current week into ${ARCHIVE_DIR}/KW_${XX}.md + stdout, where XX is the current calendar week.
  • task push: Upload unlogged files to Harvest

On each task invocation:

  • Print the current task + time running to a file for the OS statusbar

Config

The following config parameters can be edited in the source directly:

TIMETRACK_DB = "timetrack.db"
STATUSBAR_FILE = "/tmp/task"
ARCHIVE_DIR = Path("/tmp")

TIMETRACK_DB is the storage location of the SQLite database (make sure to use an absolute path). STATUSBAR_FILE is the file that gets an ultra-short stat on the current running task on each invocation. ARCHIVE_DIR is where task print stores the weekly human-readable reports in Markdown format.

Harvest integration

In order to successfully push to Harvest, you need to set 3 environment variables:

export [email protected]
export HARVEST_ACCOUNT_ID=1234
export HARVEST_TOKEN=1234

Read the API doc for more info.

Also, there are 2 more config variables that are currently hardcoded:

PROJECT_ID = 1
TASK_ID = 1

These IDs define to which project on Harvest the unlogged tasks are uploaded to.

Internal architecture

  • SQLite database
  • Each task has unique UUID

TODO

Test Harvest integration.

About

A time tracking utility to automate logging hours for work

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages