1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use clap::{Args, Subcommand};
#[derive(Subcommand, Debug)]
pub enum GatewayCommand {
/// Start gateway as a background daemon.
Start,
/// Stop the running gateway.
Stop,
/// Restart the gateway.
Restart,
/// Run gateway in the foreground (for systemd/launchd).
Run(GatewayRunArgs),
/// Show gateway status.
Status,
/// Health check endpoint probe.
Health,
/// Probe gateway connectivity.
Probe,
/// Register as a system service (systemd / launchd).
Install,
/// Remove system service registration.
Uninstall,
/// Call a gateway RPC method.
Call { method: String, args: Vec<String> },
/// Discover gateways on the local network.
Discover,
/// Show gateway usage and cost statistics.
UsageCost,
}
#[derive(Args, Debug, Default)]
pub struct GatewayRunArgs {
/// Port to listen on (overrides config).
#[arg(long)]
pub port: Option<u16>,
/// Bind address (e.g. "0.0.0.0", "loopback", "127.0.0.1").
#[arg(long)]
pub bind: Option<String>,
/// Auth mode (e.g. "token", "password", "none").
#[arg(long)]
pub auth: Option<String>,
/// Bearer token for gateway authentication.
#[arg(long)]
pub token: Option<String>,
/// Password for gateway authentication.
#[arg(long)]
pub password: Option<String>,
/// Force start even if another instance is running.
#[arg(long)]
pub force: bool,
/// Enable verbose logging.
#[arg(long)]
pub verbose: bool,
/// Enable compact log format.
#[arg(long)]
pub compact: bool,
/// Enable WebSocket debug logging.
#[arg(long)]
pub ws_log: bool,
}