aaif-goose/goose · error
goose was not built with nostr support
Error message
goose was not built with nostr support
What it means
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.
Source
Thrown at crates/goose-cli/src/commands/session.rs:282
if output_path.is_some() {
return Err(anyhow::anyhow!(
"Nostr session sharing cannot be combined with --output"
));
}
let relays = nostr_share::resolve_relays(relays, Config::global());
let share = nostr_share::publish_session_json(&output, relays).await?;
println!("Session published to Nostr relays:");
for relay in &share.relays {
println!("- {}", relay);
}
println!("\nShare link:");
println!("{}", share.deeplink);
return Ok(());
}
#[cfg(not(feature = "nostr"))]
if nostr {
return Err(anyhow::anyhow!("goose was not built with nostr support"));
}
if let Some(output_path) = output_path {
fs::write(&output_path, output).with_context(|| {
format!("Failed to write to output file: {}", output_path.display())
})?;
println!("Session exported to {}", output_path.display());
} else {
println!("{}", output);
}
Ok(())
}
pub async fn handle_session_import(input: String, nostr: bool) -> Result<()> {
let json = if nostr || input.starts_with("goose://sessions/nostr") {
#[cfg(feature = "nostr")]
{View on GitHub (pinned to 3810898a74)
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
Example fix
# before cargo install goose-cli goose session export <id> --nostr # after cargo install goose-cli --features nostr goose session export <id> --nostr
Defensive patterns
Strategy: validation
Validate before calling
if nostr && !cfg!(feature = "nostr") {
eprintln!("this build lacks nostr support; exporting to file instead");
// fall back to file export, or build with --features nostr
} Type guard
fn nostr_supported() -> bool {
cfg!(feature = "nostr")
} Try / catch
match handle_session_export(id, None, "json".into(), true, relays).await {
Err(e) if e.to_string().contains("not built with nostr support") => {
handle_session_export(id, Some(path), "json".into(), false, vec![]).await // file fallback
}
other => other,
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Nostr session sharing only supports --format json
- Nostr session sharing cannot be combined with --output
- state-machine session loaded without conversation
- No session found to resume
- No session found with name '{}'
AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16).
Data as JSON: /api/errors/27cb050d84e27d28.
Report an issue: GitHub.