ref:5f5100f6f4c93ff015473b9f49e07b79901d4e15

fix: update runner admin commands to use slug-based routes

Runner list and token commands now use org slugs and org/repo format instead of UUIDs, matching the updated server routes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SHA: 5f5100f6f4c93ff015473b9f49e07b79901d4e15
Author: Cole Christensen <cole.christensen@macmillan.com>
Date: 2026-03-11 03:23
Parents: 6f41f8e
1 files changed +20 -8
Type
src/commands/runner.rs +20 −8
@@ -70,10 +70,10 @@
// === Admin commands (use PAT auth) ===
/// List runners for an org or repo
List {
/// Organization ID
/// Organization slug
#[arg(long)]
org: Option<String>,
/// Repository ID
/// Repository (org/repo)
#[arg(long)]
repo: Option<String>,
},
@@ -100,10 +100,10 @@
},
/// Generate a registration token
Token {
/// Organization ID (mutually exclusive with --repo)
/// Organization slug (mutually exclusive with --repo)
#[arg(long)]
org: Option<String>,
/// Repository ID (mutually exclusive with --org)
/// Repository (org/repo, mutually exclusive with --org)
#[arg(long)]
repo: Option<String>,
},
@@ -566,7 +566,13 @@
let client = Client::from_config()?;
let path = match (org, repo) {
(Some(org_slug), _) => format!("/runners/orgs/{org_slug}"),
(_, Some(repo_ref)) => {
let parts: Vec<&str> = repo_ref.splitn(2, '/').collect();
(Some(org_id), _) => format!("/runners/orgs/{org_id}"),
(_, Some(repo_id)) => format!("/runners/repos/{repo_id}"),
if parts.len() != 2 {
return Err("--repo must be in org/repo format".into());
}
format!("/runners/repos/{}/{}", parts[0], parts[1])
}
_ => return Err("specify --org or --repo".into()),
};
@@ -697,7 +703,13 @@
let client = Client::from_config()?;
let path = match (org, repo) {
(Some(org_id), _) => format!("/runners/orgs/{org_id}/tokens"),
(_, Some(repo_id)) => format!("/runners/repos/{repo_id}/tokens"),
(Some(org_slug), _) => format!("/runners/orgs/{org_slug}/tokens"),
(_, Some(repo_ref)) => {
let parts: Vec<&str> = repo_ref.splitn(2, '/').collect();
if parts.len() != 2 {
return Err("--repo must be in org/repo format".into());
}
format!("/runners/repos/{}/{}/tokens", parts[0], parts[1])
}
_ => return Err("specify --org or --repo".into()),
};