YouTip LogoYouTip

Codex Usage

Launching Codex

\\n

Codex features a standard three-column interface: the left sidebar contains the task list, the center is the chat window, and the right side is the multi-function area.

\\n

Image 1

\\n

After launching the Codex application, we can add projects from the left menu, and enter our requirements in the input box of the center column:

\\n

Image 2

\\n

You can set the model or upload files, etc.:

\\n

Image 3

\\n

Launching Codex CLI

\\n

After installing and configuring your account, open a terminal in your project directory and type codex to launch the interactive interface:

\\n
# Enter your project directory\\ncd ~/my-project\\n\\n# Launch Codex interactive interface\\ncodex\\n\\n# Launch with an initial prompt\\ncodex "Help me analyze the structure of this project."\\n\\n# Specify model on launch\\ncodex --model gpt-5\\n
\\n
\\n

? It is recommended to launch Codex from the project root directory so that it can fully read the project file structure.

\\n

Codex interface is very simple, the cursor position is the input box, just type your requirements directly.

\\n
\\n

For example, we enter the directory codex-tutorial-test and then use the codex command to launch:

\\n
cd codex-tutorial-test\\n\\n# Launch Codex interactive interface\\ncodex\\n
\\n

Image 4

\\n

Then you can directly enter your requirements in the interactive interface, such as asking it to explain the code in test.py, the effect is as follows (these records will also be displayed in the Codex App):

\\n

Image 5

\\n

Three Approval Modes

\\n

Codex CLI provides three different levels of operation permission modes, you can choose the appropriate mode according to your task requirements:

\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n
ModeDescriptionApplicable Scenarios
ask (default)Read-only mode: can read files and formulate plans, but requires your confirmation before executing any operationsExploring unfamiliar codebases, risk assessment
auto-editAuto edit: can read and modify files in the current directory, but network operations still require confirmationDaily code development, refactoring tasks
full-autoFully automatic: runs automatically in a sandbox with network disabled, no confirmation neededBatch tasks, CI/CD automation
\\n
# Specify approval mode on launch\\ncodex --approval-mode ask          # Default read-only mode\\ncodex --approval-mode auto-edit    # Auto edit mode (abbreviated as -a auto-edit)\\ncodex --approval-mode full-auto    # Fully automatic mode\\n\\n# Switch in interactive interface\\n/approvals  # Enter this command to switch approval mode\\n
\\n

Your First Conversation

\\n

Example 1: Analyzing Project Structure

\\n
codex "Analyze the directory structure of this project and tell me the purpose of the main files."\\n# Codex will automatically read files and output something like:\\n# βœ“ Read package.json\\n# βœ“ Scan src/ Directory (23 files)\\n# Project Structure Analysis:\\n# - src/index.ts:Application entry point, initializes the Express server.\\n# - src/routes/:API Route Definitions (5 endpoints in total)\\n# ...\\n
\\n

Example 2: Fixing Bugs

\\n
codex "My login function has a bug; the token is not saved correctly after user login. Help me identify the issue and fix it."\\n# Codex will:\\n# 1. Read relevant files\\n# 2. Analyze code logic\\n# 3. Propose modification plan\\n# 4. Execute modifications after your confirmation\\n
\\n

Example 3: Generating New Features

\\n
codex "Add a user registration endpoint to my Express application that validates the email format, requires a minimum 8-character password, and stores user information in the database."\\n\\n# Pass image context\\ncodex -i design.png "Implement the corresponding React component according to this design mockup."\\n
\\n

Image Input

\\n

Codex CLI supports using images as context input, which is particularly useful in the following scenarios:

\\n
    \\n
  • Analyzing error screenshots
  • \\n
  • Generating frontend code based on UI design mockups
  • \\n
  • Interpreting architecture diagrams and implementing features accordingly
  • \\n
\\n
# Method 1: Pass image path via command line\\ncodex -i screenshot.png "Explain this error message and tell me how to fix it."\\n\\n# Method 2: Pass multiple images\\ncodex --image img1.png,img2.jpg "Compare the differences between these two interfaces and implement the design from Figure 1."\\n\\n# Method 3: Paste image in interactive interface (macOS)\\n# After copying the image, directly press Cmd+V in the Codex input box to paste\\n\\n# Method 4: Shift + drag image to terminal window\\n
← Codex AdvancedCodex Intro β†’