@estruyf/worklog-cli 0.1.0 → 0.2.1
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.
- package/README.md +102 -8
- package/dist/worklog.js +1294 -279
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
# @estruyf/worklog-cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx @estruyf/worklog-cli log --client acme --title "Fix the mobile picker" \
|
|
9
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"
|
|
10
18
|
```
|
|
11
19
|
|
|
12
20
|
It edits a **local clone of your timesheet repo** and pushes with your own git credentials. It never
|
|
13
21
|
talks to the Worklog site, so there is no token to set up.
|
|
14
22
|
|
|
15
|
-
|
|
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
|
|
16
28
|
|
|
17
29
|
| Option | Meaning |
|
|
18
30
|
| --- | --- |
|
|
@@ -22,16 +34,98 @@ talks to the Worklog site, so there is no token to set up.
|
|
|
22
34
|
| `--id` | Log on this exact task id instead. |
|
|
23
35
|
| `--note` | Progress note added under the task's `### Notes`. |
|
|
24
36
|
| `--date` | The day worked, `YYYY-MM-DD`. Defaults to today. |
|
|
25
|
-
| `--
|
|
26
|
-
|
|
37
|
+
| `--time` | Time spent on the task that day: `1h`, `45m`, `1h30m`, or `none` to clear it. Sets the day's time, the same as the app's Time field. |
|
|
38
|
+
|
|
39
|
+
`--time` is a record on the task only. The hours you bill a client for stay with [`hours`](#hours--time-worked).
|
|
27
40
|
|
|
28
41
|
The task is matched by `--id`, then `--link`, then an **open task of the same title** for that
|
|
29
42
|
client — so a task you typed into the app yourself is picked up rather than duplicated. With no match
|
|
30
|
-
it is created.
|
|
43
|
+
it is created.
|
|
44
|
+
|
|
45
|
+
## `unlog` — take a log back off
|
|
46
|
+
|
|
47
|
+
For a log that went on the wrong task or day. Name the task like `update`, then pass what to remove:
|
|
48
|
+
|
|
49
|
+
| Option | Meaning |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| `--date` | Take this day worked off the task, with its time. |
|
|
52
|
+
| `--note` | Remove the note with exactly this text. |
|
|
53
|
+
|
|
54
|
+
Each option removes only what it names. The task itself and its status stay as they are.
|
|
55
|
+
|
|
56
|
+
## `add` — a to-do
|
|
57
|
+
|
|
58
|
+
Creates an **open task**: nothing is marked worked and no note is written.
|
|
59
|
+
|
|
60
|
+
| Option | Meaning |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `--title` | The task's title. Required. |
|
|
63
|
+
| `--client` | Client id. Leave it out for the general to-do list, the one that belongs to no client. |
|
|
64
|
+
| `--due` | The day the task is due, `YYYY-MM-DD`. |
|
|
65
|
+
| `--priority` | `urgent`, `high`, `normal` or `low`. Defaults to normal. |
|
|
66
|
+
| `--description` | What the task is about, written under its fields. |
|
|
67
|
+
| `--tag` | A tag. Repeat it for several. |
|
|
68
|
+
| `--parent` | A task id, making the new task its subtask. |
|
|
69
|
+
| `--repeat` | A repeat rule, as the app's `- repeat:` line takes it: `weekly on mon`, `monthly on last`, … Without `--due`, the first occurrence is the due date. |
|
|
70
|
+
| `--link` | Issue or ticket url. |
|
|
71
|
+
|
|
72
|
+
An open task with the same link or title is left as it is rather than duplicated.
|
|
73
|
+
|
|
74
|
+
## `update` — change a task
|
|
75
|
+
|
|
76
|
+
Name the task with `--id`, `--link` or `--title` (an open task's exact title; add `--client` when
|
|
77
|
+
several clients have one), then pass only what changes:
|
|
78
|
+
|
|
79
|
+
| Option | Meaning |
|
|
80
|
+
| --- | --- |
|
|
81
|
+
| `--rename` | A new title. |
|
|
82
|
+
| `--due` | A new due date, or `none` to clear it. |
|
|
83
|
+
| `--priority` | A new priority; `normal` clears it. |
|
|
84
|
+
| `--description` | A new description; `""` clears it. |
|
|
85
|
+
| `--status` | A status id from `.worklog/config.json`. A closing one closes the task. |
|
|
86
|
+
| `--tag` / `--untag` | Add or remove a tag. Repeatable. |
|
|
87
|
+
| `--parent` | Move it under this task id, or `none` to make it top-level. |
|
|
88
|
+
| `--repeat` | A new repeat rule, or `none` to stop it repeating. Its `repeatFrom` and `repeatUntil` are kept. |
|
|
89
|
+
|
|
90
|
+
A title that matches open tasks of several clients is refused, with their ids, rather than guessed.
|
|
91
|
+
|
|
92
|
+
## `done` — close a task
|
|
93
|
+
|
|
94
|
+
Named like `update`. The task moves to the archive with its subtasks, as when you close it in the app.
|
|
95
|
+
A recurring task rolls on to its next occurrence instead.
|
|
96
|
+
|
|
97
|
+
## `list` — what's open
|
|
98
|
+
|
|
99
|
+
Read-only: it catches up with the remote first, and prints one tab-separated line per open task (id,
|
|
100
|
+
due, priority, client, status, title), soonest due first.
|
|
101
|
+
|
|
102
|
+
| Option | Meaning |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `--client` | Only this client's tasks; `todos` for the general to-do list. |
|
|
105
|
+
| `--due-by` | Only tasks due on or before this day. |
|
|
106
|
+
| `--tag` | Only tasks with this tag. Repeat it for tasks with all of them. |
|
|
107
|
+
| `--json` | Print JSON instead, with descriptions, tags, links, the days worked and the minutes per day. |
|
|
108
|
+
|
|
109
|
+
## `hours` — time worked
|
|
110
|
+
|
|
111
|
+
Time is tracked per client per day, as in the app's day editor, with the same rules: one line per
|
|
112
|
+
client per day, `full` and `half` follow your working day (`hoursPerDay`), the general to-do list has
|
|
113
|
+
no hours and an archived client is refused.
|
|
114
|
+
|
|
115
|
+
| Option | Meaning |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| `--client` | The client the time is for. Or… |
|
|
118
|
+
| `--event` | …a day off: `vacation`, `public-holiday`, `out-of-office`, `conference`, `sick` or `other`. |
|
|
119
|
+
| `--hours` | `full`, `half` or a number of hours. **Sets** the day's total for that client; `0` removes it. |
|
|
120
|
+
| `--date` | The day, `YYYY-MM-DD`. Defaults to today. |
|
|
121
|
+
| `--note` | What the time went to. Left out, the note already there is kept. |
|
|
122
|
+
|
|
123
|
+
Without `--hours` it is read-only and prints what's logged that day, and the total against your
|
|
124
|
+
working day.
|
|
31
125
|
|
|
32
126
|
## Requirements
|
|
33
127
|
|
|
34
128
|
- Node 20 or newer, and git.
|
|
35
129
|
- A clone of your timesheet repo with no uncommitted changes and no unpushed commits — when its push
|
|
36
130
|
loses a race with the app, the CLI resets the clone to the remote and replays its edit on top.
|
|
37
|
-
-
|
|
131
|
+
- `log` records *that* you worked on a task, not for how long; hours are `hours`, per client per day.
|