Skip to main content

Command

Enum Command 

Source
pub enum Command {
    Vps {
        action: VpsAction,
    },
    Connect {
        name: String,
    },
    Exec {
        vps_name: String,
        command: String,
        json: bool,
        password: Option<String>,
        password_stdin: bool,
        key: Option<String>,
        key_passphrase: Option<String>,
        key_passphrase_stdin: bool,
        timeout: Option<u64>,
        description: Option<String>,
    },
    SudoExec {
        vps_name: String,
        command: String,
        json: bool,
        password: Option<String>,
        password_stdin: bool,
        sudo_password: Option<String>,
        sudo_password_stdin: bool,
        key: Option<String>,
        key_passphrase: Option<String>,
        key_passphrase_stdin: bool,
        timeout: Option<u64>,
        description: Option<String>,
    },
    SuExec {
        vps_name: String,
        command: String,
        json: bool,
        password: Option<String>,
        password_stdin: bool,
        su_password: Option<String>,
        su_password_stdin: bool,
        key: Option<String>,
        key_passphrase: Option<String>,
        key_passphrase_stdin: bool,
        timeout: Option<u64>,
        description: Option<String>,
    },
    Scp {
        action: ScpAction,
    },
    Tunnel {
        vps_name: String,
        local_port: u16,
        remote_host: String,
        remote_port: u16,
        timeout_ms: u64,
        password: Option<String>,
        password_stdin: bool,
        key: Option<String>,
        key_passphrase: Option<String>,
        key_passphrase_stdin: bool,
        json: bool,
        bind: String,
    },
    HealthCheck {
        vps_name: Option<String>,
        json: bool,
        password: Option<String>,
        password_stdin: bool,
        key: Option<String>,
        key_passphrase: Option<String>,
        key_passphrase_stdin: bool,
        timeout: Option<u64>,
    },
    Secrets {
        action: SecretsAction,
    },
    Completions {
        shell: Shell,
    },
}
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).

Fields

§vps_name: String

VPS name.

§command: String

Shell command to run.

§json: bool

JSON output.

§password: Option<String>

SSH password override.

§password_stdin: bool

Reads the SSH password from stdin.

§key: Option<String>

Private key path override.

§key_passphrase: Option<String>

Key passphrase (runtime).

§key_passphrase_stdin: bool

Reads the key passphrase from stdin.

§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).

Fields

§vps_name: String

VPS name.

§command: String

Shell command.

§json: bool

JSON output.

§password: Option<String>

SSH password override.

§password_stdin: bool

Reads the SSH password from stdin.

§sudo_password: Option<String>

Sudo password override.

§sudo_password_stdin: bool

Reads the sudo password from stdin.

§key: Option<String>

Key path override.

§key_passphrase: Option<String>

Key passphrase (runtime).

§key_passphrase_stdin: bool

Reads the key passphrase 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.

Fields

§vps_name: String

VPS name.

§command: String

Shell command.

§json: bool

JSON output.

§password: Option<String>

SSH password override.

§password_stdin: bool

Reads the SSH password from stdin (GAP-SSH-CLI-001).

§su_password: Option<String>

Su password override.

§su_password_stdin: bool

Reads the su password from stdin.

§key: Option<String>

Key path override.

§key_passphrase: Option<String>

Key passphrase (runtime).

§key_passphrase_stdin: bool

Reads the key passphrase 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.

§

Tunnel

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

Fields

§vps_name: String

VPS name.

§local_port: u16

Local port.

§remote_host: String

Remote host.

§remote_port: u16

Remote port.

§timeout_ms: u64

Mandatory tunnel timeout in milliseconds.

§password: Option<String>

SSH password override.

§password_stdin: bool

Reads the SSH password from stdin (GAP-SSH-CLI-005).

§key: Option<String>

Private key path override.

§key_passphrase: Option<String>

Key passphrase.

§key_passphrase_stdin: bool

Reads the key passphrase from stdin (GAP-SSH-CLI-005).

§json: bool

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

§bind: String

Local bind address (default 127.0.0.1 loopback for security).

§

HealthCheck

Checks SSH connectivity to a VPS.

Fields

§vps_name: Option<String>

VPS name (uses active if omitted).

§json: bool

JSON output (GAP-SSH-IO-002).

§password: Option<String>

SSH password override.

§password_stdin: bool

Reads the SSH password from stdin (GAP-SSH-CLI-006).

§key: Option<String>

Private key path override (GAP-SSH-CLI-006).

§key_passphrase: Option<String>

Key passphrase.

§key_passphrase_stdin: bool

Reads the key passphrase from stdin (GAP-SSH-CLI-006).

§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.

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