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:
2026-03-30 09:19:58 +02:00
parent ad5595e06f
commit 75864eaf3d
2 changed files with 13 additions and 1 deletions

View File

@@ -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!(),
}
}