From 2b5d6e5d0efc2f8a8eecd0395653e242e16b0419 Mon Sep 17 00:00:00 2001 From: Toshii <94262432+0xToshii@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:02:57 -0700 Subject: [PATCH] add instance check to cline task new and full yolo flags (#6844) --- cli/pkg/cli/task.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/pkg/cli/task.go b/cli/pkg/cli/task.go index 202d73b0c3..5855888432 100644 --- a/cli/pkg/cli/task.go +++ b/cli/pkg/cli/task.go @@ -115,6 +115,12 @@ func newTaskNewCommand() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() + // Check if an instance exists when no address specified + if address == "" && global.Clients.GetRegistry().GetDefaultInstance() == "" { + fmt.Println("No instances available for creating tasks") + return nil + } + // Get content from both args and stdin prompt, err := getContentFromStdinAndArgs(args) if err != nil { @@ -170,6 +176,7 @@ func newTaskNewCommand() *cobra.Command { cmd.Flags().StringVarP(&mode, "mode", "m", "", "mode (act|plan)") cmd.Flags().StringSliceVarP(&settings, "setting", "s", nil, "task settings (key=value format, e.g., -s aws-region=us-west-2 -s mode=act)") cmd.Flags().BoolVarP(&yolo, "yolo", "y", false, "enable yolo mode (non-interactive)") + cmd.Flags().BoolVar(&yolo, "no-interactive", false, "enable yolo mode (non-interactive)") return cmd }