Skip to main content

Crate ssh_cli

Crate ssh_cli 

Source
Expand description

§ssh-cli

Full-stack Rust CLI that gives an LLM (Claude Code, Cursor, Windsurf) the ability to operate remote servers over SSH in a subprocess flow via stdin/stdout.

§Modules

ModuleResponsibility
cliClap derive argument definitions and dispatcher
vpsCRUD and persistence of VPS records (XDG + TOML + 0o600)
secretsPrimary key and default at-rest encryption (ChaCha20-Poly1305)
sshReal one-shot SSH client via russh (password/key, TOFU)
i18nInternationalization with bilingual Message enum
localeOS locale detection and resolution
platformPlatform adjustments (Windows UTF-8, TTY detection)
maskingUnicode-safe masking of sensitive values
errorsStructured error types via thiserror
outputSole module authorized for println! (CRUD formatting)
pathsPath validation and normalization (anti-traversal, NFC)
signalsCtrl+C handler with cancellation flag via AtomicBool
terminalTTY detection and color choice via termcolor

§Entry point

The public run function is the entry point called by main.rs.

Modules§

cli
CLI argument definitions via clap derive and dispatcher.
errors
Structured error types for ssh-cli.
erros
Legacy Portuguese module path for errors (GAP-AUD-017).
i18n
ssh-cli internationalization system.
locale
Cross-platform language detection and resolution.
masking
Masking of sensitive values (passwords, tokens) — agent-safe.
output
Only module allowed to emit stdout for VPS CRUD.
paths
File path validation and normalization.
platform
Operating-system conditional abstractions.
scp
File transfer via SCP over SSH (one-shot).
secrets
At-rest encryption of secrets in config.toml (GAP-009 / R-SECRETS-DEFAULT).
signals
Operating system signal handling.
ssh
SSH engine via russh 0.62.x.
terminal
Colored output configuration and interactive terminal detection.
tunnel
SSH tunnel (local port-forward) with mandatory deadline (bounded one-shot).
vps
VPS record CRUD and persistence (XDG + atomic TOML + flock).

Functions§

run
Runs ssh-cli from the command-line arguments.