{"record":{"id":"27cb050d84e27d28","repo":"aaif-goose/goose","slug":"goose-was-not-built-with-nostr-support","errorCode":null,"errorMessage":"goose was not built with nostr support","messagePattern":"goose was not built with nostr support","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/goose-cli/src/commands/session.rs","lineNumber":282,"sourceCode":"        if output_path.is_some() {\n            return Err(anyhow::anyhow!(\n                \"Nostr session sharing cannot be combined with --output\"\n            ));\n        }\n\n        let relays = nostr_share::resolve_relays(relays, Config::global());\n        let share = nostr_share::publish_session_json(&output, relays).await?;\n        println!(\"Session published to Nostr relays:\");\n        for relay in &share.relays {\n            println!(\"- {}\", relay);\n        }\n        println!(\"\\nShare link:\");\n        println!(\"{}\", share.deeplink);\n        return Ok(());\n    }\n    #[cfg(not(feature = \"nostr\"))]\n    if nostr {\n        return Err(anyhow::anyhow!(\"goose was not built with nostr support\"));\n    }\n\n    if let Some(output_path) = output_path {\n        fs::write(&output_path, output).with_context(|| {\n            format!(\"Failed to write to output file: {}\", output_path.display())\n        })?;\n        println!(\"Session exported to {}\", output_path.display());\n    } else {\n        println!(\"{}\", output);\n    }\n\n    Ok(())\n}\n\npub async fn handle_session_import(input: String, nostr: bool) -> Result<()> {\n    let json = if nostr || input.starts_with(\"goose://sessions/nostr\") {\n        #[cfg(feature = \"nostr\")]\n        {","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose-cli/src/commands/session.rs#L264-L300","documentation":"Nostr support is a compile-time cargo feature (goose-cli: nostr = [\"goose/nostr\"], not enabled by default). This branch is compiled only #[cfg(not(feature = \"nostr\"))], so a binary built without the feature rejects --nostr at runtime with this message instead of attempting relay publishing.","triggerScenarios":"Passing --nostr to a goose binary built with default features (e.g. some distro or self-built packages); a release channel that does not enable the nostr feature.","commonSituations":"Installing goose via a package manager that builds without optional features; building from source with `cargo build` and no --features flag; docs describing --nostr for a build that lacks it.","solutions":["Drop --nostr and export/import via file (json/yaml) instead","Use a goose build compiled with the feature: `cargo build --features nostr` in the goose-cli crate","Check how your goose was installed and switch to a distribution that enables nostr"],"exampleFix":"# before\ncargo install goose-cli\ngoose session export <id> --nostr\n# after\ncargo install goose-cli --features nostr\ngoose session export <id> --nostr","handlingStrategy":"validation","validationCode":"if nostr && !cfg!(feature = \"nostr\") {\n    eprintln!(\"this build lacks nostr support; exporting to file instead\");\n    // fall back to file export, or build with --features nostr\n}","typeGuard":"fn nostr_supported() -> bool {\n    cfg!(feature = \"nostr\")\n}","tryCatchPattern":"match handle_session_export(id, None, \"json\".into(), true, relays).await {\n    Err(e) if e.to_string().contains(\"not built with nostr support\") => {\n        handle_session_export(id, Some(path), \"json\".into(), false, vec![]).await // file fallback\n    }\n    other => other,\n}","preventionTips":["Decide the sharing mechanism at install time: build with `--features nostr` or standardize on file exports","Feature-check with cfg!(feature = \"nostr\") in code, or a dry `goose session export --nostr` probe in scripts"],"tags":["nostr","feature-flag","build-config","session"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}