How to start a Codex interactive session

Starting a Codex interactive session opens the terminal UI in the current working directory so Codex can inspect the local project, answer questions, edit files, and run commands within the active approval and sandbox settings.

Current OpenAI Codex CLI docs describe codex as the interactive terminal entry point, while the current local codex --help output confirms that when no subcommand is specified, the command starts the interactive CLI flow.

Interactive sessions expect a real terminal. First-run authentication can happen at launch when no cached login is present, while non-interactive automation belongs under codex exec and returning to an earlier thread belongs under codex resume.

Steps to start a Codex interactive session:

  1. Change to the project directory that Codex should use as its working root.
    $ cd ~/projects/example-app
    $ pwd
    /home/user/projects/example-app

    The interactive session uses the current directory unless -C sets a different working root at launch.

  2. Confirm that a cached login is already available before opening the session.
    $ codex login status
    Logged in using ChatGPT

    The first codex launch can prompt for ChatGPT or API-key authentication when no cached login exists.

  3. Start the interactive Codex CLI from the chosen directory.
    $ codex
    
    ╭──────────────────────────────────────────────────────────╮
    │ >_ OpenAI Codex                                         │
    │                                                          │
    │ model:     gpt-5.4 xhigh        /model to change        │
    │ directory: ~/projects/example-app                       │
    ╰──────────────────────────────────────────────────────────╯
    
    ›

    The exact model line can differ by account, profile, or config. The decisive success signal is the open prompt in the intended directory.

  4. Enter the first request after the prompt appears and wait for Codex to start replying in the same terminal window.
    › Explain this repository and point out the main entrypoints.

    An opening request can also be passed at launch as codex "Explain this repository and point out the main entrypoints." when the session should begin with a prompt instead of a blank input line.