Add timesheet entry CRUD commands and clock shortcut#129
Conversation
Picks up Get, Create, Update, and Trash timesheet entry methods plus the Marker type renames (Title→Name, StartsOn/EndsOn→Date). Adapts lineup.go to the new field names.
New subcommands under `bcq timesheet entry`: - show: view a single timesheet entry - create: log time against a recording (--recording, --hours, --date) - update: modify hours, date, description, or person - trash: move an entry to the trash New shortcut `bcq clock <hours> --on <recording>` for quick time logging with --date defaulting to today. Dates accept natural language via dateparse (today, yesterday, monday, etc.). Hours accept decimal (1.5) or time format (1:30). All commands support URL arguments for entry/recording IDs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 56f6e72204
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive CRUD operations for timesheet entries, a convenient clock shortcut command for quick time logging, and updates the SDK to incorporate field renames for lineup markers.
Changes:
- Updated SDK dependency to incorporate timesheet entry API operations and lineup marker field renames (
Title→Name,StartsOn/EndsOn→Date) - Added full timesheet entry management:
bcq timesheet entry show|create|update|trashsubcommands - Added
bcq clock <hours> --on <recording>shortcut command that defaults date to today for streamlined time logging - Updated lineup commands to use renamed SDK fields and registered the new clock command in the command catalog
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Updated SDK dependency to version with timesheet entry operations and lineup marker field renames |
| go.sum | Updated checksums for new SDK version |
| internal/commands/timesheet.go | Added comprehensive timesheet entry CRUD commands (show, create, update, trash) and clock shortcut command with natural language date parsing |
| internal/commands/lineup.go | Updated to use renamed SDK fields for lineup markers (Name, Date instead of Title, StartsOn, EndsOn) |
| internal/commands/commands.go | Updated command catalog to include new timesheet entry actions and clock shortcut |
| internal/cli/root.go | Registered NewClockCmd in root command |
| internal/commands/commands_test.go | Added NewClockCmd to test command registration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR review feedback: - Validate entry and recording IDs with strconv.ParseInt instead of silently passing 0 to the API, returning "Invalid entry ID" or "Invalid recording ID" usage errors on non-numeric input - Extract runTimesheetCreate helper to eliminate ~80 lines of duplication between newTimesheetEntryCreateCmd and NewClockCmd
* Update SDK to main after timesheet-api merge (basecamp/basecamp-sdk#76) Picks up Get, Create, Update, and Trash timesheet entry methods plus the Marker type renames (Title→Name, StartsOn/EndsOn→Date). Adapts lineup.go to the new field names. * Add timesheet entry CRUD commands and clock shortcut New subcommands under `bcq timesheet entry`: - show: view a single timesheet entry - create: log time against a recording (--recording, --hours, --date) - update: modify hours, date, description, or person - trash: move an entry to the trash New shortcut `bcq clock <hours> --on <recording>` for quick time logging with --date defaulting to today. Dates accept natural language via dateparse (today, yesterday, monday, etc.). Hours accept decimal (1.5) or time format (1:30). All commands support URL arguments for entry/recording IDs. * Validate entry/recording IDs and extract shared create helper Address PR review feedback: - Validate entry and recording IDs with strconv.ParseInt instead of silently passing 0 to the API, returning "Invalid entry ID" or "Invalid recording ID" usage errors on non-numeric input - Extract runTimesheetCreate helper to eliminate ~80 lines of duplication between newTimesheetEntryCreateCmd and NewClockCmd
Summary
bcq timesheet entry show|create|update|trashsubcommands for full timesheet CRUDbcq clock <hours> --on <recording>shortcut for quick time logging (defaults to today)Title→Name,StartsOn/EndsOn→Date)New commands
bcq timesheet entry show <id|url>bcq timesheet entry create --recording <id|url> --hours <h> --date <d>bcq timesheet entry update <id|url> --hours/--date/--description/--personbcq timesheet entry trash <id|url>bcq clock <hours> --on <id|url>Dates accept natural language (today, yesterday, monday, etc.) via
dateparse. Hours accept decimal (1.5) or time format (1:30). All commands support Basecamp URL arguments.Test plan
makepasses (vet, lint, unit tests, integration tests)TestCatalogMatchesRegisteredCommandspasses (clock shortcut registered and cataloged)bcq timesheet entry create --recording <id> --hours 1.5 --date today --project <p>bcq clock 1.5 --on <id> --project <p>