/harvest-timer-cli

💻 CLI tool to manage the personal Harvest timer ⌚

Primary LanguageJavaScriptMIT LicenseMIT

⌚ Harvest Time Tracking CLI

This is a zx-based cli tool to manage the personal Harvest timer using its API v2.

Start this script with (cf. prerequisites):

npx zx index.js

Exit the script with ctrl+c.

Tip: Create an alias within your bash; e.g., harvest=npx zx <path-to-script>/index.js.

🎨 Features

Days

  • ✅ shows today's entries (with breaks, conflicts, and missing notes)
  • ✅ show entries of preceding workdays (max. five workdays)

Timer

  • ✅ start timer (on a project task with notes and start time)
    • ✅ exclude irrelevant projects from prompts via config
    • ✅ input relative start time; e.g., -15m for 15 minutes ago
  • ✅ start timer using configurable rules (pre-defining the project, task, and notes)
  • ✅ stop running timer (with end time)
  • ✅ restart timer by choosing an entry from preceding workdays

Entries

  • ✅ edit an entry (start time, end time, notes, and task)
  • ✅ delete an entry

WIP

  • 💡 TODO start timer rules with lookups; e.g., title form ticket system
  • 💡 TODO start timer rules deducing project; e.g., via ticket number
  • 💡 TODO restart timer configurable rules; e.g., development -> pair programming -> testing
  • 💡 TODO fix overlaps
  • 💡 TODO fix gaps (unwanted breaks)
  • 💡 TODO create new entry with endet time
  • 💡 TODO configure workdays
  • 💡 TODO bundle to binary (e.g., with pgk?)

💻 Prerequisites

  • Node version >= 16.0.0
  • Install project dependencies with npm install
  • Create a Harvest **developer API token **
    • Set the environment variables HARVEST_ACCOUNT_ID and HARVEST_API_TOKEN; e.g., in the .env file

⚙ Config

The configuration for the script is saved in .json-files under the .config directory. If a configuration file is missing, a default one will be created. The files are read only once on startup.

🐛 Known Issues

  • Stop action isn't shown when a timer is running but its start time is before the start time of the latest entry.
  • Unknown unknowns 🤷‍♂️

📚 Used Libraries