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//!
7//! Copyright (c) systemprompt.io — Business Source License 1.1.
8//! See <https://systemprompt.io> for licensing details.
9
10pub mod list;
11pub mod show;
12pub mod types;
13
14use crate::context::CommandContext;
15use crate::shared::render_result;
16use anyhow::Result;
17use clap::Subcommand;
18
19pub use types::*;
20
21#[derive(Debug, Subcommand)]
22pub enum ArtifactsCommands {
23    #[command(about = "List artifacts")]
24    List(list::ListArgs),
25
26    #[command(about = "Show artifact details and content")]
27    Show(show::ShowArgs),
28}
29
30pub async fn execute(cmd: ArtifactsCommands, ctx: &CommandContext) -> Result<()> {
31    match cmd {
32        ArtifactsCommands::List(args) => {
33            let result = list::execute(args, ctx).await?;
34            render_result(&result, &ctx.cli);
35        },
36        ArtifactsCommands::Show(args) => {
37            let result = show::execute(args, ctx).await?;
38            render_result(&result, &ctx.cli);
39        },
40    }
41    Ok(())
42}