@@ -12,6 +12,7 @@ mod prompts;
1212use anyhow:: { Result , anyhow} ;
1313use clap:: { Args , ValueEnum } ;
1414use std:: io:: IsTerminal ;
15+ use std:: path:: PathBuf ;
1516use std:: sync:: Arc ;
1617
1718use auths_core:: PrefilledPassphraseProvider ;
@@ -29,6 +30,7 @@ use crate::config::CliConfig;
2930use crate :: factories:: storage:: build_auths_context;
3031use crate :: ux:: format:: Output ;
3132
33+ use super :: signers:: { SignersSyncArgs , handle_sync} ;
3234use display:: {
3335 display_agent_dry_run, display_agent_result, display_ci_result, display_developer_result,
3436} ;
@@ -118,13 +120,13 @@ pub struct InitCommand {
118120 #[ clap( long) ]
119121 pub dry_run : bool ,
120122
121- /// Registry URL for automatic identity registration
123+ /// Registry URL for identity registration
122124 #[ clap( long, default_value = DEFAULT_REGISTRY_URL ) ]
123125 pub registry : String ,
124126
125- /// Skip automatic registry registration during setup
127+ /// Register identity with the Auths Registry after creation
126128 #[ clap( long) ]
127- pub skip_registration : bool ,
129+ pub register : bool ,
128130
129131 /// Scaffold a GitHub Actions workflow using the auths attest-action
130132 #[ clap( long) ]
@@ -240,7 +242,7 @@ fn run_developer_setup(
240242
241243 // PLATFORM VERIFICATION
242244 guide. section ( "Platform Verification" ) ;
243- let proof_url = if interactive && ! cmd. skip_registration {
245+ let proof_url = if interactive && cmd. register {
244246 out. print_info ( "Claim your Developer Passport" ) ;
245247 out. newline ( ) ;
246248 match prompt_platform_verification (
@@ -267,13 +269,28 @@ fn run_developer_setup(
267269 offer_shell_completions ( interactive, out) ?;
268270 write_allowed_signers ( & result. key_alias , out) ?;
269271
272+ // Also write repo-local .auths/allowed_signers if we're inside a git repo,
273+ // so `auths verify` works immediately without extra flags.
274+ if let Ok ( output) = std:: process:: Command :: new ( "git" )
275+ . args ( [ "rev-parse" , "--show-toplevel" ] )
276+ . output ( )
277+ && output. status . success ( )
278+ {
279+ let root = PathBuf :: from ( String :: from_utf8_lossy ( & output. stdout ) . trim ( ) ) ;
280+ let repo_signers = root. join ( ".auths" ) . join ( "allowed_signers" ) ;
281+ let _ = handle_sync ( & SignersSyncArgs {
282+ repo : "~/.auths" . into ( ) ,
283+ output_file : Some ( repo_signers) ,
284+ } ) ;
285+ }
286+
270287 // REGISTRATION & DISPLAY
271288 guide. section ( "Registration & Summary" ) ;
272289 let registered = submit_registration (
273290 & get_auths_repo_path ( ) ?,
274291 & cmd. registry ,
275292 proof_url,
276- cmd. skip_registration ,
293+ ! cmd. register , // skip unless --register is explicitly passed
277294 out,
278295 ) ;
279296 display_developer_result ( out, & result, registered. as_deref ( ) ) ;
@@ -390,7 +407,7 @@ mod tests {
390407 force : false ,
391408 dry_run : false ,
392409 registry : DEFAULT_REGISTRY_URL . to_string ( ) ,
393- skip_registration : false ,
410+ register : false ,
394411 github_action : false ,
395412 } ;
396413 assert ! ( !cmd. interactive) ;
@@ -400,7 +417,7 @@ mod tests {
400417 assert ! ( !cmd. force) ;
401418 assert ! ( !cmd. dry_run) ;
402419 assert_eq ! ( cmd. registry, "https://auths-registry.fly.dev" ) ;
403- assert ! ( !cmd. skip_registration ) ;
420+ assert ! ( !cmd. register ) ;
404421 assert ! ( !cmd. github_action) ;
405422 }
406423
@@ -414,7 +431,7 @@ mod tests {
414431 force : true ,
415432 dry_run : false ,
416433 registry : DEFAULT_REGISTRY_URL . to_string ( ) ,
417- skip_registration : false ,
434+ register : false ,
418435 github_action : false ,
419436 } ;
420437 assert ! ( cmd. non_interactive) ;
@@ -446,7 +463,7 @@ mod tests {
446463 force : false ,
447464 dry_run : false ,
448465 registry : DEFAULT_REGISTRY_URL . to_string ( ) ,
449- skip_registration : false ,
466+ register : false ,
450467 github_action : false ,
451468 } ;
452469 assert ! ( !resolve_interactive( & cmd) . unwrap( ) ) ;
@@ -462,7 +479,7 @@ mod tests {
462479 force : false ,
463480 dry_run : false ,
464481 registry : DEFAULT_REGISTRY_URL . to_string ( ) ,
465- skip_registration : false ,
482+ register : false ,
466483 github_action : false ,
467484 } ;
468485 // Auto-detect returns is_terminal() — result depends on environment
0 commit comments