saya-cli 0.2.0

Database-aware AI agent for the terminal: full-screen TUI, schema discovery, and bounded read-only SQL over PostgreSQL, MySQL, DuckDB, and Snowflake.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::runtime::RuntimeConfig;

pub(crate) fn summary(runtime: &RuntimeConfig) -> String {
    format!(
        "config: {}\nconnections: {}\nprofiles: {}\nselected profile: {}",
        path(&runtime.config_path),
        path(&runtime.connections_path),
        runtime.connections.profiles.len(),
        runtime.resolved.profile_name.as_deref().unwrap_or("none")
    )
}

fn path(value: &Option<std::path::PathBuf>) -> String {
    value
        .as_deref()
        .map(|path| path.display().to_string())
        .unwrap_or_else(|| "not found".into())
}