zmoog / toggl-track

Toggl Track CLI
Apache License 2.0
1 stars 1 forks source link

Add initiative #9

Closed zmoog closed 1 year ago

zmoog commented 1 year ago

This is a personal extension on top of Toggl.

I often write time entries description using the following pattern:

<initiative>: <activity>

For example:

practical nerdery: switch the hosting from S3 to GitHub Pages

In this case, the initiative is "practical nerdery" the title of my personal blog. The "activity" is "switch the hosting from S3 to GitHub Pages".

The activity is what I am currently doing, and the initiative is the context I am currently spending or investing time on.

I would use "project" or "task" instead of "initiative", but they are already in use by Toggl with a different semantics.

Initiative looks like a good alternative and it also echoes the concept from OKRs.

zmoog commented 1 year ago

I would start by adding a new property initiative in TimeEntry and setting it by parsing the description field.

zmoog commented 1 year ago

For example:

$ tgl entries --project-id 95029662 list --start-date 2023-01-30
                                  Time Entries

  At           Description               Start      Stop       Duration   Tags
 ──────────────────────────────────────────────────────────────────────────────
  2023-02-04   toggl-track: initiative   07:37 AM   08:32 AM   0:54
  2023-02-04   toggl-track: insights     05:37 AM   07:13 AM   1:36
  2023-02-03   toggl-track: insights     07:06 AM   08:07 AM   1:01
  2023-02-03   toggl-track: insights     05:51 AM   06:08 AM   0:16
  2023-02-02   toggl-track: insights     05:13 AM   06:00 AM   0:46
  2023-02-02   zmoog.dev                 12:07 AM   12:17 AM   0:10
  2023-02-01   toggl-track: insights     06:53 AM   08:09 AM   1:15
  2023-02-01   toggl-track: insights     05:37 AM   06:05 AM   0:28
 ──────────────────────────────────────────────────────────────────────────────
                                                    Total      6:29

$ tgl entries --project-id 95029662 group-by --field initiative --start-date 2023-01-30
       Time Entries

  initiative    Duration
 ────────────────────────
  toggl-track   6:19
  zmoog.dev     0:10
 ────────────────────────
  Total         6:29
zmoog commented 1 year ago

implemented by #10