Problem
devcontainer_exec passes the command parameter as argv[0] directly to the OCI runtime, not through a shell. This means:
-
Multi-word commands fail — command: "echo hello" looks for a binary literally named echo hello:
OCI runtime exec failed: exec: "echo hello": executable file not found in $PATH
-
Workaround requires splitting command/args — command: "echo", args: "hello" works, but breaks down for compound commands.
-
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
Problem
devcontainer_execpasses thecommandparameter asargv[0]directly to the OCI runtime, not through a shell. This means:Multi-word commands fail —
command: "echo hello"looks for a binary literally namedecho hello:Workaround requires splitting command/args —
command: "echo",args: "hello"works, but breaks down for compound commands.Compound shell commands with quotes get mangled — passing
bashas command and-lc "cd /foo && bar -c baz.yml -o out.html"as args fails with:What works today
But this is fragile —
&&, pipes, and flags can be misinterpreted depending on how the args string is tokenized.Expected behavior
Either:
commandshould be passed through a shell so compound commands workargsshould preserve the entire string as-is (no splitting/re-quoting)shell: trueoption that wraps command + args insh -cEnvironment