{"record":{"id":"29c9f2dbff88d69f","repo":"gitbutlerapp/gitbutler","slug":"json-output-is-not-supported-for-but-update-insta","errorCode":null,"errorMessage":"JSON output is not supported for 'but update install'.\n\nThe installation process requires interactive output.\nFor automated installations, use the standalone installer:\nhttps://docs.gitbutler.com/installation","messagePattern":"JSON output is not supported for 'but update install'\\.\n\nThe installation process requires interactive output\\.\nFor automated installations, use the standalone installer:\nhttps://docs\\.gitbutler\\.com/installation","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but/src/command/update.rs","lineNumber":138,"sourceCode":"            if days == 1 { \"day\" } else { \"days\" }\n        )?;\n    } else if let Some(out) = out.for_json() {\n        out.write_value(serde_json::json!({\n            \"suppressed\": true,\n            \"days\": days,\n            \"hours\": hours\n        }))?;\n    }\n\n    Ok(())\n}\n\n#[cfg(all(unix, not(feature = \"packaged-but-distribution\")))]\nfn install(out: &mut OutputChannel, target: Option<String>) -> Result<()> {\n    // Installation requires interactive output and cannot be used with JSON mode\n    // because the installer writes directly to stdout/stderr\n    if out.for_json().is_some() {\n        anyhow::bail!(\n            \"JSON output is not supported for 'but update install'.\\n\\n\\\n             The installation process requires interactive output.\\n\\\n             For automated installations, use the standalone installer:\\n\\\n             https://docs.gitbutler.com/installation\"\n        );\n    }\n\n    // Parse target to determine what to install\n    let version_request = match target.as_deref() {\n        Some(\"nightly\") => VersionRequest::Nightly,\n        Some(\"release\") => VersionRequest::Release,\n        Some(version_str) => {\n            // Specific version - validate and create\n            // Wrap validation errors with CLI-specific context\n            VersionRequest::from_string(Some(version_str.to_string())).map_err(|e| {\n                anyhow::anyhow!(\n                    \"Invalid version '{version_str}': {e}\\n\\nValid targets:\\n  nightly          Install latest nightly build\\n  release          Install latest stable release\\n  <version>        Install specific version (e.g., 0.18.7)\"\n                )","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/update.rs#L120-L156","documentation":"`but update install` runs an external installer that writes progress directly to stdout/stderr, which conflicts with JSON output mode. `install` therefore rejects the combination up front and points to the standalone installer for automation.","triggerScenarios":"Running `but update install --json` (any invocation where out.for_json() is Some) on a supported unix, non-packaged distribution.","commonSituations":"Automation scripts that always pass `--json` to every `but` command; CI update jobs trying to parse the installer output as JSON.","solutions":["Drop `--json` when running `but update install`.","Use the standalone installer from https://docs.gitbutler.com/installation for automated, non-interactive installs.","Run `but update` (check only) with `--json` if you just need machine-readable update info."],"exampleFix":"// before\nbut update install --json\n// error: JSON output is not supported for 'but update install'.\n\n// after\nbut update install   # or use the standalone installer in scripts","handlingStrategy":"validation","validationCode":"# shell: never pass --json to update install\nARGS=(but update install); for a in \"$@\"; do [ \"$a\" = \"--json\" ] || ARGS+=(\"$a\"); done","typeGuard":null,"tryCatchPattern":"but update install 2>err.log || { grep -q 'JSON output is not supported' err.log && echo 'drop --json or use the standalone installer'; }","preventionTips":["Exclude `but update install` from blanket --json wrappers.","Use the standalone installer for automated updates.","Use `but update --json` for machine-readable update checks instead."],"tags":["cli","json-output","update"],"backgroundTag":"mutually-exclusive-flags","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"}