Skip to main content

systemprompt_cli/commands/web/assets/
mod.rs

1//! Read-only inspection of web assets (CSS, fonts, images, favicons).
2//!
3//! Dispatches the `web assets` subcommands ([`AssetsCommands`]) to list the
4//! asset inventory or show details for a single asset.
5//!
6//! Copyright (c) systemprompt.io — Business Source License 1.1.
7//! See <https://systemprompt.io> for licensing details.
8
9pub mod asset_type;
10pub mod list;
11mod show;
12
13use anyhow::{Context, Result};
14use clap::Subcommand;
15
16use crate::CliConfig;
17use crate::shared::render_result;
18
19#[derive(Debug, Subcommand)]
20pub enum AssetsCommands {
21    #[command(about = "List all assets")]
22    List(list::ListArgs),
23
24    #[command(about = "Show asset details")]
25    Show(show::ShowArgs),
26}
27
28pub fn execute(command: AssetsCommands, config: &CliConfig) -> Result<()> {
29    match command {
30        AssetsCommands::List(args) => {
31            let result = list::execute(args, config).context("Failed to list assets")?;
32            render_result(&result, config);
33            Ok(())
34        },
35        AssetsCommands::Show(args) => {
36            let result = show::execute(&args, config).context("Failed to show asset")?;
37            render_result(&result, config);
38            Ok(())
39        },
40    }
41}