{"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/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/update.rs#L120-L156","documentation":"`but update install` runs an installer that streams progress directly to stdout/stderr, which would corrupt a structured --output-format json stream (and vice versa). The command therefore rejects JSON output up front (out.for_json() is Some) and points automated flows at the standalone installer documented at https://docs.gitbutler.com/installation.","triggerScenarios":"`but update install --output-format json`, or any invocation where a global JSON output setting or alias makes the output channel JSON.","commonSituations":"Automation wrapping every but call in a JSON-parsing harness, global output-format config in dotfiles, CI wanting machine-readable update results.","solutions":["Drop --output-format json when invoking `but update install`","For automated installs, use the standalone installer from https://docs.gitbutler.com/installation","Set output format per-command instead of globally so this subcommand stays human-formatted"],"exampleFix":"$ but update install --output-format json   # fails\n$ but update install                        # interactive OK\n# automation: use the standalone installer instead","handlingStrategy":"validation","validationCode":"// before invoking programmatically:\nif json_output_requested {\n    return Err(anyhow::anyhow!(\"but update install does not support JSON; use the standalone installer\"));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set a global --output-format json config if you run update install","Scope output-format flags to the specific subcommands that support them","Use the standalone installer for headless/automated updates"],"tags":["cli","json","output-format","update","installer"],"backgroundTag":"unsupported-output-format","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}