@@ -176,8 +176,7 @@ type BrowsersCreateInput struct {
176176}
177177
178178type BrowsersDeleteInput struct {
179- Identifier string
180- SkipConfirm bool
179+ Identifier string
181180}
182181
183182type BrowsersViewInput struct {
@@ -415,39 +414,7 @@ func buildBrowserTableData(sessionID, cdpURL, liveViewURL string, persistence ke
415414}
416415
417416func (b BrowsersCmd ) Delete (ctx context.Context , in BrowsersDeleteInput ) error {
418- if ! in .SkipConfirm {
419- found , err := b .browsers .Get (ctx , in .Identifier )
420- if err != nil {
421- return util.CleanedUpSdkError {Err : err }
422- }
423-
424- confirmMsg := fmt .Sprintf ("Are you sure you want to delete browser \" %s\" ?" , in .Identifier )
425- pterm .DefaultInteractiveConfirm .DefaultText = confirmMsg
426- result , _ := pterm .DefaultInteractiveConfirm .Show ()
427- if ! result {
428- pterm .Info .Println ("Deletion cancelled" )
429- return nil
430- }
431-
432- if found .Persistence .ID == in .Identifier {
433- err = b .browsers .Delete (ctx , kernel.BrowserDeleteParams {PersistentID : in .Identifier })
434- if err != nil && ! util .IsNotFound (err ) {
435- return util.CleanedUpSdkError {Err : err }
436- }
437- pterm .Success .Printf ("Successfully deleted browser: %s\n " , in .Identifier )
438- return nil
439- }
440-
441- pterm .Info .Printf ("Deleting browser: %s\n " , in .Identifier )
442- err = b .browsers .DeleteByID (ctx , in .Identifier )
443- if err != nil && ! util .IsNotFound (err ) {
444- return util.CleanedUpSdkError {Err : err }
445- }
446- pterm .Success .Printf ("Successfully deleted browser: %s\n " , in .Identifier )
447- return nil
448- }
449-
450- // Skip confirmation: try both deletion modes without listing first
417+ // Try both deletion modes without confirmation
451418 // Treat not found as a success (idempotent delete)
452419 var nonNotFoundErrors []error
453420
@@ -2286,8 +2253,6 @@ func init() {
22862253 browsersCreateCmd .Flags ().String ("pool-id" , "" , "Browser pool ID to acquire from (mutually exclusive with --pool-name)" )
22872254 browsersCreateCmd .Flags ().String ("pool-name" , "" , "Browser pool name to acquire from (mutually exclusive with --pool-id)" )
22882255
2289- // Add flags for delete command
2290- browsersDeleteCmd .Flags ().BoolP ("yes" , "y" , false , "Skip confirmation prompt" )
22912256
22922257 // no flags for view; it takes a single positional argument
22932258}
@@ -2446,13 +2411,12 @@ func runBrowsersCreate(cmd *cobra.Command, args []string) error {
24462411
24472412func runBrowsersDelete (cmd * cobra.Command , args []string ) error {
24482413 client := getKernelClient (cmd )
2449- skipConfirm , _ := cmd .Flags ().GetBool ("yes" )
24502414
24512415 svc := client .Browsers
24522416 b := BrowsersCmd {browsers : & svc }
24532417 // Iterate all provided identifiers
24542418 for _ , identifier := range args {
2455- if err := b .Delete (cmd .Context (), BrowsersDeleteInput {Identifier : identifier , SkipConfirm : skipConfirm }); err != nil {
2419+ if err := b .Delete (cmd .Context (), BrowsersDeleteInput {Identifier : identifier }); err != nil {
24562420 return err
24572421 }
24582422 }
0 commit comments