zeroclaw-labs/zeroclaw · error · anyhow::Error

cli-skills-install-skill-requires-git

cli-skills-install-skill-requires-git

Error message

--skill <name> requires a git repository URL as the source (got '{$source}')

What it means

`skills install --skill <name> <source>` extracts a single skill out of a git repository catalog, so the source must pass is_git_source. Any other source shape — a local directory or a registry reference — is rejected up front with the offending value embedded in the message, before anything is downloaded or created.

Source

Thrown at src/skills/mod.rs:253

            bundle,
            no_tier_banner,
            skill,
        } => {
            println!(
                "{}",
                get_required_cli_string_with_args(
                    "cli-skills-install-start",
                    &[("source", &source)]
                )
            );

            let location = resolve_install_location(config, agent.as_deref(), bundle.as_deref())?;
            let skills_path = location.dir().to_path_buf();
            std::fs::create_dir_all(&skills_path)?;

            let (installed_dir, files_scanned) = if let Some(skill_name) = skill.as_deref() {
                if !is_git_source(&source) {
                    anyhow::bail!(get_required_cli_string_with_args(
                        "cli-skills-install-skill-requires-git",
                        &[("source", &source)]
                    ));
                }
                install_git_catalog_skill_source(
                    &source,
                    skill_name,
                    &skills_path,
                    config.skills.allow_scripts,
                    workspace_dir,
                )
                .with_context(|| {
                    get_required_cli_string_with_args(
                        "cli-skills-install-catalog-failed",
                        &[("skill", skill_name), ("source", &source)],
                    )
                })?
            } else if is_git_source(&source) {

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Use a full git URL for --skill installs, e.g. https://github.com/owner/skill-catalog.git
  2. If the source is a local dir or registry ref, drop --skill and install the whole source: `skills install ./path` or `skills install owner/repo`
  3. Check the (got '{$source}') value in the error to see exactly what was parsed

Example fix

# before
zeroclaw skills install --skill code-review ./local-skills

# after — one skill pulled from a git catalog
zeroclaw skills install --skill code-review https://github.com/owner/skill-catalog.git
Defensive patterns

Strategy: validation

Validate before calling

fn looks_like_git(source: &str) -> bool {
    (source.starts_with("https://") || source.starts_with("http://") || source.starts_with("git@"))
        && (source.ends_with(".git") || source.starts_with("git@"))
}

if skill_flag.is_some() && !looks_like_git(&source) {
    eprintln!("--skill requires a git URL; drop --skill for local/registry sources");
}

Prevention

When it happens

Trigger: Passing a local path (`skills install --skill foo ./skills`) or registry shorthand (`--skill foo some-registry/foo`); a URL missing its scheme or .git suffix; an SSH form the is_git_source matcher does not recognize.

Common situations: Copy-pasting a local-path install command while keeping --skill from an earlier git-catalog install; muscle memory from the registry syntax; truncated URLs from docs.

Related errors


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/12c1bbaf440d1af2. Report an issue: GitHub.