Instruções
- 1
Passo
Check Node.js
Use o comando copiável como está e verifique a saída antes de continuar. O objetivo é manter velocidade com controle.
node -v && npm -v - 2
Passo
Install Codex Globally
Use o comando copiável como está e verifique a saída antes de continuar. O objetivo é manter velocidade com controle.
npm install -g @openai/codex - 3
Passo
Verify Installation
Use o comando copiável como está e verifique a saída antes de continuar. O objetivo é manter velocidade com controle.
codex --version - 4
Passo
Avoid Old Flags
Use o comando copiável como está e verifique a saída antes de continuar. O objetivo é manter velocidade com controle.
codex
Por que importa
Garante o pacote oficial da OpenAI, evitando flags deprecadas como `-q`.
Solução de problemas
- Se arquivos inesperados aparecerem, pare e revise git diff antes de continuar.
- Se os testes falharem, corrija a causa ou reverta antes de rodar o agente de novo.
- Se o workspace é importante e não pode ser perdido, não use modos que pulam permissões.
FAQ
What is the npm command for OpenAI Codex?
The official command is `npm install -g @openai/codex`. The `-g` flag is important because it makes the `codex` command available globally across all your project folders.
Does Codex CLI require Python or Node.js?
Codex CLI runs on Node.js. You do not need Python to install or run the standard Codex package, but you must have a recent version of Node.js installed.
Can I install Codex CLI with Homebrew instead of NPM?
While `brew install --cask codex` has been used historically for unofficial wrappers, the direct supported method from OpenAI is using NPM via the `@openai/codex` package.
How do I fix unexpected argument '-q' in Codex CLI?
Stop using the `-q` flag. Older versions used it to suppress prompts, but the current v0.130.0+ architecture rejects it. Just type `codex` and hit enter.
Is Codex CLI the same as Claude Code?
No. Codex is OpenAI's coding agent CLI, whereas Claude Code is Anthropic's terminal agent. They are installed differently and use different AI models on the backend.
Tutoriais relacionados
Copilot
How to Install GitHub Copilot CLI on Mac and Windows
Step-by-step guide to installing the GitHub Copilot CLI extension. Learn how to authenticate and run gh copilot suggest and explain in your terminal.
Aider
How to Install Aider AI Coding CLI on Mac and Windows
Step-by-step guide to installing the Aider AI pair programming CLI on macOS and Windows. Learn how to configure API keys for Claude 3.7 and GPT-4o.