zeroski 0.0.1

zero.ski CLI — @-protocol dispatch, streaming chat, and trace feed for the Zero runtime
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `zeroski me` — GET /api/me. Prints the server's identity response as
//! pretty JSON. No interpretation — this is the thinnest possible wrapper
//! so "what does the server think I am right now" is always one command.

use anyhow::Result;
use serde_json::Value;

use crate::api::Client;
use crate::config::Config;

pub async fn run(cfg: &Config) -> Result<()> {
    let client = Client::new(cfg)?;
    let resp: Value = client.get_json("/api/me").await?;
    println!("{}", serde_json::to_string_pretty(&resp)?);
    Ok(())
}