- Codex CLI ဆိုတာ ဘာလဲ?
- စတင်ခြင်း
- Authentication - Login နှင့် Access
- AGENTS.md - ပရောဂျက် ညွှန်ကြားချက်များ
- Settings နှင့် Configuration
- Sandbox, Approval, Network နှင့် Rules
- Skills နှင့် Slash Commands
- Agents နှင့် Subagents
- MCP (Model Context Protocol)
- Hooks - Lifecycle အလိုအလျောက်လုပ်ဆောင်ခြင်း
- Non-interactive Mode နှင့် Automation
- Session History, Resume နှင့် Local State
- CLI ရည်ညွှန်းချက်
- Project Structure
- နောက်ထပ် ဖတ်ရှုရန်
Codex CLI ဆိုတာ OpenAI ရဲ့ coding agent ကို terminal ထဲကနေ တိုက်ရိုက် အသုံးပြုနိုင်စေတဲ့ command-line client ဖြစ်ပါတယ်။ အလွယ်ပြောရရင် သူက chat bot တစ်ခုထက် ပိုပါတယ်။ Repository ကို ဖတ်နိုင်တယ်၊ file တွေကို ပြင်နိုင်တယ်၊ terminal command တွေ run နိုင်တယ်၊ MCP tools တွေနဲ့ ချိတ်ဆက်နိုင်တယ်၊ လိုအပ်ရင် subagent တွေ spawn လုပ်ပြီး အပြိုင်အလုပ်လုပ်စေနိုင်တယ်။
graph LR
A[You] -->|Natural language| B[Codex CLI]
B -->|Read / Edit| C[Codebase]
B -->|Run| D[Shell Commands]
B -->|Connect| E[MCP Servers]
B -->|Spawn| F[Subagents]
B -->|Review| G[Diffs & Git Workflow]
style B fill:#0f766e,color:#fff
style C fill:#2563eb,color:#fff
style D fill:#d97706,color:#fff
style E fill:#7c3aed,color:#fff
style F fill:#dc2626,color:#fff
style G fill:#059669,color:#fff
ဘယ်နေရာမှာ အဓိက သုံးလဲဆိုရင်တော့-
- local terminal ထဲမှာ codebase ကို နားလည်စေချင်တဲ့အခါ
- repo အပေါ်မှာ implementation, review, debugging လုပ်ခိုင်းချင်တဲ့အခါ
codex execနဲ့ CI/CD, scripts, automation flow ထဲ ထည့်သုံးချင်တဲ့အခါAGENTS.md, skills, MCP, subagents တွေပါ တစ်ပြိုင်နက် အသုံးချချင်တဲ့အခါ
Codex CLI ကို official docs အရ npm နဲ့ install လုပ်တာက အလွယ်ဆုံးပါ။
# Install
npm i -g @openai/codex
# Start interactive terminal UI
codex
# Quick one-off prompt
codex "Explain this codebase"
# Use a specific model
codex --model gpt-5.4
# Low-friction local automation
codex --full-auto "Fix the failing tests"
# Upgrade to the latest CLI
npm i -g @openai/codex@latestမှတ်ထားသင့်တဲ့ အချက်တွေ
- ပထမဆုံး
codexrun လုပ်တဲ့အခါ login ဝင်ခိုင်းပါလိမ့်မယ်။ - Official docs အရ Codex CLI ကို macOS နဲ့ Linux မှာ အပြည့်အဝ ပိုကောင်းစွာ သုံးနိုင်ပါတယ်။
- Windows support က experimental အနေအထားပါ။ Windows သုံးမယ်ဆို WSL ထဲမှာ run တာ ပိုကောင်းပါတယ်။
Codex CLI မှာ OpenAI models သုံးဖို့ login နည်း (၂) မျိုးရှိပါတယ်။
- ChatGPT sign-in: subscription / workspace access နဲ့ သုံးတာ
- API key sign-in: usage-based billing နဲ့ သုံးတာ
Official docs အရ Codex CLI နဲ့ IDE extension က ဒီ login method နှစ်မျိုးစလုံးကို support လုပ်ပါတယ်။
# Browser login flow
codex login
# API key from stdin
printenv OPENAI_API_KEY | codex login --with-api-key
# Check current login state
codex login status
# Headless / remote environment
codex login --device-auth| နည်းလမ်း | ဘာအတွက် သင့်တော်လဲ |
|---|---|
| ChatGPT login | ပုံမှန် local development, Codex credits / workspace policies, Fast mode လို feature မျိုးတွေ |
| API key login | CI/CD, script automation, usage-based billing, headless workflows |
- ChatGPT login လုပ်ရင် browser window တစ်ခု ဖွင့်ပြီး OAuth flow နဲ့ sign in လုပ်ပါတယ်။
- API key login လုပ်ရင် OpenAI Platform usage အတိုင်း billing လုပ်သွားမှာပါ။
- Cached credential တွေကို
~/.codex/auth.jsonသို့မဟုတ် OS keychain ထဲမှာ သိမ်းထားနိုင်ပါတယ်။ - Remote/headless machine တွေအတွက် device auth (
codex login --device-auth) ကို official docs က recommend လုပ်ထားပါတယ်။
Claude Code မှာ CLAUDE.md ရှိသလို Codex CLI မှာတော့ AGENTS.md က project instruction file အဓိက ဖြစ်ပါတယ်။ Codex က အလုပ်မစခင် AGENTS.md ကို ဖတ်ပြီး အဲဒီ project ရဲ့ working agreements, build command, coding rules, testing rules, architecture notes တွေကို context ထဲ ထည့်သွားပါတယ်။
graph TD
GLOBAL["~/.codex/AGENTS.md<br/><small>Global defaults</small>"]
ROOT["repo/AGENTS.md<br/><small>Project-wide rules</small>"]
NESTED["services/payments/AGENTS.md<br/><small>Module rules</small>"]
OVERRIDE["services/payments/AGENTS.override.md<br/><small>Closest override wins</small>"]
CODEX["Codex CLI Session"]
GLOBAL --> ROOT
ROOT --> NESTED
NESTED --> OVERRIDE
OVERRIDE --> CODEX
style GLOBAL fill:#7c3aed,color:#fff
style ROOT fill:#2563eb,color:#fff
style NESTED fill:#059669,color:#fff
style OVERRIDE fill:#dc2626,color:#fff
style CODEX fill:#0f766e,color:#fff
Official docs အရ discovery order က ဒီလိုပါ-
~/.codex/AGENTS.override.mdရှိရင် အဲဒါကို သုံးတယ်- မရှိရင်
~/.codex/AGENTS.mdကို သုံးတယ် - Project root ကနေ current working directory အထိ directory တစ်ခုချင်းစီမှာ
AGENTS.override.mdကို အရင်ရှာတယ် - မရှိရင်
AGENTS.mdကိုရှာတယ် - မရှိသေးရင်
project_doc_fallback_filenamesထဲက alternate filename တွေကို စစ်တယ် - Root ကနေ current directory အထိ ရလာတဲ့ instruction file တွေကို ပေါင်းစည်းပြီး later file က earlier guidance ကို override ဖြစ်စေတယ်
- Directory တစ်ခုချင်းစီမှာ file တစ်ခုတည်း ပဲ ယူပါတယ်
AGENTS.override.mdကAGENTS.mdထက် ဦးစားပေးပါတယ်- Combined instruction size က default 32 KiB ထိပဲ load လုပ်ပါတယ်
- Project ကို trusted မထားရင်
.codex/config.tomlလို project layer တွေအပြင် instruction discovery ပိုင်းလည်း ကန့်သတ်နိုင်ပါတယ်
mkdir -p ~/.codex# ~/.codex/AGENTS.md
## Working agreements
- Always run tests after code changes
- Prefer pnpm over npm when both exist
- Ask before adding new production dependencies# AGENTS.md
## Repository expectations
- Run `npm run lint` before opening a pull request
- Update docs when public behavior changes
- Prefer existing utilities over adding new helper files# services/payments/AGENTS.override.md
## Payments rules
- Use `make test-payments` instead of generic test commands
- Never change payment credentials without calling it out clearlyCodex CLI ထဲမှာ /init command သုံးပြီး current directory အတွက် AGENTS.md scaffold တစ်ခု အလိုအလျောက် generate လုပ်လို့ရပါတယ်။
/init
# ~/.codex/config.toml
project_doc_fallback_filenames = ["TEAM_GUIDE.md", ".agents.md"]
project_doc_max_bytes = 65536Codex CLI ရဲ့ main config file က config.toml ဖြစ်ပါတယ်။
- User-level config:
~/.codex/config.toml - Project-level config:
<repo>/.codex/config.toml - System-level config:
/etc/codex/config.toml
Official docs အရ precedence order က ဒီလိုပါ-
- CLI flags နဲ့
--config --profile <name>နဲ့ရွေးထားတဲ့ profile- Project
.codex/config.tomllayers (root ကနေ current dir ထိ, closest wins) - User config
~/.codex/config.toml - System config
/etc/codex/config.toml - Built-in defaults
graph BT
DEFAULT["Built-in defaults"]
SYSTEM["/etc/codex/config.toml"]
USER["~/.codex/config.toml"]
PROJECT["repo/.codex/config.toml"]
PROFILE["--profile <name>"]
CLI["CLI flags / --config"]
DEFAULT --> SYSTEM
SYSTEM --> USER
USER --> PROJECT
PROJECT --> PROFILE
PROFILE --> CLI
style CLI fill:#dc2626,color:#fff
style PROFILE fill:#7c3aed,color:#fff
style PROJECT fill:#2563eb,color:#fff
style USER fill:#059669,color:#fff
style SYSTEM fill:#d97706,color:#fff
model = "gpt-5.4"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
web_search = "cached"
model_reasoning_effort = "high"
personality = "friendly"
[sandbox_workspace_write]
network_access = false
[shell_environment_policy]
include_only = ["PATH", "HOME"]| key | ရည်ရွယ်ချက် |
|---|---|
model |
Default model သတ်မှတ်ရန် |
approval_policy |
command run မလုပ်ခင် prompt မေး/မမေး ထိန်းချုပ်ရန် |
sandbox_mode |
filesystem / network access scope ထိန်းချုပ်ရန် |
web_search |
cached / live / disabled search mode |
model_reasoning_effort |
reasoning depth ကို minimal မှ xhigh ထိ သတ်မှတ်ရန် |
personality |
friendly, pragmatic, none style |
review_model |
/review အတွက် model override |
codex --model gpt-5.4
codex --config model='"gpt-5.4"'
codex --config sandbox_workspace_write.network_access=true
codex --config 'shell_environment_policy.include_only=["PATH","HOME"]'Profiles က named preset တစ်ခုလို သုံးလို့ရပါတယ်။ Official docs အရ experimental ဖြစ်ပြီး CLI မှာသာ အဓိက support လုပ်ထားပါတယ်။
model = "gpt-5-codex"
approval_policy = "on-request"
[profiles.deep-review]
model = "gpt-5-pro"
model_reasoning_effort = "high"
approval_policy = "never"
[profiles.lightweight]
model = "gpt-4.1"
approval_policy = "untrusted"codex --profile deep-reviewCodex ရဲ့ local state ကို default အနေဖြင့် ~/.codex အောက်မှာ သိမ်းထားပါတယ်။ CODEX_HOME သတ်မှတ်ထားရင် အဲဒီ path ကို သုံးသွားမှာပါ။
Codex CLI ကို လုံခြုံစွာ သုံးဖို့ဆိုရင် sandbox mode နဲ့ approval policy ကို နားလည်ထားဖို့ အရေးကြီးပါတယ်။ Official docs အရ local Codex run တွေမှာ network access က default အနေဖြင့် off ဖြစ်ပြီး၊ write access ကိုလည်း active workspace ထဲမှာပဲ ကန့်သတ်ထားပါတယ်။
graph TD
USER["You"] --> APPROVAL["Approval Policy"]
APPROVAL --> SANDBOX["Sandbox Mode"]
SANDBOX --> FS["Filesystem Access"]
SANDBOX --> NET["Network Access"]
SANDBOX --> CMD["Command Execution"]
style APPROVAL fill:#7c3aed,color:#fff
style SANDBOX fill:#dc2626,color:#fff
style FS fill:#2563eb,color:#fff
style NET fill:#d97706,color:#fff
style CMD fill:#059669,color:#fff
| mode | အဓိပ္ပာယ် |
|---|---|
read-only |
file မပြင်နိုင်၊ command run scope က အလွန်ကန့်သတ်ထား |
workspace-write |
workspace ထဲမှာ read/edit/run လုပ်နိုင်၊ default local mode အဖြစ် အများဆုံးသုံးတဲ့ mode |
danger-full-access |
machine ပေါ်က အခြားနေရာတွေထိ သွားနိုင်၊ network access လည်း ဖွင့်နိုင် |
| policy | အဓိပ္ပာယ် |
|---|---|
untrusted |
trusted command မဟုတ်ရင် approval တောင်းမယ် |
on-request |
model က လိုအပ်တဲ့အချိန် approval တောင်းမယ် |
never |
approval မတောင်းဘဲ failure ဖြစ်ရင် model ကိုပြန်ပေးမယ် |
on-failure |
deprecated ဖြစ်ပါပြီ |
# Ask before risky actions, write only in workspace
codex --full-auto
# Explicit control
codex --sandbox workspace-write --ask-for-approval on-request
# Read-only consultation
codex --sandbox read-only --ask-for-approval untrusted
# Extremely dangerous
codex --dangerously-bypass-approvals-and-sandboxOfficial docs အရ /permissions နဲ့ approval mode ကို mid-session ပြောင်းလို့ရပါတယ်။
- Auto: workspace ထဲမှာ file read/edit/run လုပ်နိုင်
- Read-only: consultative mode, plan-only style ပိုနီးစပ်
- Full Access: network အပါအဝင် machine scope ပိုကျယ်
workspace-write mode မှာ network access ကို config နဲ့ သီးသန့်ဖွင့်နိုင်ပါတယ်-
[sandbox_workspace_write]
network_access = trueOfficial docs အရ local Codex CLI မှာ web search ကို default အနေဖြင့် cached mode နဲ့ သုံးနိုင်ပါတယ်။
web_search = "cached" # default
# web_search = "live" # same as --search
# web_search = "disabled"# Use live web search for a run
codex --search "Find the latest breaking changes in this library"Codex မှာ experimental rules system လည်း ရှိပါတယ်။ ဒီကောင်က sandbox အပြင်ကို ထွက်သွားမယ့် command prefix တွေကို allow / prompt / forbidden လုပ်ဖို့ သုံးတာပါ။
User-level rule file example:
# ~/.codex/rules/default.rules
prefix_rule(
pattern = ["gh", "pr", "view"],
decision = "prompt",
justification = "Viewing PRs is allowed with approval",
match = [
"gh pr view 7888",
"gh pr view --repo openai/codex",
],
)Rule file ကို test လုပ်ချင်ရင်-
codex execpolicy check --pretty \
--rules ~/.codex/rules/default.rules \
-- gh pr view 7888 --json title,body,commentsCodex CLI ရဲ့ customization ပိုင်းမှာ skills နဲ့ slash commands နှစ်မျိုးစလုံး အရေးကြီးပါတယ်။
Skill ဆိုတာ task-specific workflow တစ်ခုကို instructions, references, scripts တွေနဲ့ ထုပ်ပိုးထားတဲ့ reusable capability ဖြစ်ပါတယ်။
flowchart LR
USER["User prompt"] --> SKILL["Skill metadata"]
SKILL --> LOAD["Load full SKILL.md only when needed"]
LOAD --> CODEX["Codex executes workflow"]
CODEX --> RESULT["Result"]
style SKILL fill:#7c3aed,color:#fff
style LOAD fill:#d97706,color:#fff
style CODEX fill:#0f766e,color:#fff
my-skill/
SKILL.md
scripts/
references/
assets/
agents/
openai.yaml
---
name: release-notes
description: Generate release notes when the user asks to summarize recent changes for a release.
---
1. Inspect the recent commits
2. Group changes by feature / fix / docs
3. Produce concise release notesOfficial docs အရ skill ကို (၂) နည်းနဲ့ activate လုပ်နိုင်ပါတယ်-
- Explicit:
/skillsသို့မဟုတ်$skill-namemention နဲ့ - Implicit: prompt က skill description နဲ့ ကိုက်ညီရင် Codex က auto သုံးနိုင်တယ်
| scope | location |
|---|---|
| Repo | .agents/skills |
| User | $HOME/.agents/skills |
| Admin | /etc/codex/skills |
| System | Codex built-in skills |
Repo အတွင်းက .agents/skills folder တွေကို Codex က current directory ကနေ repo root အထိ scan လုပ်ပါတယ်။
$skill-creator
$skill-installer linear
Codex CLI မှာ / ရိုက်လိုက်တာနဲ့ slash command picker ဖွင့်နိုင်ပါတယ်။ Official docs အရ keyboard-first control အတွက် ဒီ commands တွေက အလွန်အသုံးဝင်ပါတယ်။
| Command | လုပ်ဆောင်ချက် |
|---|---|
/permissions |
approval / access level ပြောင်းရန် |
/agent |
active agent thread ပြောင်းရန် |
/apps |
connector/app mention ထည့်ရန် |
/clear |
terminal နဲ့ conversation ကို fresh start လုပ်ရန် |
/compact |
long conversation ကို summarize လုပ်ရန် |
/copy |
latest completed output ကို copy လုပ်ရန် |
/diff |
Git diff ကိုကြည့်ရန် |
/init |
AGENTS.md scaffold generate လုပ်ရန် |
/mcp |
active MCP tools list ကြည့်ရန် |
/mention |
file/folder mention ထည့်ရန် |
/model |
model နှင့် reasoning effort ပြောင်းရန် |
/fast |
GPT-5.4 Fast mode toggle လုပ်ရန် |
/plan |
plan mode ထဲ ပြောင်းရန် |
/personality |
communication style ပြောင်းရန် |
/ps |
background terminal status ကြည့်ရန် |
/fork |
current conversation ကို fork လုပ်ရန် |
/resume |
saved session ပြန်ဖွင့်ရန် |
/new |
same CLI session ထဲ chat အသစ်စရန် |
/review |
working tree review လုပ်ရန် |
/status |
current model, approvals, token usage ကြည့်ရန် |
/debug-config |
config layer diagnostics ကြည့်ရန် |
/logout |
sign out လုပ်ရန် |
/plan Propose a migration plan for this service
/review
/diff
/mcp
/status
/fork
Codex CLI က image input လည်း support လုပ်ပါတယ်။
codex -i screenshot.png "Explain this UI bug"
codex --image img1.png,img2.jpg "Summarize these diagrams"Long prompt ရေးရတာခက်ရင် input field ထဲမှာ Ctrl+G နှိပ်ပြီး VISUAL သို့မဟုတ် EDITOR နဲ့ သတ်မှတ်ထားတဲ့ editor ကို ဖွင့်လို့ရပါတယ်။
Codex က subagent workflow ကို support လုပ်ပါတယ်။ ဒါပေမယ့် official docs အရ Codex က user က explicit ပြောမှပဲ subagent spawn လုပ်ပါတယ်။ Claude လို auto fan-out လုပ်သွားတာမျိုး default မဟုတ်ပါဘူး။
graph TD
MAIN["Main Codex Session"]
MAIN -->|"explicit request"| EXP["Explorer Agent"]
MAIN -->|"explicit request"| WRK["Worker Agent"]
MAIN -->|"explicit request"| CUS["Custom Agent"]
EXP --> MAIN
WRK --> MAIN
CUS --> MAIN
style MAIN fill:#0f766e,color:#fff
style EXP fill:#2563eb,color:#fff
style WRK fill:#059669,color:#fff
style CUS fill:#7c3aed,color:#fff
| agent | ရည်ရွယ်ချက် |
|---|---|
default |
general-purpose fallback |
worker |
implementation, edits, fixes |
explorer |
read-heavy exploration |
Custom agent file တွေကို ဒီနေရာတွေမှာထားနိုင်ပါတယ်-
~/.codex/agents/*.toml # Personal agents
.codex/agents/*.toml # Project-scoped agents
name = "reviewer"
description = "PR reviewer focused on correctness, security, and missing tests."
model = "gpt-5.4"
model_reasoning_effort = "high"
sandbox_mode = "read-only"
developer_instructions = """
Review code like an owner.
Prioritize correctness, security, behavior regressions, and missing test coverage.
"""[agents]
max_threads = 6
max_depth = 1
job_max_runtime_seconds = 1800- Default
max_threadsက 6 ဖြစ်ပါတယ် - Default
max_depthက 1 ဖြစ်ပြီး direct child agent ထိပဲ ခွင့်ပြုတာနဲ့ ဆင်တူပါတယ် - Subagent workflow က token ပိုကုန်တယ်
/agentcommand နဲ့ active agent thread တွေကြား switch လုပ်နိုင်တယ်
MCP ကတော့ Codex ကို third-party tools, docs, browser tooling, design tools, databases, internal systems တွေနဲ့ ချိတ်ပေးတဲ့ protocol ဖြစ်ပါတယ်။
graph LR
CODEX["Codex CLI"] <-->|stdio| DOCS["Docs MCP"]
CODEX <-->|stdio| DB["Database MCP"]
CODEX <-->|http| FIGMA["Figma MCP"]
CODEX <-->|http| BROWSER["Browser MCP"]
CODEX <-->|http| CUSTOM["Custom MCP Server"]
style CODEX fill:#0f766e,color:#fff
style DOCS fill:#2563eb,color:#fff
style DB fill:#059669,color:#fff
style FIGMA fill:#7c3aed,color:#fff
style BROWSER fill:#d97706,color:#fff
style CUSTOM fill:#dc2626,color:#fff
Official docs အရ Codex က support လုပ်တာ-
- STDIO servers
- Streamable HTTP servers
- Bearer token auth
- OAuth auth (
codex mcp login <server-name>)
codex mcp add context7 -- npx -y @upstash/context7-mcp
codex mcp list
codex mcp get context7
codex mcp remove context7
codex mcp login some-server[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"][mcp_servers.design]
url = "https://example.com/mcp"
bearer_token_env_var = "DESIGN_TOKEN"| transport | fields |
|---|---|
| STDIO | command, args, env, env_vars, cwd |
| HTTP | url, bearer_token_env_var, http_headers, env_http_headers |
/mcp
ဒီ command နဲ့ active MCP tools တွေကို interactive session ထဲကနေ တိုက်ရိုက် ကြည့်လို့ရပါတယ်။
Codex hooks က lifecycle event တချို့ပေါ်မှာ deterministic script တွေ run စေဖို့ သုံးတာပါ။ Official docs အရ ဒီ feature က experimental ဖြစ်ပြီး Windows support ကို ယာယီ disable လုပ်ထားပါတယ်။
- prompt / command log များကို analytics system ဆီပို့ခြင်း
- API key paste လုပ်မိတာမျိုးကို block လုပ်ခြင်း
- stop event မှာ custom validator run လုပ်ခြင်း
- conversation summary ကို persistent note အဖြစ် သိမ်းခြင်း
[features]
codex_hooks = true~/.codex/hooks.json
<repo>/.codex/hooks.json
Codex က matching hook file အားလုံးကို load လုပ်ပြီး run စေပါတယ်။ Higher precedence layer က lower layer ကို replace မလုပ်ပါဘူး။
| event | အဓိပ္ပာယ် |
|---|---|
SessionStart |
session စတင်ချိန် |
UserPromptSubmit |
prompt မစီမံခင် |
PreToolUse |
tool မ run ခင် |
PostToolUse |
tool run ပြီးနောက် |
Stop |
turn ပြီးဆုံးချိန် |
{
"hooks": {
"SessionStart": [
{
"matcher": "startup|resume",
"hooks": [
{
"type": "command",
"command": "python3 ~/.codex/hooks/session_start.py",
"statusMessage": "Loading session notes"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "/usr/bin/python3 .codex/hooks/pre_tool_use_policy.py",
"statusMessage": "Checking Bash command"
}
]
}
]
}
}Codex CLI ကို script, CI, batch workflow တွေထဲ ထည့်သုံးချင်ရင် codex exec က အဓိက command ဖြစ်ပါတယ်။
codex exec "summarize the repository structure and list the top 5 risky areas"
codex exec "generate release notes for the last 10 commits" | tee release-notes.md
codex exec --ephemeral "triage this repository and suggest next steps"Official docs အရ codex exec က-
- progress ကို
stderrမှာ stream လုပ်တယ် - final agent message ကို
stdoutထုတ်တယ် - default အနေဖြင့် read-only sandbox နဲ့ run တယ်
# Allow edits in automation
codex exec --full-auto "fix the CI failure"
# Broad access only in controlled environments
codex exec --sandbox danger-full-access "run the full release process"codex exec --json "summarize the repo structure" | jqcodex exec "Extract project metadata" -o ./project-metadata.txtcodex exec "Extract project metadata" \
--output-schema ./schema.json \
-o ./project-metadata.jsonOfficial docs အရ codex exec မှာ one-off API key သုံးချင်ရင် CODEX_API_KEY ကိုသုံးနိုင်ပါတယ်။
CODEX_API_KEY=<api-key> codex exec --json "triage open bug reports"codex review --uncommitted
codex review --base main
codex review --commit HEAD~1
codex review "Focus on performance regressions"Codex CLI မှာ Claude Code လို auto-memory system တစ်ခုကို user-facing အနေနဲ့ အလေးပေးပြထားတာ မဟုတ်ပေမယ့် local session transcripts, resume workflow, shared config state တွေတော့ ရှိပါတယ်။
codex resume
codex resume --last
codex resume --all
codex resume <SESSION_ID>Official docs အရ-
codex resumeက recent interactive sessions picker ကို ဖွင့်တယ်--lastက picker မဖွင့်ဘဲ latest session ကို တိုက်ရိုက် ဖွင့်တယ်--allက current working directory filter ကို ဖြုတ်တယ်- Session ID ကို
/status, picker, သို့မဟုတ်~/.codex/sessions/ကနေ ယူနိုင်တယ်
codex exec resume --last "Implement the plan"
codex exec resume <SESSION_ID> "Fix the race conditions you found"Codex docs အရ CODEX_HOME default က ~/.codex ဖြစ်ပြီး common files တွေက-
~/.codex/
config.toml
auth.json
history.jsonl
log/
sessions/
sqlite/
- CLI နဲ့ IDE extension က config layers နဲ့ cached login ကို မျှဝေသုံးနိုင်တယ်
/compactနဲ့ long conversation ကို summarize လုပ်ပြီး context လွတ်အောင် လုပ်နိုင်တယ်/forkနဲ့ current conversation ကို thread အသစ်တစ်ခုအဖြစ် ခွဲထုတ်နိုင်တယ်
codex # Interactive CLI
codex "Explain this codebase" # Quick prompt
codex exec "fix the CI failure" # Non-interactive automation
codex review --uncommitted # Review local changes
codex login # Login flow
codex logout # Remove cached credentials
codex resume --last # Resume latest session
codex fork # Fork a previous session
codex mcp list # MCP server management
codex features list # Feature flags
codex completion zsh # Shell completion
codex --version # CLI version
codex --help # Top-level help| flag | ရည်ရွယ်ချက် |
|---|---|
--model, -m |
model သတ်မှတ်ရန် |
--cd, -C |
working directory သတ်မှတ်ရန် |
--profile, -p |
named profile ရွေးရန် |
--sandbox, -s |
sandbox mode သတ်မှတ်ရန် |
--ask-for-approval, -a |
approval policy သတ်မှတ်ရန် |
--full-auto |
on-request + workspace-write shortcut |
--search |
live web search ဖွင့်ရန် |
--add-dir |
extra writable roots ထည့်ရန် |
--image, -i |
image input attach လုပ်ရန် |
--config, -c |
one-off config override |
--oss |
local OSS provider သုံးရန် |
--dangerously-bypass-approvals-and-sandbox |
sandbox/approval bypass, အလွန်အန္တရာယ်များ |
codex exec --json "summarize the repo structure"
codex exec --ephemeral "temporary analysis"
codex exec -o result.txt "write the final answer to a file too"
codex exec --output-schema schema.json -o out.json "return structured JSON"codex completion zsh~/.zshrc ထဲမှာ-
autoload -Uz compinit && compinit
eval "$(codex completion zsh)"| shortcut | လုပ်ဆောင်ချက် |
|---|---|
Ctrl+L |
screen clear |
Ctrl+G |
prompt editor open |
Up / Down |
composer draft history navigate |
Codex CLI project တစ်ခုကို စနစ်တကျ ပြင်ဆင်ထားမယ်ဆိုရင် structure က ဒီလိုမျိုး ဖြစ်လာနိုင်ပါတယ်။
graph TD
ROOT["Project Root"]
AG["AGENTS.md"]
OVR["services/payments/AGENTS.override.md"]
CFG[".codex/config.toml"]
HOOK[".codex/hooks.json"]
AGENTS[".codex/agents/*.toml"]
SKILLS[".agents/skills/*/SKILL.md"]
RULES["~/.codex/rules/default.rules"]
ROOT --> AG
ROOT --> CFG
ROOT --> HOOK
ROOT --> AGENTS
ROOT --> SKILLS
ROOT --> OVR
CFG --> RULES
style ROOT fill:#0f766e,color:#fff
style AG fill:#2563eb,color:#fff
style CFG fill:#7c3aed,color:#fff
style HOOK fill:#d97706,color:#fff
style AGENTS fill:#059669,color:#fff
style SKILLS fill:#dc2626,color:#fff
style OVR fill:#2563eb,color:#fff
style RULES fill:#991b1b,color:#fff
your-project/
AGENTS.md
services/
payments/
AGENTS.override.md
.codex/
config.toml
hooks.json
agents/
reviewer.toml
explorer.toml
.agents/
skills/
release-notes/
SKILL.md
scripts/
references/
တကယ်လို့ အရမ်းမရှုပ်စေချင်ဘူးဆိုရင် file (၂) ခုလောက်နဲ့တင် စလို့ရပါတယ်။
AGENTS.md
# Project: My App
## Stack
TypeScript, React, Node.js, PostgreSQL
## Commands
- `npm run dev` - start dev server
- `npm test` - run tests
- `npm run lint` - lint code
## Rules
- Use functional components
- Run tests after code changes
- Ask before adding new dependencies.codex/config.toml
model = "gpt-5.4"
approval_policy = "on-request"
sandbox_mode = "workspace-write"
web_search = "cached"
personality = "friendly"ဒီလောက်နဲ့တင် Codex CLI ကို လက်တွေ့ production-ish workflow တော်တော်များများမှာ အသုံးချလို့ရသွားပါပြီ။
- Codex CLI overview: developers.openai.com/codex/cli
- Codex CLI features: developers.openai.com/codex/cli/features
- Command line options: developers.openai.com/codex/cli/reference
- AGENTS.md guide: developers.openai.com/codex/guides/agents-md
- Config basics: developers.openai.com/codex/config-basic
- Hooks: developers.openai.com/codex/hooks
- MCP: developers.openai.com/codex/mcp
- Skills: developers.openai.com/codex/skills
- Subagents: developers.openai.com/codex/subagents
- Non-interactive mode: developers.openai.com/codex/noninteractive