From a3ef7722f93d8ac50f55d051486193b0a6a86261 Mon Sep 17 00:00:00 2001 From: beads/crew/wickham Date: Tue, 20 Jan 2026 19:07:12 -0800 Subject: [PATCH] feat(cmd): add 'bd children ' command (bd-scbxh) Convenience alias for 'bd list --parent '. Lists all child beads of a specified parent, supporting all standard list flags (--json, --pretty, etc.). Co-Authored-By: Claude Opus 4.5 --- cmd/bd/children.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cmd/bd/children.go diff --git a/cmd/bd/children.go b/cmd/bd/children.go new file mode 100644 index 00000000..66b11558 --- /dev/null +++ b/cmd/bd/children.go @@ -0,0 +1,34 @@ +package main + +import ( + "github.com/spf13/cobra" +) + +// childrenCmd lists child beads of a parent. +// This is a convenience alias for 'bd list --parent '. +var childrenCmd = &cobra.Command{ + Use: "children ", + GroupID: "issues", + Short: "List child beads of a parent", + Long: `List all beads that are children of the specified parent bead. + +This is a convenience alias for 'bd list --parent '. + +Examples: + bd children hq-abc123 # List children of hq-abc123 + bd children hq-abc123 --json # List children in JSON format + bd children hq-abc123 --pretty # Show children in tree format`, + Args: cobra.ExactArgs(1), + Run: func(cmd *cobra.Command, args []string) { + parentID := args[0] + + // Set the parent flag on listCmd, run it, then reset + listCmd.Flags().Set("parent", parentID) + defer listCmd.Flags().Set("parent", "") + listCmd.Run(listCmd, []string{}) + }, +} + +func init() { + rootCmd.AddCommand(childrenCmd) +}