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)]
12pub struct Cli {
13    /// Wekan server base URL. Initializes or verifies the selected profile, or identifies an orphaned credential for local-only logout.
14    #[arg(long, global = true)]
15    pub server: Option<String>,
16
17    /// Named local server profile. Overrides environment and active selection.
18    #[arg(
19        long = "profile",
20        global = true,
21        value_parser = crate::config::profiles::parse_profile_name
22    )]
23    pub profile_name: Option<String>,
24
25    /// Output format.
26    #[arg(long, global = true, value_enum, default_value_t = OutputFormat::Human)]
27    pub output: OutputFormat,
28
29    /// Permit plaintext HTTP for a non-loopback server.
30    #[arg(long, global = true)]
31    pub allow_insecure_http: bool,
32
33    #[command(subcommand)]
34    pub command: RootCommand,
35}