เริ่มต้นใช้งาน Codex
เริ่มใช้ Codex ใน IDE, CLI หรือบน Cloud ได้เลย
ทุกแผน ChatGPT รวม Codex ไว้แล้ว นอกจากนี้ยังสามารถใช้ Codex ด้วย API credits โดย sign in ด้วย OpenAI API key
ตัวเลือกการติดตั้ง
เลือกช่องทางที่เหมาะกับคุณ: App, IDE Extension, CLI หรือ Cloud
ตัวเลือกที่ 1: App
Codex app รองรับ macOS และ Windows
ขั้นตอน
-
ดาวน์โหลดและติดตั้ง Codex app
- ดาวน์โหลดสำหรับ macOS (Apple Silicon)
- ดาวน์โหลดสำหรับ macOS (Intel)
- ดาวน์โหลดสำหรับ Windows
- แจ้งเตือนเมื่อมีรุ่น Linux
-
เปิด Codex และ sign in
- Sign in ด้วย ChatGPT account หรือ OpenAI API key
- หมายเหตุ: ฟีเจอร์บางอย่างอาจไม่พร้อมใช้เมื่อ sign in ด้วย API key
-
เลือกโปรเจกต์
- เลือกโฟลเดอร์โปรเจกต์ที่ต้องการให้ Codex ทำงาน
- โปรเจกต์เก่าจะปรากฏหากเคยใช้งานไปแล้ว
-
ส่งข้อความแรก
- เลือก "Local" เพื่อทำงานบนเครื่องของคุณ
- ตัวอย่าง prompt:
- "Tell me about this project"
- "Build a classic Snake game in this repo"
- "Find and fix bugs in my codebase with minimal, high-confidence changes"
ตัวเลือกที่ 2: IDE Extension
-
ติดตั้ง Codex extension
- รองรับ Visual Studio Code, Cursor, Windsurf, VS Code Insiders
-
เปิด Codex panel
- Extension จะปรากฏใน sidebar; สามารถย้ายไปด้านขวาได้
-
Sign in และเริ่ม task แรก
- Codex เริ่มต้นใน Agent mode โดยค่าเริ่มต้น
- สามารถอ่านไฟล์ รันคำสั่ง และบันทึกการเปลี่ยนแปลงได้
-
ใช้ Git checkpoints
- สร้าง checkpoint ก่อนและหลัง task เพื่อ revert ได้ง่าย
ตัวเลือกที่ 3: CLI
Codex CLI รองรับ macOS, Windows และ Linux
ขั้นตอน
-
ติดตั้ง Codex CLI
สำหรับ macOS/Linux:
curl -fsSL https://chatgpt.com/codex/install.sh | shสำหรับ Windows:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"ติดตั้งแบบ unattended: ตั้งค่า
CODEX_NON_INTERACTIVE=1หรือใช้ทางเลือก:
npm install -g @openai/codex
# หรือ
brew install --cask codex -
รัน
codexและ sign in- ระบบจะแจ้งให้ sign in ด้วย ChatGPT account หรือ API key
-
สั่งให้ Codex ทำงานใน directory ปัจจุบัน
- ใช้ prompt เดียวกับตัวอย่างใน App
-
ใช้ Git checkpoints
- สร้าง checkpoint เพื่อ revert ได้ง่าย
ตัวเลือกที่ 4: Cloud
ใช้ Codex บน cloud ที่ chatgpt.com/codex
ขั้นตอน
-
เปิด Codex ในเบราว์เซอร์
- เข้าถึงได้ที่ chatgpt.com/codex
- หรือแท็ก
@codexใน GitHub PR comment (ต้อง sign in ด้วย ChatGPT)
-
ตั้งค่า environment
- กำหนด environment settings
- เชื่อมต่อ GitHub repository
-
เริ่ม task และติดตามความคืบหน้า
- ติดตามแบบ real-time ผ่าน logs
- ปล่อยให้ task รันใน background
-
รีวิวการเปลี่ยนแปลงและสร้าง pull request
- รีวิว diff ใน diff view
- แก้ไขเพิ่มเติมหรือสร้าง PR ตรงใน GitHub
ขั้นตอนต่อไป
- ศึกษาเพิ่มเติมเกี่ยวกับ Codex app สำหรับการทำงานกับโปรเจกต์ local
- Migrate ไปยัง Codex โดยย้ายไฟล์ instruction, การตั้งค่า MCP server, skills และ subagents