Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 16 variants Vps { action: VpsAction, }, Connect { name: String, }, Exec { all: bool, hosts: Option<String>, tags: Option<String>, use_active: bool, target: Vec<String>, steps: Vec<String>, json: bool, auth: SshAuthArgs, timeout: Option<u64>, description: Option<String>, }, SudoExec { all: bool, hosts: Option<String>, tags: Option<String>, use_active: bool, target: Vec<String>, steps: Vec<String>, json: bool, auth: SshAuthArgs, sudo_password: Option<String>, sudo_password_stdin: bool, timeout: Option<u64>, description: Option<String>, }, SuExec { all: bool, hosts: Option<String>, tags: Option<String>, use_active: bool, target: Vec<String>, steps: Vec<String>, json: bool, auth: SshAuthArgs, su_password: Option<String>, su_password_stdin: bool, timeout: Option<u64>, description: Option<String>, }, Scp { action: ScpAction, }, Sftp { action: SftpAction, }, Tunnel { vps_name: String, local_port: u16, remote_host: Option<String>, remote_port: Option<u16>, socks5: bool, remote_socket: Option<String>, reverse: bool, timeout_ms: u64, auth: SshAuthArgs, json: bool, bind: IpAddr, i_accept_network_exposure: bool, }, HealthCheck { vps_name: Option<String>, all: bool, hosts: Option<String>, use_active: bool, json: bool, auth: SshAuthArgs, timeout: Option<u64>, }, Secrets { action: SecretsAction, }, Completions { shell: Shell, }, Commands { json: bool, }, Schema { name: Option<String>, json: bool, }, Doctor { json: bool, probe_ssh: bool, hosts: Option<String>, }, Locale { json: bool, action: Option<LocaleAction>, }, Tls { json: bool, action: TlsAction, },
}
Expand description

Top-level subcommands.

Variants§

§

Vps

Manages registered VPS hosts.

Fields

§action: VpsAction

Specific VPS CRUD action.

§

Connect

Sets the active VPS (writes sibling active file in the config directory).

Fields

§name: String

Name of the VPS previously added via vps add.

§

Exec

Runs a command on the VPS over SSH (stdout/stderr captured).

The target is always designated explicitly, in one of three ways: two positionals VPS COMMAND; a selector with one positional (--all/--hosts <LIST>/--tags <LIST> COMMAND); or the active marker under the deliberate opt-in (--use-active COMMAND). A lone positional with no selector is a usage error, never a command aimed at whatever connect last wrote (GAP-SSH-EXEC-ARGC-001).

Extra steps on the same SSH session: --step cmd2 --step cmd3 (G-O3). Exit 127 on the first step aborts the batch, because that code there is the signature of a host name having been read as a command.

Fields

§all: bool

Run on every registered host (bounded concurrency). When set, pass only the shell command as the single positional.

§hosts: Option<String>

Comma-separated host subset (bounded fan-out). Batch JSON even for one name.

§tags: Option<String>

Select hosts that have any of these tags (OR). Batch JSON (G-O2).

§use_active: bool

Run against the host recorded by connect, deliberately (GAP-SSH-EXEC-ARGC-001).

Inheriting the target from on-disk state is ambient authority, so it must be asked for. Without this flag a lone positional is a usage error, never a command aimed at whatever host connect last wrote.

§target: Vec<String>

VPS COMMAND, or COMMAND alone with --all/--hosts/--tags/--use-active.

Kept as a vector rather than two named positional slots on purpose: clap fills positionals by order and cannot know which selector is active, so exec --all uptime would bind uptime to a VPS slot and leave the command empty — silently accepting a shape worse than the one being fixed. The arity rule therefore lives in parse_exec_target, which can see the flags. See GAP-SSH-EXEC-ARGC-001.

§steps: Vec<String>

Additional commands on the same SSH session after the primary (G-O3).

§json: bool

JSON output (from global --json / format; G-AUD-01).

§auth: SshAuthArgs

SSH authentication overrides (password/key/passphrase).

§timeout: Option<u64>

Timeout override in milliseconds.

§description: Option<String>

Shell comment appended for audit trails.

§

SudoExec

Runs a command with sudo (safe sh -c packing).

Same target rules as exec: VPS COMMAND, or one positional with a selector (--all/--hosts/--tags), or --use-active COMMAND. Elevation makes an undesignated target worse, not better, so nothing here is inferred.

Fields

§all: bool

Run on every registered host (bounded concurrency).

§hosts: Option<String>

Comma-separated host subset (bounded fan-out).

§tags: Option<String>

Select hosts by tag (OR). Batch JSON (G-O2).

§use_active: bool

Run against the host recorded by connect, deliberately (GAP-SSH-EXEC-ARGC-001).

Elevation makes ambient authority worse, not better: a misdirected sudo step writes root-owned state on a host the caller never named.

§target: Vec<String>

VPS COMMAND, or COMMAND alone with a selector or --use-active.

See the note on Exec::target for why this stays a vector.

§steps: Vec<String>

Extra commands on the same session (G-O3).

§json: bool

JSON output (from global --json / format; G-AUD-01).

§auth: SshAuthArgs

SSH authentication overrides (password/key/passphrase).

§sudo_password: Option<String>

Sudo password override.

§sudo_password_stdin: bool

Reads the sudo password from stdin.

§timeout: Option<u64>

Timeout override in milliseconds.

§description: Option<String>

Shell comment appended for audit.

§

SuExec

Runs a command with one-shot su - elevation.

Same target rules as exec: VPS COMMAND, or one positional with a selector (--all/--hosts/--tags), or --use-active COMMAND.

Fields

§all: bool

Run on every registered host (bounded concurrency).

§hosts: Option<String>

Comma-separated host subset (bounded fan-out).

§tags: Option<String>

Select hosts by tag (OR). Batch JSON (G-O2).

§use_active: bool

Run against the host recorded by connect, deliberately (GAP-SSH-EXEC-ARGC-001).

Elevation makes ambient authority worse, not better: a misdirected su - step writes root-owned state on a host the caller never named.

§target: Vec<String>

VPS COMMAND, or COMMAND alone with a selector or --use-active.

See the note on Exec::target for why this stays a vector.

§steps: Vec<String>

Extra commands on the same session (G-O3).

§json: bool

JSON output (from global --json / format; G-AUD-01).

§auth: SshAuthArgs

SSH authentication overrides (password/key/passphrase).

§su_password: Option<String>

Su password override.

§su_password_stdin: bool

Reads the su password from stdin.

§timeout: Option<u64>

Timeout override.

§description: Option<String>

Shell comment appended for audit.

§

Scp

SCP file transfer (upload/download).

Fields

§action: ScpAction

Specific SCP action.

§

Sftp

SFTP subsystem transfer and remote filesystem ops (G-SFTP).

Fields

§action: SftpAction

Specific SFTP action.

§

Tunnel

SSH tunnel with mandatory deadline (bounded one-shot).

Contract: one local bind + one SSH session per invocation (G-PAR-30). Multi-host tunnels = N one-shots with distinct --bind/ports. Forward accepts still use JoinSet + Semaphore (--max-concurrency).

Fields

§vps_name: String

VPS name (single host only — no --all / --hosts).

§local_port: u16

Local port to bind — with --reverse, the local port that receives.

§remote_host: Option<String>

Remote host — with --reverse, the address the server binds.

Optional since 0.5.4: --socks5 chooses a destination per connection and --remote-socket names a Unix socket, so neither has one.

§remote_port: Option<u16>

Remote port — with --reverse, the server port (0 = server allocates).

Reverse accepts 0 because the server then reports the port it bound; a local forward cannot, since there is nothing to connect to.

§socks5: bool

Serve a SOCKS5 proxy locally instead of a fixed forward (G-TUN-R02).

§remote_socket: Option<String>

Forward to a Unix domain socket on the remote host (G-TUN-R03).

§reverse: bool

Ask the server to listen and deliver connections back here (G-TUN-R01).

§timeout_ms: u64

Mandatory tunnel timeout in milliseconds.

§auth: SshAuthArgs

SSH authentication overrides (password/key/passphrase).

§json: bool

Agent-first JSON output when the local listener is up (GAP-SSH-IO-008).

§bind: IpAddr

Local bind address (default loopback for security).

G-TUN-R08: validated by clap as an IP address, so a typo like 127.0.0..1 fails at parse time (exit 2) instead of after resolving the host, opening the SSH session and authenticating — which on a host with MFA or slow auth meant paying a full handshake to learn about a typo.

§i_accept_network_exposure: bool

Acknowledge that a non-loopback bind exposes the forwarded service.

G-TUN-R13: required for any routable bind. Without it, --bind 0.0.0.0 silently published the remote service to the local network. Under --reverse it guards the server’s bind address instead, which is the end that is exposed in that direction.

§

HealthCheck

Checks SSH connectivity to a VPS (--all / --hosts / --use-active).

The target must be designated: a name, a selector, or the explicit opt-in. Omitting all three is a usage error rather than a probe against whatever connect last wrote (GAP-SSH-EXEC-ARGC-001).

Fields

§vps_name: Option<String>

VPS name. Required unless a selector or --use-active is present.

§all: bool

Probe every registered host in parallel (bounded concurrency).

§hosts: Option<String>

Comma-separated host subset (bounded fan-out). Batch JSON even for one name.

§use_active: bool

Probe the host recorded by connect, deliberately.

This surface used to inherit the marker with no opt-in, defended as safe because a probe is an idempotent read. The probe is safe; the habit is not. An operator who learns that a target is optional here carries the expectation to exec, where the same shortcut sent a day of work to the wrong machine. The cheap half of the asymmetry is the one to make strict.

§json: bool

JSON output (GAP-SSH-IO-002). Single host: classic object; multi: batch.

§auth: SshAuthArgs

SSH authentication overrides (password/key/passphrase).

§timeout: Option<u64>

SSH timeout override in milliseconds (GAP-SSH-CLI-004).

§

Secrets

Manages the primary key and at-rest secret encryption (one-shot).

Fields

§action: SecretsAction

Secrets action.

§

Completions

Generates shell completions.

Fields

§shell: Shell

Target shell.

§

Commands

Emits the full command tree as JSON (agent discovery / rules mycli commands).

Fields

§json: bool

JSON output (from global --json).

§

Schema

Emits embedded JSON Schema catalog or one schema body (G-E2E-02).

Fields

§name: Option<String>

Schema name (omit to list catalog). Example: vps-list.

§json: bool

JSON catalog envelope when listing (from global --json).

§

Doctor

Root alias for vps doctor (XDG / schema diagnostics; G-E2E-03).

Fields

§json: bool

JSON output (from global --json).

§probe_ssh: bool

Also probe SSH health on registered hosts.

§hosts: Option<String>

Comma-separated host subset for --probe-ssh.

§

Locale

Diagnoses and manages UI language (locale resolution / XDG preference).

Fields

§json: bool

JSON diagnostics (from global --json / format).

§action: Option<LocaleAction>

Optional locale action (default: show status).

§

Tls

TLS stack: provider status, mTLS identities, ACME certs (XDG; rustls only).

Fields

§json: bool

JSON output (from global --json).

§action: TlsAction

TLS action.

Trait Implementations§

Source§

impl Debug for Command

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Command

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Command

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more