diff --git a/src/cli.rs b/src/cli.rs index 926258d..bafc08d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -471,7 +471,11 @@ fn resolve_mostro_pubkey(cli: &Cli) -> Result { "MOSTRO_PUBKEY not set.\n\ Provide it using one of the following methods:\n\ 1) --mostropubkey \n\ - 2) export MOSTRO_PUBKEY=" + 2) export MOSTRO_PUBKEY=\n\n\ + mostro-cli does not read any config file. To avoid re-exporting every\n\ + time, put the exports in a file (e.g. ~/.config/mostro/env.sh) and\n\ + `source` it before running the CLI.\n\ + See https://github.com/MostroP2P/mostro-cli#configuration" ) }) } @@ -487,7 +491,11 @@ fn resolve_relays() -> Result { "RELAYS not set.\n\ Provide it using one of the following methods:\n\ 1) --relays \n\ - 2) export RELAYS=" + 2) export RELAYS=\n\n\ + mostro-cli does not read any config file. To avoid re-exporting every\n\ + time, put the exports in a file (e.g. ~/.config/mostro/env.sh) and\n\ + `source` it before running the CLI.\n\ + See https://github.com/MostroP2P/mostro-cli#configuration" )), } } diff --git a/tests/cli_functions.rs b/tests/cli_functions.rs index 1faaec4..768722a 100644 --- a/tests/cli_functions.rs +++ b/tests/cli_functions.rs @@ -373,3 +373,15 @@ mod maintenance_commands { ); } } + +// ── missing configuration guidance ───────────────────────────────────────── +mod missing_config_guidance { + use clap::Parser; + use mostro_client::cli::Cli; + + #[test] + fn missing_mostro_pubkey_message_content() { + let cli = Cli::try_parse_from(["mostro-cli", "listorders"]).unwrap(); + assert!(cli.mostropubkey.is_none()); + } +}