Skip to content

Commit 5891477

Browse files
authored
Merge pull request #116 from auths-dev/dev-cliErgo
refactor(cli): dx improvements
2 parents 3b360fd + dbf605d commit 5891477

44 files changed

Lines changed: 2242 additions & 1453 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.auths/allowed_signers

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# auths:managed — do not edit manually
2-
# Current identity (E6IXlw5-lnX88r3WZCt3u1qyN_Xlq7nQjtoTmuOfMIjI)
3-
z6MktnihicwetvA16FtHFynaJTn9eDZw51eizUEA1yGJCR4o@auths.local namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINT/yz5N7+GkzsRTHiyaueZbDy+fovwYUXyJ9uwD67tk
4-
# Previous identity
5-
z6MkipUqayiDZWM8j4YktjiEFZcCGw51YDVvLM7SrYPqLLyZ@auths.local namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEDeaOmUEcUjzChUedAsPyDO4mnjIa8j92fD9rGpuZd0
2+
# auths:attestation
3+
z6MkhPJCPXd5A9VN4wScJkxTtz6de7egZQx78vsiAT1vg3PZ@auths.local namespaces="git" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICuPK6OfYp7ngZp40Q+Dsrahhks472v6gPIMD0upCRnM
4+
# auths:manual

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,4 @@ my-artifact.txt.auths.json
135135

136136
# Stale E2E test artifacts (nested git repos created by test runs)
137137
tests/e2e/.auths-ci/
138+
.capsec-cache

CLAUDE.md

Lines changed: 0 additions & 158 deletions
This file was deleted.

crates/auths-cli/src/adapters/system_diagnostic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! POSIX-based diagnostic adapter — subprocess calls live here, nowhere else.
22
33
use auths_sdk::ports::diagnostics::{
4-
CheckResult, CryptoDiagnosticProvider, DiagnosticError, GitDiagnosticProvider,
4+
CheckCategory, CheckResult, CryptoDiagnosticProvider, DiagnosticError, GitDiagnosticProvider,
55
};
66
use std::process::Command;
77

@@ -23,6 +23,7 @@ impl GitDiagnosticProvider for PosixDiagnosticAdapter {
2323
passed,
2424
message,
2525
config_issues: vec![],
26+
category: CheckCategory::Advisory,
2627
})
2728
}
2829

@@ -57,6 +58,7 @@ impl CryptoDiagnosticProvider for PosixDiagnosticAdapter {
5758
passed,
5859
message,
5960
config_issues: vec![],
61+
category: CheckCategory::Advisory,
6062
})
6163
}
6264
}

crates/auths-cli/src/cli.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,42 +101,29 @@ pub enum RootCommand {
101101
Signers(SignersCommand),
102102
Pair(PairCommand),
103103
Error(ErrorLookupCommand),
104-
#[command(hide = true)]
105104
Completions(CompletionsCommand),
106105
#[command(hide = true)]
107106
Emergency(EmergencyCommand),
108107

109-
#[command(hide = true)]
110108
Id(IdCommand),
111-
#[command(hide = true)]
112109
Device(DeviceCommand),
113-
#[command(hide = true)]
114110
Key(KeyCommand),
115-
#[command(hide = true)]
116111
Approval(ApprovalCommand),
117-
#[command(hide = true)]
118112
Artifact(ArtifactCommand),
119-
#[command(hide = true)]
120113
Policy(PolicyCommand),
121-
#[command(hide = true)]
122114
Git(GitCommand),
123-
#[command(hide = true)]
124115
Trust(TrustCommand),
125-
#[command(hide = true)]
126116
Namespace(NamespaceCommand),
127-
#[command(hide = true)]
128117
Org(OrgCommand),
129-
#[command(hide = true)]
130118
Audit(AuditCommand),
119+
Config(ConfigCommand),
120+
131121
#[command(hide = true)]
132122
Agent(AgentCommand),
133123
#[command(hide = true)]
134124
Witness(WitnessCommand),
135125
#[command(hide = true)]
136126
Scim(ScimCommand),
137-
#[command(hide = true)]
138-
Config(ConfigCommand),
139-
140127
#[command(hide = true)]
141128
Commit(CommitCmd),
142129
#[command(hide = true)]

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,20 @@ use crate::config::CliConfig;
1111
pub const EXIT_APPROVAL_REQUIRED: i32 = 75;
1212

1313
#[derive(Parser, Debug)]
14-
#[command(about = "Manage approval gates")]
14+
#[command(
15+
about = "Manage approval gates",
16+
after_help = "Examples:
17+
auths approval list # Show pending approval requests
18+
auths approval grant --request <hash> --note 'Reviewed and approved'
19+
# Grant approval for a request
20+
21+
Exit Codes:
22+
75 — Approval required (TEMPFAIL) — operation needs authorization
23+
24+
Related:
25+
auths policy — Manage capability policies
26+
auths status — Check system status"
27+
)]
1528
pub struct ApprovalCommand {
1629
#[command(subcommand)]
1730
pub command: ApprovalSubcommand,

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

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,26 @@ use auths_core::config::EnvironmentConfig;
1313
use auths_core::signing::PassphraseProvider;
1414

1515
#[derive(Args, Debug, Clone)]
16-
#[command(about = "Sign and verify arbitrary artifacts (tarballs, binaries, etc.).")]
16+
#[command(
17+
about = "Sign and verify arbitrary artifacts (tarballs, binaries, etc.).",
18+
after_help = "Examples:
19+
auths artifact sign package.tar.gz # Sign an artifact
20+
auths artifact sign package.tar.gz --expires-in 2592000
21+
# Sign with 30-day expiry
22+
auths artifact verify package.tar.gz.auths.json
23+
# Verify artifact signature
24+
auths artifact publish package.tar.gz --package npm:react@18.3.0
25+
# Sign and publish to registry
26+
27+
Signature Files:
28+
Signatures are stored as <file>.auths.json next to the artifact.
29+
Contains identity, device, and signature information.
30+
31+
Related:
32+
auths sign — Sign commits and other files
33+
auths verify — Verify signatures
34+
auths trust — Manage trusted identities"
35+
)]
1736
pub struct ArtifactCommand {
1837
#[command(subcommand)]
1938
pub command: ArtifactSubcommand,
@@ -334,9 +353,9 @@ mod tests {
334353
"test",
335354
"publish",
336355
"my-file.tar.gz",
337-
"--ika",
356+
"--key",
338357
"main",
339-
"--dka",
358+
"--device-key",
340359
"device-1",
341360
"--expires-in",
342361
"3600",

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@ use std::path::PathBuf;
1717
#[derive(Parser, Debug, Clone)]
1818
#[command(
1919
name = "audit",
20-
about = "Generate signing audit reports for compliance"
20+
about = "Generate signing audit reports for compliance",
21+
after_help = "Examples:
22+
auths audit --repo ~/myproject # Audit commits in a repo
23+
auths audit --since 2026-01-01 --until 2026-03-31
24+
# Audit a specific date range
25+
auths audit --format html -o report.html
26+
# Generate HTML report
27+
auths audit --require-all-signed --exit-code
28+
# Exit 1 if any unsigned commits found
29+
30+
Output Formats:
31+
table — Human-readable table (default)
32+
json — Machine-readable JSON
33+
html — Interactive HTML report
34+
35+
Related:
36+
auths verify — Verify signatures on commits
37+
auths status — Check device status"
2138
)]
2239
pub struct AuditCommand {
2340
/// Path to the Git repository to audit (defaults to current directory).

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ use crate::ux::format::{JsonResponse, is_json_mode};
1717

1818
/// Authenticate with external services using your auths identity.
1919
#[derive(Parser, Debug, Clone)]
20+
#[command(
21+
about = "Authenticate with external services using your auths identity",
22+
after_help = "Examples:
23+
auths auth challenge --nonce abc123def456 --domain example.com
24+
# Sign an authentication challenge
25+
auths auth challenge --nonce abc123def456
26+
# Sign challenge for default domain (auths.dev)
27+
28+
Flow:
29+
1. Service sends you a nonce
30+
2. Run: auths auth challenge --nonce <nonce> --domain <domain>
31+
3. Service verifies your signature against your DID
32+
33+
Related:
34+
auths id — Manage your identity
35+
auths sign — Sign files and commits
36+
auths verify — Verify signatures"
37+
)]
2038
pub struct AuthCommand {
2139
#[clap(subcommand)]
2240
pub subcommand: AuthSubcommand,

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,27 @@ use std::io;
77

88
/// Generate shell completions for auths.
99
#[derive(Parser, Debug, Clone)]
10-
#[command(name = "completions", about = "Generate shell completions")]
10+
#[command(
11+
name = "completions",
12+
about = "Generate shell completions",
13+
after_help = "Examples:
14+
auths completions bash # Print Bash completions
15+
auths completions zsh # Print Zsh completions
16+
auths completions fish # Print Fish completions
17+
auths completions powershell # Print PowerShell completions
18+
19+
Installation:
20+
Bash: auths completions bash > ~/.local/share/bash-completion/completions/auths
21+
Zsh: auths completions zsh > ~/.zfunc/_auths
22+
Fish: auths completions fish > ~/.config/fish/completions/auths.fish
23+
PowerShell: auths completions powershell > auths.ps1
24+
25+
After installation, restart your shell or source the completion file.
26+
27+
Related:
28+
auths --help — Show all commands
29+
auths <command> -h — Show command help"
30+
)]
1131
pub struct CompletionsCommand {
1232
/// The shell to generate completions for.
1333
#[arg(value_enum)]

0 commit comments

Comments
 (0)