Codex is a programming-assisted agent tool provided by OpenAI in ChatGPT, trained on the GPT-4/5 architecture, capable of reading and writing files, running tests, fixing bugs, and generating pull requests. Its goal is to help developers complete software engineering work more efficiently. Unlike the "Codex model" of 2021, Codex is now a complete engineering agent, not just code completion.
- Access Prerequisites
To access Codex through ChatGPT, users need to have a subscription to ChatGPT Plus, Pro, Business, Edu, or Enterprise. It is currently not available directly for free users. Codex can be used through three official portals: the ChatGPT web sidebar, the Codex CLI (command-line tool), and IDE extensions (e.g., VS Code, Cursor).
- Specific usage steps
First, log in to ChatGPT and confirm that the subscription is open. Go to the sidebar and select "Codex", which can be used in Code or Ask mode. If you need to operate a GitHub repository and authorize Codex to access a specific project, the scope of authorization can be set by repository or organization. Codex then runs code in a sandbox environment, executes tests, and generates suggestions for changes or submits PRs. Users can review diffs, logs, and test results in the ChatGPT interface to decide whether to merge.
- Precautions for use
Codex supports collaboration on the web, CLI, and IDE, and the mobile terminal can follow up on tasks. You can configure tests and style specifications using AGENTS.md files in the repository. While Codex can significantly improve efficiency, the generated code still needs to be manually reviewed and tested to ensure security and quality.
Frequently Asked Questions (Q&A)
Q: What are the requirements for using Codex with ChatGPT?
A: Must have a Plus/Pro/Business/Edu/Enterprise subscription.
Q: Does Codex automatically read all my repositories?
A: No, only the repositories you actively authorize will be accessed, and the permissions can be revoked at any time.
Q: Can Codex generated code be used directly for production?
A: It is not recommended to go live directly, and it still needs to be tested and reviewed by developers before putting it into production.