systemprompt_cli/commands/admin/bridge/
mod.rs1mod enroll_cert;
2mod issue_code;
3mod list;
4mod rotate_signing_key;
5mod types;
6
7use crate::CliConfig;
8use crate::shared::render_result;
9use anyhow::Result;
10use clap::Subcommand;
11
12#[derive(Debug, Subcommand)]
13pub enum BridgeCommands {
14 #[command(about = "Enroll a device certificate fingerprint for a user")]
15 EnrollCert(enroll_cert::EnrollCertArgs),
16
17 #[command(about = "Issue a one-shot session exchange code for the bridge helper")]
18 IssueCode(issue_code::IssueCodeArgs),
19
20 #[command(about = "List active bridge sessions (recent heartbeats)")]
21 List(list::ListArgs),
22
23 #[command(
24 about = "Generate a fresh ed25519 manifest signing seed and persist it to the secrets file"
25 )]
26 RotateSigningKey(rotate_signing_key::RotateSigningKeyArgs),
27}
28
29pub async fn execute(cmd: BridgeCommands, config: &CliConfig) -> Result<()> {
30 match cmd {
31 BridgeCommands::EnrollCert(args) => {
32 let result = enroll_cert::execute(args, config).await?;
33 render_result(&result);
34 Ok(())
35 },
36 BridgeCommands::IssueCode(args) => {
37 let result = issue_code::execute(args, config).await?;
38 render_result(&result);
39 Ok(())
40 },
41 BridgeCommands::List(args) => {
42 let result = list::execute(args, config).await?;
43 render_result(&result);
44 Ok(())
45 },
46 BridgeCommands::RotateSigningKey(args) => {
47 let result = rotate_signing_key::execute(args, config)?;
48 render_result(&result);
49 Ok(())
50 },
51 }
52}