pub struct CliArgs {Show 27 fields
pub lang: Option<String>,
pub verbose: u8,
pub quiet: bool,
pub config_dir: Option<PathBuf>,
pub no_color: bool,
pub output_format: Option<OutputFormat>,
pub json: bool,
pub select: Vec<String>,
pub filter: Vec<String>,
pub limit: Option<usize>,
pub sort: Option<String>,
pub dedupe_by: Option<String>,
pub count_only: bool,
pub truncate_content: Option<usize>,
pub max_output_bytes: Option<usize>,
pub no_input: bool,
pub dry_run: bool,
pub disable_sudo: bool,
pub replace_host_key: bool,
pub allow_plaintext_secrets: bool,
pub secrets_key_file: Option<PathBuf>,
pub use_keyring: bool,
pub timeout: Option<u64>,
pub max_concurrency: Option<u16>,
pub fail_fast: bool,
pub scp_file_concurrency: Option<u16>,
pub command: Command,
}Expand description
Global ssh-cli arguments.
Fields§
§lang: Option<String>Forces the CLI language (BCP47; must negotiate to en or pt-BR).
Examples: en, en-US, pt-BR, pt. Invalid tags fail clap validation.
verbose: u8Increases log verbosity on stderr (-v info, -vv debug, -vvv trace).
Always scoped to this crate (G2/G14): never a bare global debug/trace
that would enable russh::client::encrypted password dumps.
quiet: boolSuppresses non-JSON output (quiet mode).
config_dir: Option<PathBuf>Configuration directory override (useful for tests).
no_color: boolDisables colored output.
output_format: Option<OutputFormat>Global output format (text, json). If omitted: JSON when stdout is not a TTY.
json: boolForce JSON on stdout (agent; alias of --output-format json; G-AUD-01).
Global — appears before or after subcommands. Subcommand fields use
from_global so there is a single --json long name (clap uniqueness).
select: Vec<String>Keep only these dotted paths in each record (CSV; alias --fields).
Agent-native shaping: applied before serialization, so the full envelope is
never built. Without it an agent must pipe through jaq, by which point the
oversized payload has already been written and the tokens already spent.
filter: Vec<String>Keep records matching key=value, key!=value or key~substring (repeatable, AND).
A malformed predicate is rejected at parse time rather than silently matching nothing — a typo must not be indistinguishable from an empty result.
limit: Option<usize>Emit at most N records (distinct from per-command query limits).
sort: Option<String>Sort records ascending by dotted path (numbers compare numerically).
dedupe_by: Option<String>Drop later records repeating this dotted path’s value.
count_only: boolReplace the record collection with {"count": N}, counted after all filtering.
truncate_content: Option<usize>Shorten strings longer than N characters (never bytes; UTF-8 stays valid).
max_output_bytes: Option<usize>Cap envelope size by dropping trailing records (never by slicing the JSON text).
no_input: boolRefuse to read stdin; fail fast instead of blocking on an absent human.
dry_run: boolPrint the plan for a destructive operation and exit without executing it.
Accepted only by commands that implement it (see
supports_dry_run); anywhere else it is rejected with exit 64 rather
than accepted and ignored. A global flag that silently does nothing on
half the surface is worse than no flag at all — that is exactly how
--no-input shipped broken on vps add.
disable_sudo: boolDisables sudo-exec/su-exec for this invocation (alias –disableSudo).
replace_host_key: boolReplaces a diverging host key in TOFU known_hosts.
allow_plaintext_secrets: boolAllow plaintext secrets at rest (no auto secrets.key). Prefer for tests only.
secrets_key_file: Option<PathBuf>Path to a 64-hex primary-key file (overrides XDG secrets.key for this one-shot).
use_keyring: boolPrefer OS keyring for the primary key (CLI flag only; no product env store).
timeout: Option<u64>Global default timeout in milliseconds for SSH ops (exec/scp/health-check).
Local --timeout on a subcommand wins. Tunnel still requires --timeout-ms.
max_concurrency: Option<u16>Cap concurrent multi-host SSH sessions / tunnel forwards (1..=MAX_CONCURRENCY).
Default: auto from CPUs × I/O oversubscribe vs free RAM (see concurrency).
Applies to --all fan-out and tunnel accepts (no env store; G-UNSAFE-14).
fail_fast: boolStop admitting new multi-host units after the first failure (G-O1).
Default: continue all hosts (agent-friendly partial success). In-flight units still finish; never-started hosts are omitted from batch results unless callers pad skipped rows.
scp_file_concurrency: Option<u16>Max concurrent SCP file transfers on one SSH session (G-O4).
Default: 1 (serial multi-file, session reuse). Values >1 open parallel SCP channels on the same session (bounded). Env: not used; CLI only.
command: CommandSubcommand to run.
Trait Implementations§
Source§impl Args for CliArgs
impl Args for CliArgs
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for CliArgs
impl CommandFactory for CliArgs
Source§impl FromArgMatches for CliArgs
impl FromArgMatches for CliArgs
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.