systemprompt_cli/commands/core/
mod.rs1pub mod artifacts;
12pub mod content;
13pub mod contexts;
14pub mod files;
15pub mod hooks;
16pub mod marketplace;
17pub mod plugins;
18pub mod services;
19pub mod skills;
20
21use anyhow::Result;
22use clap::Subcommand;
23
24use crate::context::CommandContext;
25
26#[derive(Debug, Subcommand)]
27pub enum CoreCommands {
28 #[command(subcommand, about = "Artifact inspection and debugging")]
29 Artifacts(artifacts::ArtifactsCommands),
30
31 #[command(subcommand, about = "Content management and analytics")]
32 Content(content::ContentCommands),
33
34 #[command(subcommand, about = "File management and uploads")]
35 Files(files::FilesCommands),
36
37 #[command(subcommand, about = "Context management")]
38 Contexts(contexts::ContextsCommands),
39
40 #[command(subcommand, about = "Skill management and database sync")]
41 Skills(skills::SkillsCommands),
42
43 #[command(subcommand, about = "Plugin management and marketplace generation")]
44 Plugins(plugins::PluginsCommands),
45
46 #[command(subcommand, about = "Marketplace manifest diagnostics")]
47 Marketplace(marketplace::MarketplaceCommands),
48
49 #[command(subcommand, about = "Hook validation and inspection")]
50 Hooks(hooks::HooksCommands),
51
52 #[command(
53 subcommand,
54 about = "Services bundles: validate, pack, sign, publish, refresh, inspect"
55 )]
56 Services(services::ServicesCommands),
57}
58
59pub async fn execute(cmd: CoreCommands, ctx: &CommandContext) -> Result<()> {
60 if ctx.is_database_scoped() && !matches!(cmd, CoreCommands::Content(_) | CoreCommands::Files(_))
61 {
62 return Err(crate::shared::database_scoped_command_error());
63 }
64
65 match cmd {
66 CoreCommands::Artifacts(cmd) => artifacts::execute(cmd, ctx).await,
67 CoreCommands::Content(cmd) => content::execute(cmd, ctx).await,
68 CoreCommands::Files(cmd) => files::execute(cmd, ctx).await,
69 CoreCommands::Contexts(cmd) => contexts::execute(cmd, ctx).await,
70 CoreCommands::Skills(cmd) => skills::execute(cmd, ctx),
71 CoreCommands::Plugins(cmd) => plugins::execute(cmd, ctx),
72 CoreCommands::Marketplace(cmd) => marketplace::execute(cmd, ctx).await,
73 CoreCommands::Hooks(cmd) => hooks::execute(cmd, ctx),
74 CoreCommands::Services(cmd) => Box::pin(services::execute(cmd, ctx)).await,
75 }
76}