oxibrain-cli 0.2.0

Command-line interface and MCP server for oxibrain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use oxibrain::{Brain, BrainConfig};
use std::path::{Path, PathBuf};

pub async fn run(dir: &Path, out: Option<PathBuf>) -> anyhow::Result<()> {
    let brain = Brain::open(BrainConfig::at(dir)).await?;
    let jsonl = brain.export_jsonl().await?;
    match out {
        Some(path) => {
            std::fs::write(&path, jsonl.as_bytes())?;
            println!("wrote {} bytes to {}", jsonl.len(), path.display());
        }
        None => {
            println!("{jsonl}");
        }
    }
    Ok(())
}