Skip to main content

ssh_cli/commands/
mod.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2// G-CLOSE-04 / G-CLOSE-09: command layer (clap CAMADA 2) — real thin handlers.
3#![forbid(unsafe_code)]
4//! Per-subcommand command layer (rules clap CAMADA 2).
5//!
6//! CLI types live in [`crate::cli`]; this module owns the dispatch entry so
7//! `main` / `lib::run` route through a stable command surface.
8
9use crate::cli::CliArgs;
10use anyhow::Result;
11
12/// Runs the requested subcommand (command-layer entry).
13pub async fn run(args: CliArgs) -> Result<()> {
14    crate::cli::dispatch_impl(args).await
15}
16
17/// Exec-family handlers (domain: [`crate::vps`] exec_ops).
18pub mod exec {
19    pub use crate::vps::{
20        run_exec as run, run_su_exec as run_su, run_sudo_exec as run_sudo, ExecOptions,
21    };
22}
23
24/// VPS inventory handlers.
25pub mod vps {
26    pub use crate::vps::{run_connect as connect, run_vps_command as run};
27}
28
29/// SCP handlers.
30pub mod scp {
31    pub use crate::scp::{run_scp as run, ScpOptions};
32}
33
34/// SFTP handlers (G-SFTP). Present only with the real SSH stack (A6).
35#[cfg(feature = "ssh-real")]
36pub mod sftp {
37    pub use crate::sftp::{run_sftp as run, SftpOptions};
38}
39
40/// Tunnel handler.
41pub mod tunnel {
42    pub use crate::tunnel::run_tunnel as run;
43}
44
45/// Health-check handler.
46pub mod health {
47    pub use crate::vps::run_health_check as run;
48}
49
50/// Secrets handlers.
51pub mod secrets {
52    pub use crate::vps::run_secrets_command as run;
53}
54
55/// Completions generation.
56pub mod completions {
57    pub use crate::cli::generate_completions as run;
58}