feat(create): non-interactive goal creation via CLI flags - #342
Merged
Conversation
Add flag-based `buzz create` (--slug/--units/--title/--type/--goaldate/ --goalval/--rate/--deadline) alongside the interactive flow. Title now defaults to the slug when omitted, and --deadline sets the goal deadline after creation. Closes #331, #332, #335. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- --type now resolves menu numbers/labels to canonical goal_type (bug scan) - handleCreateCommand uses shared loadClient() helper (structural) - cover deadline partial-failure, no-deadline skip, --type resolution, and bad-flag parse paths (test coverage) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
CodeRabbit feedback: `buzz create ... typo` silently ignored the stray arg; now errors on fs.NArg() != 0. Also cover --deadline=0 (explicit midnight) so setDeadline intent isn't inferred from a nonzero value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a flag-based form of
buzz createalongside the existing interactive prompts, closing three related issues.What
buzz create --slug=reading --units=pages --goalval=365 --rate=1— no prompts. Flags:--slug --units --title --type --goaldate --goalval --rate --deadline. Runningbuzz createwith no flags keeps the interactive flow unchanged.--deadline=<seconds-from-midnight>sets the goal's deadline after creation (reuses the existingUpdateGoalDeadlinepath).--deadline=0(midnight) is honored — explicit-set is detected viaflag.Visit, not the value.--typeaccepts a menu number, canonical name, or human label (e.g.--type=1,--type="Do Less",--type=drinker) — the same resolution the interactive prompt does.--helpand bad flags report without requiring auth, matchingbuzz add.Config loading now goes through the shared
loadClient()helper, consistent with the other credentialed commands.Test
go build,go test ./...,go vet ./...all green. New tests cover flag parsing,--typeresolution, title-defaults-to-slug, the deadline partial-failure path, the no-deadline skip, and--help/ bad-flag branches.Closes #331
Closes #332
Closes #335
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
buzz create.Bug Fixes