Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/rad-id-sync/blob/main/src/main.rs # rad-id-sync This project has not described itself yet. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `rad-id-sync / src / main.rs` 41 lines ยท 1748 bytes Raw Blame History 1 use rad_id_sync::identity::IdentityAnchor; 2 use rad_id_sync::keys::sync_identity_keys; 3 use std::env; 4 5 fn main() { 6 let args: Vec = env::args().collect(); 7 let cmd = args.get(1).map(|s| s.as_str()).unwrap_or("status"); 8 9 match cmd { 10 "status" => { 11 let anchor = match IdentityAnchor::load_or_init() { 12 Ok(a) => a, 13 Err(e) => { 14 eprintln!("Error loading identity anchor: {}", e); 15 std::process::exit(1); 16 } 17 }; 18 println!("=== Radicle Identity Anchor ==="); 19 println!("DID: {}", anchor.did); 20 println!("Name: {}", anchor.name); 21 println!("Type: {:?}", anchor.entity_type); 22 println!("Radicle Key: {}", anchor.primary_radicle_key.as_deref().unwrap_or("")); 23 println!("SSH Key: {}", anchor.primary_ssh_key.as_deref().unwrap_or("")); 24 println!("Last Synced: {}", anchor.last_synced_at); 25 println!("Key History: {} records", anchor.key_history.len()); 26 } 27 "sync" => { 28 let anchor = IdentityAnchor::load_or_init().expect("Failed to load anchor"); 29 let (_, report) = sync_identity_keys(anchor).expect("Sync failed"); 30 println!("{}", serde_json::to_string_pretty(&report).unwrap()); 31 } 32 "json" => { 33 let anchor = IdentityAnchor::load_or_init().expect("Failed to load anchor"); 34 let (_, report) = sync_identity_keys(anchor).expect("Sync failed"); 35 println!("{}", serde_json::to_string(&report).unwrap()); 36 } 37 _ => { 38 println!("Usage: rad-id-sync [status|sync|json]"); 39 } 40 } 41 }