Skip to content

Commit 7f63de5

Browse files
authored
Merge pull request #161 from auths-dev/dev-cliRenaming
refactor: get rid of KERI implementation details from CLI layer
2 parents 5836ef1 + cfd4ddf commit 7f63de5

40 files changed

+207
-238
lines changed

crates/auths-cli/src/commands/artifact/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,16 @@ pub enum ArtifactSubcommand {
181181
#[arg(long, value_parser)]
182182
identity_bundle: Option<PathBuf>,
183183

184-
/// Path to witness receipts JSON file.
185-
#[arg(long)]
184+
/// Path to witness signatures JSON file.
185+
#[arg(long = "witness-signatures")]
186186
witness_receipts: Option<PathBuf>,
187187

188188
/// Witness public keys as DID:hex pairs (e.g., "did:key:z6Mk...:abcd1234...").
189189
#[arg(long, num_args = 1..)]
190190
witness_keys: Vec<String>,
191191

192-
/// Witness quorum threshold (default: 1).
193-
#[arg(long, default_value = "1")]
192+
/// Number of witnesses required (default: 1).
193+
#[arg(long = "witnesses-required", default_value = "1")]
194194
witness_threshold: usize,
195195

196196
/// Also verify the source commit's signing attestation.

crates/auths-cli/src/commands/cache.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use auths_sdk::core_config::EnvironmentConfig;
99
use auths_sdk::keri::cache;
1010

1111
#[derive(Parser, Debug, Clone)]
12-
#[command(about = "Manage local identity history cache")]
12+
#[command(about = "Manage cached identity snapshots")]
1313
pub struct CacheCommand {
1414
#[command(subcommand)]
1515
command: CacheSubcommand,
@@ -47,15 +47,15 @@ fn handle_list(auths_home: &std::path::Path) -> Result<()> {
4747
let entries = cache::list_cached_entries(auths_home)?;
4848

4949
if entries.is_empty() {
50-
println!("No cached identity states found.");
50+
println!("No cached snapshots found.");
5151
return Ok(());
5252
}
5353

54-
println!("Cached identity states:\n");
54+
println!("Cached identity snapshots:\n");
5555
for entry in entries {
5656
println!(" Identity ID: {}", entry.did);
5757
println!(" Sequence: {}", entry.sequence);
58-
println!(" Validated against: {}", entry.validated_against_tip_said);
58+
println!(" Verified against: {}", entry.validated_against_tip_said);
5959
println!(" Commit OID: {}", entry.last_commit_oid);
6060
println!(" Cached at: {}", entry.cached_at);
6161
println!(" File: {}", entry.path.display());
@@ -73,15 +73,17 @@ fn handle_inspect(auths_home: &std::path::Path, did: &str) -> Result<()> {
7373
println!("Identity ID: {}", cached.did);
7474
println!("Sequence: {}", cached.sequence);
7575
println!(
76-
"Validated against tip: {}",
76+
"Verified against log entry: {}",
7777
cached.validated_against_tip_said
7878
);
7979
println!("Last commit OID: {}", cached.last_commit_oid);
8080
println!("Cached at: {}", cached.cached_at);
8181
println!("\nKey State:");
82-
println!(" Prefix: {}", cached.state.prefix);
8382
println!(" Current keys: {:?}", cached.state.current_keys);
84-
println!(" Next commitment: {:?}", cached.state.next_commitment);
83+
println!(
84+
" Pre-committed rotation key: {:?}",
85+
cached.state.next_commitment
86+
);
8587
println!(" Is abandoned: {}", cached.state.is_abandoned);
8688
println!(
8789
"\nCache file: {}",

crates/auths-cli/src/commands/ci/rotate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub fn run_rotate(
189189
super::setup::humanize_duration(max_age_secs)
190190
);
191191
println!(
192-
"To revoke: auths device revoke --device-did {} --key {}",
192+
"To revoke: auths device revoke --device {} --key {}",
193193
device_did, identity_key_alias
194194
);
195195

crates/auths-cli/src/commands/ci/setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ pub fn run_setup(
252252
);
253253
println!("To rotate: auths ci rotate");
254254
println!(
255-
"To revoke: auths device revoke --device-did {} --key {}",
255+
"To revoke: auths device revoke --device {} --key {}",
256256
device_did, identity_key_alias
257257
);
258258

crates/auths-cli/src/commands/device/authorization.rs

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,17 @@ struct DeviceEntry {
3838

3939
#[derive(Args, Debug, Clone)]
4040
#[command(
41-
about = "Manage device authorizations within an identity repository.",
41+
about = "Manage which devices can sign with your identity.",
4242
after_help = "Examples:
43-
auths device list # List all linked devices
44-
auths device link --key identity-key --device-key device-key --device-did did:key:...
45-
# Link a new device to your identity
46-
auths device revoke # Revoke a device authorization
43+
auths device list # List authorized devices
44+
auths device link --key identity-key --device-key device-key --device did:key:...
45+
# Authorize a new device
46+
auths device revoke # Revoke a device
4747
auths device extend # Extend device expiry
4848
4949
Related:
50-
auths pair — Pair a new device with your identity
5150
auths status — Show device status and expiry
52-
auths init — Set up identity and linking"
51+
auths init — Set up identity and signing"
5352
)]
5453
pub struct DeviceCommand {
5554
#[command(subcommand)]
@@ -74,19 +73,19 @@ pub enum DeviceSubcommand {
7473
/// Authorize a new device to act on behalf of the identity.
7574
#[command(visible_alias = "add")]
7675
Link {
77-
#[arg(long, help = "Local alias of the *identity's* key (used for signing).")]
76+
#[arg(long, help = "Your identity's key name.")]
7877
key: String,
7978

8079
#[arg(
8180
long,
82-
help = "Local alias of the *new device's* key (must be imported first)."
81+
help = "The new device's key name (import first with: auths key import)."
8382
)]
8483
device_key: String,
8584

8685
#[arg(
8786
long,
8887
visible_alias = "device",
89-
help = "Identity ID of the new device being authorized (must match --device-key)."
88+
help = "The device's ID (must match --device-key)."
9089
)]
9190
device_did: String,
9291

@@ -128,17 +127,10 @@ pub enum DeviceSubcommand {
128127

129128
/// Revoke an existing device authorization using the identity key.
130129
Revoke {
131-
#[arg(
132-
long,
133-
visible_alias = "device",
134-
help = "Identity ID of the device authorization to revoke."
135-
)]
130+
#[arg(long, visible_alias = "device", help = "The device's ID to revoke.")]
136131
device_did: String,
137132

138-
#[arg(
139-
long,
140-
help = "Local alias of the *identity's* key (required to authorize revocation)."
141-
)]
133+
#[arg(long, help = "Your identity's key name.")]
142134
key: String,
143135

144136
#[arg(long, help = "Optional note explaining the revocation.")]
@@ -148,12 +140,12 @@ pub enum DeviceSubcommand {
148140
dry_run: bool,
149141
},
150142

151-
/// Resolve a device DID to its controller identity DID.
143+
/// Resolve a device to its owner identity.
152144
Resolve {
153145
#[arg(
154146
long,
155147
visible_alias = "device",
156-
help = "The device DID to resolve (e.g. did:key:z6Mk...)."
148+
help = "The device ID to resolve (e.g. did:key:z6Mk...)."
157149
)]
158150
device_did: String,
159151
},
@@ -167,11 +159,7 @@ pub enum DeviceSubcommand {
167159

168160
/// Extend the expiration date of an existing device authorization.
169161
Extend {
170-
#[arg(
171-
long,
172-
visible_alias = "device",
173-
help = "Identity ID of the device authorization to extend."
174-
)]
162+
#[arg(long, visible_alias = "device", help = "The device's ID to extend.")]
175163
device_did: String,
176164

177165
/// Duration in seconds until expiration (per RFC 6749).
@@ -182,16 +170,10 @@ pub enum DeviceSubcommand {
182170
)]
183171
expires_in: u64,
184172

185-
#[arg(
186-
long,
187-
help = "Local alias of the *identity's* key (required for re-signing)."
188-
)]
173+
#[arg(long, help = "Your identity's key name.")]
189174
key: String,
190175

191-
#[arg(
192-
long,
193-
help = "Local alias of the *device's* key (required for re-signing)."
194-
)]
176+
#[arg(long, help = "The device's key name.")]
195177
device_key: String,
196178
},
197179
}
@@ -331,11 +313,11 @@ pub fn handle_device(
331313

332314
fn display_link_result(
333315
result: &auths_sdk::result::DeviceLinkResult,
334-
device_did: &str,
316+
_device_did: &str,
335317
) -> Result<()> {
336318
println!(
337-
"\nSuccessfully linked device {} (attestation: {})",
338-
device_did, result.attestation_id
319+
"\nDevice authorized. (Attestation: {})",
320+
result.attestation_id
339321
);
340322
Ok(())
341323
}
@@ -577,7 +559,7 @@ fn list_devices(
577559
.map_err(anyhow::Error::from);
578560
}
579561

580-
println!("Devices for identity: {}", identity.controller_did);
562+
println!("Authorized devices for: {}", identity.controller_did);
581563
if entries.is_empty() {
582564
if include_revoked {
583565
println!(" No authorized devices found.");

crates/auths-cli/src/commands/device/pair/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ pub(crate) fn handle_pairing_response(
323323
println!(" You can manually link this device using:");
324324
println!(
325325
" {}",
326-
style(format!("auths device link --device-did {} ...", device_did)).dim()
326+
style(format!("auths device link --device {} ...", device_did)).dim()
327327
);
328328
save_device_info(now, auths_dir, &response)?;
329329
}

crates/auths-cli/src/commands/device/pair/online.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub(crate) async fn handle_initiate_online(
142142
println!(" You can manually link this device using:");
143143
println!(
144144
" {}",
145-
style(format!("auths device link --device-did {} ...", device_did)).dim()
145+
style(format!("auths device link --device {} ...", device_did)).dim()
146146
);
147147
}
148148
}

crates/auths-cli/src/commands/device/verify_attestation.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,18 @@ pub struct VerifyCommand {
3232
#[arg(long, value_parser, required = true)]
3333
pub attestation: String,
3434

35-
/// Issuer public key in hex format (64 hex chars = 32 bytes).
35+
/// Signer public key in hex format (64 hex chars = 32 bytes).
3636
///
3737
/// If provided, bypasses trust resolution and uses this key directly.
38-
/// Takes precedence over --issuer-did and trust policy.
39-
#[arg(long = "issuer-pk", value_parser)]
38+
/// Takes precedence over --signer and trust policy.
39+
#[arg(long = "signer-key", value_parser)]
4040
pub issuer_pk: Option<String>,
4141

42-
/// Issuer identity ID for trust-based key resolution.
42+
/// Signer identity ID for trust-based key resolution.
4343
///
4444
/// Looks up the public key from pinned identity store or roots.json.
4545
/// Uses --trust policy to determine behavior for unknown identities.
46-
#[arg(long = "issuer-did", visible_alias = "issuer", value_parser)]
46+
#[arg(long = "signer", visible_alias = "issuer-did", value_parser)]
4747
pub issuer_did: Option<String>,
4848

4949
/// Trust policy for unknown identities.
@@ -68,12 +68,12 @@ pub struct VerifyCommand {
6868
#[arg(long = "require-capability")]
6969
pub require_capability: Option<String>,
7070

71-
/// Path to witness receipts JSON file.
72-
#[arg(long)]
71+
/// Path to witness signatures JSON file.
72+
#[arg(long = "witness-signatures")]
7373
pub witness_receipts: Option<PathBuf>,
7474

75-
/// Witness quorum threshold (default: 1).
76-
#[arg(long, default_value = "1")]
75+
/// Number of witnesses required (default: 1).
76+
#[arg(long = "witnesses-required", default_value = "1")]
7777
pub witness_threshold: usize,
7878

7979
/// Witness public keys as DID:hex pairs (e.g., "did:key:z6Mk...:abcd1234...").
@@ -243,7 +243,7 @@ fn resolve_issuer_key(
243243
// The attestation itself doesn't contain the issuer's public key directly,
244244
// so we need it from --issuer-pk or the user needs to provide it
245245
anyhow::bail!(
246-
"Unknown identity '{}'. Provide --issuer-pk to trust on first use, \
246+
"Unknown identity '{}'. Provide --signer-key to trust on first use, \
247247
or add to .auths/roots.json for explicit trust.",
248248
did
249249
);
@@ -254,7 +254,7 @@ fn resolve_issuer_key(
254254
Options:\n \
255255
1. Add to .auths/roots.json in the repository\n \
256256
2. Pin manually: auths trust pin --did {} --key <hex>\n \
257-
3. Provide --issuer-pk <hex> to bypass trust resolution",
257+
3. Provide --signer-key <hex> to bypass trust resolution",
258258
did,
259259
did
260260
);

crates/auths-cli/src/commands/emergency.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub enum EmergencySubcommand {
4747
/// Revoke a compromised device.
4848
#[derive(Parser, Debug, Clone)]
4949
pub struct RevokeDeviceCommand {
50-
/// Device DID to revoke.
50+
/// Device ID to revoke.
5151
#[arg(long)]
5252
pub device: Option<String>,
5353

@@ -306,7 +306,7 @@ fn handle_revoke_device(
306306
did
307307
} else if std::io::stdin().is_terminal() {
308308
Input::new()
309-
.with_prompt("Enter device DID to revoke")
309+
.with_prompt("Enter device ID to revoke")
310310
.interact_text()?
311311
} else {
312312
return Err(anyhow!("--device is required in non-interactive mode"));
@@ -426,7 +426,7 @@ fn handle_rotate_now(
426426
out.print_info("Dry run mode - no changes will be made");
427427
out.newline();
428428
out.println("Would perform the following actions:");
429-
out.println(" 1. Generate new Ed25519 keypair");
429+
out.println(" 1. Generate new signing key");
430430
out.println(" 2. Create rotation event in identity log");
431431
out.println(" 3. Update key alias mappings");
432432
return Ok(());

0 commit comments

Comments
 (0)