Hmbown/CodeWhale · error

github source must be 'github:owner/repo

Error message

github source must be 'github:owner/repo' (got {spec})

What it means

For a spec beginning with 'github:', parse splits owner/repo on '/'. If there is no '/' at all, split_once fails and this error is raised via with_context. It means the github: source did not have the required owner/repo shape.

Solutions

  1. Include the owner and repo separated by a slash: github:owner/repo
  2. If you have a full GitHub URL, paste the https:// URL instead and it will be parsed
  3. Trim stray whitespace inside the spec

Example fix

// before
skill install github:tokio-rs
// after
skill install github:tokio-rs/tokio
Defensive patterns

Strategy: validation

Validate before calling

fn valid_github_spec(spec: &str) -> bool {
    match spec.trim().strip_prefix("github:") {
        Some(rest) => rest.split_once('/').map_or(false, |(o, r)| !o.trim().is_empty() && !r.trim().is_empty()),
        None => true, // not a github: spec
    }
}

Try / catch

match InstallSource::parse(spec) {
    Ok(src) => /* proceed */,
    Err(e) if e.to_string().contains("github source must be") => {
        eprintln!("expected github:owner/repo, got: {spec}");
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: `InstallSource::parse("github:somerepo")` or `parse("github: ")` — a github: prefix with no slash separating owner and repo.

Common situations: Pasting just a repo name assuming a default owner; truncating a URL when copying; writing 'github:owner-repo' instead of 'github:owner/repo'.

Understand the failure class

Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/960485760c17f445. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/skills/install.rs:130

    ///   [`InstallSource::GitHubRepo`]
    /// * any other `http://` or `https://` prefix → [`InstallSource::DirectUrl`]
    /// * anything else → [`InstallSource::Registry`]
    pub fn parse(spec: &str) -> Result<Self> {
        let trimmed = spec.trim();
        if trimmed.is_empty() {
            bail!("install source must not be empty");
        }
        if let Some(rest) = trimmed.strip_prefix("github:") {
            let rest = rest.trim();
            // Reject obviously bogus values up front. We intentionally accept
            // case-insensitive owner/repo so `github:Hmbown/Foo` works.
            let (owner, repo) = rest.split_once('/').with_context(|| {
                format!("github source must be 'github:owner/repo' (got {spec})")
            })?;
            let owner = owner.trim();
            let repo = repo.trim().trim_end_matches('/');
            if owner.is_empty() || repo.is_empty() {
                bail!("github source must be 'github:owner/repo' (got {spec})");
            }
            if owner.contains('/') || repo.contains('/') {
                bail!("github source must be 'github:owner/repo' (got {spec})");
            }
            return Ok(Self::GitHubRepo(format!("{owner}/{repo}")));
        }
        if trimmed.starts_with("https://") || trimmed.starts_with("http://") {
            if let Some(repo) = parse_github_browser_url(trimmed) {
                return Ok(Self::GitHubRepo(repo));
            }
            return Ok(Self::DirectUrl(trimmed.to_string()));
        }
        Ok(Self::Registry(trimmed.to_string()))
    }
}

/// Detect bare `https://github.com/<owner>/<repo>` URLs (with or without a
/// trailing `.git`) and return `owner/repo`. Returns `None` for any URL that

View on GitHub (pinned to 73e0f67d83)