diff --git a/AGENTS.md b/AGENTS.md index 1185df5e..afee52a7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -147,8 +147,9 @@ bd create "Issue title" -t bug|feature|task -p 0-4 -d "Description" --json # Create with explicit ID (for parallel workers) bd create "Issue title" --id worker1-100 -p 1 --json -# Create with labels +# Create with labels (--labels or --label work) bd create "Issue title" -t bug -p 1 -l bug,critical --json +bd create "Issue title" -t bug -p 1 --label bug,critical --json # Examples with special characters (all require quoting): bd create "Fix: auth doesn't validate tokens" -t bug -p 1 --json diff --git a/cmd/bd/create.go b/cmd/bd/create.go index e37a340c..8ac409ef 100644 --- a/cmd/bd/create.go +++ b/cmd/bd/create.go @@ -96,6 +96,10 @@ var createCmd = &cobra.Command{ assignee, _ := cmd.Flags().GetString("assignee") labels, _ := cmd.Flags().GetStringSlice("labels") + labelAlias, _ := cmd.Flags().GetStringSlice("label") + if len(labelAlias) > 0 { + labels = append(labels, labelAlias...) + } if len(labels) == 0 && tmpl != nil && len(tmpl.Labels) > 0 { labels = tmpl.Labels } @@ -375,6 +379,8 @@ func init() { createCmd.Flags().StringP("type", "t", "task", "Issue type (bug|feature|task|epic|chore)") createCmd.Flags().StringP("assignee", "a", "", "Assignee") createCmd.Flags().StringSliceP("labels", "l", []string{}, "Labels (comma-separated)") + createCmd.Flags().StringSlice("label", []string{}, "Alias for --labels") + _ = createCmd.Flags().MarkHidden("label") createCmd.Flags().String("id", "", "Explicit issue ID (e.g., 'bd-42' for partitioning)") createCmd.Flags().String("parent", "", "Parent issue ID for hierarchical child (e.g., 'bd-a3f8e9')") createCmd.Flags().String("external-ref", "", "External reference (e.g., 'gh-9', 'jira-ABC')")