link_assistant_router/cli/deploy_args.rs
1//! `deploy` and `usage` command arguments.
2//!
3//! Split from `cli.rs` to keep that file within the repository's 1000-line
4//! limit.
5
6use clap::Args;
7
8/// What a `router deploy` run should do.
9#[derive(Debug, Args)]
10pub struct DeployArgs {
11 /// SSH destination on which to converge the deployment.
12 ///
13 /// The destination uses OpenSSH's ordinary `user@host`/config-alias
14 /// syntax. Credentials are discovered on that host and are never copied
15 /// from the machine running this command.
16 #[arg(long, value_name = "TARGET")]
17 pub server: Option<String>,
18 /// Report the current state without changing anything.
19 ///
20 /// The question "what is missing?" must be answerable without provisioning
21 /// anything, so this makes no mutating call at all — a property its tests
22 /// assert by comparing the container id and image digest across the run.
23 #[arg(long, conflicts_with = "down")]
24 pub status: bool,
25 /// Remove what this command created, and nothing else.
26 #[arg(long)]
27 pub down: bool,
28 /// Confirm a destructive action, for unattended use.
29 ///
30 /// Removing a deployment leaves its issued tokens and request log behind or
31 /// loses them, so it is confirmed rather than assumed.
32 #[arg(long)]
33 pub yes: bool,
34 /// Published host port.
35 #[arg(long, default_value_t = crate::deploy::DEFAULT_PORT)]
36 pub port: u16,
37 /// Public TLS port exposing inference only.
38 ///
39 /// Management remains on the loopback-only `--port` listener. The remote
40 /// verifier trusts the deployment's generated CA rather than disabling
41 /// certificate validation.
42 #[arg(long, requires = "server")]
43 pub public_port: Option<u16>,
44 /// Image to deploy. Must be a release tag or digest, never a moving ref.
45 ///
46 /// A moving reference lets the CLI and the container disagree about the API
47 /// contract while both look correct, so one is refused with the reason.
48 #[arg(long)]
49 pub image: Option<String>,
50 /// Build the image from this context when it is not present.
51 ///
52 /// With `--server`, this is a path on the target, never a directory copied
53 /// over SSH. Without it, the target builds this Router's pinned release
54 /// tag itself.
55 #[arg(long, value_name = "DIR")]
56 pub build: Option<String>,
57 /// Root holding the deployment's credential and data directories.
58 ///
59 /// Two directories, not one: credentials remain isolated from mutable
60 /// Router data and its request log.
61 #[arg(long, value_name = "DIR")]
62 pub root: Option<String>,
63}
64
65/// Which subscription's remaining limits to report.
66#[derive(Debug, Args)]
67pub struct UsageArgs {
68 /// Public subscription provider name.
69 #[arg(value_enum)]
70 pub provider: Option<crate::subscription_usage::UsageProvider>,
71 /// Emit the stable machine-readable Router response.
72 #[arg(long)]
73 pub json: bool,
74 #[command(flatten)]
75 pub target: super::AuthTarget,
76}