aboutsummaryrefslogtreecommitdiff
path: root/src/cli/spec/machine.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-06 02:27:06 +0300
committerGitHub <noreply@github.com>2026-09-06 02:27:06 +0300
commit9e9bc8a144667a6b7debfd4f0c7a31ff0e11493a (patch)
tree03f1259f91fd9edeacfd4b904f2e84d4acf25232 /src/cli/spec/machine.rs
parent35b0dff96579f099e0436290085024424ffb289c (diff)
feat: manage multiple ssh machines from one client (#3670)
Diffstat (limited to 'src/cli/spec/machine.rs')
-rw-r--r--src/cli/spec/machine.rs49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/cli/spec/machine.rs b/src/cli/spec/machine.rs
new file mode 100644
index 00000000..188e27b9
--- /dev/null
+++ b/src/cli/spec/machine.rs
@@ -0,0 +1,49 @@
+use clap::{Arg, Command};
+
+use super::{json_flag, option};
+
+pub(super) fn command() -> Command {
+ Command::new("machine")
+ .about("Manage saved SSH machines")
+ .subcommand(
+ Command::new("list")
+ .about("List saved SSH machines")
+ .arg(json_flag()),
+ )
+ .subcommand(
+ Command::new("add")
+ .about("Prepare the remote Herdr server and save an SSH machine")
+ .arg(
+ Arg::new("ssh-target")
+ .value_name("SSH_TARGET")
+ .required(true),
+ )
+ .arg(
+ option("label", "LABEL")
+ .required(true)
+ .help("Set the machine label shown in the sidebar"),
+ )
+ .arg(
+ option("remote-session", "NAME")
+ .help("Set the explicit Herdr session on the remote machine"),
+ ),
+ )
+ .subcommand(
+ profile_command("rename", "Rename a saved SSH machine").arg(
+ option("label", "LABEL")
+ .required(true)
+ .help("Set the machine label shown in the sidebar"),
+ ),
+ )
+ .subcommand(profile_command("remove", "Remove a saved SSH machine"))
+ .subcommand(profile_command("enable", "Enable a saved SSH machine"))
+ .subcommand(profile_command("disable", "Disable a saved SSH machine"))
+}
+
+fn profile_command(name: &'static str, about: &'static str) -> Command {
+ Command::new(name).about(about).arg(
+ Arg::new("profile-id")
+ .value_name("PROFILE_ID")
+ .required(true),
+ )
+}