feat: allow time tracking via the CLI#44
Draft
dhth wants to merge 4 commits into
Draft
Conversation
|
Is there a hope that this will come into main? Being able to use the cli is really beneficial for quick start/stop of tasks especially. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the following interface via the CLI:
List tasks
[ { "id": 8, "summary": "sql", "created_at": "2025-01-18T15:22:41.178314+01:00", "updated_at": "2025-01-20T00:14:33.732783+01:00", "tracking_active": false, "seconds_spent": 77336 }, { "id": 1, "summary": "javascript", "created_at": "2025-01-18T15:22:41.093522+01:00", "updated_at": "2025-01-20T00:09:39.09208+01:00", "tracking_active": false, "seconds_spent": 86100 }, { "id": 2, "summary": "objective-c", "created_at": "2025-01-18T15:22:41.105774+01:00", "updated_at": "2025-01-19T23:38:34.912586+01:00", "tracking_active": false, "seconds_spent": 87978 } ]Start tracking
hours track start 8 -c "task comment goes here"{ "task_id": 8, "task_summary": "sql", "begin_ts": "2025-01-20T00:20:12.719771+01:00", "comment": "task comment goes here" }Update tracking
{ "task_id": 8, "task_summary": "sql", "begin_ts": "2025-01-20T00:10:00+01:00", "comment": "task comment goes here, updated" }End tracking
{ "task_id": 8, "task_summary": "sql", "begin_ts": "2025-01-20T00:12:00+01:00", "end_ts": "2025-01-19T23:18:00+01:00", "seconds_spent": 360, "comment": "task comment goes here, updated, again" }Quick switch tracking
Given, a task being tracked:
{ "task_id": 2, "task_summary": "objective-c", "begin_ts": "2025-01-20T00:23:11.275523+01:00", "comment": "quick switched" }