systemprompt_cli/commands/admin/keys/
mod.rs1mod generate;
2mod issue_plugin_token;
3
4use anyhow::Result;
5use clap::Subcommand;
6
7use crate::shared::render_result;
8
9#[derive(Debug, Subcommand)]
10pub enum KeysCommands {
11 #[command(about = "Generate a fresh RSA-2048 signing keypair")]
12 Generate(generate::GenerateArgs),
13
14 #[command(
15 name = "issue-plugin-token",
16 about = "Mint a long-lived RS256 JWT with `aud=plugin` for hook/governance authentication"
17 )]
18 IssuePluginToken(issue_plugin_token::IssuePluginTokenArgs),
19}
20
21pub async fn execute(cmd: KeysCommands) -> Result<()> {
22 match cmd {
23 KeysCommands::Generate(args) => generate::execute(args),
24 KeysCommands::IssuePluginToken(args) => {
25 let result = issue_plugin_token::execute(args).await?;
26 render_result(&result);
27 Ok(())
28 },
29 }
30}