Instructions
- 1
Étape
Check Node.js
Utilisez la commande copiable telle quelle puis vérifiez la sortie avant de continuer. Le but est d’aller vite sans perdre le contrôle.
node -v && npm -v - 2
Étape
Install Codex Globally
Utilisez la commande copiable telle quelle puis vérifiez la sortie avant de continuer. Le but est d’aller vite sans perdre le contrôle.
npm install -g @openai/codex - 3
Étape
Verify Installation
Utilisez la commande copiable telle quelle puis vérifiez la sortie avant de continuer. Le but est d’aller vite sans perdre le contrôle.
codex --version - 4
Étape
Avoid Old Flags
Utilisez la commande copiable telle quelle puis vérifiez la sortie avant de continuer. Le but est d’aller vite sans perdre le contrôle.
codex
Pourquoi c'est important
Évite les tutoriels obsolètes avec le flag `-q`.
Dépannage
- Si des fichiers inattendus changent, arrêtez-vous et relisez git diff avant de continuer.
- Si les tests échouent, corrigez la cause ou revenez en arrière avant de relancer l’agent.
- Si le workspace est important et ne peut pas être perdu, n’utilisez pas les modes qui sautent les permissions.
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.
Tutoriels liés
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.