tinyhumansai/openhuman · error

missing value for --method

Error message

missing value for --method

What it means

CLI argument parsing in run_call_command (direct in-process JSON-RPC invocation for debugging): `--method` was passed with no following value. Usage error; supply the RPC method name, e.g. `--method config.get`. No call was attempted.

Solutions

  1. Supply the method name, e.g. `openhuman call --method agent.list_agents`
  2. Check `openhuman call --help` for the expected syntax
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/cli.rs:466 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/60a1df0a4b539a8e. Report an issue: GitHub.

Appendix: source

Thrown at src/core/cli.rs:466

/// Handles the `call` subcommand to invoke a JSON-RPC method directly from the CLI.
///
/// This is used for one-off commands and debugging, bypassing the HTTP transport
/// and calling the internal `invoke_method` directly.
///
/// # Arguments
///
/// * `args` - Command-line arguments specifying the method and parameters.
fn run_call_command(args: &[String]) -> Result<()> {
    let mut method: Option<String> = None;
    let mut params = "{}".to_string();

    let mut i = 0usize;
    while i < args.len() {
        match args[i].as_str() {
            "--method" => {
                method = Some(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow::anyhow!("missing value for --method"))?
                        .clone(),
                );
                i += 2;
            }
            "--params" => {
                params = args
                    .get(i + 1)
                    .ok_or_else(|| anyhow::anyhow!("missing value for --params"))?
                    .clone();
                i += 2;
            }
            "-h" | "--help" => {
                println!("Usage: openhuman call --method <name> [--params '<json>']");
                return Ok(());
            }
            other => return Err(anyhow::anyhow!("unknown call arg: {other}")),
        }
    }

View on GitHub (pinned to 7491200858)