aaif-goose/goose · error

No command provided in extension string

Error message

No command provided in extension string

What it means

Stdio extension strings have the shape 'KEY=VALUE cmd args...': leading tokens containing '=' are consumed as environment variables, and the next token becomes the command. parse_stdio_extension fails when, after consuming env assignments, no token remains to serve as the command.

Source

Thrown at crates/goose-cli/src/session/mod.rs:355

    }

    /// Parse a stdio extension command string into an ExtensionConfig
    /// Format: "ENV1=val1 ENV2=val2 command args..."
    pub fn parse_stdio_extension(extension_command: &str) -> Result<ExtensionConfig> {
        let mut parts = goose::utils::split_command_args(extension_command)?;
        let mut envs = HashMap::new();

        while let Some(part) = parts.first() {
            if !part.contains('=') {
                break;
            }
            let env_part = parts.remove(0);
            let (key, value) = env_part.split_once('=').unwrap();
            envs.insert(key.to_string(), value.to_string());
        }

        if parts.is_empty() {
            return Err(anyhow::anyhow!("No command provided in extension string"));
        }

        let cmd = parts.remove(0);
        let name = std::path::Path::new(&cmd)
            .file_name()
            .and_then(|f| f.to_str())
            .unwrap_or("unnamed")
            .to_string();

        Ok(ExtensionConfig::Stdio {
            name,
            cmd,
            args: parts,
            envs: Envs::new(envs),
            env_keys: Vec::new(),
            description: goose::config::DEFAULT_EXTENSION_DESCRIPTION.to_string(),
            timeout: Some(goose::config::DEFAULT_EXTENSION_TIMEOUT),
            cwd: None,

View on GitHub (pinned to 3810898a74)

Solutions

  1. Append the server command after the env assignments: 'API_KEY=x node server.js'
  2. Echo the extension string before passing it to goose to verify it expands as expected
  3. Check for stray quotes or empty shell variables

Example fix

# before
goose session add-extension "API_KEY=$MY_TOKEN"
# after
goose session add-extension "API_KEY=$MY_TOKEN node /abs/path/mcp-server/build/index.js"
Defensive patterns

Strategy: validation

Validate before calling

fn has_command(ext: &str) -> bool {
    ext.split_whitespace().any(|p| !p.contains('='))
}

assert!(has_command(&extension_command), "extension string needs a command after KEY=VALUE parts");

Prevention

When it happens

Trigger: goose add-extension / --with-extension / config strings such as 'FOO=bar' (env assignments only), an empty command after word splitting, or an unset shell variable that expanded to nothing.

Common situations: Quoting mistakes where only the env part survives; copy-pasted extension strings missing the binary; passing "API_KEY=$TOKEN" when $TOKEN is unset.

Related errors


AI-assisted analysis of aaif-goose/goose@3810898a74 (2026-08-16). Data as JSON: /api/errors/074469c6779d61c0. Report an issue: GitHub.