@@ -9,51 +9,26 @@ mod settings;
99mod user;
1010
1111use std:: fmt:: Display ;
12- use std:: io:: {
13- Write as _,
14- stdout,
15- } ;
12+ use std:: io:: { Write as _, stdout} ;
1613use std:: process:: ExitCode ;
1714
1815use agent:: AgentArgs ;
1916use anstream:: println;
2017pub use chat:: ConversationState ;
21- use clap:: {
22- ArgAction ,
23- CommandFactory ,
24- Parser ,
25- Subcommand ,
26- ValueEnum ,
27- } ;
18+ use clap:: { ArgAction , CommandFactory , Parser , Subcommand , ValueEnum } ;
2819use crossterm:: style:: Stylize ;
29- use eyre:: {
30- Result ,
31- bail,
32- } ;
20+ use eyre:: { Result , bail} ;
3321use feed:: Feed ;
3422use serde:: Serialize ;
35- use tracing:: {
36- Level ,
37- debug,
38- } ;
23+ use tracing:: { Level , debug} ;
3924
4025use crate :: cli:: chat:: ChatArgs ;
4126use crate :: cli:: mcp:: McpSubcommand ;
42- use crate :: cli:: user:: {
43- LoginArgs ,
44- WhoamiArgs ,
45- } ;
46- use crate :: logging:: {
47- LogArgs ,
48- initialize_logging,
49- } ;
27+ use crate :: cli:: user:: { LoginArgs , WhoamiArgs } ;
28+ use crate :: logging:: { LogArgs , initialize_logging} ;
5029use crate :: os:: Os ;
51- use crate :: subagents;
5230use crate :: util:: directories:: logs_dir;
53- use crate :: util:: {
54- CLI_BINARY_NAME ,
55- GOV_REGIONS ,
56- } ;
31+ use crate :: util:: { CLI_BINARY_NAME , GOV_REGIONS } ;
5732
5833#[ derive( Debug , Clone , Copy , Default , PartialEq , Eq , ValueEnum ) ]
5934pub enum OutputFormat {
@@ -98,8 +73,6 @@ pub enum RootSubcommand {
9873 Whoami ( WhoamiArgs ) ,
9974 /// Show the profile associated with this idc user
10075 Profile ,
101- /// Show the current running agents across processes
102- Agent ( subagents:: AgentArgs ) ,
10376 /// Customize appearance & behavior
10477 #[ command( alias( "setting" ) ) ]
10578 Settings ( settings:: SettingsArgs ) ,
@@ -159,7 +132,6 @@ impl RootSubcommand {
159132 Self :: Version { changelog } => Cli :: print_version ( changelog) ,
160133 Self :: Chat ( args) => args. execute ( os) . await ,
161134 Self :: Mcp ( args) => args. execute ( os, & mut std:: io:: stderr ( ) ) . await ,
162- Self :: Agent ( args) => args. execute ( ) . await ,
163135 }
164136 }
165137}
@@ -340,59 +312,80 @@ mod test {
340312 /// Test flag parsing for the top level [Cli]
341313 #[ test]
342314 fn test_flags ( ) {
343- assert_eq ! ( Cli :: parse_from( [ CHAT_BINARY_NAME , "-v" ] ) , Cli {
344- subcommand: None ,
345- verbose: 1 ,
346- help_all: false ,
347- } ) ;
315+ assert_eq ! (
316+ Cli :: parse_from( [ CHAT_BINARY_NAME , "-v" ] ) ,
317+ Cli {
318+ subcommand: None ,
319+ verbose: 1 ,
320+ help_all: false ,
321+ }
322+ ) ;
348323
349- assert_eq ! ( Cli :: parse_from( [ CHAT_BINARY_NAME , "-vvv" ] ) , Cli {
350- subcommand: None ,
351- verbose: 3 ,
352- help_all: false ,
353- } ) ;
324+ assert_eq ! (
325+ Cli :: parse_from( [ CHAT_BINARY_NAME , "-vvv" ] ) ,
326+ Cli {
327+ subcommand: None ,
328+ verbose: 3 ,
329+ help_all: false ,
330+ }
331+ ) ;
354332
355- assert_eq ! ( Cli :: parse_from( [ CHAT_BINARY_NAME , "--help-all" ] ) , Cli {
356- subcommand: None ,
357- verbose: 0 ,
358- help_all: true ,
359- } ) ;
333+ assert_eq ! (
334+ Cli :: parse_from( [ CHAT_BINARY_NAME , "--help-all" ] ) ,
335+ Cli {
336+ subcommand: None ,
337+ verbose: 0 ,
338+ help_all: true ,
339+ }
340+ ) ;
360341
361- assert_eq ! ( Cli :: parse_from( [ CHAT_BINARY_NAME , "chat" , "-vv" ] ) , Cli {
362- subcommand: Some ( RootSubcommand :: Chat ( ChatArgs {
363- resume: false ,
364- input: None ,
365- agent: None ,
366- model: None ,
367- trust_all_tools: false ,
368- trust_tools: None ,
369- no_interactive: false ,
370- migrate: false ,
371- } ) ) ,
372- verbose: 2 ,
373- help_all: false ,
374- } ) ;
342+ assert_eq ! (
343+ Cli :: parse_from( [ CHAT_BINARY_NAME , "chat" , "-vv" ] ) ,
344+ Cli {
345+ subcommand: Some ( RootSubcommand :: Chat ( ChatArgs {
346+ resume: false ,
347+ input: None ,
348+ agent: None ,
349+ model: None ,
350+ trust_all_tools: false ,
351+ trust_tools: None ,
352+ no_interactive: false ,
353+ migrate: false ,
354+ } ) ) ,
355+ verbose: 2 ,
356+ help_all: false ,
357+ }
358+ ) ;
375359 }
376360
377361 #[ test]
378362 fn test_version_changelog ( ) {
379- assert_parse ! ( [ "version" , "--changelog" ] , RootSubcommand :: Version {
380- changelog: Some ( "" . to_string( ) ) ,
381- } ) ;
363+ assert_parse ! (
364+ [ "version" , "--changelog" ] ,
365+ RootSubcommand :: Version {
366+ changelog: Some ( "" . to_string( ) ) ,
367+ }
368+ ) ;
382369 }
383370
384371 #[ test]
385372 fn test_version_changelog_all ( ) {
386- assert_parse ! ( [ "version" , "--changelog=all" ] , RootSubcommand :: Version {
387- changelog: Some ( "all" . to_string( ) ) ,
388- } ) ;
373+ assert_parse ! (
374+ [ "version" , "--changelog=all" ] ,
375+ RootSubcommand :: Version {
376+ changelog: Some ( "all" . to_string( ) ) ,
377+ }
378+ ) ;
389379 }
390380
391381 #[ test]
392382 fn test_version_changelog_specific ( ) {
393- assert_parse ! ( [ "version" , "--changelog=1.8.0" ] , RootSubcommand :: Version {
394- changelog: Some ( "1.8.0" . to_string( ) ) ,
395- } ) ;
383+ assert_parse ! (
384+ [ "version" , "--changelog=1.8.0" ] ,
385+ RootSubcommand :: Version {
386+ changelog: Some ( "1.8.0" . to_string( ) ) ,
387+ }
388+ ) ;
396389 }
397390
398391 #[ test]
0 commit comments