@@ -218,6 +218,13 @@ pub enum CliRootCommands {
218
218
/// Inline shell completions
219
219
#[ command( subcommand) ]
220
220
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
+ } ,
221
228
}
222
229
223
230
impl CliRootCommands {
@@ -252,6 +259,7 @@ impl CliRootCommands {
252
259
CliRootCommands :: Chat { .. } => "chat" ,
253
260
CliRootCommands :: Mcp { .. } => "mcp" ,
254
261
CliRootCommands :: Inline ( _) => "inline" ,
262
+ CliRootCommands :: Agent { .. } => "agent" ,
255
263
}
256
264
}
257
265
}
@@ -375,6 +383,13 @@ impl Cli {
375
383
Self :: execute_chat ( "mcp" , Some ( args) , true ) . await
376
384
} ,
377
385
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
+ } ,
378
393
} ,
379
394
// Root command
380
395
None => Self :: execute_chat ( "chat" , None , true ) . await ,
0 commit comments