feat: add --estimate flag to bd create/update commands (GH #443)

The estimated_minutes field existed in the Issue schema but wasn't exposed
via CLI. This adds:

- --estimate / -e flag to bd create (e.g., bd create "Task" --estimate 120)
- --estimate / -e flag to bd update (e.g., bd update bd-xyz --estimate 60)
- EstimatedMinutes field to RPC CreateArgs and UpdateArgs
- Server-side handling in handleCreate and updatesFromArgs
- Validation for non-negative values

The value is specified in minutes and is useful for planning and
prioritization. The vscode-beads extension already has an Estimate column
that can now be populated.

Fixes #443

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-03 15:55:35 -08:00
parent 49b3353688
commit a1fba65c67
4 changed files with 32 additions and 1 deletions

View File

@@ -68,6 +68,7 @@ type CreateArgs struct {
AcceptanceCriteria string `json:"acceptance_criteria,omitempty"`
Assignee string `json:"assignee,omitempty"`
ExternalRef string `json:"external_ref,omitempty"` // Link to external issue trackers
EstimatedMinutes *int `json:"estimated_minutes,omitempty"` // Time estimate in minutes
Labels []string `json:"labels,omitempty"`
Dependencies []string `json:"dependencies,omitempty"`
}
@@ -84,6 +85,7 @@ type UpdateArgs struct {
Notes *string `json:"notes,omitempty"`
Assignee *string `json:"assignee,omitempty"`
ExternalRef *string `json:"external_ref,omitempty"` // Link to external issue trackers
EstimatedMinutes *int `json:"estimated_minutes,omitempty"` // Time estimate in minutes
AddLabels []string `json:"add_labels,omitempty"`
RemoveLabels []string `json:"remove_labels,omitempty"`
SetLabels []string `json:"set_labels,omitempty"`

View File

@@ -70,6 +70,9 @@ func updatesFromArgs(a UpdateArgs) map[string]interface{} {
if a.ExternalRef != nil {
u["external_ref"] = *a.ExternalRef
}
if a.EstimatedMinutes != nil {
u["estimated_minutes"] = *a.EstimatedMinutes
}
return u
}
@@ -142,6 +145,7 @@ func (s *Server) handleCreate(req *Request) Response {
AcceptanceCriteria: strValue(acceptance),
Assignee: strValue(assignee),
ExternalRef: externalRef,
EstimatedMinutes: createArgs.EstimatedMinutes,
Status: types.StatusOpen,
}