codex exec --help advertises a second positional [COMMAND] but parser rejects it

Resolved 💬 2 comments Opened Mar 23, 2026 by aquiles-ai123 Closed Apr 6, 2026

codex exec --help advertises a second positional [COMMAND], but the parser rejects it

Summary

codex exec --help currently shows this usage line:

Usage: codex exec [OPTIONS] [PROMPT] [COMMAND]

That suggests exec accepts two positionals: a prompt and then a command.

In practice, providing a second positional fails immediately in argument parsing with:

error: unexpected argument 'false' found

So the help output and the actual parser behavior disagree.

Repro

Check the help text:

codex exec --help | sed -n '1,20p'

Observed excerpt:

Run Codex non-interactively

Usage: codex exec [OPTIONS] [PROMPT] [COMMAND]

Now try to use stdin for the prompt and pass false as the advertised second positional:

printf '' | codex exec --ephemeral --skip-git-repo-check --color never -C /home/cryptotrading74 - false
printf "outer_exit=%s\n" "$?"

Observed output:

error: unexpected argument 'false' found

Usage: codex exec [OPTIONS] [PROMPT] [COMMAND]

For more information, try '--help'.
outer_exit=2

Expected behavior

One of these should be true:

  • codex exec should actually accept the advertised second positional [COMMAND]
  • or the help text should stop advertising [COMMAND]

Actual behavior

The help text advertises [COMMAND], but the parser rejects any second positional as unexpected.

Why this matters

This is misleading for automation and scripting, because the CLI help describes an invocation form that cannot be used.

Additional information

This looks related in spirit to other exec --help mismatches such as #13614, but this report is specifically about the phantom [COMMAND] positional shown in usage.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗