@@ -600,7 +600,13 @@ def create_and_start_single_node(ctx, api_key, show_logs, tensorboard, tensorboa
600600
601601
602602@experiments_group .command ("start" , help = "Start experiment" )
603- @click .argument ("id" , cls = common .GradientArgument )
603+ @click .option (
604+ "--id" ,
605+ "id" ,
606+ required = True ,
607+ cls = common .GradientOption ,
608+ help = "ID of the experiment" ,
609+ )
604610@click .option (
605611 "--logs" ,
606612 "show_logs" ,
@@ -619,7 +625,13 @@ def start_experiment(ctx, id, show_logs, api_key, options_file):
619625
620626
621627@experiments_group .command ("stop" , help = "Stop experiment" )
622- @click .argument ("id" , cls = common .GradientArgument )
628+ @click .option (
629+ "--id" ,
630+ "id" ,
631+ required = True ,
632+ cls = common .GradientOption ,
633+ help = "ID of the experiment" ,
634+ )
623635@api_key_option
624636@common .options_file
625637def stop_experiment (id , api_key , options_file ):
@@ -672,7 +684,13 @@ def list_experiments(project_ids, api_key, exp_limit, exp_offset, tags, options_
672684
673685
674686@experiments_group .command ("details" , help = "Show detail of an experiment" )
675- @click .argument ("id" , cls = common .GradientArgument )
687+ @click .option (
688+ "--id" ,
689+ "id" ,
690+ required = True ,
691+ cls = common .GradientOption ,
692+ help = "ID of the experiment" ,
693+ )
676694@api_key_option
677695@common .options_file
678696def get_experiment_details (id , options_file , api_key ):
@@ -682,7 +700,7 @@ def get_experiment_details(id, options_file, api_key):
682700
683701@experiments_group .command ("logs" , help = "List experiment logs" )
684702@click .option (
685- "--experimentId " ,
703+ "--id " ,
686704 "experiment_id" ,
687705 required = True ,
688706 cls = common .GradientOption ,
@@ -716,7 +734,13 @@ def list_logs(experiment_id, line, limit, follow, options_file, api_key=None):
716734
717735
718736@experiments_group .command ("delete" , help = "Delete an experiment" )
719- @click .argument ("id" , cls = common .GradientArgument )
737+ @click .option (
738+ "--id" ,
739+ "id" ,
740+ required = True ,
741+ cls = common .GradientOption ,
742+ help = "ID of the experiment" ,
743+ )
720744@api_key_option
721745@common .options_file
722746def delete_experiment (id , options_file , api_key ):
@@ -725,7 +749,13 @@ def delete_experiment(id, options_file, api_key):
725749
726750
727751@experiments_tags .command ("add" , help = "Add tags to experiment" )
728- @click .argument ("id" , cls = common .GradientArgument )
752+ @click .option (
753+ "--id" ,
754+ "id" ,
755+ required = True ,
756+ cls = common .GradientOption ,
757+ help = "ID of the experiment" ,
758+ )
729759@click .option (
730760 "--tag" ,
731761 "tags" ,
@@ -742,14 +772,20 @@ def delete_experiment(id, options_file, api_key):
742772@api_key_option
743773@common .options_file
744774def experiment_add_tags (id , options_file , api_key , ** kwargs ):
745- kwargs ["tags" ] = validate_comma_split_option (kwargs .pop ("tags_comma" ), kwargs .pop ("tags" ))
775+ kwargs ["tags" ] = validate_comma_split_option (kwargs .pop ("tags_comma" ), kwargs .pop ("tags" ), raise_if_no_tags = True )
746776
747777 command = ExperimentAddTagsCommand (api_key = api_key )
748778 command .execute (id , ** kwargs )
749779
750780
751781@experiments_tags .command ("remove" , help = "Remove tags from experiment" )
752- @click .argument ("id" , cls = common .GradientArgument )
782+ @click .option (
783+ "--id" ,
784+ "id" ,
785+ required = True ,
786+ cls = common .GradientOption ,
787+ help = "ID of the experiment" ,
788+ )
753789@click .option (
754790 "--tag" ,
755791 "tags" ,
@@ -766,7 +802,7 @@ def experiment_add_tags(id, options_file, api_key, **kwargs):
766802@api_key_option
767803@common .options_file
768804def experiment_remove_tags (id , options_file , api_key , ** kwargs ):
769- kwargs ["tags" ] = validate_comma_split_option (kwargs .pop ("tags_comma" ), kwargs .pop ("tags" ))
805+ kwargs ["tags" ] = validate_comma_split_option (kwargs .pop ("tags_comma" ), kwargs .pop ("tags" ), raise_if_no_tags = True )
770806
771807 command = ExperimentRemoveTagsCommand (api_key = api_key )
772808 command .execute (id , ** kwargs )
0 commit comments