OpenAI Coding Agent 入門

Codex:ターミナルで働く AI コーディングパートナー

808AI ワークショップ向けの実用ページです。Codex の役割を理解し、インストールし、安全な手順でコード読解、バグ修正、テスト作成、PR準備に使います。

01 / Intro

Codex とは

Codex is OpenAI's coding agent. It can run locally through Codex CLI, work in an IDE, or run as Codex Web in ChatGPT. Use it for reading code, planning changes, fixing bugs, writing tests, and preparing PR notes.

02 / Setup

インストール

Mac / Linux
curl -fsSL https://chatgpt.com/codex/install.sh | sh
npm
npm install -g @openai/codex
Homebrew
brew install --cask codex

Run codex, then choose Sign in with ChatGPT. API-key auth is also available for advanced users.

03 / Workflow

808 推奨ワークフロー

  1. Ask Codex to read first, without editing.
  2. Ask for a plan listing files, risks, and verification steps.
  3. Let it make one small change at a time.
  4. Run tests, lint, and build before calling the task done.
  5. Ask for a delivery summary with changes, checks, and remaining risks.

04 / Guardrails

安全と権限

Do not paste secrets

Never paste API keys, passwords, payment data, or customer private data. Share variable names only.

公式ソース

OpenAI Codex GitHub README と OpenAI Developers docs に基づく内容です。使用前に公式の最新バージョンを確認してください。