@@ -381,8 +381,16 @@ Examples:
381381 asc builds --app "123456789" --limit 10 --json
382382 asc builds --app "123456789" --sort -uploadedDate --json
383383 asc builds --app "123456789" --output table
384- asc builds --next "<links.next>" --json` ,
384+ asc builds --next "<links.next>" --json
385+
386+ Subcommands:
387+ info Show build details
388+ expire Expire a build for TestFlight` ,
385389 FlagSet : fs ,
390+ Subcommands : []* ffcli.Command {
391+ BuildsInfoCommand (),
392+ BuildsExpireCommand (),
393+ },
386394 Exec : func (ctx context.Context , args []string ) error {
387395 if * limit != 0 && (* limit < 1 || * limit > 200 ) {
388396 return fmt .Errorf ("builds: --limit must be between 1 and 200" )
@@ -431,6 +439,104 @@ Examples:
431439 }
432440}
433441
442+ // BuildsInfoCommand returns a build detail subcommand.
443+ func BuildsInfoCommand () * ffcli.Command {
444+ fs := flag .NewFlagSet ("builds info" , flag .ExitOnError )
445+
446+ buildID := fs .String ("build" , "" , "Build ID" )
447+ output := fs .String ("output" , "json" , "Output format: json (default), table, markdown" )
448+ jsonFlag := fs .Bool ("json" , false , "Output in JSON format (shorthand)" )
449+ pretty := fs .Bool ("pretty" , false , "Pretty-print JSON output" )
450+
451+ return & ffcli.Command {
452+ Name : "info" ,
453+ ShortUsage : "asc builds info [flags]" ,
454+ ShortHelp : "Show build details." ,
455+ LongHelp : `Show build details.
456+
457+ Examples:
458+ asc builds info --build "BUILD_ID" --json` ,
459+ FlagSet : fs ,
460+ Exec : func (ctx context.Context , args []string ) error {
461+ if strings .TrimSpace (* buildID ) == "" {
462+ fmt .Fprintln (os .Stderr , "Error: --build is required" )
463+ fs .Usage ()
464+ return flag .ErrHelp
465+ }
466+
467+ client , err := getASCClient ()
468+ if err != nil {
469+ return fmt .Errorf ("builds info: %w" , err )
470+ }
471+
472+ requestCtx , cancel := contextWithTimeout (ctx )
473+ defer cancel ()
474+
475+ build , err := client .GetBuild (requestCtx , strings .TrimSpace (* buildID ))
476+ if err != nil {
477+ return fmt .Errorf ("builds info: failed to fetch: %w" , err )
478+ }
479+
480+ format := * output
481+ if * jsonFlag {
482+ format = "json"
483+ }
484+
485+ return printOutput (build , format , * pretty )
486+ },
487+ }
488+ }
489+
490+ // BuildsExpireCommand returns a build expiration subcommand.
491+ func BuildsExpireCommand () * ffcli.Command {
492+ fs := flag .NewFlagSet ("builds expire" , flag .ExitOnError )
493+
494+ buildID := fs .String ("build" , "" , "Build ID" )
495+ output := fs .String ("output" , "json" , "Output format: json (default), table, markdown" )
496+ jsonFlag := fs .Bool ("json" , false , "Output in JSON format (shorthand)" )
497+ pretty := fs .Bool ("pretty" , false , "Pretty-print JSON output" )
498+
499+ return & ffcli.Command {
500+ Name : "expire" ,
501+ ShortUsage : "asc builds expire [flags]" ,
502+ ShortHelp : "Expire a build for TestFlight." ,
503+ LongHelp : `Expire a build for TestFlight.
504+
505+ This action is irreversible for the specified build.
506+
507+ Examples:
508+ asc builds expire --build "BUILD_ID" --json` ,
509+ FlagSet : fs ,
510+ Exec : func (ctx context.Context , args []string ) error {
511+ if strings .TrimSpace (* buildID ) == "" {
512+ fmt .Fprintln (os .Stderr , "Error: --build is required" )
513+ fs .Usage ()
514+ return flag .ErrHelp
515+ }
516+
517+ client , err := getASCClient ()
518+ if err != nil {
519+ return fmt .Errorf ("builds expire: %w" , err )
520+ }
521+
522+ requestCtx , cancel := contextWithTimeout (ctx )
523+ defer cancel ()
524+
525+ build , err := client .ExpireBuild (requestCtx , strings .TrimSpace (* buildID ))
526+ if err != nil {
527+ return fmt .Errorf ("builds expire: failed to expire: %w" , err )
528+ }
529+
530+ format := * output
531+ if * jsonFlag {
532+ format = "json"
533+ }
534+
535+ return printOutput (build , format , * pretty )
536+ },
537+ }
538+ }
539+
434540// VersionCommand returns a version subcommand
435541func VersionCommand (version string ) * ffcli.Command {
436542 return & ffcli.Command {
0 commit comments