zeroski 0.0.1

zero.ski CLI — @-protocol dispatch, streaming chat, and trace feed for the Zero runtime
//! `zeroski config` — print the effective configuration. Key is never
//! echoed in full; we print its length and first 4 chars so the user can
//! sanity-check that a value is present without leaking it to logs.

use anyhow::Result;

use crate::config::Config;

pub fn run(cfg: &Config) -> Result<()> {
    println!("base = {}", cfg.base);
    match &cfg.key {
        Some(k) => {
            let prefix: String = k.chars().take(4).collect();
            println!("key  = {prefix}… ({} chars)", k.len());
        }
        None => println!("key  = (unset)"),
    }
    match Config::config_path() {
        Some(p) => println!("config file = {}", p.display()),
        None => println!("config file = (unavailable on this platform)"),
    }
    Ok(())
}