use anyhow::Result;
use clap::{Parser, Subcommand};
mod audio;
mod client;
mod commands;
mod config;
mod progress;
mod style;
const VERSION: &str = concat!(
env!("CARGO_PKG_VERSION"),
"\n",
env!("CARGO_PKG_NAME"),
" — ",
env!("CARGO_PKG_DESCRIPTION"),
"\n",
env!("CARGO_PKG_REPOSITORY"),
);
#[derive(Parser)]
#[command(
name = "wk",
version = VERSION,
about = "Command-line client for the WaveKat platform",
long_about = "Command-line client for the WaveKat platform.\n\n\
Run `wk login` to authenticate. Credentials are stored under your platform \
config dir (e.g. ~/.config/wavekat/auth.json on Linux/macOS).\n\n\
Run `wk update` to upgrade in place, or `wk agents` for the AI-agent \
integration guide (also at https://github.com/wavekat/wavekat-cli/blob/main/AGENTS.md)."
)]
struct Cli {
#[command(subcommand)]
command: Command,
}
#[derive(Subcommand)]
enum Command {
Login(commands::login::Args),
Logout,
Me,
Projects {
#[command(subcommand)]
command: commands::projects::Cmd,
},
Annotations {
#[command(subcommand)]
command: commands::annotations::Cmd,
},
Exports {
#[command(subcommand)]
command: commands::exports::Cmd,
},
Models {
#[command(subcommand)]
command: commands::models::Cmd,
},
Files {
#[command(subcommand)]
command: commands::files::Cmd,
},
Version(commands::version::Args),
Update(commands::update::Args),
Agents,
}
#[tokio::main]
async fn main() -> Result<()> {
let cli = Cli::parse();
match cli.command {
Command::Login(args) => commands::login::run(args).await,
Command::Logout => commands::logout::run().await,
Command::Me => commands::me::run().await,
Command::Projects { command } => commands::projects::run(command).await,
Command::Annotations { command } => commands::annotations::run(command).await,
Command::Exports { command } => commands::exports::run(command).await,
Command::Models { command } => commands::models::run(command).await,
Command::Files { command } => commands::files::run(command).await,
Command::Version(args) => commands::version::run(args).await,
Command::Update(args) => commands::update::run(args).await,
Command::Agents => commands::agents::run().await,
}
}