File tree Expand file tree Collapse file tree
crates/auths-cli/src/commands/init Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ pub(crate) fn display_ci_result(
4343 out. print_heading ( "Add these to your CI secrets:" ) ;
4444 out. println ( "─" . repeat ( 50 ) . as_str ( ) ) ;
4545 for line in & result. env_block {
46- println ! ( "{}" , line) ;
46+ out . println ( line) ;
4747 }
4848 out. println ( "─" . repeat ( 50 ) . as_str ( ) ) ;
4949 out. newline ( ) ;
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ pub(crate) fn gather_ci_config(
8282 let keychain =
8383 get_platform_keychain ( ) . map_err ( |e| anyhow ! ( "Failed to get memory keychain: {}" , e) ) ?;
8484
85- out. println ( & format ! ( " Using keychain: {}" , keychain. backend_name( ) ) ) ;
85+ out. print_info ( & format ! ( "Using keychain: {}" , keychain. backend_name( ) ) ) ;
8686
8787 let config = CiIdentityConfig {
8888 ci_environment : map_ci_environment ( & ci_env) ,
@@ -111,7 +111,11 @@ pub(crate) fn gather_agent_config(
111111 . filter_map ( |s| auths_verifier:: Capability :: parse ( & s) . ok ( ) )
112112 . collect ( ) ;
113113
114+ out. print_info ( "Checking prerequisites..." ) ;
114115 let keychain = check_keychain_access ( out) ?;
116+ out. print_success ( "Prerequisites OK" ) ;
117+ out. newline ( ) ;
118+
115119 let registry_path = get_auths_repo_path ( ) ?;
116120
117121 let config = auths_sdk:: types:: CreateAgentIdentityConfig :: builder (
Original file line number Diff line number Diff line change @@ -9,26 +9,33 @@ pub(crate) struct GuidedSetup<'a> {
99 out : & ' a Output ,
1010 total_steps : usize ,
1111 current_step : usize ,
12+ interactive : bool ,
1213}
1314
1415impl < ' a > GuidedSetup < ' a > {
15- pub fn new ( out : & ' a Output , total_steps : usize ) -> Self {
16+ pub fn new ( out : & ' a Output , total_steps : usize , interactive : bool ) -> Self {
1617 Self {
1718 out,
1819 total_steps,
1920 current_step : 0 ,
21+ interactive,
2022 }
2123 }
2224
2325 /// Display a section heading with step progress.
26+ ///
27+ /// In non-interactive mode the heading is suppressed so that only
28+ /// `[OK]` / `[INFO]` lines appear, keeping CI and scripted output clean.
2429 pub fn section ( & mut self , title : & str ) {
2530 self . current_step += 1 ;
26- self . out . newline ( ) ;
27- self . out . print_heading ( & format ! (
28- "[{}/{}] {}" ,
29- self . current_step, self . total_steps, title
30- ) ) ;
31- self . out . newline ( ) ;
31+ if self . interactive {
32+ self . out . newline ( ) ;
33+ self . out . print_heading ( & format ! (
34+ "[{}/{}] {}" ,
35+ self . current_step, self . total_steps, title
36+ ) ) ;
37+ self . out . newline ( ) ;
38+ }
3239 }
3340}
3441
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ fn run_developer_setup(
199199 ctx : & CliConfig ,
200200 now : chrono:: DateTime < chrono:: Utc > ,
201201) -> Result < ( ) > {
202- let mut guide = GuidedSetup :: new ( out, guided:: developer_steps ( ) ) ;
202+ let mut guide = GuidedSetup :: new ( out, guided:: developer_steps ( ) , interactive ) ;
203203
204204 // GATHER
205205 guide. section ( "Prerequisites & Configuration" ) ;
@@ -304,7 +304,7 @@ fn run_developer_setup(
304304}
305305
306306fn run_ci_setup ( out : & Output , ctx : & CliConfig ) -> Result < ( ) > {
307- let mut guide = GuidedSetup :: new ( out, guided:: ci_steps ( ) ) ;
307+ let mut guide = GuidedSetup :: new ( out, guided:: ci_steps ( ) , false ) ;
308308
309309 // GATHER
310310 guide. section ( "CI Environment Detection" ) ;
@@ -344,7 +344,7 @@ fn run_agent_setup(
344344 cmd : & InitCommand ,
345345 ctx : & CliConfig ,
346346) -> Result < ( ) > {
347- let mut guide = GuidedSetup :: new ( out, guided:: agent_steps ( ) ) ;
347+ let mut guide = GuidedSetup :: new ( out, guided:: agent_steps ( ) , interactive ) ;
348348
349349 // GATHER
350350 guide. section ( "Agent Configuration" ) ;
You can’t perform that action at this time.
0 commit comments