crowdtime-cli 0.1.0__py3-none-any.whl

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,659 @@
1
+ # CrowdTime CLI — Complete Command Reference
2
+
3
+ Every command, subcommand, argument, flag, and option in the CrowdTime CLI.
4
+
5
+ ## Table of Contents
6
+
7
+ - [Global Behavior](#global-behavior)
8
+ - [ct (bare / status)](#ct-bare--status)
9
+ - [ct auth](#ct-auth)
10
+ - [ct timer](#ct-timer)
11
+ - [ct log](#ct-log)
12
+ - [ct clients](#ct-clients)
13
+ - [ct projects](#ct-projects)
14
+ - [ct tasks](#ct-tasks)
15
+ - [ct report](#ct-report)
16
+ - [ct ai](#ct-ai)
17
+ - [ct favorites](#ct-favorites)
18
+ - [ct org](#ct-org)
19
+ - [ct config](#ct-config)
20
+ - [Short Aliases](#short-aliases)
21
+
22
+ ---
23
+
24
+ ## Global Behavior
25
+
26
+ - Entry points: `crowdtime` and `ct` (identical)
27
+ - Config file: `~/.crowdtime/config.toml`
28
+ - Token storage: OS keychain (via `keyring`), fallback to `~/.crowdtime/credentials`
29
+ - All org-scoped commands require: authenticated user + active organization
30
+ - `--json` flag on most commands outputs machine-readable JSON
31
+
32
+ ### Magic Routing
33
+
34
+ Any unrecognized first argument routes to AI parsing:
35
+ ```bash
36
+ ct "2h on project alpha code review" # → ct ai parse "..."
37
+ ```
38
+
39
+ ---
40
+
41
+ ## ct (bare / status)
42
+
43
+ Shows full status dashboard.
44
+
45
+ ```
46
+ ct
47
+ ct status [--json]
48
+ ct s [--json] # alias
49
+ ```
50
+
51
+ **Output includes:**
52
+ - Authenticated user and current organization
53
+ - Running timer (if any) with elapsed HH:MM:SS
54
+ - Today's entries with progress bar toward daily target
55
+ - This week's breakdown with daily hour bars
56
+
57
+ **Endpoints called:**
58
+ - `GET /api/v1/auth/me/`
59
+ - `GET /time/running/`
60
+ - `GET /time/daily/{today}/`
61
+ - `GET /time/weekly/{monday}/`
62
+
63
+ ---
64
+
65
+ ## ct auth
66
+
67
+ ### ct auth login
68
+
69
+ ```
70
+ ct auth login [--token/-t TOKEN] [--no-browser] [--json]
71
+ ```
72
+
73
+ | Option | Type | Description |
74
+ |--------|------|-------------|
75
+ | `--token`, `-t` | string | API token (skips browser login) |
76
+ | `--no-browser` | flag | Prompt for token instead of opening browser |
77
+ | `--json` | flag | JSON output |
78
+
79
+ - Default (no flags): opens browser for Google OAuth login
80
+ - `--token`: provide an API token directly
81
+ - `--no-browser`: prompts for token interactively (useful for headless environments)
82
+ - Stores token in OS keychain with file fallback
83
+ - Validates by calling `GET /api/v1/auth/me/`
84
+
85
+ ### ct auth logout
86
+
87
+ ```
88
+ ct auth logout
89
+ ```
90
+
91
+ Removes stored credentials from keychain and file.
92
+
93
+ ### ct auth whoami
94
+
95
+ ```
96
+ ct auth whoami [--json]
97
+ ```
98
+
99
+ Shows: name, email, timezone, current organization.
100
+
101
+ ---
102
+
103
+ ## ct timer
104
+
105
+ ### ct timer start
106
+
107
+ ```
108
+ ct timer start [DESCRIPTION] [options]
109
+ ```
110
+
111
+ | Argument/Option | Type | Description |
112
+ |-----------------|------|-------------|
113
+ | `DESCRIPTION` | string (optional) | What you're working on |
114
+ | `--project`, `-p` | string | Project slug or UUID |
115
+ | `--task`, `-t` | string | Task name or UUID (auto-creates and assigns if needed) |
116
+ | `--billable`, `-b` | flag | Mark as billable |
117
+ | `--no-billable`, `-B` | flag | Mark as non-billable |
118
+ | `--json` | flag | JSON output |
119
+
120
+ - Fails if a timer is already running (use `switch` instead)
121
+ - Uses default project from config if `--project` not specified
122
+ - Endpoint: `POST /time/start/`
123
+
124
+ ### ct timer stop
125
+
126
+ ```
127
+ ct timer stop [--note/-n NOTE] [--json]
128
+ ```
129
+
130
+ | Option | Type | Description |
131
+ |--------|------|-------------|
132
+ | `--note`, `-n` | string | Add a note to the completed entry |
133
+ | `--json` | flag | JSON output |
134
+
135
+ - Returns 404 if no timer running
136
+ - Endpoint: `POST /time/stop/`
137
+
138
+ ### ct timer status
139
+
140
+ ```
141
+ ct timer status [--json]
142
+ ```
143
+
144
+ Shows running timer with elapsed HH:MM:SS, description, project, task, billable status.
145
+ Endpoint: `GET /time/running/`
146
+
147
+ ### ct timer switch
148
+
149
+ ```
150
+ ct timer switch [DESCRIPTION] [options]
151
+ ```
152
+
153
+ Same arguments and options as `timer start`. Atomically stops the current timer and starts a new one.
154
+
155
+ ### ct timer discard
156
+
157
+ ```
158
+ ct timer discard [--force/-f]
159
+ ```
160
+
161
+ | Option | Type | Description |
162
+ |--------|------|-------------|
163
+ | `--force`, `-f` | flag | Skip confirmation prompt |
164
+
165
+ Discards the running timer without saving any time entry.
166
+
167
+ ---
168
+
169
+ ## ct log
170
+
171
+ **Bare `ct log` (no arguments)** lists today's entries (same as `ct log list`).
172
+
173
+ `ct log` with options/args auto-routes to `ct log create` — all three forms below are equivalent:
174
+ - `ct log -p proj 2h "work"`
175
+ - `ct log create -p proj 2h "work"`
176
+ - `ct l -p proj 2h "work"`
177
+
178
+ ### ct log create
179
+
180
+ ```
181
+ ct log [create] [OPTIONS] DURATION [DESCRIPTION]
182
+ ```
183
+
184
+ **IMPORTANT: Options MUST come BEFORE positional arguments (duration, description).** This is a Typer/Click constraint.
185
+
186
+ | Argument/Option | Type | Description |
187
+ |-----------------|------|-------------|
188
+ | `DURATION` | string (required) | Time spent: `2h`, `2h30m`, `2:30`, `150m`, `0.25d`, or number |
189
+ | `DESCRIPTION` | string (optional) | What you worked on |
190
+ | `--project`, `-p` | string | Project slug or UUID |
191
+ | `--task`, `-t` | string | Task name or UUID (auto-creates and assigns if needed) |
192
+ | `--date`, `-d` | string | Date (default: today) |
193
+ | `--billable`, `-b` | flag | Billable |
194
+ | `--no-billable`, `-B` | flag | Non-billable |
195
+ | `--json` | flag | JSON output |
196
+
197
+ **Usage examples:**
198
+ ```bash
199
+ ct log -p crowdtime-dev 2h "code review"
200
+ ct log -p crowdtime-dev -t "Research" -d yesterday 2h30m "meeting"
201
+
202
+ # Short alias (ct l):
203
+ ct l -p crowdtime-dev 2h "code review"
204
+ ct l -p crowdtime-dev -t "Design" 1:30 "wireframes"
205
+ ```
206
+
207
+ **Duration formats:**
208
+ | Format | Example | Result |
209
+ |--------|---------|--------|
210
+ | Hours | `2h` | 2.0 hours |
211
+ | Hours + minutes | `2h30m` | 2.5 hours |
212
+ | HH:MM | `2:30` | 2.5 hours |
213
+ | Minutes | `150m` | 2.5 hours |
214
+ | Days | `0.25d` | 2.0 hours (1d = 8h) |
215
+ | Decimal | `2.5` | 2.5 hours |
216
+
217
+ **Date formats:**
218
+ | Format | Example |
219
+ |--------|---------|
220
+ | Keywords | `today`, `yesterday` |
221
+ | Day names | `monday`, `tue`, `fri` |
222
+ | Last + day | `last friday` |
223
+ | ISO | `2026-03-10` |
224
+ | US short | `3/10`, `03/10/2026` |
225
+
226
+ Endpoint: `POST /time/`
227
+
228
+ ### ct log edit
229
+
230
+ ```
231
+ ct log edit ENTRY_ID [options]
232
+ ```
233
+
234
+ | Option | Type | Description |
235
+ |--------|------|-------------|
236
+ | `--duration` | string | New duration |
237
+ | `--description` | string | New description |
238
+ | `--project`, `-p` | string | New project |
239
+ | `--task`, `-t` | string | New task (name or UUID) |
240
+ | `--date`, `-d` | string | New date |
241
+ | `--billable`, `-b` | flag | Set billable |
242
+ | `--no-billable`, `-B` | flag | Set non-billable |
243
+ | `--json` | flag | JSON output |
244
+
245
+ Only provided fields are updated. Endpoint: `PATCH /time/{id}/`
246
+
247
+ ### ct log delete
248
+
249
+ ```
250
+ ct log delete ENTRY_ID [--force/-f]
251
+ ```
252
+
253
+ Requires confirmation unless `--force`. Endpoint: `DELETE /time/{id}/`
254
+
255
+ ### ct log list
256
+
257
+ ```
258
+ ct log list [options]
259
+ ```
260
+
261
+ | Option | Type | Description |
262
+ |--------|------|-------------|
263
+ | `--date`, `-d` | string | Specific date |
264
+ | `--week`, `-w` | flag | This week |
265
+ | `--month`, `-m` | flag | This month |
266
+ | `--from` | string | Start date for range |
267
+ | `--to` | string | End date for range |
268
+ | `--project`, `-p` | string | Filter by project |
269
+ | `--format` | string | Output: `table`, `json`, `csv` |
270
+ | `--json` | flag | JSON output |
271
+
272
+ Endpoint: `GET /time/`
273
+
274
+ ---
275
+
276
+ ## ct clients
277
+
278
+ ### ct clients list
279
+
280
+ ```
281
+ ct clients list [--archived/-a] [--json]
282
+ ```
283
+
284
+ | Option | Type | Description |
285
+ |--------|------|-------------|
286
+ | `--archived`, `-a` | flag | Include archived clients |
287
+ | `--json` | flag | JSON output |
288
+
289
+ Shows: ID, Name, Contact, Projects count, Status.
290
+ Endpoint: `GET /clients/`
291
+
292
+ ### ct clients show
293
+
294
+ ```
295
+ ct clients show CLIENT_ID [--json]
296
+ ```
297
+
298
+ Shows: ID, name, currency, contact info, status.
299
+ Endpoint: `GET /clients/{id}/`
300
+
301
+ ### ct clients create
302
+
303
+ ```
304
+ ct clients create NAME [options]
305
+ ```
306
+
307
+ | Option | Type | Description |
308
+ |--------|------|-------------|
309
+ | `--currency` | string | Currency code (e.g. USD) |
310
+ | `--contact` | string | Contact person name |
311
+ | `--email` | string | Contact email |
312
+ | `--json` | flag | JSON output |
313
+
314
+ Endpoint: `POST /clients/`
315
+
316
+ ### ct clients archive
317
+
318
+ ```
319
+ ct clients archive CLIENT_ID [--force/-f]
320
+ ```
321
+
322
+ Soft-archives the client. Requires confirmation unless `--force`.
323
+ Endpoint: `DELETE /clients/{id}/`
324
+
325
+ ---
326
+
327
+ ## ct projects
328
+
329
+ ### ct projects list
330
+
331
+ ```
332
+ ct projects list [--archived/-a] [--json]
333
+ ```
334
+
335
+ | Option | Type | Description |
336
+ |--------|------|-------------|
337
+ | `--archived`, `-a` | flag | Include archived projects |
338
+ | `--json` | flag | JSON output |
339
+
340
+ Shows: ID, Name, Code, Client, Status, Billable. Marks default project.
341
+ Endpoint: `GET /projects/`
342
+
343
+ ### ct projects show
344
+
345
+ ```
346
+ ct projects show PROJECT_ID [--json]
347
+ ```
348
+
349
+ Shows: ID, code, client, status, billable, budget, description.
350
+ Endpoint: `GET /projects/{id}/`
351
+
352
+ ### ct projects create
353
+
354
+ ```
355
+ ct projects create NAME [options]
356
+ ```
357
+
358
+ | Option | Type | Description |
359
+ |--------|------|-------------|
360
+ | `--client`, `-c` | string | Client name (auto-creates if not found) |
361
+ | `--billable`, `-b` | flag | Billable (default: true) |
362
+ | `--no-billable`, `-B` | flag | Non-billable |
363
+ | `--color` | string | Hex color code |
364
+ | `--budget` | float | Budget in hours |
365
+ | `--code` | string | Short project code |
366
+ | `--json` | flag | JSON output |
367
+
368
+ Endpoint: `POST /projects/`
369
+
370
+ ### ct projects archive
371
+
372
+ ```
373
+ ct projects archive PROJECT_ID [--force/-f]
374
+ ```
375
+
376
+ Requires confirmation unless `--force`. Endpoint: `PATCH /projects/{id}/`
377
+
378
+ ### ct projects switch
379
+
380
+ ```
381
+ ct projects switch SLUG
382
+ ```
383
+
384
+ Sets project as default for new entries. Saves to config `defaults.project`.
385
+
386
+ ---
387
+
388
+ ## ct tasks
389
+
390
+ ### ct tasks list
391
+
392
+ ```
393
+ ct tasks list [--project/-p PROJECT] [--json]
394
+ ```
395
+
396
+ Shows: ID, Name, Project, Billable. Endpoint: `GET /tasks/`
397
+
398
+ ### ct tasks create
399
+
400
+ ```
401
+ ct tasks create NAME [--project/-p PROJECT] [--billable/-b] [--no-billable/-B] [--json]
402
+ ```
403
+
404
+ Creates an organization-level task. If `--project` is specified, also assigns the task to that project (via ProjectTask).
405
+ Endpoint: `POST /tasks/` + `POST /projects/{id}/tasks/`
406
+
407
+ ---
408
+
409
+ ## ct report
410
+
411
+ ### ct report (main)
412
+
413
+ ```
414
+ ct report [period options] [filter options] [output options]
415
+ ```
416
+
417
+ **Period options** (default: this week):
418
+
419
+ | Option | Description |
420
+ |--------|-------------|
421
+ | `--today` | Today only |
422
+ | `--yesterday` | Yesterday |
423
+ | `--week`, `-w` | This week |
424
+ | `--last-week` | Last week |
425
+ | `--month`, `-m` | This month |
426
+ | `--from` | Start date (with optional `--to`) |
427
+ | `--to` | End date |
428
+
429
+ **Filter options:**
430
+
431
+ | Option | Type | Description |
432
+ |--------|------|-------------|
433
+ | `--project`, `-p` | string | Filter by project |
434
+
435
+ **Output options:**
436
+
437
+ | Option | Type | Description |
438
+ |--------|------|-------------|
439
+ | `--group-by`, `-g` | string | `project` (default), `task`, `day`, `client` |
440
+ | `--format`, `-f` | string | `table` (default), `json`, `csv`, `markdown` |
441
+
442
+ Endpoint: `GET /reports/time-detail/` or `GET /reports/project-summary/`
443
+
444
+ ### ct report projects
445
+
446
+ ```
447
+ ct report projects [--week/-w] [--month/-m] [--json]
448
+ ```
449
+
450
+ Project breakdown with hours, billable, budget info. Default: this month.
451
+
452
+ ### ct report team
453
+
454
+ ```
455
+ ct report team [--week/-w] [--month/-m] [--member MEMBER] [--json]
456
+ ```
457
+
458
+ Team utilization: Member, Hours, Billable, Utilization %. Endpoint: `GET /reports/team-utilization/`
459
+
460
+ ---
461
+
462
+ ## ct ai
463
+
464
+ ### ct ai parse
465
+
466
+ ```
467
+ ct ai parse TEXT [--dry-run] [--yes/-y] [--json]
468
+ ```
469
+
470
+ | Option | Type | Description |
471
+ |--------|------|-------------|
472
+ | `TEXT` | string (required) | Natural language time entry |
473
+ | `--dry-run` | flag | Preview without creating |
474
+ | `--yes`, `-y` | flag | Skip confirmation |
475
+ | `--json` | flag | JSON output |
476
+
477
+ Shows parsed: description, project, task, duration, date, billable, confidence, ambiguities.
478
+ Endpoints: `POST /ai/parse/` then `POST /ai/parse/confirm/`
479
+
480
+ ### ct ai suggest
481
+
482
+ ```
483
+ ct ai suggest [--date/-d DATE] [--json]
484
+ ```
485
+
486
+ AI-powered suggestions based on work patterns. Interactive: select a suggestion to start a timer.
487
+ Endpoint: `GET /ai/suggestions/`
488
+
489
+ ### ct ai summarize
490
+
491
+ ```
492
+ ct ai summarize [period] [--for FORMAT] [--copy/-c] [--json]
493
+ ```
494
+
495
+ | Option | Type | Description |
496
+ |--------|------|-------------|
497
+ | `--today` | flag | Today |
498
+ | `--week`, `-w` | flag | This week (default) |
499
+ | `--month`, `-m` | flag | This month |
500
+ | `--for` | string | `report` (default), `standup`, `slack` |
501
+ | `--copy`, `-c` | flag | Copy to clipboard |
502
+ | `--json` | flag | JSON output |
503
+
504
+ Generates headline, total hours, project breakdown, insights.
505
+ Endpoint: `GET /ai/summary/weekly/`
506
+
507
+ ---
508
+
509
+ ## ct favorites
510
+
511
+ ### ct favorites list
512
+
513
+ ```
514
+ ct favorites list [--json]
515
+ ```
516
+
517
+ Shows: ID, Project, Task, Description, Use count. Endpoint: `GET /favorites/`
518
+
519
+ ### ct favorites create
520
+
521
+ ```
522
+ ct favorites create [DESCRIPTION] [--project/-p] [--task/-t] [--notes/-n] [--billable/-b] [--no-billable/-B] [--json]
523
+ ```
524
+
525
+ Creates a reusable entry template. Endpoint: `POST /favorites/`
526
+
527
+ ### ct favorites delete
528
+
529
+ ```
530
+ ct favorites delete FAVORITE_ID [--force/-f]
531
+ ```
532
+
533
+ Endpoint: `DELETE /favorites/{id}/`
534
+
535
+ ### ct favorites start
536
+
537
+ ```
538
+ ct favorites start FAVORITE_ID [--json]
539
+ ```
540
+
541
+ Starts a timer from a saved template. Endpoint: `POST /favorites/{id}/start/`
542
+
543
+ ---
544
+
545
+ ## ct org
546
+
547
+ ### ct org list
548
+
549
+ ```
550
+ ct org list [--json]
551
+ ```
552
+
553
+ Lists organizations you belong to. Marks current with `*`. Non-org-scoped.
554
+ Endpoint: `GET /api/v1/organizations/`
555
+
556
+ ### ct org switch
557
+
558
+ ```
559
+ ct org switch SLUG
560
+ ```
561
+
562
+ Switches active organization. Saves to config `defaults.organization`.
563
+
564
+ ### ct org members
565
+
566
+ ```
567
+ ct org members [--json]
568
+ ```
569
+
570
+ Shows: Name, Email, Role, Status. Endpoint: `GET /members/`
571
+
572
+ ### ct org invite
573
+
574
+ ```
575
+ ct org invite EMAIL [--role/-r ROLE] [--json]
576
+ ```
577
+
578
+ | Option | Type | Description |
579
+ |--------|------|-------------|
580
+ | `--role`, `-r` | string | `admin`, `manager`, `member` (default) |
581
+
582
+ Endpoint: `POST /members/invite/`
583
+
584
+ ---
585
+
586
+ ## ct config
587
+
588
+ ### ct config set
589
+
590
+ ```
591
+ ct config set KEY VALUE
592
+ ```
593
+
594
+ Uses dot notation. Examples:
595
+ - `ct config set server.url https://api.crowdtime.io`
596
+ - `ct config set defaults.project myproject`
597
+ - `ct config set defaults.daily_target 7h`
598
+ - `ct config set display.compact true`
599
+
600
+ Auto-converts boolean strings.
601
+
602
+ ### ct config get
603
+
604
+ ```
605
+ ct config get KEY
606
+ ```
607
+
608
+ ### ct config list
609
+
610
+ ```
611
+ ct config list [--json]
612
+ ```
613
+
614
+ Shows all config with file path.
615
+
616
+ ### ct config edit
617
+
618
+ ```
619
+ ct config edit
620
+ ```
621
+
622
+ Opens in `$EDITOR`, `$VISUAL`, or `nano`.
623
+
624
+ ### Config Structure
625
+
626
+ ```toml
627
+ [server]
628
+ url = "https://api.crowdtime.lat"
629
+
630
+ [defaults]
631
+ organization = ""
632
+ project = ""
633
+ daily_target = "8h"
634
+ weekly_target = "40h"
635
+ date_format = "%Y-%m-%d"
636
+ time_format = "24h"
637
+
638
+ [display]
639
+ theme = "auto"
640
+ color = true
641
+ compact = false
642
+ ```
643
+
644
+ ---
645
+
646
+ ## Short Aliases
647
+
648
+ | Alias | Expands To |
649
+ |-------|-----------|
650
+ | `ct` | `ct status` |
651
+ | `ct s` | `ct status` |
652
+ | `ct t` | `ct timer status` |
653
+ | `ct ts` | `ct timer start` |
654
+ | `ct tx` | `ct timer stop` |
655
+ | `ct l` | `ct log` (create) |
656
+ | `ct ll` | `ct log list` |
657
+ | `ct p` | `ct projects list` |
658
+ | `ct r` | `ct report` |
659
+ | `ct "text"` | `ct ai parse "text"` |