actr_cli/commands/
deps.rs1use anyhow::Result;
8use async_trait::async_trait;
9use clap::{Args, Subcommand};
10
11use super::install::InstallCommand;
12use crate::core::{Command, CommandContext, CommandResult, ComponentType};
13
14#[derive(Args, Debug)]
15pub struct DepsArgs {
16 #[command(subcommand)]
17 pub command: DepsCommand,
18}
19
20#[derive(Subcommand, Debug)]
21pub enum DepsCommand {
22 Install(InstallCommand),
24}
25
26#[async_trait]
27impl Command for DepsArgs {
28 async fn execute(&self, ctx: &CommandContext) -> Result<CommandResult> {
29 match &self.command {
30 DepsCommand::Install(cmd) => {
31 let command = InstallCommand::from_args(cmd);
32 {
33 let container = ctx.container.lock().unwrap();
34 container.validate(&command.required_components())?;
35 }
36 command.execute(ctx).await
37 }
38 }
39 }
40
41 fn required_components(&self) -> Vec<ComponentType> {
42 match &self.command {
43 DepsCommand::Install(cmd) => cmd.required_components(),
44 }
45 }
46
47 fn name(&self) -> &str {
48 "deps"
49 }
50
51 fn description(&self) -> &str {
52 "Manage local service dependencies"
53 }
54}