Skip to main content

wekan_cli/
cli.rs

1use clap::Parser;
2
3use crate::{commands::RootCommand, output::OutputFormat};
4
5#[derive(Debug, Parser)]
6#[command(
7    name = "wekan",
8    version,
9    about = "Agent-first, human-friendly command-line client for Wekan",
10    arg_required_else_help = true,
11    after_help = "Examples:\n  wekan profile add local http://localhost:3000 --use\n  wekan auth login --username alice\n  wekan --output json board list\n  wekan card get card-id --board board-id --list list-id"
12)]
13pub struct Cli {
14    /// Wekan server base URL. Initializes or verifies a profile; public system/preflight probes and local-only logout also accept a missing profile.
15    /// Not accepted by profile-management commands.
16    #[arg(long, global = true, help_heading = "Global options")]
17    pub server: Option<String>,
18
19    /// Named local server profile. Overrides environment and active selection.
20    /// Not accepted by profile-management commands.
21    #[arg(
22        long = "profile",
23        global = true, help_heading = "Global options",
24        value_parser = crate::config::profiles::parse_profile_name
25    )]
26    pub profile_name: Option<String>,
27
28    /// Output format.
29    #[arg(long, global = true, help_heading = "Global options", value_enum, default_value_t = OutputFormat::Human)]
30    pub output: OutputFormat,
31
32    /// Permit plaintext HTTP for a non-loopback server.
33    #[arg(long, global = true, help_heading = "Global options")]
34    pub allow_insecure_http: bool,
35
36    #[command(subcommand)]
37    pub command: RootCommand,
38}