hematite-cli 0.10.0

Senior SysAdmin, Network Admin, Data Analyst, and Software Engineer living in your terminal. A high-precision local AI agent harness for LM Studio, Ollama, and other local OpenAI-compatible runtimes that runs 100% on your own silicon. Reads repos, edits files, runs builds, inspects full network state and workstation telemetry, and runs real Python/JS for data analysis.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use lazy_static::lazy_static;
use regex::Regex;

lazy_static! {
    pub static ref ANSI_REGEX: Regex =
        Regex::new(r"[\u001b\u009b][\[()#;?]*([0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]")
            .unwrap();
    pub static ref CRLF_REGEX: Regex = Regex::new(r"(?i)LF will be replaced by CRLF").unwrap();
}

pub fn strip_ansi(text: &str) -> String {
    let s = ANSI_REGEX.replace_all(text, "").to_string();
    CRLF_REGEX.replace_all(&s, "").to_string()
}