Codex CLI 치트시트
공식 문서에 있는 Codex CLI 명령, 자주 쓰는 플래그, 비대화형 실행, MCP, 플러그인 관리, 내장 slash commands를 빠르게 확인합니다.
codex로컬 저장소 대화형 작업
codex exec스크립트와 단발성 작업
codex cloudCloud 작업 워크플로
/permissions실시간 세션 제어
빠른 시작
먼저 보게 되는 명령
로컬 작업, 자동화, Cloud 작업, 대화형 세션 제어에서 자주 쓰는 흐름입니다.
codex현재 워크스페이스에서 터미널 UI를 엽니다.
codex exec "fix the failing test"Codex를 비대화형으로 실행하고 결과를 스트리밍합니다.
codex resume --last가장 최근 대화형 세션으로 돌아갑니다.
codex apply TASK_IDCodex Cloud 작업의 최신 diff를 적용합니다.
/permissionsCodex가 확인 없이 수행할 수 있는 작업을 조정합니다.
/model활성 모델과 reasoning effort를 선택합니다.
전역 옵션
codex [OPTIONS] [PROMPT]
주로 기본 codex 명령에 적용되는 옵션입니다. 많은 옵션은 하위 명령에서도 사용할 수 있습니다.
| 옵션 | 타입 / 값 | 용도 |
|---|---|---|
--add-dir | path | Add another writable directory beside the main workspace. |
--ask-for-approval, -a | untrusted | on-request | never | Choose when Codex asks before running commands. |
--cd, -C | path | Set the working directory before the agent starts. |
--config, -c | key=value | Override configuration values inline. |
--dangerously-bypass-approvals-and-sandbox | boolean | Disable approvals and sandboxing for externally isolated environments. |
--yolo | boolean | Alias for the dangerous bypass mode. |
--dangerously-bypass-hook-trust | boolean | Run enabled hooks without persisted trust for this run. |
--disable | feature | Force-disable a feature flag. |
--enable | feature | Force-enable a feature flag. |
--image, -i | path[,path...] | Attach images to the initial prompt. |
--model, -m | string | Override the configured model. |
--no-alt-screen | boolean | Disable alternate-screen mode in the terminal UI. |
--oss | boolean | Use a local open-source model provider, commonly with Ollama. |
--profile, -p | string | Load a named Codex config profile. |
--remote | ws://host:port | wss://host:port | unix:// | unix://PATH | Connect the TUI to a remote app-server. |
--remote-auth-token-env | ENV_VAR | Read the remote bearer token from an environment variable. |
--sandbox, -s | read-only | workspace-write | danger-full-access | Select the sandbox policy for shell commands. |
--search | boolean | Enable live web search. |
--strict-config | boolean | Error on unknown config fields. |
PROMPT | string | Optional starting instruction. |
--add-dir타입 / 값
path용도
Add another writable directory beside the main workspace.
--ask-for-approval, -a타입 / 값
untrusted | on-request | never용도
Choose when Codex asks before running commands.
--cd, -C타입 / 값
path용도
Set the working directory before the agent starts.
--config, -c타입 / 값
key=value용도
Override configuration values inline.
--dangerously-bypass-approvals-and-sandbox타입 / 값
boolean용도
Disable approvals and sandboxing for externally isolated environments.
--yolo타입 / 값
boolean용도
Alias for the dangerous bypass mode.
--dangerously-bypass-hook-trust타입 / 값
boolean용도
Run enabled hooks without persisted trust for this run.
--disable타입 / 값
feature용도
Force-disable a feature flag.
--enable타입 / 값
feature용도
Force-enable a feature flag.
--image, -i타입 / 값
path[,path...]용도
Attach images to the initial prompt.
--model, -m타입 / 값
string용도
Override the configured model.
--no-alt-screen타입 / 값
boolean용도
Disable alternate-screen mode in the terminal UI.
--oss타입 / 값
boolean용도
Use a local open-source model provider, commonly with Ollama.
--profile, -p타입 / 값
string용도
Load a named Codex config profile.
--remote타입 / 값
ws://host:port | wss://host:port | unix:// | unix://PATH용도
Connect the TUI to a remote app-server.
--remote-auth-token-env타입 / 값
ENV_VAR용도
Read the remote bearer token from an environment variable.
--sandbox, -s타입 / 값
read-only | workspace-write | danger-full-access용도
Select the sandbox policy for shell commands.
--search타입 / 값
boolean용도
Enable live web search.
--strict-config타입 / 값
boolean용도
Error on unknown config fields.
PROMPT타입 / 값
string용도
Optional starting instruction.
--dangerously-bypass-approvals-and-sandbox 또는 --yolo는 주변 환경이 강하게 격리되어 있을 때만 사용하세요.
명령 개요
문서화된 최상위 명령
Stable 명령은 일반 사용을 위한 것이며, Experimental 명령은 Codex 변화에 따라 달라질 수 있습니다.
| 명령 | 성숙도 | 용도 |
|---|---|---|
codex | Stable | 대화형 터미널 UI를 시작합니다. |
codex app | Stable | Codex 데스크톱 앱을 엽니다. |
codex app-server | Experimental | 개발 또는 디버깅용 로컬 app-server를 시작합니다. |
codex apply | Stable | Codex Cloud 작업 diff를 로컬에 적용합니다. |
codex a | Stable | Alias for codex apply. |
codex archive | Stable | 저장된 대화형 세션을 보관합니다. |
codex cloud | Experimental | Browse or run Codex Cloud tasks from the terminal. |
codex cloud-tasks | Experimental | Alias for codex cloud. |
codex completion | Stable | shell 자동완성 스크립트를 생성합니다. |
codex debug app-server send-message-v2 | Experimental | Send a V2 test message to app-server. |
codex debug models | Experimental | Print the model catalog Codex sees. |
codex doctor | Stable | 로컬 진단 보고서를 만듭니다. |
codex exec | Stable | Codex를 비대화형으로 실행합니다. |
codex e | Stable | Alias for codex exec. |
codex execpolicy | Experimental | Evaluate command execution policy rules. |
codex features | Stable | List or persist feature flag overrides. |
codex fork | Stable | Fork a previous session into a new thread. |
codex login | Stable | Codex를 인증합니다. |
codex logout | Stable | 저장된 자격 증명을 제거합니다. |
codex mcp | Experimental | Manage MCP server definitions and auth. |
codex mcp-server | Experimental | Run Codex itself as an MCP server. |
codex plugin | Experimental | Install, list, and remove Codex plugins. |
codex plugin marketplace | Experimental | Manage plugin marketplace sources. |
codex remote-control | Experimental | Ensure app-server remote control support is enabled. |
codex resume | Stable | 이전 대화형 세션을 재개합니다. |
codex sandbox | Experimental | Codex 샌드박스 안에서 명령을 실행합니다. |
codex unarchive | Stable | Restore an archived session. |
codex update | Stable | Check for or apply a CLI update when supported. |
codexStable대화형 터미널 UI를 시작합니다.
codex appStableCodex 데스크톱 앱을 엽니다.
codex app-serverExperimental개발 또는 디버깅용 로컬 app-server를 시작합니다.
codex applyStableCodex Cloud 작업 diff를 로컬에 적용합니다.
codex aStableAlias for codex apply.
codex archiveStable저장된 대화형 세션을 보관합니다.
codex cloudExperimentalBrowse or run Codex Cloud tasks from the terminal.
codex cloud-tasksExperimentalAlias for codex cloud.
codex completionStableshell 자동완성 스크립트를 생성합니다.
codex debug app-server send-message-v2ExperimentalSend a V2 test message to app-server.
codex debug modelsExperimentalPrint the model catalog Codex sees.
codex doctorStable로컬 진단 보고서를 만듭니다.
codex execStableCodex를 비대화형으로 실행합니다.
codex eStableAlias for codex exec.
codex execpolicyExperimentalEvaluate command execution policy rules.
codex featuresStableList or persist feature flag overrides.
codex forkStableFork a previous session into a new thread.
codex loginStableCodex를 인증합니다.
codex logoutStable저장된 자격 증명을 제거합니다.
codex mcpExperimentalManage MCP server definitions and auth.
codex mcp-serverExperimentalRun Codex itself as an MCP server.
codex pluginExperimentalInstall, list, and remove Codex plugins.
codex plugin marketplaceExperimentalManage plugin marketplace sources.
codex remote-controlExperimentalEnsure app-server remote control support is enabled.
codex resumeStable이전 대화형 세션을 재개합니다.
codex sandboxExperimentalCodex 샌드박스 안에서 명령을 실행합니다.
codex unarchiveStableRestore an archived session.
codex updateStableCheck for or apply a CLI update when supported.
하위 명령
워크플로별 명령 매트릭스
공식 문서 범위를 유지하면서 빠르게 훑어볼 수 있도록 워크플로별로 정리했습니다.
| 구문 | 타입 / 값 | 용도 |
|---|---|---|
codex | - | 대화형 터미널 UI를 시작합니다. |
codex "PROMPT" | - | Start the TUI with an initial instruction. |
codex --image path | path[,path...] | Start with one or more image attachments. |
codex --remote ENDPOINT | ws://, wss://, unix:// | Connect the TUI to a remote app-server. |
codex app | - | Open the desktop app. |
codex app PATH | path | Open a workspace path in Codex Desktop. |
codex app --download-url URL | url | Override the desktop installer download URL. |
codex app-server | - | Start the local app server. |
codex app-server --listen VALUE | stdio:// | ws://IP:PORT | unix:// | unix://PATH | off | Set the transport listener. |
codex app-server --stdio | boolean | Use stdio transport. |
codex app-server --analytics-default-enabled | boolean | Default analytics to enabled for app-server clients. |
codex app-server --ws-auth MODE | capability-token | signed-bearer-token | Choose WebSocket authentication mode. |
codex app-server --ws-audience VALUE | string | Expected JWT audience. |
codex app-server --ws-issuer VALUE | string | Expected JWT issuer. |
codex app-server --ws-max-clock-skew-seconds N | number | Allow clock skew for token time checks. |
codex app-server --ws-shared-secret-file PATH | absolute path | HMAC secret file for signed bearer tokens. |
codex app-server --ws-token-file PATH | absolute path | Capability token file. |
codex app-server --ws-token-sha256 HEX | hex SHA-256 | Expected SHA-256 digest for a token. |
codex remote-control | - | Ensure the local app-server daemon is running with remote-control enabled. |
codex용도
대화형 터미널 UI를 시작합니다.
codex "PROMPT"용도
Start the TUI with an initial instruction.
codex --image path타입 / 값
path[,path...]용도
Start with one or more image attachments.
codex --remote ENDPOINT타입 / 값
ws://, wss://, unix://용도
Connect the TUI to a remote app-server.
codex app용도
Open the desktop app.
codex app PATH타입 / 값
path용도
Open a workspace path in Codex Desktop.
codex app --download-url URL타입 / 값
url용도
Override the desktop installer download URL.
codex app-server용도
Start the local app server.
codex app-server --listen VALUE타입 / 값
stdio:// | ws://IP:PORT | unix:// | unix://PATH | off용도
Set the transport listener.
codex app-server --stdio타입 / 값
boolean용도
Use stdio transport.
codex app-server --analytics-default-enabled타입 / 값
boolean용도
Default analytics to enabled for app-server clients.
codex app-server --ws-auth MODE타입 / 값
capability-token | signed-bearer-token용도
Choose WebSocket authentication mode.
codex app-server --ws-audience VALUE타입 / 값
string용도
Expected JWT audience.
codex app-server --ws-issuer VALUE타입 / 값
string용도
Expected JWT issuer.
codex app-server --ws-max-clock-skew-seconds N타입 / 값
number용도
Allow clock skew for token time checks.
codex app-server --ws-shared-secret-file PATH타입 / 값
absolute path용도
HMAC secret file for signed bearer tokens.
codex app-server --ws-token-file PATH타입 / 값
absolute path용도
Capability token file.
codex app-server --ws-token-sha256 HEX타입 / 값
hex SHA-256용도
Expected SHA-256 digest for a token.
codex remote-control용도
Ensure the local app-server daemon is running with remote-control enabled.
| 구문 | 타입 / 값 | 용도 |
|---|---|---|
codex apply TASK_ID | string | Codex Cloud 작업 diff를 로컬에 적용합니다. |
codex a TASK_ID | string | Alias for codex apply. |
codex archive SESSION | session ID | session name | Archive a saved session by ID or name. |
codex unarchive SESSION | session ID | session name | Restore an archived session by ID or name. |
codex archive --remote ENDPOINT SESSION | endpoint | Connect to remote app-server before changing archive state. |
codex cloud | - | Browse or run Cloud tasks from the terminal. |
codex cloud exec QUERY | string | Submit a Cloud task directly. |
codex cloud exec --attempts N | 1-4 | Set the number of assistant attempts. |
codex cloud exec --env ENV_ID | ENV_ID | Target a Codex Cloud environment. |
codex cloud list | - | List recent Cloud tasks. |
codex cloud list --cursor VALUE | string | Use a pagination cursor. |
codex cloud list --env ENV_ID | ENV_ID | Filter by environment. |
codex cloud list --json | boolean | Emit JSON output. |
codex cloud list --limit N | 1-20 | Limit the number of tasks returned. |
codex cloud-tasks | - | Alias for codex cloud. |
codex resume | - | Resume an interactive session. |
codex resume SESSION_ID | uuid | Resume a specific interactive session. |
codex resume --all | boolean | Show sessions outside the current directory. |
codex resume --last | boolean | Resume the most recent session. |
codex fork | - | Fork a previous session into a new thread. |
codex fork SESSION_ID | uuid | Fork a specific session. |
codex fork --all | boolean | Show sessions outside the current directory. |
codex fork --last | boolean | Fork the most recent session. |
codex apply TASK_ID타입 / 값
string용도
Codex Cloud 작업 diff를 로컬에 적용합니다.
codex a TASK_ID타입 / 값
string용도
Alias for codex apply.
codex archive SESSION타입 / 값
session ID | session name용도
Archive a saved session by ID or name.
codex unarchive SESSION타입 / 값
session ID | session name용도
Restore an archived session by ID or name.
codex archive --remote ENDPOINT SESSION타입 / 값
endpoint용도
Connect to remote app-server before changing archive state.
codex cloud용도
Browse or run Cloud tasks from the terminal.
codex cloud exec QUERY타입 / 값
string용도
Submit a Cloud task directly.
codex cloud exec --attempts N타입 / 값
1-4용도
Set the number of assistant attempts.
codex cloud exec --env ENV_ID타입 / 값
ENV_ID용도
Target a Codex Cloud environment.
codex cloud list용도
List recent Cloud tasks.
codex cloud list --cursor VALUE타입 / 값
string용도
Use a pagination cursor.
codex cloud list --env ENV_ID타입 / 값
ENV_ID용도
Filter by environment.
codex cloud list --json타입 / 값
boolean용도
Emit JSON output.
codex cloud list --limit N타입 / 값
1-20용도
Limit the number of tasks returned.
codex cloud-tasks용도
Alias for codex cloud.
codex resume용도
Resume an interactive session.
codex resume SESSION_ID타입 / 값
uuid용도
Resume a specific interactive session.
codex resume --all타입 / 값
boolean용도
Show sessions outside the current directory.
codex resume --last타입 / 값
boolean용도
Resume the most recent session.
codex fork용도
Fork a previous session into a new thread.
codex fork SESSION_ID타입 / 값
uuid용도
Fork a specific session.
codex fork --all타입 / 값
boolean용도
Show sessions outside the current directory.
codex fork --last타입 / 값
boolean용도
Fork the most recent session.
비대화형 모드
codex exec 옵션
터미널, 스크립트, 자동화에서 Codex를 단발성 명령으로 실행할 때 사용합니다.
| 옵션 | 타입 / 값 | 용도 |
|---|---|---|
--cd, -C | path | Set the workspace root. |
--color | always | never | auto | Control ANSI color output. |
--dangerously-bypass-approvals-and-sandbox | boolean | Disable approvals and sandboxing. |
--yolo | boolean | Alias for dangerous bypass mode. |
--dangerously-bypass-hook-trust | boolean | Run hooks without persisted trust. |
--ephemeral | boolean | Do not persist session rollout files. |
--full-auto | boolean | Deprecated compatibility option. |
--ignore-rules | boolean | Do not load execpolicy rule files. |
--ignore-user-config | boolean | Do not load user config. |
--image, -i | path[,path...] | Attach images to the first message. |
--json | boolean | Emit NDJSON events. |
--experimental-json | boolean | Older alias for JSON event output. |
--model, -m | string | Override the model. |
--oss | boolean | Use a local OSS model provider. |
--output-last-message, -o | path | Write the final assistant message to a file. |
--output-schema | path | Validate the final output against a JSON Schema. |
--profile, -p | string | Load a config profile. |
--sandbox, -s | read-only | workspace-write | danger-full-access | Choose the sandbox policy. |
--skip-git-repo-check | boolean | Allow running outside a Git repository. |
--config, -c | key=value | Override config inline. |
PROMPT | string | - | Initial instruction. Use - to read from stdin. |
--cd, -C타입 / 값
path용도
Set the workspace root.
--color타입 / 값
always | never | auto용도
Control ANSI color output.
--dangerously-bypass-approvals-and-sandbox타입 / 값
boolean용도
Disable approvals and sandboxing.
--yolo타입 / 값
boolean용도
Alias for dangerous bypass mode.
--dangerously-bypass-hook-trust타입 / 값
boolean용도
Run hooks without persisted trust.
--ephemeral타입 / 값
boolean용도
Do not persist session rollout files.
--full-auto타입 / 값
boolean용도
Deprecated compatibility option.
--ignore-rules타입 / 값
boolean용도
Do not load execpolicy rule files.
--ignore-user-config타입 / 값
boolean용도
Do not load user config.
--image, -i타입 / 값
path[,path...]용도
Attach images to the first message.
--json타입 / 값
boolean용도
Emit NDJSON events.
--experimental-json타입 / 값
boolean용도
Older alias for JSON event output.
--model, -m타입 / 값
string용도
Override the model.
--oss타입 / 값
boolean용도
Use a local OSS model provider.
--output-last-message, -o타입 / 값
path용도
Write the final assistant message to a file.
--output-schema타입 / 값
path용도
Validate the final output against a JSON Schema.
--profile, -p타입 / 값
string용도
Load a config profile.
--sandbox, -s타입 / 값
read-only | workspace-write | danger-full-access용도
Choose the sandbox policy.
--skip-git-repo-check타입 / 값
boolean용도
Allow running outside a Git repository.
--config, -c타입 / 값
key=value용도
Override config inline.
PROMPT타입 / 값
string | -용도
Initial instruction. Use - to read from stdin.
대화형 TUI
내장 slash commands
Codex 입력창에서 / 를 입력하면 slash command 팝업이 열립니다.
| Slash command | 용도 |
|---|---|
/permissions | Set what Codex may do without asking. |
/ide | Include IDE context such as open files and selection. |
/keymap | Remap TUI keyboard shortcuts. |
/vim | Toggle Vim mode for the composer. |
/sandbox-add-read-dir | Add sandbox read access to a directory on Windows. |
/agent | Switch the active agent thread. |
/apps | Browse apps or connectors and insert one into the prompt. |
/plugins | Browse installed and discoverable plugins. |
/hooks | Review lifecycle hooks. |
/clear | Clear the terminal and start a fresh chat. |
/archive | Archive the current session and exit Codex. |
/compact | Summarize visible conversation to free tokens. |
/copy | Copy the latest completed Codex output. |
/diff | Show Git diff, including untracked files. |
/exit | Exit the CLI. |
/experimental | Toggle experimental features. |
/approve | Approve one retry after an auto-review denial. |
/memories | Configure memory usage and generation. |
/skills | Browse and use skills. |
/feedback | Send logs to Codex maintainers. |
/init | Generate an AGENTS.md scaffold. |
/logout | Sign out of Codex. |
/mcp | List configured MCP tools. |
/mcp verbose | Show MCP server details. |
/mention | Attach a file or folder to the conversation. |
/model | Choose model and reasoning effort. |
/fast | Toggle or inspect the Fast service tier. |
/plan | Switch to plan mode. |
/goal | Set, view, pause, resume, or clear a goal. |
/personality | Choose communication style. |
/ps | Show experimental background terminals. |
/stop | Stop all background terminals. |
/fork | Fork the current conversation into a new thread. |
/side | Start an ephemeral side conversation. |
/btw | Start a short side conversation. |
/raw | Toggle raw scrollback mode. |
/resume | Resume a saved conversation. |
/new | Start a new conversation in the same CLI session. |
/quit | Exit the CLI. |
/review | Ask Codex to review the working tree. |
/status | Display session config and token usage. |
/debug-config | Print config-layer diagnostics. |
/statusline | Configure TUI status-line fields. |
/title | Configure terminal title fields. |
/theme | Choose syntax-highlighting theme. |
/permissionsSet what Codex may do without asking.
/ideInclude IDE context such as open files and selection.
/keymapRemap TUI keyboard shortcuts.
/vimToggle Vim mode for the composer.
/sandbox-add-read-dirAdd sandbox read access to a directory on Windows.
/agentSwitch the active agent thread.
/appsBrowse apps or connectors and insert one into the prompt.
/pluginsBrowse installed and discoverable plugins.
/hooksReview lifecycle hooks.
/clearClear the terminal and start a fresh chat.
/archiveArchive the current session and exit Codex.
/compactSummarize visible conversation to free tokens.
/copyCopy the latest completed Codex output.
/diffShow Git diff, including untracked files.
/exitExit the CLI.
/experimentalToggle experimental features.
/approveApprove one retry after an auto-review denial.
/memoriesConfigure memory usage and generation.
/skillsBrowse and use skills.
/feedbackSend logs to Codex maintainers.
/initGenerate an AGENTS.md scaffold.
/logoutSign out of Codex.
/mcpList configured MCP tools.
/mcp verboseShow MCP server details.
/mentionAttach a file or folder to the conversation.
/modelChoose model and reasoning effort.
/fastToggle or inspect the Fast service tier.
/planSwitch to plan mode.
/goalSet, view, pause, resume, or clear a goal.
/personalityChoose communication style.
/psShow experimental background terminals.
/stopStop all background terminals.
/forkFork the current conversation into a new thread.
/sideStart an ephemeral side conversation.
/btwStart a short side conversation.
/rawToggle raw scrollback mode.
/resumeResume a saved conversation.
/newStart a new conversation in the same CLI session.
/quitExit the CLI.
/reviewAsk Codex to review the working tree.
/statusDisplay session config and token usage.
/debug-configPrint config-layer diagnostics.
/statuslineConfigure TUI status-line fields.
/titleConfigure terminal title fields.
/themeChoose syntax-highlighting theme.
자주 쓰는 형태
/fast onTurn the Fast tier on.
/fast offTurn the Fast tier off.
/fast statusShow Fast tier status.
/personality friendlyUse the friendly communication style.
/personality pragmaticUse the pragmatic communication style.
/personality noneDisable personality styling.
/goal <objective>Set a task goal.
/goal pausePause the current goal.
/goal resumeResume the current goal.
/goal clearClear the current goal.
/prompts:<name>Run a local custom prompt. Custom prompts are deprecated in favor of skills.
로컬 확장
내장 slash commands는 정해져 있지만, 설치된 skills, plugins, MCP servers, 더 이상 권장되지 않는 /prompts:* 파일이 이 장비만의 기능을 추가할 수 있습니다.
출처
공식 문서
명령 이름, 플래그, 성숙도 라벨, slash command 범위는 OpenAI Codex CLI 공식 문서를 기준으로 합니다.
읽는 법
이 페이지는 빠른 참조이며 공식 문서 전체를 옮긴 것이 아닙니다.