@estruyf/worklog-cli 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +114 -2
  2. package/dist/worklog.js +2909 -0
  3. package/package.json +27 -4
package/README.md CHANGED
@@ -1,3 +1,115 @@
1
- # Temporary Holding Version
1
+ # @estruyf/worklog-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Work with your [Worklog](https://github.com/estruyf/worklog-web) timesheet repo from the command line —
4
+ made for AI agents. Log the work they finished, add to-dos with a due date and priority, change or
5
+ close tasks, list what's open, and set the hours worked on a day. The next time you open Worklog, it's all there.
6
+
7
+ ```bash
8
+ npx @estruyf/worklog-cli log --client acme --title "Fix the mobile picker" \
9
+ --link https://github.com/acme/app/issues/12 --note "Widened the tap targets"
10
+
11
+ npx @estruyf/worklog-cli add --client acme --title "Email Sam about the workshop" \
12
+ --due 2026-11-13 --priority high --description "Ask whether it becomes a roundtable or a session"
13
+
14
+ npx @estruyf/worklog-cli update --id t_469p6i --due 2026-11-20
15
+ npx @estruyf/worklog-cli done --id t_469p6i
16
+ npx @estruyf/worklog-cli list --due-by 2026-11-30
17
+ npx @estruyf/worklog-cli hours --client acme --hours 4 --note "Picker fixes"
18
+ ```
19
+
20
+ It edits a **local clone of your timesheet repo** and pushes with your own git credentials. It never
21
+ talks to the Worklog site, so there is no token to set up.
22
+
23
+ Every command takes `--repo` (the clone; defaults to `$WORKLOG_REPO`), and every command that writes
24
+ takes `--dry-run` (print the diff, commit nothing). Running the same command twice changes nothing.
25
+ Each command refuses options it doesn't have, so a to-do's due date can never end up as a day worked.
26
+
27
+ ## `log` — work done
28
+
29
+ | Option | Meaning |
30
+ | --- | --- |
31
+ | `--client` | Client id from `.worklog/config.json`. Required. |
32
+ | `--title` | Title for a new task, or of an open task to log on. Required. |
33
+ | `--link` | Issue or ticket url. The task is found again by it on later runs, archived tasks included. |
34
+ | `--id` | Log on this exact task id instead. |
35
+ | `--note` | Progress note added under the task's `### Notes`. |
36
+ | `--date` | The day worked, `YYYY-MM-DD`. Defaults to today. |
37
+
38
+ The task is matched by `--id`, then `--link`, then an **open task of the same title** for that
39
+ client — so a task you typed into the app yourself is picked up rather than duplicated. With no match
40
+ it is created.
41
+
42
+ ## `add` — a to-do
43
+
44
+ Creates an **open task**: nothing is marked worked and no note is written.
45
+
46
+ | Option | Meaning |
47
+ | --- | --- |
48
+ | `--title` | The task's title. Required. |
49
+ | `--client` | Client id. Leave it out for the general to-do list, the one that belongs to no client. |
50
+ | `--due` | The day the task is due, `YYYY-MM-DD`. |
51
+ | `--priority` | `urgent`, `high`, `normal` or `low`. Defaults to normal. |
52
+ | `--description` | What the task is about, written under its fields. |
53
+ | `--tag` | A tag. Repeat it for several. |
54
+ | `--parent` | A task id, making the new task its subtask. |
55
+ | `--link` | Issue or ticket url. |
56
+
57
+ An open task with the same link or title is left as it is rather than duplicated.
58
+
59
+ ## `update` — change a task
60
+
61
+ Name the task with `--id`, `--link` or `--title` (an open task's exact title; add `--client` when
62
+ several clients have one), then pass only what changes:
63
+
64
+ | Option | Meaning |
65
+ | --- | --- |
66
+ | `--rename` | A new title. |
67
+ | `--due` | A new due date, or `none` to clear it. |
68
+ | `--priority` | A new priority; `normal` clears it. |
69
+ | `--description` | A new description; `""` clears it. |
70
+ | `--status` | A status id from `.worklog/config.json`. A closing one closes the task. |
71
+ | `--tag` / `--untag` | Add or remove a tag. Repeatable. |
72
+ | `--parent` | Move it under this task id, or `none` to make it top-level. |
73
+
74
+ A title that matches open tasks of several clients is refused, with their ids, rather than guessed.
75
+
76
+ ## `done` — close a task
77
+
78
+ Named like `update`. The task moves to the archive with its subtasks, as when you close it in the app.
79
+ A recurring task rolls on to its next occurrence instead.
80
+
81
+ ## `list` — what's open
82
+
83
+ Read-only: it catches up with the remote first, and prints one tab-separated line per open task (id,
84
+ due, priority, client, status, title), soonest due first.
85
+
86
+ | Option | Meaning |
87
+ | --- | --- |
88
+ | `--client` | Only this client's tasks; `todos` for the general to-do list. |
89
+ | `--due-by` | Only tasks due on or before this day. |
90
+ | `--tag` | Only tasks with this tag. |
91
+ | `--json` | Print JSON instead, with descriptions, tags and links. |
92
+
93
+ ## `hours` — time worked
94
+
95
+ Time is tracked per client per day, as in the app's day editor, with the same rules: one line per
96
+ client per day, `full` and `half` follow your working day (`hoursPerDay`), the general to-do list has
97
+ no hours and an archived client is refused.
98
+
99
+ | Option | Meaning |
100
+ | --- | --- |
101
+ | `--client` | The client the time is for. Or… |
102
+ | `--event` | …a day off: `vacation`, `public-holiday`, `out-of-office`, `conference`, `sick` or `other`. |
103
+ | `--hours` | `full`, `half` or a number of hours. **Sets** the day's total for that client; `0` removes it. |
104
+ | `--date` | The day, `YYYY-MM-DD`. Defaults to today. |
105
+ | `--note` | What the time went to. Left out, the note already there is kept. |
106
+
107
+ Without `--hours` it is read-only and prints what's logged that day, and the total against your
108
+ working day.
109
+
110
+ ## Requirements
111
+
112
+ - Node 20 or newer, and git.
113
+ - A clone of your timesheet repo with no uncommitted changes and no unpushed commits — when its push
114
+ loses a race with the app, the CLI resets the clone to the remote and replays its edit on top.
115
+ - `log` records *that* you worked on a task, not for how long; hours are `hours`, per client per day.