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
| Module | Responsibility |
|---|---|
cli | Clap derive argument definitions and dispatcher |
vps | CRUD and persistence of VPS records (XDG + TOML + 0o600) |
secrets | Primary key and default at-rest encryption (ChaCha20-Poly1305) |
ssh | Real one-shot SSH client via russh (password/key, TOFU) |
i18n | Internationalization with bilingual Message enum |
locale | OS locale detection and resolution |
platform | Platform adjustments (Windows UTF-8, TTY detection) |
masking | Unicode-safe masking of sensitive values |
errors | Structured error types via thiserror |
output | Sole module authorized for println! (CRUD formatting) |
paths | Path validation and normalization (anti-traversal, NFC) |
signals | Ctrl+C handler with cancellation flag via AtomicBool |
terminal | TTY 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
clapderive 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
russh0.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.