From 92d854c1cbc02798eed48f63c5eb286ec7fe46e0 Mon Sep 17 00:00:00 2001 From: Dawid Zbinski Date: Sun, 15 Mar 2026 23:01:55 +0100 Subject: [PATCH 1/2] refactor: move log, edit, remove under log group command Convert top-level `log`, `edit`, and `remove` commands into subcommands `log add`, `log edit`, and `log remove` under a new `log` group command. This groups all time entry operations under a single namespace, improving CLI discoverability and consistency with the existing project/defaults group pattern. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 44 +- internal/cli/log.go | 448 +----------------- internal/cli/log_add.go | 443 +++++++++++++++++ internal/cli/{log_test.go => log_add_test.go} | 245 +++++----- internal/cli/{edit.go => log_edit.go} | 6 +- .../cli/{edit_test.go => log_edit_test.go} | 201 ++++---- internal/cli/{remove.go => log_remove.go} | 6 +- .../{remove_test.go => log_remove_test.go} | 57 +-- internal/cli/root.go | 2 - web/docs/commands/time-tracking.md | 36 +- 10 files changed, 754 insertions(+), 734 deletions(-) create mode 100644 internal/cli/log_add.go rename internal/cli/{log_test.go => log_add_test.go} (66%) rename internal/cli/{edit.go => log_edit.go} (99%) rename internal/cli/{edit_test.go => log_edit_test.go} (66%) rename internal/cli/{remove.go => log_remove.go} (93%) rename internal/cli/{remove_test.go => log_remove_test.go} (63%) diff --git a/README.md b/README.md index 53e53f1..58ed375 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,8 @@ hourgit version 3. **Log non-git work** manually: ```bash - hourgit log --duration 1h30m "standup" - hourgit log --from 9am --to 10:30am "standup" + hourgit log add --duration 1h30m "standup" + hourgit log add --from 9am --to 10:30am "standup" ``` 4. **View the interactive report:** @@ -111,7 +111,7 @@ hourgit version Core commands for recording, viewing, and managing your time entries. -Commands: `init` · `log` · `edit` · `remove` · `sync` · `report` · `history` · `status` +Commands: `init` · `log add` · `log edit` · `log remove` · `sync` · `report` · `history` · `status` #### `hourgit init` @@ -129,12 +129,12 @@ hourgit init [--project ] [--mode ] [--force] [--append] [--yes] | `-a`, `--append` | `false` | Append to existing post-checkout hook | | `-y`, `--yes` | `false` | Skip confirmation prompt | -#### `hourgit log` +#### `hourgit log add` Manually log time for a project. Uses a hybrid mode: provide any combination of flags and you'll be prompted only for the missing pieces. ```bash -hourgit log [MESSAGE] [--duration ] [--from