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