asimov-cli 25.4.0

ASIMOV Command-Line Interface (CLI)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// This is free and unencumbered software released into the public domain.

use crate::{BoxError, StandardOptions};

pub async fn models(format: Option<String>, _flags: &StandardOptions) -> Result<(), BoxError> {
    match format.as_deref() {
        Some("csv") => println!("id,label\nopenrouter/free,Free"),
        Some("json") => println!("{}", r#"{ "@id": "openrouter/free", "label": "Free" }"#),
        Some("list") | None => println!("openrouter/free"),
        Some("md") => println!("| ID | Label |\n| :- | :---- |\n| openrouter/free | Free |"),
        Some("tsv") => println!("id\tlabel\nopenrouter/free\tFree"),
        Some(_) => {}, // TODO
    }
    Ok(())
}