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:
@@ -29,7 +29,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|||||||
- **GCP project is `apes-platform`.** Always pass `--project=apes-platform`.
|
- **GCP project is `apes-platform`.** Always pass `--project=apes-platform`.
|
||||||
- **Region is `europe-west1`.** Zone `europe-west1-b` unless there's a reason to change.
|
- **Region is `europe-west1`.** Zone `europe-west1-b` unless there's a reason to change.
|
||||||
- **No split brains.** If two pieces of code represent the same thing, one must derive from the other. DB models and API types are separate Rust layers, but API types are the single source for the wire format. TypeScript types are generated from API types via `ts-rs`. SQL migrations are canonical for the DB. Never hand-write a type that can be derived.
|
- **No split brains.** If two pieces of code represent the same thing, one must derive from the other. DB models and API types are separate Rust layers, but API types are the single source for the wire format. TypeScript types are generated from API types via `ts-rs`. SQL migrations are canonical for the DB. Never hand-write a type that can be derived.
|
||||||
- **Rust first.** Backend code is Rust. Type safety everywhere. If it compiles, it should work.
|
- **Rust first.** Backend code is Rust. Type safety everywhere. If it compiles, it should work. Avoid bash scripts — put commands in the Rust CLI instead.
|
||||||
- **Always push.** After committing, push to origin immediately. Never ask the ape "should I push?" — just do it. Handle auth, firewall, DNS issues yourself.
|
- **Always push.** After committing, push to origin immediately. Never ask the ape "should I push?" — just do it. Handle auth, firewall, DNS issues yourself.
|
||||||
- **Document decisions.** When discussing architecture, features, or design with apes, write the spec to `docs/` as a markdown file. Conversations are ephemeral, docs persist.
|
- **Document decisions.** When discussing architecture, features, or design with apes, write the spec to `docs/` as a markdown file. Conversations are ephemeral, docs persist.
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ enum Commands {
|
|||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
quiet: bool,
|
quiet: bool,
|
||||||
},
|
},
|
||||||
|
/// SSH into colony-vm
|
||||||
|
Ssh,
|
||||||
/// Initialize .colony.toml
|
/// Initialize .colony.toml
|
||||||
Init {
|
Init {
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
@@ -87,6 +89,15 @@ async fn main() {
|
|||||||
let cli = Cli::parse();
|
let cli = Cli::parse();
|
||||||
|
|
||||||
match cli.command {
|
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 } => {
|
Commands::Init { api_url, user, token } => {
|
||||||
let config = Config {
|
let config = Config {
|
||||||
api_url,
|
api_url,
|
||||||
@@ -224,6 +235,7 @@ async fn run_command(cmd: Commands, client: &ColonyClient) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Commands::Ssh => unreachable!(),
|
||||||
Commands::Init { .. } => unreachable!(),
|
Commands::Init { .. } => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user