tinyhumansai/openhuman · error · Error

could not resolve repo (set RABBIT_REPO=owner/name)

Error message

could not resolve repo (set RABBIT_REPO=owner/name)

What it means

The rabbit CLI needs an owner/name GitHub repository slug. It tries RABBIT_REPO first, then runs `git remote get-url upstream` and `origin` and matches github.com[:/]owner/repo(.git) URLs. If RABBIT_REPO is unset and neither named remote exists or parses as a GitHub URL, it throws with the fix in the message.

Source

Thrown at scripts/rabbit/cli.mjs:51

    stdio: input ? ["pipe", "pipe", "inherit"] : ["ignore", "pipe", "inherit"],
    maxBuffer: 32 * 1024 * 1024,
  });
}

function resolveRepo() {
  if (process.env.RABBIT_REPO) return process.env.RABBIT_REPO;
  for (const remote of ["upstream", "origin"]) {
    try {
      const url = execFileSync("git", ["remote", "get-url", remote], {
        encoding: "utf8",
      }).trim();
      const m = url.match(/github\.com[:/]([^/]+\/[^/.]+)(?:\.git)?$/);
      if (m) return m[1];
    } catch {
      // try next
    }
  }
  throw new Error("could not resolve repo (set RABBIT_REPO=owner/name)");
}

function parseArgs(argv) {
  const out = {
    cmd: argv[0] ?? "run",
    max: 5,
    dryRun: false,
    pr: null,
    graceSec: 30,
  };
  for (let i = 1; i < argv.length; i++) {
    const a = argv[i];
    if (a === "--dry-run") out.dryRun = true;
    else if (a === "--max") out.max = Number(argv[++i]);
    else if (a === "--pr") out.pr = Number(argv[++i]);
    else if (a === "--grace") out.graceSec = Number(argv[++i]);
    else if (a === "-h" || a === "--help") {
      out.cmd = "help";

View on GitHub (pinned to a221052e0d)

Solutions

  1. Set the slug explicitly: `RABBIT_REPO=tinyhumansai/openhuman node scripts/rabbit/cli.mjs run`
  2. Or add a GitHub-shaped remote: `git remote add upstream git@github.com:owner/name.git`
  3. Or rename your existing GitHub remote so it is called `origin` or `upstream` (`git remote rename github upstream`)

Example fix

# before — only a non-github remote exists:
git remote -v
# gitea  https://git.internal/team/openhuman.git
node scripts/rabbit/cli.mjs run

# after:
RABBIT_REPO=tinyhumansai/openhuman node scripts/rabbit/cli.mjs run
Defensive patterns

Strategy: validation

Validate before calling

import { execFileSync } from 'node:child_process';
function resolveRepoSafe() {
  if (process.env.RABBIT_REPO) return process.env.RABBIT_REPO;
  for (const remote of ['upstream', 'origin']) {
    try {
      const url = execFileSync('git', ['remote', 'get-url', remote], { encoding: 'utf8' }).trim();
      const m = url.match(/github\.com[:\/]([^\/]+\/[^\/.]+)(?:\.git)?$/);
      if (m) return m[1];
    } catch { /* next */ }
  }
  return null; // caller decides: set RABBIT_REPO or bail with a clear message
}

Type guard

/** True for strings like 'owner/name' that came from a github.com remote. */
function isGitHubRepoSlug(value) {
  return /^[\w.-]+\/[\w.-]+$/.test(value);
}

Prevention

When it happens

Trigger: Running scripts/rabbit/cli.mjs outside a git repository (execFileSync git fails, both remotes skipped); remotes named something else (e.g. only a `github` remote); remote URLs on a non-GitHub host (GitLab, gitea, SSH aliases like `git@work:team/repo`) that never match the regex.

Common situations: Corporate forks where origin points at an internal mirror; fresh clones with no `upstream` and a non-GitHub origin; CI checkouts configured with a token URL that doesn't include github.com.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/2abbbac2a3ab10f7. Report an issue: GitHub.