News

OpenAI Codex CLI Now Supports Logging in with ChatGPT Accounts, Default Model Set to GPT-5

2025-08-08 #AI#OpenAI#Codex CLI#Coding Assistant

As Claude's terminal programming assistant Claude Code grows increasingly popular, and Google's Gemini CLI also captures a certain market share thanks to its free quota, the industry leader OpenAI was bound to step in.
Now, following the release of GPT-5, OpenAI has finally updated Codex CLI to support direct login using ChatGPT accounts (Plus / Pro), switching the default model to GPT-5.

GitHub - OpenAI Codex CLI

Quick Highlights

  • Supports logging in with ChatGPT (Plus/Pro/Team): No separate API Key required.
  • Default model set to GPT-5: The latest default setting out of the box.
  • Supports direct installation via npm.
  • Verify login and model configuration with /status.

Installation

We highly recommend installing globally via npm:

1
npm install -g @openai/codex

macOS users can also install via Homebrew:

1
brew install codex

Haven't installed Node.js/npm yet? See: How to Install Node.js
Codex CLI requires a minimum Node version of 22

Login and Authentication

Start Codex in your terminal:

1
codex

When run for the first time, it will prompt you to choose an authentication method. It now supports logging in directly with ChatGPT:

1
2
3
> 1. Sign in with ChatGPT 
Usage included with Plus, Pro, and Team plans
2. Provide your own API key (按用量计费)

After choosing "Sign in with ChatGPT", your browser will open to complete the authorization and login process:

login-codex-with-chatgpt-plus

Once authorized, the terminal will display a welcome message and account source (ChatGPT).

1
2
3
>_ Welcome to Codex, OpenAI's command-line coding agent

✓ Signed in with your ChatGPT account

Initial Configuration (Authorization Mode)

Unlike Claude Code or Gemini CLI, when entering a directory for the first time, Codex will ask whether it can edit files and run commands inside that directory "without asking for confirmation every time":

1
2
> 1. Yes, allow Codex to work in this folder without asking for approval
2. No, ask me to approve edits and commands

Recommendations:

  • Personal projects with version control in place: You can select Yes to improve efficiency.
  • Beginners or sensitive repositories: Selecting No for step-by-step approvals is safer.

Chat Preview

codex-welcome

Verification and Common Commands

  • Check status:

    1
    /status

    You will see information such as the authorization source (ChatGPT) and the default model gpt-5.

    Example status output (irrelevant lines omitted):

    1
    2
    3
    4
    5
    6
    7
    👤 Account
    • Signed in with ChatGPT
    • Plan: Plus

    🧠 Model
    • Name: gpt-5
    • Provider: OpenAI
  • Initialize project context:

    1
    /init

    Allows Codex to retrieve the project structure and create the AGENTS.md file.

If you have subscribed to ChatGPT Plus / Pro, go ahead and install it to try it out!

Comments
Share

Comments