tinyhumansai/openhuman · error

--query is required

Error message

--query is required

What it means

Post-parse required-argument check in `openhuman memory query`. The query text is optional during parsing and unwrapped with ok_or_else after the loop; with no --query/-q given there is nothing to search for, so the command rejects the invocation before contacting the memory store.

Source

Thrown at src/core/memory_cli.rs:343

                    .map_err(|e| anyhow::anyhow!("invalid --limit: {e}"))?;
            }
            "-v" | "--verbose" => {
                verbose = true;
                i += 1;
            }
            "-h" | "--help" => {
                println!(
                    "Usage: openhuman memory query --namespace <ns> --query <text> [--limit <n>] [-v]"
                );
                return Ok(());
            }
            other => return Err(anyhow::anyhow!("unknown query arg: {other}")),
        }
    }

    let namespace =
        namespace.ok_or_else(|| anyhow::anyhow!("--namespace is required for query"))?;
    let query = query.ok_or_else(|| anyhow::anyhow!("--query is required"))?;

    crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);

    let rt = tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .build()?;

    let result = rt.block_on(async {
        let client = create_memory_client("query").await?;
        client
            .query_namespace(&namespace, &query, limit)
            .await
            .map_err(anyhow::Error::msg)
    })?;

    println!("{result}");
    Ok(())
}

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide the search text: `--query "some text"` (short form -q).
  2. Quote the query if it contains spaces.
  3. Run `openhuman memory query --help` for the full usage line.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/memory_cli.rs:343 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/e7b26f8ed83d4530. Report an issue: GitHub.