openfunctions-rs 0.1.0

A universal framework for creating and managing LLM tools and agents
Documentation
//! The `check` command for verifying the environment and dependencies.

use crate::core::{Checker, Config};
use anyhow::Result;
use clap::Args;

/// A command for checking the environment and dependencies.
#[derive(Args, Debug)]
pub struct CheckCommand {
    /// The specific target to check (a tool or agent name).
    /// If not provided, the entire environment will be checked.
    pub target: Option<String>,
}

impl CheckCommand {
    /// Executes the `check` command.
    pub async fn execute(&self, config: &Config) -> Result<()> {
        let checker = Checker::new(config);
        if let Some(target) = &self.target {
            checker.check_target(target).await?;
        } else {
            checker.check_all().await?;
        }
        Ok(())
    }
}