colony ssh: SSH into colony-vm from the CLI, no bash scripts
- colony ssh — runs gcloud compute ssh under the hood - Removed scripts/ssh-vm.sh (bash scripts bad, Rust CLI good) - CLAUDE.md: "Avoid bash scripts — put commands in the Rust CLI instead" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,8 @@ enum Commands {
|
||||
#[arg(long)]
|
||||
quiet: bool,
|
||||
},
|
||||
/// SSH into colony-vm
|
||||
Ssh,
|
||||
/// Initialize .colony.toml
|
||||
Init {
|
||||
#[arg(long)]
|
||||
@@ -87,6 +89,15 @@ async fn main() {
|
||||
let cli = Cli::parse();
|
||||
|
||||
match cli.command {
|
||||
Commands::Ssh => {
|
||||
let status = std::process::Command::new("gcloud")
|
||||
.args(["compute", "ssh", "colony-vm", "--zone=europe-west1-b", "--project=apes-platform"])
|
||||
.status();
|
||||
match status {
|
||||
Ok(s) => std::process::exit(s.code().unwrap_or(1)),
|
||||
Err(e) => { eprintln!("failed to run gcloud: {}", e); std::process::exit(1); }
|
||||
}
|
||||
}
|
||||
Commands::Init { api_url, user, token } => {
|
||||
let config = Config {
|
||||
api_url,
|
||||
@@ -224,6 +235,7 @@ async fn run_command(cmd: Commands, client: &ColonyClient) {
|
||||
}
|
||||
}
|
||||
|
||||
Commands::Ssh => unreachable!(),
|
||||
Commands::Init { .. } => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user