Skip to content

devcontainer_exec: command param treated as single executable, compound shell commands fail #10

@aniongithub

Description

@aniongithub

Problem

devcontainer_exec passes the command parameter as argv[0] directly to the OCI runtime, not through a shell. This means:

  1. Multi-word commands failcommand: "echo hello" looks for a binary literally named echo hello:

    OCI runtime exec failed: exec: "echo hello": executable file not found in $PATH
    
  2. Workaround requires splitting command/argscommand: "echo", args: "hello" works, but breaks down for compound commands.

  3. Compound shell commands with quotes get mangled — passing bash as command and -lc "cd /foo && bar -c baz.yml -o out.html" as args fails with:

    unexpected EOF while looking for matching `"`
    

What works today

command: bash
args: -c cd /workspaces/forgewright && forgewright visualize -c forgewright.yml

But this is fragile — &&, pipes, and flags can be misinterpreted depending on how the args string is tokenized.

Expected behavior

Either:

  • Option A: command should be passed through a shell so compound commands work
  • Option B: args should preserve the entire string as-is (no splitting/re-quoting)
  • Option C: Add a shell: true option that wraps command + args in sh -c

Environment

  • devcontainer-mcp (MCP tool)
  • macOS, Docker Desktop
  • devcontainer CLI 0.86.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions