{"record":{"id":"b69acd18092fde35","repo":"gitbutlerapp/gitbutler","slug":"could-not-detect-an-existing-gitbutler-skill-insta","errorCode":null,"errorMessage":"Could not detect an existing GitButler skill installation.\nRun `but skill install` to create one, or use `--path <dir>` to choose a location.","messagePattern":"Could not detect an existing GitButler skill installation\\.\nRun `but skill install` to create one, or use `--path <dir>` to choose a location\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/skill/mod.rs","lineNumber":985,"sourceCode":"/// Returns every GitButler skill in the highest-priority scope that has one\n/// (local before global), so `--detect` refreshes them all instead of forcing a\n/// choice between them. Filtering to a single scope keeps a repo-local `--detect`\n/// from reaching into global installs.\nfn detect_install_paths(ctx: Option<&mut Context>, global: bool) -> Result<Vec<PathBuf>> {\n    let installations = find_all_installations(ctx, true, !global)?;\n\n    for scope in [SCOPE_LOCAL, SCOPE_GLOBAL] {\n        let paths: Vec<PathBuf> = installations\n            .iter()\n            .filter(|(_, _, s)| *s == scope)\n            .map(|(path, _, _)| path.clone())\n            .collect();\n        if !paths.is_empty() {\n            return Ok(paths);\n        }\n    }\n\n    anyhow::bail!(\n        \"Could not detect an existing GitButler skill installation.\\n\\\n         Run `but skill install` to create one, or use `--path <dir>` to choose a location.\"\n    )\n}\n\nfn prompt_for_install_scope(\n    input: &mut crate::utils::InputOutputChannel<'_>,\n    progress: &mut impl std::io::Write,\n) -> Result<InstallScope> {\n    let t = theme::get();\n    writeln!(progress)?;\n    writeln!(\n        progress,\n        \"{}\",\n        t.important.paint(\"Select installation scope:\")\n    )?;\n    writeln!(progress)?;\n","sourceCodeStart":967,"sourceCodeEnd":1003,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/skill/mod.rs#L967-L1003","documentation":"`but skill` needs to know where an existing GitButler skill bundle is installed so it can update or manage it. `detect_install_paths` scans the known agent skill directories (e.g. Claude, Cursor) and bails with this error when none of them contain a GitButler installation. It is a guard so the CLI never edits a skill bundle it cannot locate.","triggerScenarios":"Running `but skill` management commands (via install_skill -> detect_install_paths) without `--path` when no supported agent directory contains a GitButler skill installation, e.g. before ever running `but skill install`.","commonSituations":"Fresh machine where skills were never installed; skills installed to a custom, non-standard directory the detector does not scan; running from an environment (CI, script) with a different HOME so the agent directories aren't where expected.","solutions":["Run `but skill install` to create a fresh installation.","Re-run with `--path <dir>` pointing at the existing skill directory.","Verify the agent's skill directory (e.g. ~/.claude/skills) actually contains the GitButler skill files."],"exampleFix":"// before\nbut skill update\n// error: Could not detect an existing GitButler skill installation.\n\n// after\nbut skill update --path ~/.claude/skills/gitbutler","handlingStrategy":"fallback","validationCode":"if [ ! -d ~/.claude/skills/gitbutler ]; then but skill install --path ~/.claude/skills/gitbutler; fi","typeGuard":null,"tryCatchPattern":"but skill update --path \"$SKILL_DIR\" || but skill install --path \"$SKILL_DIR\"","preventionTips":["Always install once with `but skill install` before using other skill subcommands.","Pass `--path` explicitly in scripts instead of relying on detection.","Keep the skill directory in a standard agent location the detector scans."],"tags":["cli","skill-installation","not-found"],"backgroundTag":"resource-not-found","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}