Skip to content

Commit dd224da

Browse files
feat: accept pool name as positional arg in browser-pools create
Allow `kernel browser-pools create my-pool` as shorthand for `kernel browser-pools create --name my-pool`. The --name flag still works for backward compatibility. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 6bf0331 commit dd224da

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/browser_pools.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,9 @@ var browserPoolsListCmd = &cobra.Command{
404404
}
405405

406406
var browserPoolsCreateCmd = &cobra.Command{
407-
Use: "create",
407+
Use: "create [name]",
408408
Short: "Create a new browser pool",
409+
Args: cobra.MaximumNArgs(1),
409410
RunE: runBrowserPoolsCreate,
410411
}
411412

@@ -517,7 +518,11 @@ func runBrowserPoolsList(cmd *cobra.Command, args []string) error {
517518
func runBrowserPoolsCreate(cmd *cobra.Command, args []string) error {
518519
client := getKernelClient(cmd)
519520

521+
// Name can be provided as positional argument or via --name flag
520522
name, _ := cmd.Flags().GetString("name")
523+
if len(args) > 0 && args[0] != "" {
524+
name = args[0]
525+
}
521526
size, _ := cmd.Flags().GetInt64("size")
522527
fillRate, _ := cmd.Flags().GetInt64("fill-rate")
523528
timeout, _ := cmd.Flags().GetInt64("timeout")

0 commit comments

Comments
 (0)