@togglhq/cli 1.5.19

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.
@@ -0,0 +1,33 @@
1
+ # Statuses and Users
2
+
3
+ Statuses and users are reference data. Use them to resolve IDs before task updates, assignment-related payloads, filtering, or reporting.
4
+
5
+ ## Statuses
6
+
7
+ List statuses:
8
+
9
+ ```bash
10
+ toggl --json statuses list
11
+ ```
12
+
13
+ Use this before moving a task when the user gives a status name instead of a status ID:
14
+
15
+ ```bash
16
+ toggl --json tasks update --task-id <task-id> --payload-status-id <status-id>
17
+ ```
18
+
19
+ ## Users
20
+
21
+ List users:
22
+
23
+ ```bash
24
+ toggl --json users list
25
+ ```
26
+
27
+ Use this before working with assignee/member IDs when a user gives a person name or email.
28
+
29
+ ## Agent Workflow
30
+
31
+ Do not guess IDs from names. List the reference data, pick the exact match, and ask when there are multiple plausible matches.
32
+
33
+ If a status or user appears missing, verify the active workspace and profile before concluding it does not exist.
@@ -0,0 +1,57 @@
1
+ # Tasks
2
+
3
+ Use task commands for Focus task lookup, creation, updates, and deletion.
4
+
5
+ ## Commands
6
+
7
+ List tasks:
8
+
9
+ ```bash
10
+ toggl --json tasks list --project-id <project-id>
11
+ toggl --json tasks list --project-id <project-id> --status-id <status-id>
12
+ ```
13
+
14
+ Get one task:
15
+
16
+ ```bash
17
+ toggl --json tasks get --task-id <task-id>
18
+ ```
19
+
20
+ Create a task:
21
+
22
+ ```bash
23
+ toggl --json tasks create --data '{"name":"Follow up with design","project_id":436195}'
24
+ ```
25
+
26
+ Update a task with scalar payload flags:
27
+
28
+ ```bash
29
+ toggl --json tasks update --task-id <task-id> --payload-name "Updated name"
30
+ toggl --json tasks update --task-id <task-id> --payload-status-id <status-id>
31
+ ```
32
+
33
+ Update a task with a JSON payload:
34
+
35
+ ```bash
36
+ toggl --json tasks update --data '{"task_id":12345,"payload":{"name":"Updated name","status_id":270002}}'
37
+ ```
38
+
39
+ Delete a task only after explicit user confirmation:
40
+
41
+ ```bash
42
+ toggl --json tasks delete --task-id <task-id> --yes
43
+ ```
44
+
45
+ ## Agent Workflow
46
+
47
+ When the user names a task but does not provide an ID, list tasks in the relevant project first. If multiple matches are plausible, ask before mutating.
48
+
49
+ When changing a task status, use `toggl --json statuses list` if the status ID is unknown.
50
+
51
+ Use `--dry-run` before non-trivial updates:
52
+
53
+ ```bash
54
+ toggl tasks update --task-id <task-id> --payload-status-id <status-id> --dry-run
55
+ ```
56
+
57
+ Prefer scalar flags for single-field updates. Prefer `--data -` or `--data-file` for multi-field payloads or names with tricky shell quoting.
@@ -0,0 +1,43 @@
1
+ # Time Blocks
2
+
3
+ Use time block commands to inspect, create, update, and delete scheduled Focus blocks.
4
+
5
+ ## Commands
6
+
7
+ List time blocks for a date range:
8
+
9
+ ```bash
10
+ toggl --json time-blocks list --date-from 2026-04-01 --date-to 2026-04-07
11
+ ```
12
+
13
+ Get one time block:
14
+
15
+ ```bash
16
+ toggl --json time-blocks get --task-id <task-id> --time-block-id <time-block-id>
17
+ ```
18
+
19
+ Create a time block:
20
+
21
+ ```bash
22
+ toggl --json time-blocks create --data '{"task_id":12345,"payload":{"start":"2026-04-06T09:00:00Z","end":"2026-04-06T11:00:00Z"}}'
23
+ ```
24
+
25
+ Update a time block:
26
+
27
+ ```bash
28
+ toggl --json time-blocks update --data '{"task_id":12345,"time_block_id":67890,"payload":{"start":"2026-04-06T10:00:00Z","end":"2026-04-06T12:00:00Z"}}'
29
+ ```
30
+
31
+ Delete a time block only after explicit user confirmation:
32
+
33
+ ```bash
34
+ toggl --json time-blocks delete --task-id <task-id> --time-block-id <time-block-id> --yes
35
+ ```
36
+
37
+ ## Agent Workflow
38
+
39
+ Use RFC 3339 timestamps for exact scheduled blocks. If the user gives local times, preserve the intended time zone offset when possible.
40
+
41
+ Time block commands usually need both `task_id` and `time_block_id`. Resolve both IDs with a list or get command before mutating.
42
+
43
+ Use `--dry-run` before creating or updating blocks when times were inferred from natural language.
@@ -0,0 +1,42 @@
1
+ # Time Entries
2
+
3
+ Use time entry commands to inspect tracked time and control the running timer.
4
+
5
+ ## Commands
6
+
7
+ List time entries for a date range:
8
+
9
+ ```bash
10
+ toggl --json time-entries list --date-from 2026-04-01 --date-to 2026-04-07
11
+ ```
12
+
13
+ Start tracking a task. When `--type` is omitted, the CLI defaults to `activity`:
14
+
15
+ ```bash
16
+ toggl --json time-entries start --task-id <task-id>
17
+ ```
18
+
19
+ Start a break:
20
+
21
+ ```bash
22
+ toggl --json time-entries start --type break
23
+ ```
24
+
25
+ Stop the running timer:
26
+
27
+ ```bash
28
+ toggl --json time-entries stop
29
+ ```
30
+
31
+ ## Update vs partial-update
32
+
33
+ - **`time-entries partial-update`** — PATCH-style: change optional fields (for example description, billable, or type) without sending a full timing payload.
34
+ - **`time-entries update`** — full timing replace: the API requires **`start`**, **`duration`**, and **`type`** together (`activity` or `break`). Use **`update`** when moving or resizing an entry (new start and duration); do not use **`partial-update`** for that.
35
+
36
+ ## Agent Workflow
37
+
38
+ When the user asks to start tracking work for a named task, resolve the task ID first with `tasks list` or `tasks get`.
39
+
40
+ Use `YYYY-MM-DD` ranges for full days. Use RFC 3339 datetimes when the user gives exact times or time zones.
41
+
42
+ Before starting a timer on an ambiguous task, ask for confirmation. Stopping the timer does not require a task ID.
@@ -0,0 +1,100 @@
1
+ # Troubleshooting
2
+
3
+ ## Not Authenticated
4
+
5
+ Error:
6
+
7
+ ```text
8
+ Not authenticated. Run `toggl auth` to sign in.
9
+ ```
10
+
11
+ Fix:
12
+
13
+ ```bash
14
+ toggl auth
15
+ ```
16
+
17
+ Use `toggl profile list` and `toggl profile switch [<profile>]` (omit name in a TTY for an interactive picker) if the user intended a different auth context.
18
+
19
+ ## Workspace Problems
20
+
21
+ If data appears missing or a command targets the wrong workspace:
22
+
23
+ ```bash
24
+ toggl --json profile current
25
+ toggl --json profile list
26
+ toggl --json workspace list
27
+ toggl --json workspace list --refresh
28
+ toggl --json workspace switch <workspace-id>
29
+ ```
30
+
31
+ For one-off calls, prefer:
32
+
33
+ ```bash
34
+ toggl --workspace-id <workspace-id> --json tasks list --project-id <project-id>
35
+ ```
36
+
37
+ ## Invalid JSON
38
+
39
+ Error:
40
+
41
+ ```text
42
+ Invalid JSON from --data
43
+ ```
44
+
45
+ Fix shell quoting by using stdin or a file:
46
+
47
+ ```bash
48
+ printf '%s\n' '{"task_id":12345,"payload":{"name":"Renamed task"}}' | toggl --json tasks update --data -
49
+ toggl --json tasks update --data-file ./payload.json
50
+ ```
51
+
52
+ ## Missing Fields
53
+
54
+ Error:
55
+
56
+ ```text
57
+ Invalid input: task_id: required
58
+ ```
59
+
60
+ Add the named scalar flag or include the field in `--data`:
61
+
62
+ ```bash
63
+ toggl --json tasks get --task-id 12345
64
+ toggl --json tasks get --data '{"task_id":12345}'
65
+ ```
66
+
67
+ ## Date Validation
68
+
69
+ Use `YYYY-MM-DD` for full days or RFC 3339 for exact datetimes:
70
+
71
+ ```bash
72
+ toggl --json time-entries list --date-from 2026-04-01 --date-to 2026-04-07
73
+ toggl --json time-blocks list --date-from 2026-04-01T08:00:00+03:00 --date-to 2026-04-01T17:00:00+03:00
74
+ ```
75
+
76
+ ## Destructive Operation Blocked
77
+
78
+ Delete commands fail without `--yes`. Only retry with `--yes` when the user explicitly requested the delete and the ID is confirmed:
79
+
80
+ ```bash
81
+ toggl --json tasks delete --task-id <task-id> --yes
82
+ ```
83
+
84
+ ## Schema Warnings
85
+
86
+ For API response schema warnings, rerun with debug enabled:
87
+
88
+ ```bash
89
+ TOGGL_DEBUG=1 toggl --json tasks list --project-id 436195
90
+ ```
91
+
92
+ ## Unknown Command Shape
93
+
94
+ Inspect help before guessing:
95
+
96
+ ```bash
97
+ toggl --help
98
+ toggl tasks --help
99
+ toggl tasks update --help
100
+ ```
@@ -0,0 +1,104 @@
1
+ # Common Workflows
2
+
3
+ ## Find IDs Before Acting
4
+
5
+ Resolve project IDs:
6
+
7
+ ```bash
8
+ toggl --json projects list
9
+ ```
10
+
11
+ Resolve task IDs:
12
+
13
+ ```bash
14
+ toggl --json tasks list --project-id <project-id>
15
+ ```
16
+
17
+ Resolve status IDs:
18
+
19
+ ```bash
20
+ toggl --json statuses list
21
+ ```
22
+
23
+ Resolve user IDs:
24
+
25
+ ```bash
26
+ toggl --json users list
27
+ ```
28
+
29
+ If multiple resources match a user-provided name, ask before mutating.
30
+
31
+ ## Create a Task in a Project
32
+
33
+ 1. Resolve the project ID.
34
+ 2. Create the task.
35
+ 3. Return the created task JSON or summarize the created ID.
36
+
37
+ ```bash
38
+ toggl --json projects list
39
+ toggl --json tasks create --data '{"name":"Write release notes","project_id":436195}'
40
+ ```
41
+
42
+ ## Move a Task to a Status
43
+
44
+ 1. Resolve the task ID.
45
+ 2. Resolve the status ID.
46
+ 3. Dry-run if either ID was inferred.
47
+ 4. Update the task.
48
+
49
+ ```bash
50
+ toggl --json tasks list --project-id <project-id>
51
+ toggl --json statuses list
52
+ toggl tasks update --task-id <task-id> --payload-status-id <status-id> --dry-run
53
+ toggl --json tasks update --task-id <task-id> --payload-status-id <status-id>
54
+ ```
55
+
56
+ ## Start Tracking Work
57
+
58
+ 1. Resolve the task ID when the user names a task.
59
+ 2. Start the activity timer.
60
+
61
+ ```bash
62
+ toggl --json tasks list --project-id <project-id>
63
+ toggl --json time-entries start --task-id <task-id>
64
+ ```
65
+
66
+ Start a break:
67
+
68
+ ```bash
69
+ toggl --json time-entries start --type break
70
+ ```
71
+
72
+ Stop the running timer:
73
+
74
+ ```bash
75
+ toggl --json time-entries stop
76
+ ```
77
+
78
+ ## Plan a Time Block
79
+
80
+ 1. Resolve the task ID.
81
+ 2. Convert user-provided times to RFC 3339 datetimes.
82
+ 3. Dry-run when the time range was inferred.
83
+ 4. Create the block.
84
+
85
+ ```bash
86
+ toggl time-blocks create --data '{"task_id":12345,"payload":{"start":"2026-04-06T09:00:00+03:00","end":"2026-04-06T11:00:00+03:00"}}' --dry-run
87
+ toggl --json time-blocks create --data '{"task_id":12345,"payload":{"start":"2026-04-06T09:00:00+03:00","end":"2026-04-06T11:00:00+03:00"}}'
88
+ ```
89
+
90
+ ## Switch Workspace
91
+
92
+ List workspaces, refresh if needed, then switch:
93
+
94
+ ```bash
95
+ toggl --json workspace list
96
+ toggl --json workspace list --refresh
97
+ toggl --json workspace switch <workspace-id>
98
+ ```
99
+
100
+ For one command only:
101
+
102
+ ```bash
103
+ toggl --workspace-id <workspace-id> --json tasks list --project-id <project-id>
104
+ ```