Skip to main content

systemprompt_cli/commands/core/artifacts/
mod.rs

1//! `core artifacts` command group: inspect A2A task artifacts.
2//!
3//! Dispatches the [`ArtifactsCommands`] subcommands (list, show) against the
4//! invocation's [`CommandContext`], rendering each command's `CommandOutput`
5//! to the configured output sink.
6
7mod list;
8mod show;
9mod types;
10
11use crate::context::CommandContext;
12use crate::shared::render_result;
13use anyhow::Result;
14use clap::Subcommand;
15
16pub use types::*;
17
18#[derive(Debug, Subcommand)]
19pub enum ArtifactsCommands {
20    #[command(about = "List artifacts")]
21    List(list::ListArgs),
22
23    #[command(about = "Show artifact details and content")]
24    Show(show::ShowArgs),
25}
26
27pub async fn execute(cmd: ArtifactsCommands, ctx: &CommandContext) -> Result<()> {
28    match cmd {
29        ArtifactsCommands::List(args) => {
30            let result = list::execute(args, ctx).await?;
31            render_result(&result, &ctx.cli);
32        },
33        ArtifactsCommands::Show(args) => {
34            let result = show::execute(args, ctx).await?;
35            render_result(&result, &ctx.cli);
36        },
37    }
38    Ok(())
39}