@@ -59,7 +59,6 @@ def main():
5959 )
6060 init_parser .add_argument ("slug_name" , nargs = "?" , help = "The directory name to place the project in" )
6161 init_parser .add_argument ("--wizard" , "-w" , action = "store_true" , help = "Use the setup wizard" )
62- init_parser .add_argument ("--migratecrew" , "-m" , action = "store_true" , help = "Migrate from an existing CrewAI project" )
6362 init_parser .add_argument ("--template" , "-t" , help = "Agent template to use" )
6463
6564 # 'run' command
@@ -144,32 +143,31 @@ def main():
144143
145144 update = subparsers .add_parser ('update' , aliases = ['u' ], help = 'Check for updates' , parents = [global_parser ])
146145
147- # Parse known args and store unknown args in extras; some commands use them later on
148- args , extra_args = parser .parse_known_args ()
146+ # Parse args
147+ args = parser .parse_args ()
149148
150149 # Set the project path from --path if it is provided in the global_parser
151150 conf .set_path (args .project_path )
152151
153- # Handle version
154- if args .version :
155- print (f"AgentStack CLI version: { get_version ()} " )
156- sys .exit (0 )
157-
158- telemetry_id = track_cli_command (args .command , " " .join (sys .argv [1 :]))
159- check_for_updates (update_requested = args .command in ('update' , 'u' ))
160-
161- # Handle commands
162152 try :
163- if args .command in ["docs" ]:
164- webbrowser .open ("https://docs.agentstack.sh/" )
153+ if args .version :
154+ version = get_version ()
155+ print (f"AgentStack CLI version { version } " )
156+ check_for_updates ()
157+ elif args .command in ["docs" ]:
158+ webbrowser .open ("https://docs.agentstack.sh" )
165159 elif args .command in ["quickstart" ]:
166160 webbrowser .open ("https://docs.agentstack.sh/quickstart" )
167161 elif args .command in ["templates" ]:
168162 webbrowser .open ("https://docs.agentstack.sh/quickstart" )
169163 elif args .command in ["init" , "i" ]:
170- init_project_builder (args .slug_name , args .template , args .wizard , args .migratecrew )
164+ init_project_builder (
165+ slug_name = args .slug_name ,
166+ template = args .template ,
167+ use_wizard = args .wizard ,
168+ )
171169 elif args .command in ["run" , "r" ]:
172- run_project (command = args .function , debug = args .debug , cli_args = extra_args )
170+ run_project (command = args .function , debug = args .debug )
173171 elif args .command in ['generate' , 'g' ]:
174172 if args .generate_command in ['agent' , 'a' ]:
175173 if not args .llm :
@@ -199,11 +197,13 @@ def main():
199197 else :
200198 parser .print_help ()
201199 except Exception as e :
200+ telemetry_id = track_cli_command (args .command , " " .join (sys .argv [1 :]))
202201 update_telemetry (telemetry_id , result = 1 , message = str (e ))
203202 print (term_color ("An error occurred while running your AgentStack command:" , "red" ))
204203 print (e )
205204 sys .exit (1 )
206205
206+ telemetry_id = track_cli_command (args .command , " " .join (sys .argv [1 :]))
207207 update_telemetry (telemetry_id , result = 0 )
208208
209209
0 commit comments