tinyhumansai/openhuman · error · anyhow::Error

missing value for --port

Error message

missing value for --port

What it means

CLI argument parsing in run_server_command: `--port` was given with no following value. Usage error only — pass a u16, e.g. `--port 7788` (the default from OPENHUMAN_CORE_PORT when the flag is omitted); the server never starts on this error.

Solutions

  1. Append a port value, e.g. `openhuman run --port 7788`
  2. Omit --port to use the default (7788 or OPENHUMAN_CORE_PORT)
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/cli.rs:374 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/9901bc5a8c7fd462. Report an issue: GitHub.

Appendix: source

Thrown at src/core/cli.rs:374

/// # Arguments
///
/// * `args` - Command-line arguments for the `run` command (e.g., `--port`).
fn run_server_command(args: &[String]) -> Result<()> {
    let mut port: Option<u16> = None;
    let mut host: Option<String> = None;
    let mut socketio_enabled = true;
    let mut headless_api = false;
    let mut verbose = false;
    let log_scope = CliLogDefault::Global;
    let mut i = 0usize;

    // Manual argument parsing loop for specific flags.
    while i < args.len() {
        match args[i].as_str() {
            "--port" => {
                let raw = args
                    .get(i + 1)
                    .ok_or_else(|| anyhow::anyhow!("missing value for --port"))?;
                port = Some(
                    raw.parse::<u16>()
                        .map_err(|e| anyhow::anyhow!("invalid --port: {e}"))?,
                );
                i += 2;
            }
            "--host" => {
                host = Some(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow::anyhow!("missing value for --host"))?
                        .clone(),
                );
                i += 2;
            }
            "--jsonrpc-only" => {
                socketio_enabled = false;
                i += 1;
            }

View on GitHub (pinned to 7491200858)