ตัวอย่างการตั้งค่า
หน้านี้ให้ตัวอย่าง config.toml ที่ครบถ้วนสำหรับ Codex ซึ่งนักพัฒนาสามารถ copy และปรับแต่งได้ตามต้องการ ตัวอย่างครอบคลุม keys ส่วนใหญ่ที่ Codex อ่านจาก config.toml พร้อม default behaviors, ค่าแนะนำ, และหมายเหตุอธิบาย
Core Model Selection
# โมเดลหลัก
model = "gpt-5.5"
# รูปแบบการสื่อสาร: none, friendly, pragmatic
personality = "friendly"
# Provider: openai (ค่าเริ่มต้น), ollama, bedrock, หรือ custom
model_provider = "openai"
Reasoning & Verbosity
# ระดับ reasoning: minimal, low, medium, high, xhigh
model_reasoning_effort = "medium"
# ระดับ reasoning ในโหมด plan
# plan_mode_reasoning_effort = "high"
# สรุป reasoning: auto, none, concise
# model_reasoning_summary = "auto"
# ระดับ verbosity สำหรับ GPT-5 family
# model_verbosity = "medium"
Instruction Overrides
# คำสั่งเพิ่มเติมสำหรับนักพัฒนา
# developer_instructions = "Always write tests for new functions."
# ปรับแต่ง prompt สำหรับ history compaction
# history_compaction_instructions = "Summarize concisely."
# ไฟล์ base instructions
# base_instructions_file = "~/.codex/base.md"
Approval & Sandbox
# นโยบายการอนุมัติ: untrusted, on-request, never
approval_policy = "on-request"
# Reviewer: user, auto_review
# reviewer = "user"
# Sandbox mode: read-only, workspace-write, danger-full-access
sandbox_mode = "workspace-write"
Authentication & Login
# URL สำหรับ ChatGPT authentication
# chatgpt_base_url = "https://chatgpt.com"
# Base URL สำหรับ OpenAI API
# openai_base_url = "https://api.openai.com/v1"
Project Documentation
# ขนาดสูงสุดของ AGENTS.md (bytes)
# project_doc_max_bytes = 32768
# ชื่อไฟล์ fallback documentation
# project_doc_filenames = ["AGENTS.md", "CLAUDE.md"]
# ตัวระบุ project root
# project_root_markers = [".git", "package.json"]
History & UI
# โหมด web search: disabled, cached, live
web_search = "cached"
# แสดง reasoning ใน UI
# show_reasoning = true
# ตรวจจับการวาง
# detect_paste = true
Agents & Skills
[agents]
# จำนวน agent threads สูงสุดพร้อมกัน
max_threads = 6
# ความลึกสูงสุดของ nested spawns
max_depth = 1
Shell Environment Policy
[shell_environment_policy]
# ระดับการ inherit: all, none
inherit = "none"
# Variables ที่รวมด้วย glob patterns
include = ["PATH", "HOME", "EDITOR", "TERM"]
# Variables ที่ยกเว้น
# exclude = ["SECRET_*"]
MCP Servers
# STDIO server example
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
# HTTP server example
# [mcp_servers.remote_tool]
# url = "https://tools.example.com/mcp"
# bearer_token_env_var = "TOOL_API_KEY"
Model Providers
# OpenAI (built-in, ไม่ต้องตั้งค่า)
# Ollama local
[model_providers.ollama]
name = "Ollama Local"
base_url = "http://localhost:11434/v1"
# Custom proxy
# [model_providers.proxy]
# name = "Custom Proxy"
# base_url = "http://proxy.example.com"
# env_key = "OPENAI_API_KEY"
Feature Flags
[features]
hooks = true
memories = false
shell_snapshot = true
# network_proxy = false
Lifecycle Hooks
# [hooks]
# [hooks.PreToolUse]
# [[hooks.PreToolUse.hooks]]
# type = "command"
# command = ["bash", "-c", "echo pre-tool-use"]
OpenTelemetry (OTEL)
# [otel]
# exporter = "otlp-http"
# endpoint = "http://collector.example.com:4318"
Windows Configuration
[windows]
# sandbox = "elevated" # แนะนำ
หมายเหตุ
- Root TOML keys ต้องปรากฏก่อน tables
- Keys ที่ optional จะแสดงแบบ commented — ลบ comment เพื่อเปิดใช้งาน
- ลบหรือปรับแต่งตัวอย่างก่อนใช้งานจริง
- สร้าง config profiles แยกต่างหากสำหรับแต่ละ workflow