Skip to content
/ ham-cli Public

CLI tool for Hamster - Rust learning project

Notifications You must be signed in to change notification settings

side2k/ham-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hamster CLI

Small pet project that syncs time records from Hamster tracker to Everhour. Most likely, it will not be of any use except myself. It relies on the everhour-simple-client crate, that I've created specifically for this purpose.

Rationale

Locally, I'm using Hamster to track and plan my activity, while on my job I'm required to track my working time in Everhour. To avoid doing tracking double and also to learn some Rust - this project was created.

How it works

For adding time record entry in Everhour, this data is required:

  • Everhour API token: can be obtained one the Everhour User Profile settings page. Can be specified via --api-token command line option or EVERHOUR_API_TOKEN environment variable.

  • task id - in Hamster, for work task entries' description, I add links to Asana tasks in markdown format. Task ids are extracted from these links

  • user - current user, obtained by relevant API call

  • time - time in seconds, calculated by the task duration, i.e. end_time - start_time. If end time is not defined, current time is used

  • date - date of the task. Currently, tasks that span for more than 1 day, are not processed properly!

Basic example of running the sync:

ham-cli sync-eh Work

…will sync tasks of Work category for today. The command above assumes that:

  • Hamster database is located in $HOME/.local/share/hamster/hamster.db
  • Everhour API token is set in EVERHOUR_API_TOKEN env variable (see above)

About

CLI tool for Hamster - Rust learning project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages