systemprompt_cli/commands/core/hooks/
mod.rs1pub mod types;
10
11mod list;
12mod validate;
13
14use anyhow::{Context, Result};
15use clap::Subcommand;
16
17use crate::context::CommandContext;
18use crate::shared::render_result;
19
20#[derive(Debug, Clone, Copy, Subcommand)]
21pub enum HooksCommands {
22 #[command(about = "List hooks across all plugins")]
23 List(list::ListArgs),
24
25 #[command(about = "Validate all hook definitions")]
26 Validate(validate::ValidateArgs),
27}
28
29pub fn execute(command: HooksCommands, ctx: &CommandContext) -> Result<()> {
30 match command {
31 HooksCommands::List(args) => {
32 let result = list::execute(args, &ctx.cli).context("Failed to list hooks")?;
33 render_result(&result, &ctx.cli);
34 Ok(())
35 },
36 HooksCommands::Validate(args) => {
37 let result = validate::execute(args, &ctx.cli).context("Failed to validate hooks")?;
38 render_result(&result, &ctx.cli);
39 Ok(())
40 },
41 }
42}