@@ -218,6 +218,13 @@ pub enum CliRootCommands {
218218 /// Inline shell completions
219219 #[ command( subcommand) ]
220220 Inline ( inline:: InlineSubcommand ) ,
221+ /// Agent root commands
222+ #[ command( disable_help_flag = true ) ]
223+ Agent {
224+ /// Args for Agent subcommand
225+ #[ arg( trailing_var_arg = true , allow_hyphen_values = true ) ]
226+ args : Vec < String > ,
227+ } ,
221228}
222229
223230impl CliRootCommands {
@@ -252,6 +259,7 @@ impl CliRootCommands {
252259 CliRootCommands :: Chat { .. } => "chat" ,
253260 CliRootCommands :: Mcp { .. } => "mcp" ,
254261 CliRootCommands :: Inline ( _) => "inline" ,
262+ CliRootCommands :: Agent { .. } => "agent" ,
255263 }
256264 }
257265}
@@ -375,6 +383,13 @@ impl Cli {
375383 Self :: execute_chat ( "mcp" , Some ( args) , true ) . await
376384 } ,
377385 CliRootCommands :: Inline ( subcommand) => subcommand. execute ( & cli_context) . await ,
386+ CliRootCommands :: Agent { args } => {
387+ if args. iter ( ) . any ( |arg| [ "--help" , "-h" ] . contains ( & arg. as_str ( ) ) ) {
388+ return Self :: execute_chat ( "agent" , Some ( args) , false ) . await ;
389+ }
390+
391+ Self :: execute_chat ( "agent" , Some ( args) , true ) . await
392+ } ,
378393 } ,
379394 // Root command
380395 None => Self :: execute_chat ( "chat" , None , true ) . await ,
0 commit comments