Skip to main content

systemprompt_cli/commands/web/assets/
mod.rs

1mod asset_type;
2mod list;
3mod show;
4
5use anyhow::{Context, Result};
6use clap::Subcommand;
7
8use crate::CliConfig;
9use crate::shared::render_result;
10
11#[derive(Debug, Subcommand)]
12pub enum AssetsCommands {
13    #[command(about = "List all assets")]
14    List(list::ListArgs),
15
16    #[command(about = "Show asset details")]
17    Show(show::ShowArgs),
18}
19
20pub fn execute(command: AssetsCommands, config: &CliConfig) -> Result<()> {
21    match command {
22        AssetsCommands::List(args) => {
23            let result = list::execute(args, config).context("Failed to list assets")?;
24            render_result(&result);
25            Ok(())
26        },
27        AssetsCommands::Show(args) => {
28            let result = show::execute(&args, config).context("Failed to show asset")?;
29            render_result(&result);
30            Ok(())
31        },
32    }
33}