Unexpected argument '--search' found

Resolved 💬 3 comments Opened Sep 8, 2025 by elopez3 Closed Sep 8, 2025
💡 Likely answer: A maintainer (lionelchg, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.16.0

Which model were you using?

gpt-5 high reasoning effort

What platform is your computer?

Darwin 24.2.0 arm64 arm

What steps can reproduce the bug?

I type codex --search in my terminal and is outputting this error:

error: unexpected argument '--search' found

  tip: to pass '--search' as a value, use '-- --search'

Usage: codex-aarch64-apple-darwin [OPTIONS] [PROMPT]
       codex-aarch64-apple-darwin [OPTIONS] [PROMPT] <COMMAND>

For more information, try '--help'.

What is the expected behavior?

For codex --search to work and not error.

What do you see instead?

error: unexpected argument '--search' found

  tip: to pass '--search' as a value, use '-- --search'

Usage: codex-aarch64-apple-darwin [OPTIONS] [PROMPT]
       codex-aarch64-apple-darwin [OPTIONS] [PROMPT] <COMMAND>

For more information, try '--help'.

Additional information

_No response_

View original on GitHub ↗

3 Comments

lionelchg contributor · 11 months ago

I believe your codex-cli version is too old as web_search has been introduced fully only 2 weeks ago in v0.26.0: https://github.com/openai/codex/releases/tag/rust-v0.26.0

aibrahim-oai contributor · 11 months ago

You need to update codex-cli. Thanks @lionelchg

quinncomendant · 5 months ago

@aibrahim-oai I'm still getting the unexpected --search error in codex 0.117.0, despite the option listed in codex --help:

❯ codex --version
codex-cli 0.117.0

❯ which -a codex
/opt/homebrew/bin/codex

❯ codex exec -m gpt-5.4-mini -s read-only --ephemeral --search "Calculate the first 100 digits of Pi"
error: unexpected argument '--search' found

  tip: to pass '--search' as a value, use '-- --search'

Usage: codex exec --model <MODEL> --sandbox <SANDBOX_MODE> --ephemeral [PROMPT]

For more information, try '--help'.

I'm using codex via my ChatGPT Pro account.