tracevault-cli 0.8.0

CLI tool for TraceVault - AI code tracing and attribution
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::api_client::ApiClient;
use crate::credentials::Credentials;

pub async fn logout() -> Result<(), Box<dyn std::error::Error>> {
    let creds = Credentials::load().ok_or("Not logged in. No credentials file found.")?;

    let client = ApiClient::new(&creds.server_url, Some(&creds.token));
    match client.logout().await {
        Ok(()) => {}
        Err(e) => eprintln!("Warning: could not invalidate server session: {e}"),
    }

    Credentials::delete()?;
    println!("Logged out. Credentials removed.");
    Ok(())
}