rust_llm_cli 2.1.1

Generators for rust_llm in Loco + Inertia + React apps: install, chat_ui, tool, agent, schema, provider, upgrade.
Documentation
//! `config/initializers/ruby_llm.rb`: configures RustLLM when the app boots. Generated by
//! `rust-llm generate install`. Provider keys such as `ANTHROPIC_API_KEY` are also read from the
//! environment automatically; set anything else here.

use loco_rs::prelude::*;

pub struct RustLlm;

#[async_trait]
impl Initializer for RustLlm {
    fn name(&self) -> String {
        "rust_llm".to_string()
    }

    async fn before_run(&self, _ctx: &AppContext) -> Result<()> {
        rust_llm::configure(|config| {
            if let Ok(key) = std::env::var("OPENAI_API_KEY") {
                config.openai_api_key(key);
            }
            // config.default_model = "gpt-5-nano".to_string();
        });
        Ok(())
    }
}