openfunctions-rs 0.1.0

A universal framework for creating and managing LLM tools and agents
Documentation
//! The main entry point for the OpenFunctions command-line interface.

use anyhow::Result;
use clap::Parser;
use openfunctions_rs::cli::Cli;
use openfunctions_rs::core::Config;

#[tokio::main]
async fn main() -> Result<()> {
    // For now, we use a simple logger. A more robust solution like
    // tracing-subscriber should be used in a production application.
    env_logger::init();

    let cli = Cli::parse();
    let config = Config::load(cli.config).await?;

    if let Some(command) = cli.command {
        command.execute(&config).await?;
    } else {
        // If no command is specified, print help by re-running with --help.
        // This is a simple way to show the user all available commands.
        Cli::parse_from(vec!["openfunctions", "--help"]);
    }

    Ok(())
}