lc/cli/
mod.rs

1//! CLI module - organized by domain
2
3use anyhow::Result;
4
5// CLI definitions (structs and enums)
6pub mod definitions;
7
8// Submodules - to be implemented separately
9pub mod aliases;
10pub mod audio;
11pub mod chat;
12pub mod completion;
13pub mod config;
14pub mod embed;
15pub mod image;
16pub mod keys;
17pub mod logging;
18pub mod mcp;
19pub mod models;
20pub mod prompts;
21pub mod providers;
22pub mod proxy;
23pub mod search;
24pub mod sync;
25pub mod templates;
26pub mod usage;
27pub mod utils;
28pub mod vectors;
29pub mod webchatproxy;
30
31// Re-export all CLI types for easy access
32pub use definitions::*;
33
34// Set debug mode - updates the global debug flag used by debug_log! macro
35pub fn set_debug_mode(enabled: bool) {
36    crate::DEBUG_MODE.store(enabled, std::sync::atomic::Ordering::Relaxed);
37}
38
39// Helper function for parsing environment variables
40#[allow(dead_code)]
41pub fn parse_env_var(s: &str) -> Result<(String, String), String> {
42    let parts: Vec<&str> = s.splitn(2, '=').collect();
43    if parts.len() != 2 {
44        return Err(format!(
45            "Invalid environment variable format: '{}'. Expected 'KEY=VALUE'",
46            s
47        ));
48    }
49    Ok((parts[0].to_string(), parts[1].to_string()))
50}