---
格式版本: 2
标题: "Developer commands | ChatGPT Learn"
原文链接: "https://developers.openai.com/codex/developer-commands"
发布日期: "2026-09-06"
发布时间校准状态: "found"
发布时间需复核: "否"
发布时间来源: "rule:local:strict_original_body"
发布时间证据: "Published Time: Sun, 06 Sep 2026 04:47:15 GMT"
发布时间校准原因: "规则确认唯一严格发布时间，来源 local:strict_original_body"
发布时间校准置信度: "high"
发布时间候选数量: 4
发布时间严格候选数量: 1
发布时间原页读取状态: "source template page reused from URL open"
发布时间未找到原因: ""
发布时间校准时间: "2026-09-07T22:45:27+08:00"
发布时间仲裁状态: "skipped"
发布时间仲裁尝试次数: 0
发布时间仲裁耗时毫秒: 0
发现时间: "2026-09-07T22:07:54+08:00"
入库时间: "2026-09-07T15:14:08.987Z"
来源平台: "固定入口"
搜索渠道: "fixed_url"
搜索词: "https://developers.openai.com/blog"
匹配关键词:
  - "deployment"
  - "performance"
  - "latency"
  - "throughput"
  - "AI"
相关厂家:
  - "OpenAI"
  - "Microsoft"
  - "AWS"
  - "Google"
  - "Oracle"
相关专家:
  []
内容类型: "网页"
抓取工具: "Jina Reader"
清洗工具: "Jina Reader Markdown + Defuddle/Readability 正文提取"
原始附件:
  []
AI优质: "否"
AI打分: 19
AI分档: "非优质"
AI质检状态: "不通过"
AI打分理由: "正文主线是OpenAI Codex CLI/IDE的开发者命令与slash命令参考文档，无任何超节点、AI Rack、机柜级基础设施、互连/供电/液冷/部署内容。来源虽为官方文档，但主题不属机架级AI基础设施；也无新增硬件规格、客户、量产或部署信号。命中教程/工具文档类否决，完整性尚可但业务准入不通过。"
AI质检模型: "zj-deepseek-v4-flash"
AI质检时间: "2026-09-07T23:14:34+08:00"
AI主题相关性: 0
AI来源权威性: 10
AI新颖性: 1
AI技术细节: 1
AI商业部署信号: 0
AI完整性: 7
AI评分提示词版本: "v17-精简生产版"
AI评分提示词SHA256: "48fb9777f386026761b4873eaff30807694fb11e9b352d7c69bf2dfde750cc7d"
AI评分知识库版本: "knowledge_base_v1-20260819+runtime.100"
AI评分知识库SHA256: "7fe4568b9de9fc322c105ece08d18efab5b9b86f27dea6eb043b9a4d273bde60"
AI评分知识库检索词: "[\"OpenAI\",\"https://developers.openai.com/blog\",\"CPO\",\"RAS\",\"NPU\",\"Google\",\"Meta\",\"Microsoft\",\"URL\",\"GMT\",\"LM\",\"COMMAND\"]"
AI评分知识库命中: "[{\"id\":\"july-correct-0033\",\"title\":\"Microsoft, Alphabet, Meta Pivot from Buy to Build in AI\",\"sourceType\":\"labeled_article\",\"time\":\"2026-07\",\"matchedTerms\":[\"OpenAI\",\"RAS\",\"Google\",\"Meta\",\"Microsoft\",\"URL\"],\"rank\":-18.451199032019765},{\"id\":\"july-correct-0015\",\"title\":\"AMD to join the optical interconnect party with 2027 Instinct GPUs\",\"sourceType\":\"labeled_article\",\"time\":\"2026-07\",\"matchedTerms\":[\"OpenAI\",\"CPO\",\"Meta\",\"Microsoft\",\"URL\",\"LM\"],\"rank\":-15.7470853384495},{\"id\":\"july-correct-0001\",\"title\":\"全球首颗2nm GPU来了！苏姿丰甩出“最强AI机架”，CPU性能干翻英伟达 - 智东西\",\"sourceType\":\"labeled_article\",\"time\":\"2026-07\",\"matchedTerms\":[\"OpenAI\",\"RAS\",\"NPU\",\"Meta\",\"LM\"],\"rank\":-12.99158416382293},{\"id\":\"july-correct-0018\",\"title\":\"AMD, Cerebras partner on joint Helios rack-scale AI inference platform\",\"sourceType\":\"labeled_article\",\"time\":\"2026-07\",\"matchedTerms\":[\"OpenAI\",\"RAS\",\"Meta\",\"Microsoft\",\"URL\",\"LM\"],\"rank\":-12.403364898058182},{\"id\":\"july-correct-0104\",\"title\":\"NVIDIA Vera Rubin 提升每瓦性能，为全球合作伙伴实现最低 Token 成本\",\"sourceType\":\"labeled_article\",\"time\":\"2026-07\",\"matchedTerms\":[\"CPO\",\"RAS\",\"Google\",\"Microsoft\",\"LM\"],\"rank\":-12.075264116105425}]"
采集批次: "2026年9月7日22点05分18秒"
采集批次ID: "20260907-220517-361"
去重键: "https://developers.openai.com/codex/developer-commands"
---

Title: Developer commands | ChatGPT Learn

URL Source: https://developers.openai.com/codex/developer-commands

Published Time: Sun, 06 Sep 2026 04:47:15 GMT

Markdown Content:
For the complete documentation index, see [llms.txt](https://developers.openai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL. 

[![Image 1: OpenAI Developers](https://developers.openai.com/OpenAI_Developers.svg)ChatGPT](https://developers.openai.com/)

[Home](https://developers.openai.com/)

[API](https://developers.openai.com/api/docs)

[Codex](https://learn.chatgpt.com/docs)

[Docs Guides, concepts, and product docs for Codex](https://learn.chatgpt.com/docs)[Use cases Example workflows and tasks teams can take on with ChatGPT or Codex](https://learn.chatgpt.com/use-cases)

[Docs](https://developers.openai.com/codex)

[Use cases](https://developers.openai.com/codex/use-cases)

[Training](https://developers.openai.com/training)

[Resources](https://developers.openai.com/codex/resources)

[ChatGPT](https://developers.openai.com/chatgpt)

[Plugins Extend ChatGPT and Codex](https://developers.openai.com/plugins)[Workspace Agents Trigger published ChatGPT workspace agents](https://developers.openai.com/workspace-agents)[Commerce Build commerce flows in ChatGPT](https://developers.openai.com/commerce)[Ads Publish and measure ads in ChatGPT](https://developers.openai.com/ads)

[Resources](https://developers.openai.com/learn)

[Showcase Demo apps to get inspired](https://developers.openai.com/showcase)[Blog Learnings and experiences from developers](https://developers.openai.com/blog)[Cookbook Notebook examples for building with OpenAI models](https://developers.openai.com/cookbook)[Learn Docs, videos, and demo apps for building with OpenAI](https://developers.openai.com/learn)[Community Programs, meetups, and support for builders](https://developers.openai.com/community)

Start searching

[API Dashboard](https://platform.openai.com/login)

[Try ChatGPT](https://chatgpt.com/)

[Overview](https://developers.openai.com/codex)[Features](https://developers.openai.com/codex/features)[Configuration](https://developers.openai.com/codex/configuration)[Developers](https://developers.openai.com/codex/developers)[Security](https://developers.openai.com/codex/security-administration)[Administration](https://developers.openai.com/codex/administration)[Use Cases](https://developers.openai.com/codex/use-cases)[Resources](https://developers.openai.com/codex/resources)

## Search the docs

Search docs 

### Suggested

responses create reasoning_effort realtime prompt caching

 Primary navigation 

 API  Codex  ChatGPT  Docs  Use cases  Training  Resources  Resources 

Search docs 

### Suggested

responses create reasoning_effort realtime prompt caching

 Overview  Models  Agents  Tools  Voice & Audio  Production  API reference 

Docs Overview

*   [Home](https://developers.openai.com/api/docs)

### Get started

*   [Quickstart](https://developers.openai.com/api/docs/quickstart)
*   [Using GPT-6 Astra](https://developers.openai.com/api/docs/guides/latest-model)
*   [Key concepts](https://developers.openai.com/api/docs/concepts)

### Core concepts

*   [Responses API](https://developers.openai.com/api/docs/guides/migrate-to-responses)
*   [Conversation state](https://developers.openai.com/api/docs/guides/conversation-state)
*   [Background mode](https://developers.openai.com/api/docs/guides/background)
*   [Streaming](https://developers.openai.com/api/docs/guides/streaming-responses)
*   [WebSocket mode](https://developers.openai.com/api/docs/guides/websocket-mode)
*   [Mid-turn steering](https://developers.openai.com/api/docs/guides/steering)
*   [Multi-agent](https://developers.openai.com/api/docs/guides/responses-multi-agent)
*   [Webhooks](https://developers.openai.com/api/docs/guides/webhooks)
*   [File inputs](https://developers.openai.com/api/docs/guides/file-inputs)
*   [Compaction](https://developers.openai.com/api/docs/guides/compaction)
*   [Counting tokens](https://developers.openai.com/api/docs/guides/token-counting)

### SDKs and CLI

*   [OpenAI SDK](https://developers.openai.com/api/docs/libraries)
*   [OpenAI CLI](https://developers.openai.com/api/docs/libraries/openai-cli)

### Resources

*   [Changelog](https://developers.openai.com/api/docs/changelog)
*   [Deprecations](https://developers.openai.com/api/docs/deprecations)
*   [Supported countries](https://developers.openai.com/api/docs/supported-countries)
*   [OpenAI Crawlers](https://developers.openai.com/api/docs/bots)
*   [Terms and policies](https://openai.com/policies)

### Legacy APIs

*   
Agent Builder
    *   [Overview](https://developers.openai.com/api/docs/guides/agent-builder)
    *   [Migration guide](https://developers.openai.com/api/docs/guides/agent-builder/migrate-from-agent-builder)
    *   [Node reference](https://developers.openai.com/api/docs/guides/node-reference)
    *   [Safety in building agents](https://developers.openai.com/api/docs/guides/agent-builder-safety)

*   
Evals
    *   [Getting started](https://developers.openai.com/api/docs/guides/evaluation-getting-started)
    *   [Working with evals](https://developers.openai.com/api/docs/guides/evals)
    *   [Prompt optimizer](https://developers.openai.com/api/docs/guides/prompt-optimizer)
    *   [External models](https://developers.openai.com/api/docs/guides/external-models)
    *   [Best practices](https://developers.openai.com/api/docs/guides/evaluation-best-practices)
    *   [Graders](https://developers.openai.com/api/docs/guides/graders)

*   
Fine-tuning
    *   [Optimization cycle](https://developers.openai.com/api/docs/guides/model-optimization)
    *   [Supervised fine-tuning](https://developers.openai.com/api/docs/guides/supervised-fine-tuning)
    *   [Vision fine-tuning](https://developers.openai.com/api/docs/guides/vision-fine-tuning)
    *   [Direct preference optimization](https://developers.openai.com/api/docs/guides/direct-preference-optimization)
    *   [Reinforcement fine-tuning](https://developers.openai.com/api/docs/guides/reinforcement-fine-tuning)
    *   [RFT use cases](https://developers.openai.com/api/docs/guides/rft-use-cases)
    *   [Best practices](https://developers.openai.com/api/docs/guides/fine-tuning-best-practices)

*   
Assistants API
    *   [Migration guide](https://developers.openai.com/api/docs/assistants/migration)

*   [Model catalog](https://developers.openai.com/api/docs/models)

### Choose a model

*   [Pricing](https://developers.openai.com/api/docs/pricing)
*   [Model selection](https://developers.openai.com/api/docs/guides/model-selection)

### Text and code

*   [Text generation](https://developers.openai.com/api/docs/guides/text)
*   [Code generation](https://developers.openai.com/api/docs/guides/code-generation)
*   [Structured output](https://developers.openai.com/api/docs/guides/structured-outputs)

### Prompting

*   [Overview](https://developers.openai.com/api/docs/guides/prompting)
*   [Prompt engineering](https://developers.openai.com/api/docs/guides/prompt-engineering)
*   [Citation formatting](https://developers.openai.com/api/docs/guides/citation-formatting)
*   [Migration guide](https://developers.openai.com/api/docs/guides/prompting/migrate-from-prompt-object)
*   [Prompt generation](https://developers.openai.com/api/docs/guides/prompt-generation)
*   [Frontend prompting](https://developers.openai.com/api/docs/guides/frontend-prompt)

### Reasoning

*   [Reasoning models](https://developers.openai.com/api/docs/guides/reasoning)
*   [Reasoning best practices](https://developers.openai.com/api/docs/guides/reasoning-best-practices)

### Images and video

*   
[Images and vision](https://developers.openai.com/api/docs/guides/images-vision)
    *   [Image input cost calculator](https://developers.openai.com/api/docs/guides/image-cost-calculator)

*   [Image generation](https://developers.openai.com/api/docs/guides/image-generation)
*   [Video generation](https://developers.openai.com/api/docs/guides/video-generation)

### Realtime and audio

*   [Audio and speech](https://developers.openai.com/api/docs/guides/audio)
*   [Overview](https://developers.openai.com/api/docs/guides/realtime)
*   [Voice agents](https://developers.openai.com/api/docs/guides/voice-agents)

### Specialized models

*   [Deep research](https://developers.openai.com/api/docs/guides/deep-research)
*   [Embeddings](https://developers.openai.com/api/docs/guides/embeddings)
*   [Moderation](https://developers.openai.com/api/docs/guides/moderation)

*   [Overview](https://developers.openai.com/api/docs/guides/agents)

### Agents SDK

*   [Quickstart](https://developers.openai.com/api/docs/guides/agents/quickstart)
*   [Agent definitions](https://developers.openai.com/api/docs/guides/agents/define-agents)
*   [Models and providers](https://developers.openai.com/api/docs/guides/agents/models)
*   [Running agents](https://developers.openai.com/api/docs/guides/agents/running-agents)
*   [Sandbox agents](https://developers.openai.com/api/docs/guides/agents/sandboxes)
*   [Orchestration](https://developers.openai.com/api/docs/guides/agents/orchestration)
*   [Guardrails](https://developers.openai.com/api/docs/guides/agents/guardrails-approvals)
*   [Results and state](https://developers.openai.com/api/docs/guides/agents/results)
*   [Integrations and observability](https://developers.openai.com/api/docs/guides/agents/integrations-observability)
*   [Evaluate agent workflows](https://developers.openai.com/api/docs/guides/agent-evals)

### ChatKit

*   [Overview](https://developers.openai.com/api/docs/guides/chatkit)
*   [Customize](https://developers.openai.com/api/docs/guides/chatkit-themes)
*   [Widgets](https://developers.openai.com/api/docs/guides/chatkit-widgets)
*   [Actions](https://developers.openai.com/api/docs/guides/chatkit-actions)
*   [Advanced integrations](https://developers.openai.com/api/docs/guides/custom-chatkit)

*   [Overview](https://developers.openai.com/api/docs/guides/tools)
*   [Function calling](https://developers.openai.com/api/docs/guides/function-calling)

### Search and retrieval

*   [Web search](https://developers.openai.com/api/docs/guides/tools-web-search)
*   [File search](https://developers.openai.com/api/docs/guides/tools-file-search)
*   [Retrieval](https://developers.openai.com/api/docs/guides/retrieval)

### Connect tools and data

*   [MCP and Connectors](https://developers.openai.com/api/docs/guides/tools-connectors-mcp)
*   [Secure MCP Tunnel](https://developers.openai.com/api/docs/guides/secure-mcp-tunnels)

### Build tool workflows

*   [Skills](https://developers.openai.com/api/docs/guides/tools-skills)
*   [Tool search](https://developers.openai.com/api/docs/guides/tools-tool-search)
*   [Programmatic tool calling](https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling)
*   [Async tool calling](https://developers.openai.com/api/docs/guides/async-tool-calling)

### Computer and code

*   [Shell](https://developers.openai.com/api/docs/guides/tools-shell)
*   [Computer use](https://developers.openai.com/api/docs/guides/tools-computer-use)
*   [Apply Patch](https://developers.openai.com/api/docs/guides/tools-apply-patch)
*   [Local shell](https://developers.openai.com/api/docs/guides/tools-local-shell)
*   [Code interpreter](https://developers.openai.com/api/docs/guides/tools-code-interpreter)

### Media

*   [Image generation](https://developers.openai.com/api/docs/guides/tools-image-generation)

*   [Overview](https://developers.openai.com/api/docs/guides/realtime)

### Get started

*   [Voice agents](https://developers.openai.com/api/docs/guides/voice-agents)
*   [Live translation](https://developers.openai.com/api/docs/guides/realtime-translation)
*   [Realtime prompting guide](https://developers.openai.com/api/docs/guides/realtime-models-prompting)

### Audio

*   [Audio and speech](https://developers.openai.com/api/docs/guides/audio)
*   [Transcription](https://developers.openai.com/api/docs/guides/transcription)
*   [File transcription](https://developers.openai.com/api/docs/guides/speech-to-text)
*   [Realtime transcription](https://developers.openai.com/api/docs/guides/realtime-transcription)
*   [Speech generation](https://developers.openai.com/api/docs/guides/text-to-speech)

### Connection methods

*   [WebRTC](https://developers.openai.com/api/docs/guides/realtime-webrtc)
*   [WebSocket](https://developers.openai.com/api/docs/guides/realtime-websocket)
*   [SIP](https://developers.openai.com/api/docs/guides/realtime-sip)

### Sessions and operations

*   [Managing conversations](https://developers.openai.com/api/docs/guides/realtime-conversations)
*   [Voice activity detection](https://developers.openai.com/api/docs/guides/realtime-vad)
*   [Realtime with tools](https://developers.openai.com/api/docs/guides/realtime-mcp)
*   [Webhooks and server-side controls](https://developers.openai.com/api/docs/guides/realtime-server-controls)
*   [Managing costs](https://developers.openai.com/api/docs/guides/realtime-costs)

### Go live

*   [Production best practices](https://developers.openai.com/api/docs/guides/production-best-practices)
*   [Deployment checklist](https://developers.openai.com/api/docs/guides/deployment-checklist)

### Performance and quality

*   [Latency optimization](https://developers.openai.com/api/docs/guides/latency-optimization)
*   [Predicted Outputs](https://developers.openai.com/api/docs/guides/predicted-outputs)
*   [Fast mode](https://developers.openai.com/api/docs/guides/fast-mode)
*   [Accuracy optimization](https://developers.openai.com/api/docs/guides/optimizing-llm-accuracy)

### Cost and throughput

*   [Cost optimization](https://developers.openai.com/api/docs/guides/cost-optimization)
*   [Prompt caching](https://developers.openai.com/api/docs/guides/prompt-caching)
*   [Batch](https://developers.openai.com/api/docs/guides/batch)
*   [Flex processing](https://developers.openai.com/api/docs/guides/flex-processing)

### Safety and governance

*   [Safety best practices](https://developers.openai.com/api/docs/guides/safety-best-practices)
*   [Red teaming](https://developers.openai.com/api/docs/guides/red-teaming)
*   
Safety checks
    *   [Safety classifiers](https://developers.openai.com/api/docs/guides/safety-checks)
    *   [Cybersecurity checks](https://developers.openai.com/api/docs/guides/safety-checks/cybersecurity)
    *   [Misalignment monitoring](https://developers.openai.com/api/docs/guides/safety-checks/misalignment-monitoring)

*   [Under-18 guidance](https://developers.openai.com/api/docs/guides/safety-checks/under-18-api-guidance)
*   [CSAM guidance](https://developers.openai.com/api/docs/guides/csam-guidance)
*   [Content provenance](https://developers.openai.com/api/docs/guides/content-provenance)
*   [Your data](https://developers.openai.com/api/docs/guides/your-data)
*   [Permissions](https://developers.openai.com/api/docs/guides/rbac)

### Infrastructure and access

*   
[Terraform provider](https://developers.openai.com/api/docs/guides/terraform)
    *   [Overview](https://developers.openai.com/api/docs/guides/terraform)
    *   [Projects and access](https://developers.openai.com/api/docs/guides/terraform/projects-and-access)
    *   [Service accounts](https://developers.openai.com/api/docs/guides/terraform/service-accounts)
    *   [Rate limits and spend](https://developers.openai.com/api/docs/guides/terraform/rate-limits-and-spend)
    *   [Model, tool, and data controls](https://developers.openai.com/api/docs/guides/terraform/project-controls)
    *   [Import and reconciliation](https://developers.openai.com/api/docs/guides/terraform/import-and-reconcile)

*   [Private Link](https://developers.openai.com/api/docs/guides/private-link)
*   [IP allowlist](https://developers.openai.com/api/docs/guides/ip-allowlist)
*   [Mutual TLS](https://developers.openai.com/api/docs/guides/mutual-tls)
*   
[Workload identity federation](https://developers.openai.com/api/docs/guides/workload-identity-federation)
    *   [Codex setup](https://developers.openai.com/codex/enterprise/workload-identity)
    *   [Federation rules](https://developers.openai.com/api/docs/guides/workload-identity-federation/federation-rules)
    *   [Admin API](https://developers.openai.com/api/docs/guides/workload-identity-federation/admin-api)
    *   [X.509 certificates](https://developers.openai.com/api/docs/guides/workload-identity-federation/x509)
    *   [Kubernetes](https://developers.openai.com/api/docs/guides/workload-identity-federation/kubernetes)
    *   [AWS](https://developers.openai.com/api/docs/guides/workload-identity-federation/aws)
    *   [Microsoft Azure](https://developers.openai.com/api/docs/guides/workload-identity-federation/microsoft-azure)
    *   [Google Cloud](https://developers.openai.com/api/docs/guides/workload-identity-federation/google-cloud)
    *   [Oracle Cloud Infrastructure](https://developers.openai.com/api/docs/guides/workload-identity-federation/oracle-cloud)
    *   [GitHub Actions](https://developers.openai.com/api/docs/guides/workload-identity-federation/github-actions)
    *   [SPIFFE](https://developers.openai.com/api/docs/guides/workload-identity-federation/spiffe)

*   [IP egress ranges](https://developers.openai.com/api/docs/guides/ip-addresses)
*   [Amazon Bedrock](https://developers.openai.com/api/docs/guides/amazon-bedrock)

### Operations

*   [Rate limits](https://developers.openai.com/api/docs/guides/rate-limits)
*   [Spend limits](https://developers.openai.com/api/docs/guides/spend-limits)
*   [Admin APIs](https://developers.openai.com/api/docs/guides/admin-apis)
*   [Error codes](https://developers.openai.com/api/docs/guides/error-codes)

[Docs](https://learn.chatgpt.com/docs)[Use cases](https://learn.chatgpt.com/use-cases)

Docs Docs

 Plugins  Workspace Agents  Commerce  Ads 

Docs Select...

*   [Home](https://developers.openai.com/plugins)
*   [Quickstart](https://developers.openai.com/plugins/quickstart)

### Core concepts

*   [Plugin architecture](https://developers.openai.com/plugins/concepts/plugins)
*   [Skills](https://developers.openai.com/plugins/concepts/skills)
*   [MCP server](https://developers.openai.com/plugins/concepts/mcp-server)

### Plan

*   [Brainstorm use cases](https://developers.openai.com/plugins/plan/use-case)
*   [Define tools](https://developers.openai.com/plugins/plan/tools)

### Build

*   [Build an MCP server](https://developers.openai.com/plugins/build/mcp-server)
*   [Add UI to your MCP server (optional)](https://developers.openai.com/plugins/build/chatgpt-ui)
*   [Authenticate users](https://developers.openai.com/plugins/build/auth)
*   [Build skills](https://developers.openai.com/plugins/build/skills)
*   [Package your plugin](https://developers.openai.com/plugins/build/plugins)
*   [Examples](https://developers.openai.com/plugins/build/examples)

### Test and publish

*   [Connect and test your plugin](https://developers.openai.com/plugins/deploy/connect-chatgpt)
*   [Submit and publish](https://developers.openai.com/plugins/deploy/submission)
*   [Submission error reference](https://developers.openai.com/plugins/deploy/submission-errors)

### Conversion specs

*   [Restaurant reservation spec](https://developers.openai.com/plugins/guides/restaurant-reservation-conversion-spec)
*   [Get Quote spec](https://developers.openai.com/plugins/guides/local-services-request-quote-conversion-spec)
*   [Product checkout spec](https://developers.openai.com/plugins/guides/product-checkout-conversion-spec)

### Guides

*   [UI guidelines](https://developers.openai.com/plugins/concepts/ui-guidelines)
*   [Optimize Metadata](https://developers.openai.com/plugins/guides/optimize-metadata)
*   [Submit a Claude Code plugin](https://developers.openai.com/plugins/guides/submit-claude-plugin)
*   [Security & Privacy](https://developers.openai.com/plugins/guides/security-privacy)
*   [Troubleshooting](https://developers.openai.com/plugins/deploy/troubleshooting)

### Resources

*   [Changelog](https://developers.openai.com/plugins/changelog)
*   [Plugin guidelines](https://developers.openai.com/plugins/app-guidelines)
*   [MCP server review requirements](https://developers.openai.com/plugins/deploy/app-review)
*   [Plugin UI reference](https://developers.openai.com/plugins/reference)
*   [Checkout API reference](https://developers.openai.com/plugins/build/monetization)

*   [Home](https://developers.openai.com/workspace-agents)

### Get started

*   [Trigger workspace agent runs](https://developers.openai.com/workspace-agents/trigger-runs)
*   [Authenticate with Workspace Agent access tokens](https://developers.openai.com/workspace-agents/authentication)

*   [Home](https://developers.openai.com/commerce)

### Guides

*   [Get started](https://developers.openai.com/commerce/guides/get-started)
*   [Best practices](https://developers.openai.com/commerce/guides/best-practices)

### File Upload

*   [Overview](https://developers.openai.com/commerce/specs/file-upload/overview)
*   [Products](https://developers.openai.com/commerce/specs/file-upload/products)

### API

*   [Overview](https://developers.openai.com/commerce/specs/api/overview)
*   [Feeds](https://developers.openai.com/commerce/specs/api/feeds)
*   [Products](https://developers.openai.com/commerce/specs/api/products)
*   [Promotions](https://developers.openai.com/commerce/specs/api/promotions)

*   [Ads Overview](https://developers.openai.com/ads)

### Measurement

*   [Measurement Pixel](https://developers.openai.com/ads/measurement-pixel)
*   [Multiple Pixels (Advanced)](https://developers.openai.com/ads/multiple-pixels)
*   [Image Tag](https://developers.openai.com/ads/image-tag)
*   [Conversions API](https://developers.openai.com/ads/conversions-api)
*   [Supported Events](https://developers.openai.com/ads/supported-events)

### Advertiser API

*   [Overview](https://developers.openai.com/ads/api-overview)
*   [API Partner Setup](https://developers.openai.com/ads/api-partner-setup)
*   [Quickstart](https://developers.openai.com/ads/api-quickstart)
*   [Bulk API](https://developers.openai.com/ads/bulk-api)
*   [Product Feeds](https://developers.openai.com/ads/product-feeds)
*   [Delta Feeds API](https://developers.openai.com/ads/delta-feeds)
*   [Campaign Targeting](https://developers.openai.com/ads/campaign-targeting)
*   [Conversion-Optimized Campaigns](https://developers.openai.com/ads/conversion-optimized-campaigns)
*   [Custom Audiences](https://developers.openai.com/ads/custom-audiences)

### API Reference

*   [Authentication](https://developers.openai.com/ads/api-reference/authentication)
*   [Ad Account](https://developers.openai.com/ads/api-reference/ad-account)
*   [Campaigns](https://developers.openai.com/ads/api-reference/campaigns)
*   [Ad Groups](https://developers.openai.com/ads/api-reference/ad-groups)
*   [Ads](https://developers.openai.com/ads/api-reference/ads)
*   [Insights](https://developers.openai.com/ads/api-reference/insights)
*   [Files](https://developers.openai.com/ads/api-reference/files)
*   [Conversion Setup](https://developers.openai.com/ads/api-reference/conversion-setup)

 Overview  Features  Configuration  Developers  Security  Administration  Use Cases  Resources 

Docs Developers

*   [Home](https://developers.openai.com/codex)

### Get started

*   [Quickstart](https://developers.openai.com/codex/quickstart)
*   [Use ChatGPT](https://developers.openai.com/codex/use-chatgpt)
*   [Get started with Work](https://developers.openai.com/codex/get-started-with-work)
*   [Import from another agent](https://developers.openai.com/codex/import)

### Foundations

*   [Prompting](https://developers.openai.com/codex/prompting)
*   [Personalize ChatGPT](https://developers.openai.com/codex/personalize)
*   [Skills & Plugins](https://developers.openai.com/codex/skills-and-plugins)
*   [Permissions](https://developers.openai.com/codex/permission-modes)

### Explore

*   [What's new](https://developers.openai.com/codex/whats-new)
*   [Models](https://developers.openai.com/codex/models)
*   [Pricing](https://developers.openai.com/codex/pricing)
*   [Glossary](https://developers.openai.com/codex/glossary)

### Available on

*   [ChatGPT desktop app](https://developers.openai.com/codex/app)
*   [Remote](https://developers.openai.com/codex/remote)
*   [ChatGPT on the web](https://developers.openai.com/codex/web)
*   [Codex CLI](https://developers.openai.com/codex/cli)
*   [Codex IDE extension](https://developers.openai.com/codex/ide)
*   [Codex cloud](https://developers.openai.com/codex/cloud)

### Releases

*   [Changelog](https://developers.openai.com/codex/changelog)
*   [Feature Maturity](https://developers.openai.com/codex/feature-maturity)
*   [Open Source](https://developers.openai.com/codex/open-source)

*   [Overview](https://developers.openai.com/codex/features)

### Workflows

*   [Projects and chats](https://developers.openai.com/codex/projects)
*   [Sites](https://developers.openai.com/codex/sites)
*   [Visualizations](https://developers.openai.com/codex/visualizations)
*   [Scheduled tasks](https://developers.openai.com/codex/automations)
*   [Long-running work](https://developers.openai.com/codex/long-running-work)
*   [Notifications](https://developers.openai.com/codex/notifications)
*   [Pets](https://developers.openai.com/codex/pets)
*   [Codex Micro](https://developers.openai.com/codex/features/codex-micro)

### Capabilities

*   [Browser](https://developers.openai.com/codex/browser)
*   [Computer use](https://developers.openai.com/codex/computer-use)
*   [Voice](https://developers.openai.com/codex/features/voice)
*   [Plugins](https://developers.openai.com/codex/plugins)
*   [Web search](https://developers.openai.com/codex/web-search)
*   [Image generation](https://developers.openai.com/codex/image-generation)
*   [Image inputs](https://developers.openai.com/codex/image-inputs)
*   [Appshots](https://developers.openai.com/codex/appshots)
*   [Browser extension](https://developers.openai.com/codex/chrome-extension)
*   [Work with files](https://developers.openai.com/codex/artifacts-viewer)

### Reference

*   [Commands](https://developers.openai.com/codex/reference/commands)
*   [Slash commands](https://developers.openai.com/codex/reference/slash-commands)
*   [Settings](https://developers.openai.com/codex/reference/settings)
*   [Troubleshooting](https://developers.openai.com/codex/reference/troubleshooting)

*   [Overview](https://developers.openai.com/codex/configuration)

### Customization

*   [Overview](https://developers.openai.com/codex/customization/overview)
*   [Memories](https://developers.openai.com/codex/customization/memories)
*   [Computer History](https://developers.openai.com/codex/customization/computer-history)

### Config file

*   [Config Basics](https://developers.openai.com/codex/config-file/config-basic)
*   [Advanced Config](https://developers.openai.com/codex/config-file/config-advanced)
*   [Config Reference](https://developers.openai.com/codex/config-file/config-reference)
*   [Environment Variables](https://developers.openai.com/codex/config-file/environment-variables)
*   [Sample Config](https://developers.openai.com/codex/config-file/config-sample)

### Agent configuration

*   [AGENTS.md](https://developers.openai.com/codex/agent-configuration/agents-md)
*   [Subagents](https://developers.openai.com/codex/agent-configuration/subagents)
*   [Speed](https://developers.openai.com/codex/agent-configuration/speed)
*   [Rules](https://developers.openai.com/codex/agent-configuration/rules)

### Extend ChatGPT and Codex

*   [Record & Replay](https://developers.openai.com/codex/extend/record-and-replay)
*   [MCP](https://developers.openai.com/codex/extend/mcp)

### Linux

*   [Desktop app](https://developers.openai.com/codex/linux/linux-app)

### Windows

*   [Desktop app](https://developers.openai.com/codex/windows/windows-app)
*   [Windows sandbox](https://developers.openai.com/codex/windows/windows-sandbox)
*   [WSL](https://developers.openai.com/codex/windows/wsl)

*   [Overview](https://developers.openai.com/codex/developers)

### Development workflows

*   [Code review](https://developers.openai.com/codex/code-review)
*   [Integrated terminal](https://developers.openai.com/codex/integrated-terminal)

### Extend and automate

*   [Build skills](https://developers.openai.com/codex/build-skills)
*   [Build plugins](https://developers.openai.com/codex/build-plugins)
*   [Site tools (WebMCP)](https://developers.openai.com/codex/webmcp)
*   [Hooks](https://developers.openai.com/codex/hooks)

### Environments

*   [Modes](https://developers.openai.com/codex/environments/modes)
*   [Local environments](https://developers.openai.com/codex/environments/local-environment)
*   [Cloud environment](https://developers.openai.com/codex/environments/cloud-environment)
*   [Git worktrees](https://developers.openai.com/codex/environments/git-worktrees)

### Build with Codex

*   [Codex SDK](https://developers.openai.com/codex/codex-sdk)
*   [App Server](https://developers.openai.com/codex/app-server)
*   [MCP Server](https://developers.openai.com/codex/mcp-server)
*   [GitHub Action](https://developers.openai.com/codex/github-action)
*   [Non-interactive mode](https://developers.openai.com/codex/non-interactive-mode)

### Third-party integrations

*   [GitHub](https://developers.openai.com/codex/third-party/github)
*   [GitLab (Beta)](https://developers.openai.com/codex/third-party/gitlab)
*   [Slack](https://developers.openai.com/codex/third-party/slack)
*   [Linear](https://developers.openai.com/codex/third-party/linear)

### Reference

*   [CLI customization](https://developers.openai.com/codex/cli-customization)
*   [Developer commands](https://developers.openai.com/codex/developer-commands)
*   [Developer settings](https://developers.openai.com/codex/developer-settings)

*   [Overview](https://developers.openai.com/codex/security-administration)

### Permissions

*   [Profiles](https://developers.openai.com/codex/permissions)
*   [Sandboxing](https://developers.openai.com/codex/sandboxing)
*   [Auto-review](https://developers.openai.com/codex/sandboxing/auto-review)
*   [Agent approvals & security](https://developers.openai.com/codex/agent-approvals-security)
*   [Internet access](https://developers.openai.com/codex/cloud/internet-access)

### Codex Security

*   [Overview](https://developers.openai.com/codex/security)
*   
Codex Security plugin
    *   [Quickstart](https://developers.openai.com/codex/security/plugin)
    *   [Run a security scan](https://developers.openai.com/codex/security/plugin/scans)
    *   [Run a deep scan](https://developers.openai.com/codex/security/plugin/deep-scans)
    *   [Review code changes](https://developers.openai.com/codex/security/plugin/code-changes)
    *   [Use the Security workbench](https://developers.openai.com/codex/security/plugin/workbench)
    *   [Triage a backlog](https://developers.openai.com/codex/security/plugin/triage-backlog)
    *   [Fix findings](https://developers.openai.com/codex/security/plugin/fix-findings)
    *   [Propose security hardening](https://developers.openai.com/codex/security/plugin/security-hardening)
    *   [Write vulnerability reports](https://developers.openai.com/codex/security/plugin/vulnerability-reports)
    *   [Export and track findings](https://developers.openai.com/codex/security/plugin/export-findings)
    *   [Changelog](https://developers.openai.com/codex/security/plugin/changelog)

*   
Codex Security CLI
    *   [Quickstart](https://developers.openai.com/codex/security/cli)
    *   [Run bulk scans](https://developers.openai.com/codex/security/cli/bulk-scans)
    *   [Run scans in CI](https://developers.openai.com/codex/security/cli/ci)
    *   [GitLab CI/CD](https://developers.openai.com/codex/security/cli/ci/gitlab)
    *   [Reference](https://developers.openai.com/codex/security/cli/reference)
    *   [FAQ](https://developers.openai.com/codex/security/cli/faq)

*   [TypeScript SDK](https://developers.openai.com/codex/security/sdk)
*   
Codex Security cloud
    *   [Setup](https://developers.openai.com/codex/security/setup)
    *   [Security Review](https://developers.openai.com/codex/security/security-review)
    *   [Improving the threat model](https://developers.openai.com/codex/security/threat-model)
    *   [FAQ](https://developers.openai.com/codex/security/faq)

### Cyber safety

*   [Models & Trusted Access](https://developers.openai.com/codex/cyber-safety)
*   [Recommended configuration](https://developers.openai.com/codex/cyber-safety/recommended-configuration)

*   [Overview](https://developers.openai.com/codex/administration)

### Getting started

*   [Admin rollout guide](https://developers.openai.com/codex/enterprise/admin-setup)

### ChatGPT Work

*   [ChatGPT Work Overview](https://developers.openai.com/codex/enterprise/chatgpt-work-overview)
*   [ChatGPT Work cloud security](https://developers.openai.com/codex/enterprise/chatgpt-work-cloud-security)
*   [ChatGPT Work local security](https://developers.openai.com/codex/enterprise/chatgpt-work-local-security)
*   [ChatGPT Work admin FAQ](https://developers.openai.com/codex/enterprise/work-admin-faq)
*   [ChatGPT Work: usage and cost](https://developers.openai.com/codex/enterprise/chatgpt-work-usage-and-cost)

### Identity and authentication

*   [Authentication overview](https://developers.openai.com/codex/auth)
*   [Workload identity](https://developers.openai.com/codex/enterprise/workload-identity)
*   [Personal Access Tokens](https://developers.openai.com/codex/enterprise/access-tokens)
*   [Service accounts](https://developers.openai.com/codex/enterprise/service-accounts)

### Workspace access, policy, and models

*   [Groups and provisioning](https://developers.openai.com/codex/enterprise/groups-and-provisioning)
*   [User lifecycle management](https://developers.openai.com/codex/enterprise/user-lifecycle)
*   [Roles and workspace permissions](https://developers.openai.com/codex/enterprise/roles-and-workspace-permissions)
*   [GPTs and Sharing](https://developers.openai.com/codex/enterprise/gpts-and-sharing)
*   [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration)
*   [Prisma AIRS](https://developers.openai.com/codex/enterprise/prisma-airs)
*   [HIPAA configuration](https://developers.openai.com/codex/hipaa-configuration)
*   [Workspace model availability](https://developers.openai.com/codex/enterprise/workspace-model-availability)

### Plugin and connector controls

*   [Plugin controls](https://developers.openai.com/codex/enterprise/apps-and-connectors)
*   [Plugin management](https://developers.openai.com/codex/enterprise/plugin-management)
*   [Skill controls](https://developers.openai.com/codex/enterprise/skills)

### Usage, governance, and compliance

*   [Governance](https://developers.openai.com/codex/enterprise/governance)
*   [Admin plugin](https://developers.openai.com/codex/enterprise/admin-plugin)
*   [Workspace analytics](https://developers.openai.com/codex/enterprise/workspace-analytics)
*   [Analytics API](https://developers.openai.com/codex/enterprise/analytics-api)
*   [Compliance API and audit events](https://developers.openai.com/codex/enterprise/compliance-api)

### Deployment and model providers

*   [Manage app updates](https://developers.openai.com/codex/enterprise/manage-app-updates)
*   [Windows app deployment](https://developers.openai.com/codex/enterprise/windows-deployment)
*   [Remote connections](https://developers.openai.com/codex/remote-connections)
*   [Amazon Bedrock](https://developers.openai.com/codex/amazon-bedrock)

*   [Explore use cases](https://developers.openai.com/codex/use-cases)
*   [Collections](https://developers.openai.com/codex/use-cases/collections)

*   [Home](https://developers.openai.com/codex/resources)
*   [Videos](https://developers.openai.com/codex/videos)
*   [Showcase](https://developers.openai.com/showcase)
*   [OpenAI Academy](https://openai.com/academy/)
*   [Online trainings](https://academy.openai.com/home/events)

### Community

*   [Codex Ambassadors](https://developers.openai.com/community/codex-ambassadors)
*   [Codex for Students](https://developers.openai.com/community/students)
*   [Codex for Open Source](https://developers.openai.com/community/codex-for-oss)
*   [Meetups](https://developers.openai.com/community/meetups)

### Blog

*   [Company blog](https://openai.com/news/)
*   [Developer blog](https://developers.openai.com/blog)

*   [Explore use cases](https://developers.openai.com/codex/use-cases)
*   [Collections](https://developers.openai.com/codex/use-cases/collections)

*   [Home](https://developers.openai.com/codex/resources)
*   [Videos](https://developers.openai.com/codex/videos)
*   [Showcase](https://developers.openai.com/showcase)
*   [OpenAI Academy](https://openai.com/academy/)
*   [Online trainings](https://academy.openai.com/home/events)

### Community

*   [Codex Ambassadors](https://developers.openai.com/community/codex-ambassadors)
*   [Codex for Students](https://developers.openai.com/community/students)
*   [Codex for Open Source](https://developers.openai.com/community/codex-for-oss)
*   [Meetups](https://developers.openai.com/community/meetups)

### Blog

*   [Company blog](https://openai.com/news/)
*   [Developer blog](https://developers.openai.com/blog)

[Showcase](https://developers.openai.com/showcase) Blog  Cookbook  Learn  Community 

Docs Select...

*   [All posts](https://developers.openai.com/blog)

### Recent

*   [Architectural visualization with Astra](https://developers.openai.com/blog/architectural-visualization-with-astra)
*   [Building games with Astra](https://developers.openai.com/blog/how-to-build-games-with-astra)
*   [Meet Rosalind Workbench: Empowering every scientist to be their own research team](https://developers.openai.com/blog/rosalind-workbench)
*   [Automating repetitive work at OpenAI with Codex](https://developers.openai.com/blog/automating-repetitive-work-at-openai-with-codex)
*   [Meet the winners of OpenAI Build Week](https://developers.openai.com/blog/build-week-winners)

### Topics

*   [General](https://developers.openai.com/blog/topic/general)
*   [API](https://developers.openai.com/blog/topic/api)
*   [Apps SDK](https://developers.openai.com/blog/topic/apps-sdk)
*   [Audio](https://developers.openai.com/blog/topic/audio)
*   [Codex](https://developers.openai.com/blog/topic/codex)
*   [Life sciences](https://developers.openai.com/blog/topic/life-sciences)

*   [Home](https://developers.openai.com/cookbook)

### Topics

*   [Agents](https://developers.openai.com/cookbook/topic/agents)
*   [Evals](https://developers.openai.com/cookbook/topic/evals)
*   [Multimodal](https://developers.openai.com/cookbook/topic/multimodal)
*   [Text](https://developers.openai.com/cookbook/topic/text)
*   [Guardrails](https://developers.openai.com/cookbook/topic/guardrails)
*   [Optimization](https://developers.openai.com/cookbook/topic/optimization)
*   [ChatGPT](https://developers.openai.com/cookbook/topic/chatgpt)
*   [Codex](https://developers.openai.com/cookbook/topic/codex)
*   [gpt-oss](https://developers.openai.com/cookbook/topic/gpt-oss)

### Contribute

*   [Cookbook on GitHub](https://github.com/openai/openai-cookbook)

*   [Home](https://developers.openai.com/learn)
*   [OpenAI Developers plugin](https://developers.openai.com/learn/developers-codex-plugin)
*   [Docs MCP](https://developers.openai.com/learn/docs-mcp)

### Categories

*   [Demo apps](https://developers.openai.com/learn/code)
*   [Videos](https://developers.openai.com/learn/videos)

### Topics

*   [Agents](https://developers.openai.com/learn/agents)
*   [Audio & Voice](https://developers.openai.com/learn/audio)
*   [Computer Use](https://developers.openai.com/learn/cua)
*   [Codex](https://developers.openai.com/learn/codex)
*   [Evals](https://developers.openai.com/learn/evals)
*   [gpt-oss](https://developers.openai.com/learn/gpt-oss)
*   [Fine-tuning](https://developers.openai.com/learn/fine-tuning)
*   [Image generation](https://developers.openai.com/learn/imagegen)
*   [Scaling](https://developers.openai.com/learn/scaling)
*   [Tools](https://developers.openai.com/learn/tools)
*   [Video generation](https://developers.openai.com/learn/videogen)

*   [Community](https://developers.openai.com/community)

### Programs

*   [Codex Ambassadors](https://developers.openai.com/community/codex-ambassadors)
*   [Codex for Students](https://developers.openai.com/community/students)
*   [Codex for Open Source](https://developers.openai.com/community/codex-for-oss)
*   [OpenAI for Startups](https://openai.com/business/why-openai/startups/)

### Events

*   [Meetups](https://developers.openai.com/community/meetups)

### Spaces

*   [Developer Forum](https://community.openai.com/)
*   [Discord](https://discord.com/invite/openai)
*   [Reddit](https://www.reddit.com/r/OpenAI/)
*   [X](https://x.com/OpenAIDevs)

[API Dashboard](https://platform.openai.com/login)

[Try ChatGPT](https://chatgpt.com/)

*   [Overview](https://developers.openai.com/codex/developers)

### Development workflows

*   [Code review](https://developers.openai.com/codex/code-review)
*   [Integrated terminal](https://developers.openai.com/codex/integrated-terminal)

### Extend and automate

*   [Build skills](https://developers.openai.com/codex/build-skills)
*   [Build plugins](https://developers.openai.com/codex/build-plugins)
*   [Site tools (WebMCP)](https://developers.openai.com/codex/webmcp)
*   [Hooks](https://developers.openai.com/codex/hooks)

### Environments

*   [Modes](https://developers.openai.com/codex/environments/modes)
*   [Local environments](https://developers.openai.com/codex/environments/local-environment)
*   [Cloud environment](https://developers.openai.com/codex/environments/cloud-environment)
*   [Git worktrees](https://developers.openai.com/codex/environments/git-worktrees)

### Build with Codex

*   [Codex SDK](https://developers.openai.com/codex/codex-sdk)
*   [App Server](https://developers.openai.com/codex/app-server)
*   [MCP Server](https://developers.openai.com/codex/mcp-server)
*   [GitHub Action](https://developers.openai.com/codex/github-action)
*   [Non-interactive mode](https://developers.openai.com/codex/non-interactive-mode)

### Third-party integrations

*   [GitHub](https://developers.openai.com/codex/third-party/github)
*   [GitLab (Beta)](https://developers.openai.com/codex/third-party/gitlab)
*   [Slack](https://developers.openai.com/codex/third-party/slack)
*   [Linear](https://developers.openai.com/codex/third-party/linear)

### Reference

*   [CLI customization](https://developers.openai.com/codex/cli-customization)
*   [Developer commands](https://developers.openai.com/codex/developer-commands)
*   [Developer settings](https://developers.openai.com/codex/developer-settings)

![Image 2](https://developers.openai.com/images/codex/surface-icons/chatgpt-app.webp)ChatGPT desktop app

Copy Page

# Developer commands

Reference for commands and slash commands in Codex developer surfaces

![Image 3](https://developers.openai.com/images/codex/surface-icons/chatgpt-app.webp)ChatGPT desktop app

Copy Page

ChatGPT web has its own composer command menu. Type `/` to see the actions available in the current chat. It doesn't expose the ChatGPT desktop app or CLI command set; the Codex slash commands, CLI subcommands, and flags in this reference don't apply to ChatGPT web.

## ChatGPT desktop app commands

The general [Commands](https://developers.openai.com/codex/reference/commands) page covers app navigation, chat shortcuts, keyboard customization, and deep links for chats, settings, skills, scheduled tasks, plugins, and pets.

The [Slash commands](https://developers.openai.com/codex/reference/slash-commands) page covers the commands available from the app composer, including `/feedback`, `/goal`, `/init`, `/mcp`, `/plan`, `/review`, and `/status`.

## How to read this reference

This page catalogs every documented Codex CLI command and flag. Use the interactive tables to search by key or description. Each section shows the option's maturity and flags deprecated options and risky combinations.

The CLI inherits most defaults from `~/.codex/config.toml`. Any `-c key=value` overrides you pass at the command line take precedence for that invocation. See [Config basics](https://developers.openai.com/codex/config-file/config-basic#configuration-precedence) for more information.

## Global flags

| Key | Type / Values | Details |
| --- | --- | --- |
| `--add-dir` | `path` | Grant additional directories write access alongside the main workspace. Repeat for multiple paths. |
| `--ask-for-approval, -a` | `untrusted | on-request | never` | Control when Codex pauses for human approval before running a command. |
| `--cd, -C` | `path` | Set the working directory for the agent before it starts processing your request. |
| `--config, -c` | `key=value` | Override configuration values. Values parse as TOML if possible; otherwise the literal string is used. |
| `--dangerously-bypass-approvals-and-sandbox, --yolo` | `boolean` | Run every command without approvals or sandboxing. Only use inside an externally hardened environment. |
| `--dangerously-bypass-hook-trust` | `boolean` | Run enabled hooks without requiring persisted hook trust for this invocation. Intended only for automation that already vets hook sources. |
| `--disable` | `feature` | Force-disable a feature flag (translates to `-c features.<name>=false`). Repeatable. |
| `--enable` | `feature` | Force-enable a feature flag (translates to `-c features.<name>=true`). Repeatable. |
| `--image, -i` | `path[,path...]` | Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag. |
| `--local-provider` | `lmstudio | ollama` | Choose the local provider used with `--oss`, overriding `oss_provider` for this run. |
| `--model, -m` | `string` | Override the model set in configuration (for example `gpt-5.6-terra`). |
| `--no-alt-screen` | `boolean` | Disable alternate screen mode for the TUI (overrides `tui.alternate_screen` for this run). |
| `--oss` | `boolean` | Use a local open source model provider. Codex uses `--local-provider`, your configured `oss_provider`, or prompts you to choose between LM Studio and Ollama. |
| `--profile, -p` | `string` | Layer `$CODEX_HOME/profile-name.config.toml` on top of the base user config. |
| `--remote` | `ws://host:port | wss://host:port | unix:// | unix://PATH` | Connect to a remote app-server endpoint over WebSocket or a Unix socket. Supported for `codex`, `codex resume`, `codex fork`, `codex archive`, `codex delete`, and `codex unarchive`; other subcommands reject remote mode. |
| `--remote-auth-token-env` | `ENV_VAR` | Read a bearer token from this environment variable and send it when connecting with `--remote`. Requires `--remote`; tokens are only sent over `wss://` URLs or local-only `ws://` URLs. |
| `--sandbox, -s` | `read-only | workspace-write | danger-full-access` | Select the sandbox policy for model-generated shell commands. |
| `--search` | `boolean` | Enable live web search (sets `web_search = "live"` instead of the default `"cached"`). |
| `--strict-config` | `boolean` | Error when `config.toml` contains fields this Codex version does not recognize. Supported by runtime commands such as `codex`, `exec`, `review`, `resume`, `fork`, `app-server`, `mcp-server`, and `exec-server`. |
| `PROMPT` | `string` | Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message. |

Key

`--add-dir`

Type / Values

`path`

Details

Grant additional directories write access alongside the main workspace. Repeat for multiple paths.

Key

`--ask-for-approval, -a`

Type / Values

`untrusted | on-request | never`

Details

Control when Codex pauses for human approval before running a command.

Key

`--cd, -C`

Type / Values

`path`

Details

Set the working directory for the agent before it starts processing your request.

Key

`--config, -c`

Type / Values

`key=value`

Details

Override configuration values. Values parse as TOML if possible; otherwise the literal string is used.

Key

`--dangerously-bypass-approvals-and-sandbox, --yolo`

Type / Values

`boolean`

Details

Run every command without approvals or sandboxing. Only use inside an externally hardened environment.

Key

`--dangerously-bypass-hook-trust`

Type / Values

`boolean`

Details

Run enabled hooks without requiring persisted hook trust for this invocation. Intended only for automation that already vets hook sources.

Key

`--disable`

Type / Values

`feature`

Details

Force-disable a feature flag (translates to `-c features.<name>=false`). Repeatable.

Key

`--enable`

Type / Values

`feature`

Details

Force-enable a feature flag (translates to `-c features.<name>=true`). Repeatable.

Key

`--image, -i`

Type / Values

`path[,path...]`

Details

Attach one or more image files to the initial prompt. Separate multiple paths with commas or repeat the flag.

Key

`--local-provider`

Type / Values

`lmstudio | ollama`

Details

Choose the local provider used with `--oss`, overriding `oss_provider` for this run.

Key

`--model, -m`

Type / Values

`string`

Details

Override the model set in configuration (for example `gpt-5.6-terra`).

Key

`--no-alt-screen`

Type / Values

`boolean`

Details

Disable alternate screen mode for the TUI (overrides `tui.alternate_screen` for this run).

Key

`--oss`

Type / Values

`boolean`

Details

Use a local open source model provider. Codex uses `--local-provider`, your configured `oss_provider`, or prompts you to choose between LM Studio and Ollama.

Key

`--profile, -p`

Type / Values

`string`

Details

Layer `$CODEX_HOME/profile-name.config.toml` on top of the base user config.

Key

`--remote`

Type / Values

`ws://host:port | wss://host:port | unix:// | unix://PATH`

Details

Connect to a remote app-server endpoint over WebSocket or a Unix socket. Supported for `codex`, `codex resume`, `codex fork`, `codex archive`, `codex delete`, and `codex unarchive`; other subcommands reject remote mode.

Key

`--remote-auth-token-env`

Type / Values

`ENV_VAR`

Details

Read a bearer token from this environment variable and send it when connecting with `--remote`. Requires `--remote`; tokens are only sent over `wss://` URLs or local-only `ws://` URLs.

Key

`--sandbox, -s`

Type / Values

`read-only | workspace-write | danger-full-access`

Details

Select the sandbox policy for model-generated shell commands.

Key

`--search`

Type / Values

`boolean`

Details

Enable live web search (sets `web_search = "live"` instead of the default `"cached"`).

Key

`--strict-config`

Type / Values

`boolean`

Details

Error when `config.toml` contains fields this Codex version does not recognize. Supported by runtime commands such as `codex`, `exec`, `review`, `resume`, `fork`, `app-server`, `mcp-server`, and `exec-server`.

Key

`PROMPT`

Type / Values

`string`

Details

Optional text instruction to start the session. Omit to launch the TUI without a pre-filled message.

Expand to view all

These options apply to the base `codex` command. Most propagate to commands; see the notes above or the relevant command help for exceptions. For propagated flags, follow the relevant command help. For example, `codex exec --oss ...` applies `--oss` to `exec`.

## Command overview

The Maturity column uses feature maturity labels such as Experimental, Beta, Stable, and Deprecated. See [Feature Maturity](https://developers.openai.com/codex/feature-maturity) for how to interpret these labels.

| Key | Maturity | Details |
| --- | --- | --- |
| [`codex`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-interactive) | Stable | Launch the terminal UI. Accepts the global flags above plus an optional prompt or image attachments. |
| [`codex app`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-app) | Stable | Launch the ChatGPT desktop app on macOS or Windows. On macOS, Codex can open a workspace path; on Windows, Codex prints the path to open. |
| [`codex app-server`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-app-server) | Experimental | Launch the Codex app server for local development or debugging over stdio, WebSocket, or a Unix socket. |
| [`codex apply`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-apply) | Stable | Apply the latest diff generated by a Codex cloud chat to your local working tree. Alias: `codex a`. |
| [`codex archive`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-archive-and-codex-unarchive) | Stable | Archive a saved interactive session by session ID or session name. |
| [`codex cloud`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-cloud) | Experimental | Browse or execute Codex cloud chats from the terminal without opening the TUI. Alias: `codex cloud-tasks`. |
| [`codex completion`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-completion) | Stable | Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell. |
| [`codex debug app-server send-message-v2`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-debug-app-server-send-message-v2) | Experimental | Debug app-server by sending a single V2 message through the built-in test client. |
| [`codex debug models`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-debug-models) | Experimental | Print the raw model catalog Codex sees, including an option to inspect only the bundled catalog. |
| [`codex debug prompt-input`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-debug-prompt-input) | Experimental | Render the model-visible prompt input list as JSON, optionally with a prompt and images. |
| [`codex delete`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-delete) | Stable | Permanently delete a saved interactive session by session ID or session name. |
| [`codex doctor`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-doctor) | Stable | Generate a diagnostic report for local installation, config, auth, runtime, Git, terminal, app-server, and thread inventory issues. |
| [`codex exec`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-exec) | Stable | Run Codex non-interactively. Alias: `codex e`. Stream results to stdout or JSONL and optionally resume previous sessions. |
| [`codex execpolicy`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-execpolicy) | Experimental | Evaluate execpolicy rule files and see whether a command would be allowed, prompted, or blocked. |
| [`codex features`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-features) | Stable | List feature flags and persistently enable or disable them in `config.toml`. |
| [`codex fork`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-fork) | Stable | Fork a previous interactive session into a new chat, preserving the original transcript. |
| [`codex login`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-login) | Stable | Authenticate Codex using ChatGPT OAuth, device auth, an API key, or an access token piped over stdin. |
| [`codex logout`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-logout) | Stable | Remove stored authentication credentials. |
| [`codex mcp`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-mcp) | Stable | Manage Model Context Protocol servers (list, add, remove, authenticate). |
| [`codex mcp-server`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-mcp-server) | Deprecated | Deprecated interface for running Codex as an MCP server over stdio. Use the [Codex app server](https://developers.openai.com/codex/app-server) instead. To call Codex from Claude Code, use the [Codex plugin for Claude Code](https://github.com/openai/codex-plugin-cc). |
| [`codex plugin`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-plugin) | Stable | Install, list, and remove plugins from configured marketplace sources. |
| [`codex plugin marketplace`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-plugin-marketplace) | Stable | Add, list, upgrade, or remove plugin marketplaces from Git or local sources. |
| [`codex remote-control`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-remote-control) | Experimental | Run or manage remote control for the local app-server, or create a short-lived pairing code. |
| [`codex resume`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-resume) | Stable | Continue a previous interactive session by ID or resume the most recent chat. |
| [`codex review`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-review) | Stable | Run a non-interactive review of uncommitted changes, a base branch diff, a commit, or custom review instructions. |
| [`codex sandbox`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-sandbox) | Stable | Run arbitrary commands inside Codex-provided macOS, Linux, or Windows sandboxes. |
| [`codex unarchive`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-archive-and-codex-unarchive) | Stable | Restore an archived interactive session by session ID or session name. |
| [`codex update`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-update) | Stable | Check for and apply a Codex CLI update when the installed release supports self-update. |

Key

[`codex`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-interactive)

Maturity

Stable

Details

Launch the terminal UI. Accepts the global flags above plus an optional prompt or image attachments.

Key

[`codex app`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-app)

Maturity

Stable

Details

Launch the ChatGPT desktop app on macOS or Windows. On macOS, Codex can open a workspace path; on Windows, Codex prints the path to open.

Key

[`codex app-server`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-app-server)

Maturity

Experimental

Details

Launch the Codex app server for local development or debugging over stdio, WebSocket, or a Unix socket.

Key

[`codex apply`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-apply)

Maturity

Stable

Details

Apply the latest diff generated by a Codex cloud chat to your local working tree. Alias: `codex a`.

Key

[`codex archive`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-archive-and-codex-unarchive)

Maturity

Stable

Details

Archive a saved interactive session by session ID or session name.

Key

[`codex cloud`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-cloud)

Maturity

Experimental

Details

Browse or execute Codex cloud chats from the terminal without opening the TUI. Alias: `codex cloud-tasks`.

Key

[`codex completion`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-completion)

Maturity

Stable

Details

Generate shell completion scripts for Bash, Zsh, Fish, or PowerShell.

Key

[`codex debug app-server send-message-v2`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-debug-app-server-send-message-v2)

Maturity

Experimental

Details

Debug app-server by sending a single V2 message through the built-in test client.

Key

[`codex debug models`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-debug-models)

Maturity

Experimental

Details

Print the raw model catalog Codex sees, including an option to inspect only the bundled catalog.

Key

[`codex debug prompt-input`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-debug-prompt-input)

Maturity

Experimental

Details

Render the model-visible prompt input list as JSON, optionally with a prompt and images.

Key

[`codex delete`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-delete)

Maturity

Stable

Details

Permanently delete a saved interactive session by session ID or session name.

Key

[`codex doctor`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-doctor)

Maturity

Stable

Details

Generate a diagnostic report for local installation, config, auth, runtime, Git, terminal, app-server, and thread inventory issues.

Key

[`codex exec`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-exec)

Maturity

Stable

Details

Run Codex non-interactively. Alias: `codex e`. Stream results to stdout or JSONL and optionally resume previous sessions.

Key

[`codex execpolicy`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-execpolicy)

Maturity

Experimental

Details

Evaluate execpolicy rule files and see whether a command would be allowed, prompted, or blocked.

Key

[`codex features`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-features)

Maturity

Stable

Details

List feature flags and persistently enable or disable them in `config.toml`.

Key

[`codex fork`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-fork)

Maturity

Stable

Details

Fork a previous interactive session into a new chat, preserving the original transcript.

Key

[`codex login`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-login)

Maturity

Stable

Details

Authenticate Codex using ChatGPT OAuth, device auth, an API key, or an access token piped over stdin.

Key

[`codex logout`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-logout)

Maturity

Stable

Details

Remove stored authentication credentials.

Key

[`codex mcp`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-mcp)

Maturity

Stable

Details

Manage Model Context Protocol servers (list, add, remove, authenticate).

Key

[`codex mcp-server`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-mcp-server)

Maturity

Deprecated

Details

Deprecated interface for running Codex as an MCP server over stdio. Use the [Codex app server](https://developers.openai.com/codex/app-server) instead. To call Codex from Claude Code, use the [Codex plugin for Claude Code](https://github.com/openai/codex-plugin-cc).

Key

[`codex plugin`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-plugin)

Maturity

Stable

Details

Install, list, and remove plugins from configured marketplace sources.

Key

[`codex plugin marketplace`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-plugin-marketplace)

Maturity

Stable

Details

Add, list, upgrade, or remove plugin marketplaces from Git or local sources.

Key

[`codex remote-control`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-remote-control)

Maturity

Experimental

Details

Run or manage remote control for the local app-server, or create a short-lived pairing code.

Key

[`codex resume`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-resume)

Maturity

Stable

Details

Continue a previous interactive session by ID or resume the most recent chat.

Key

[`codex review`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-review)

Maturity

Stable

Details

Run a non-interactive review of uncommitted changes, a base branch diff, a commit, or custom review instructions.

Key

[`codex sandbox`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-sandbox)

Maturity

Stable

Details

Run arbitrary commands inside Codex-provided macOS, Linux, or Windows sandboxes.

Key

[`codex unarchive`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-archive-and-codex-unarchive)

Maturity

Stable

Details

Restore an archived interactive session by session ID or session name.

Key

[`codex update`](https://developers.openai.com/codex/developer-commands?surface=cli#cli-codex-update)

Maturity

Stable

Details

Check for and apply a Codex CLI update when the installed release supports self-update.

Expand to view all

## Command details

### `codex` (interactive)

Running `codex` with no subcommand launches the interactive terminal UI (TUI). The agent accepts the global flags above plus image attachments. Web search defaults to cached mode; use `--search` to switch to live browsing. For low-friction local work, use `--sandbox workspace-write --ask-for-approval on-request`.

Use `--remote ws://host:port` or `--remote wss://host:port` to connect the TUI to an app server started with `codex app-server --listen ws://IP:PORT`. For a local Unix socket, use `--remote unix://` for the default socket or `--remote unix://PATH` for an explicit path. Add `--remote-auth-token-env <ENV_VAR>` when the server requires a bearer token for WebSocket authentication.

### `codex app-server`

Launch the Codex app server locally. This is primarily for development and debugging and may change without notice.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--analytics-default-enabled` | `boolean` | Defaults analytics to enabled for first-party app-server clients unless the user opts out in config. |
| `--code-mode-host` | `ws://HOST/PATH | wss://HOST/PATH` | Connect to a remote Code Mode host instead of starting a local host. This outbound connection is shared across threads and is separate from `--listen`; use `wss://` for remote hosts. |
| `--listen` | `stdio:// | ws://IP:PORT | unix:// | unix://PATH | off` | Transport listener URL. Use `stdio://` for JSONL, `ws://IP:PORT` for a TCP WebSocket endpoint, `unix://` for the default Unix socket, `unix://PATH` for a custom Unix socket, or `off` to disable the local transport. |
| `--stdio` | `boolean` | Use stdio transport. Equivalent to `--listen stdio://` and mutually exclusive with `--listen`. |
| `--ws-audience` | `string` | Expected `aud` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`. |
| `--ws-auth` | `capability-token | signed-bearer-token` | Authentication mode for app-server WebSocket clients. If omitted, WebSocket auth is disabled; non-local listeners warn during startup. |
| `--ws-issuer` | `string` | Expected `iss` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`. |
| `--ws-max-clock-skew-seconds` | `number` | Clock skew allowance when validating signed bearer token `exp` and `nbf` claims. Requires `--ws-auth signed-bearer-token`. |
| `--ws-shared-secret-file` | `absolute path` | File containing the HMAC shared secret used to validate signed JWT bearer tokens. Required with `--ws-auth signed-bearer-token`. |
| `--ws-token-file` | `absolute path` | File containing the shared capability token. Use with `--ws-auth capability-token` unless you provide `--ws-token-sha256` instead. |
| `--ws-token-sha256` | `hexadecimal SHA-256 digest` | Expected SHA-256 digest for capability-token authentication. Use instead of `--ws-token-file` when the client token comes from another source. |

Key

`--analytics-default-enabled`

Type / Values

`boolean`

Details

Defaults analytics to enabled for first-party app-server clients unless the user opts out in config.

Key

`--code-mode-host`

Type / Values

`ws://HOST/PATH | wss://HOST/PATH`

Details

Connect to a remote Code Mode host instead of starting a local host. This outbound connection is shared across threads and is separate from `--listen`; use `wss://` for remote hosts.

Key

`--listen`

Type / Values

`stdio:// | ws://IP:PORT | unix:// | unix://PATH | off`

Details

Transport listener URL. Use `stdio://` for JSONL, `ws://IP:PORT` for a TCP WebSocket endpoint, `unix://` for the default Unix socket, `unix://PATH` for a custom Unix socket, or `off` to disable the local transport.

Key

`--stdio`

Type / Values

`boolean`

Details

Use stdio transport. Equivalent to `--listen stdio://` and mutually exclusive with `--listen`.

Key

`--ws-audience`

Type / Values

`string`

Details

Expected `aud` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`.

Key

`--ws-auth`

Type / Values

`capability-token | signed-bearer-token`

Details

Authentication mode for app-server WebSocket clients. If omitted, WebSocket auth is disabled; non-local listeners warn during startup.

Key

`--ws-issuer`

Type / Values

`string`

Details

Expected `iss` claim for signed bearer tokens. Requires `--ws-auth signed-bearer-token`.

Key

`--ws-max-clock-skew-seconds`

Type / Values

`number`

Details

Clock skew allowance when validating signed bearer token `exp` and `nbf` claims. Requires `--ws-auth signed-bearer-token`.

Key

`--ws-shared-secret-file`

Type / Values

`absolute path`

Details

File containing the HMAC shared secret used to validate signed JWT bearer tokens. Required with `--ws-auth signed-bearer-token`.

Key

`--ws-token-file`

Type / Values

`absolute path`

Details

File containing the shared capability token. Use with `--ws-auth capability-token` unless you provide `--ws-token-sha256` instead.

Key

`--ws-token-sha256`

Type / Values

`hexadecimal SHA-256 digest`

Details

Expected SHA-256 digest for capability-token authentication. Use instead of `--ws-token-file` when the client token comes from another source.

Expand to view all

`codex app-server --listen stdio://` keeps the default JSONL-over-stdio behavior, and `codex app-server --stdio` is an alias for that transport. `--listen ws://IP:PORT` enables WebSocket transport for app-server clients. The server accepts `ws://` listen URLs; use TLS termination or a secure proxy when clients connect with `wss://`. Use `--listen unix://` to accept WebSocket handshakes on Codex's default Unix socket, or `--listen unix:///absolute/path.sock` to choose a socket path. If you generate schemas for client bindings, add `--experimental` to include gated fields and methods.

Add `--code-mode-host wss://code-mode.example.com/host` to connect app-server to a remote Code Mode host instead of starting a local host. This outbound connection is separate from `--listen` and shared by every thread in the app-server process. Use `ws://` only for a localhost or SSH-forwarded host.

### `codex remote-control`

Run `codex remote-control` to start remote control in the foreground. Use `codex remote-control start` to start the local app-server daemon with remote control enabled, and `codex remote-control stop` to stop it. Managed remote-control clients and SSH remote workflows use these commands; they aren't a replacement for `codex app-server --listen` when you're building a local protocol client.

After the daemon is running, use `codex remote-control pair` to create and print a short-lived manual pairing code. Add `--json` to any remote-control command for machine-readable output. For `pair`, the JSON response includes `pairingCode`, `manualPairingCode`, `environmentId`, and `expiresAt`.

### `codex app`

Launch the ChatGPT desktop app from the terminal on macOS or Windows. On macOS, Codex can open a specific workspace path; on Windows, Codex prints the path to open.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--download-url` | `url` | Advanced override for the ChatGPT desktop app installer URL used during install. |
| `PATH` | `path` | Workspace path for the ChatGPT desktop app. On macOS, Codex opens this path; on Windows, Codex prints the path. |

Key

`--download-url`

Type / Values

`url`

Details

Advanced override for the ChatGPT desktop app installer URL used during install.

Key

`PATH`

Type / Values

`path`

Details

Workspace path for the ChatGPT desktop app. On macOS, Codex opens this path; on Windows, Codex prints the path.

`codex app` opens an installed ChatGPT desktop app, or starts the installer when the app is missing. On macOS, Codex opens the provided workspace path; on Windows, it prints the path to open after installation.

### `codex debug app-server send-message-v2`

Send one message through app-server's V2 thread/turn flow using the built-in app-server test client.

| Key | Type / Values | Details |
| --- | --- | --- |
| `USER_MESSAGE` | `string` | Message text sent to app-server through the built-in V2 test-client flow. |

Key

`USER_MESSAGE`

Type / Values

`string`

Details

Message text sent to app-server through the built-in V2 test-client flow.

This debug flow initializes with `experimentalApi: true`, starts a thread, sends a turn, and streams server notifications. Use it to reproduce and inspect app-server protocol behavior locally.

### `codex debug models`

Print the raw model catalog Codex sees as JSON.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--bundled` | `boolean` | Skip refresh and print only the model catalog bundled with the current Codex binary. |

Key

`--bundled`

Type / Values

`boolean`

Details

Skip refresh and print only the model catalog bundled with the current Codex binary.

Use `--bundled` when you want to inspect only the catalog bundled with the current binary, without refreshing from the remote models endpoint.

### `codex debug prompt-input`

Render the exact model-visible prompt input list as JSON. Use this when debugging instruction discovery, session context, or prompt construction.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--image, -i` | `path[,path...]` | Attach one or more images to the user prompt. Separate multiple paths with commas or repeat the flag. |
| `PROMPT` | `string` | Optional user prompt appended after the session context. |

Key

`--image, -i`

Type / Values

`path[,path...]`

Details

Attach one or more images to the user prompt. Separate multiple paths with commas or repeat the flag.

Key

`PROMPT`

Type / Values

`string`

Details

Optional user prompt appended after the session context.

### `codex apply`

Apply the most recent diff from a Codex cloud chat to your local repository. You must authenticate and have access to the chat.

| Key | Type / Values | Details |
| --- | --- | --- |
| `TASK_ID` | `string` | Identifier of the Codex cloud chat whose diff should be applied. |

Key

`TASK_ID`

Type / Values

`string`

Details

Identifier of the Codex cloud chat whose diff should be applied.

Codex prints the patched files and exits non-zero if `git apply` fails (for example, due to conflicts).

### `codex review`

Run a code review non-interactively. Choose exactly one review target, or pass custom review instructions as a prompt.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--base` | `branch` | Review changes against the specified base branch. |
| `--commit` | `SHA` | Review the changes introduced by the specified commit. |
| `--strict-config` | `boolean` | Error when `config.toml` contains fields this Codex version does not recognize. |
| `--title` | `string` | Set the commit title shown in the review summary. Requires `--commit`. |
| `--uncommitted` | `boolean` | Review staged, unstaged, and untracked changes. |
| `PROMPT` | `string | - (read stdin)` | Custom review instructions. Use `-` to read the instructions from stdin. |

Key

`--base`

Type / Values

`branch`

Details

Review changes against the specified base branch.

Key

`--commit`

Type / Values

`SHA`

Details

Review the changes introduced by the specified commit.

Key

`--strict-config`

Type / Values

`boolean`

Details

Error when `config.toml` contains fields this Codex version does not recognize.

Key

`--title`

Type / Values

`string`

Details

Set the commit title shown in the review summary. Requires `--commit`.

Key

`--uncommitted`

Type / Values

`boolean`

Details

Review staged, unstaged, and untracked changes.

Key

`PROMPT`

Type / Values

`string | - (read stdin)`

Details

Custom review instructions. Use `-` to read the instructions from stdin.

`--uncommitted`, `--base`, `--commit`, and a custom `PROMPT` conflict with one another. Use `--title` only with `--commit`.

### `codex archive` and `codex unarchive`

Archive or restore a saved interactive session by session ID or session name. Use these commands when you want to clean up the session picker without deleting the transcript. Session IDs take precedence over session names.

```
codex archive <SESSION>
codex unarchive <SESSION>
```

| Key | Type / Values | Details |
| --- | --- | --- |
| `--remote` | `ws://host:port | wss://host:port | unix:// | unix://PATH` | Connect to a remote app-server endpoint before changing archive state. |
| `--remote-auth-token-env` | `ENV_VAR` | Read a bearer token from this environment variable when `--remote` requires authentication. |
| `SESSION` | `session ID | session name` | Saved session to archive or restore. Session IDs take precedence over session names. |

Key

`--remote`

Type / Values

`ws://host:port | wss://host:port | unix:// | unix://PATH`

Details

Connect to a remote app-server endpoint before changing archive state.

Key

`--remote-auth-token-env`

Type / Values

`ENV_VAR`

Details

Read a bearer token from this environment variable when `--remote` requires authentication.

Key

`SESSION`

Type / Values

`session ID | session name`

Details

Saved session to archive or restore. Session IDs take precedence over session names.

### `codex delete`

Permanently delete a saved interactive session by session ID or session name. Use this only when you want to remove the transcript instead of hiding it from active session lists.

```
codex delete <SESSION>
codex delete <SESSION_UUID> --force
```

| Key | Type / Values | Details |
| --- | --- | --- |
| `--force` | `boolean` | Delete without prompting. The session argument must be a UUID; names still require interactive confirmation. |
| `--remote` | `ws://host:port | wss://host:port | unix:// | unix://PATH` | Connect to a remote app-server endpoint before deleting the session. |
| `--remote-auth-token-env` | `ENV_VAR` | Read a bearer token from this environment variable when `--remote` requires authentication. |
| `SESSION` | `session ID | session name` | Saved session to delete. Session IDs take precedence over session names. |

Key

`--force`

Type / Values

`boolean`

Details

Delete without prompting. The session argument must be a UUID; names still require interactive confirmation.

Key

`--remote`

Type / Values

`ws://host:port | wss://host:port | unix:// | unix://PATH`

Details

Connect to a remote app-server endpoint before deleting the session.

Key

`--remote-auth-token-env`

Type / Values

`ENV_VAR`

Details

Read a bearer token from this environment variable when `--remote` requires authentication.

Key

`SESSION`

Type / Values

`session ID | session name`

Details

Saved session to delete. Session IDs take precedence over session names.

Use `--force` only with a session UUID. Named sessions still require confirmation so Codex doesn't delete a repeated or ambiguous name without a prompt.

### `codex cloud`

Interact with Codex cloud chats from the terminal. The default command opens an interactive picker; `codex cloud exec` submits a task directly, and `codex cloud list` returns recent chats for scripting or quick inspection.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--attempts` | `1-4` | Number of assistant attempts (best-of-N) Codex cloud should run. |
| `--env` | `ENV_ID` | Target Codex cloud environment identifier (required). Use `codex cloud` to list options. |
| `QUERY` | `string` | Task prompt. If omitted, Codex prompts interactively for details. |

Key

`--attempts`

Type / Values

`1-4`

Details

Number of assistant attempts (best-of-N) Codex cloud should run.

Key

`--env`

Type / Values

`ENV_ID`

Details

Target Codex cloud environment identifier (required). Use `codex cloud` to list options.

Key

`QUERY`

Type / Values

`string`

Details

Task prompt. If omitted, Codex prompts interactively for details.

Authentication follows the same credentials as the main CLI. Codex exits non-zero if the task submission fails.

#### `codex cloud list`

List recent cloud chats with optional filtering and pagination.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--cursor` | `string` | Pagination cursor returned by a previous request. |
| `--env` | `ENV_ID` | Filter tasks by environment identifier. |
| `--json` | `boolean` | Emit machine-readable JSON instead of plain text. |
| `--limit` | `1-20` | Maximum number of tasks to return. |

Key

`--cursor`

Type / Values

`string`

Details

Pagination cursor returned by a previous request.

Key

`--env`

Type / Values

`ENV_ID`

Details

Filter tasks by environment identifier.

Key

`--json`

Type / Values

`boolean`

Details

Emit machine-readable JSON instead of plain text.

Key

`--limit`

Type / Values

`1-20`

Details

Maximum number of tasks to return.

Plain-text output prints a task URL followed by status details. Use `--json` for automation. The JSON payload contains a `tasks` array plus an optional `cursor` value. Each task includes `id`, `url`, `title`, `status`, `updated_at`, `environment_id`, `environment_label`, `summary`, `is_review`, and `attempt_total`.

### `codex completion`

Generate shell completion scripts and redirect the output to the appropriate location, for example `codex completion zsh > "${fpath[1]}/_codex"`.

| Key | Type / Values | Details |
| --- | --- | --- |
| `SHELL` | `bash | zsh | fish | power-shell | elvish` | Shell to generate completions for. Output prints to stdout. |

Key

`SHELL`

Type / Values

`bash | zsh | fish | power-shell | elvish`

Details

Shell to generate completions for. Output prints to stdout.

### `codex doctor`

Generate a local diagnostic report before filing a support issue or while investigating a broken Codex installation. The report checks installation, configuration, authentication, runtime, Git, terminal, app-server, and thread inventory health.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--all` | `boolean` | Expand long lists in the detailed human-readable report. |
| `--ascii` | `boolean` | Use ASCII status labels and separators in human-readable output. |
| `--json` | `boolean` | Emit a redacted machine-readable support report. |
| `--no-color` | `boolean` | Disable ANSI color in human-readable output. |
| `--summary` | `boolean` | Show grouped check rows and the final count summary only. |

Key

`--all`

Type / Values

`boolean`

Details

Expand long lists in the detailed human-readable report.

Key

`--ascii`

Type / Values

`boolean`

Details

Use ASCII status labels and separators in human-readable output.

Key

`--json`

Type / Values

`boolean`

Details

Emit a redacted machine-readable support report.

Key

`--no-color`

Type / Values

`boolean`

Details

Disable ANSI color in human-readable output.

Key

`--summary`

Type / Values

`boolean`

Details

Show grouped check rows and the final count summary only.

### `codex features`

Manage feature flags stored in `$CODEX_HOME/config.toml`. The `enable` and `disable` commands persist changes so they apply to future sessions. The `features` subcommand doesn't accept `--profile`.

| Key | Type / Values | Details |
| --- | --- | --- |
| `Disable subcommand` | `codex features disable <feature>` | Persistently disable a feature flag in `$CODEX_HOME/config.toml`. |
| `Enable subcommand` | `codex features enable <feature>` | Persistently enable a feature flag in `$CODEX_HOME/config.toml`. |
| `List subcommand` | `codex features list` | Show known feature flags, their maturity stage, and their effective state. |

Key

`Disable subcommand`

Type / Values

`codex features disable <feature>`

Details

Persistently disable a feature flag in `$CODEX_HOME/config.toml`.

Key

`Enable subcommand`

Type / Values

`codex features enable <feature>`

Details

Persistently enable a feature flag in `$CODEX_HOME/config.toml`.

Key

`List subcommand`

Type / Values

`codex features list`

Details

Show known feature flags, their maturity stage, and their effective state.

### `codex exec`

Use `codex exec` (or the short form `codex e`) for scripted or CI-style runs that should finish without human interaction.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--cd, -C` | `path` | Set the workspace root before executing the task. |
| `--color` | `always | never | auto` | Control ANSI color in stdout. |
| `--dangerously-bypass-approvals-and-sandbox, --yolo` | `boolean` | Bypass approval prompts and sandboxing. Dangerous—only use inside an isolated runner. |
| `--dangerously-bypass-hook-trust` | `boolean` | Run enabled hooks without requiring persisted hook trust for this invocation. Intended only for automation that already vets hook sources. |
| `--ephemeral` | `boolean` | Run without persisting session rollout files to disk. |
| `--full-auto` | `boolean` | Deprecated compatibility flag. Prefer `--sandbox workspace-write`; Codex prints a warning when this flag is used. |
| `--ignore-rules` | `boolean` | Do not load user or project execpolicy `.rules` files for this run. |
| `--ignore-user-config` | `boolean` | Do not load `$CODEX_HOME/config.toml`. Authentication still uses `CODEX_HOME`. |
| `--image, -i` | `path[,path...]` | Attach images to the first message. Repeatable; supports comma-separated lists. |
| `--json, --experimental-json` | `boolean` | Print newline-delimited JSON events instead of formatted text. |
| `--local-provider` | `lmstudio | ollama` | Choose the local provider used with `--oss`, overriding `oss_provider` for this run. |
| `--model, -m` | `string` | Override the configured model for this run. |
| `--oss` | `boolean` | Use a local open source provider. Codex uses `--local-provider` or your configured `oss_provider`, and exits with an error if neither is set. |
| `--output-last-message, -o` | `path` | Write the assistant’s final message to a file. Useful for downstream scripting. |
| `--output-schema` | `path` | JSON Schema file describing the expected final response shape. Codex validates tool output against it. |
| `--profile, -p` | `string` | Layer `$CODEX_HOME/profile-name.config.toml` on top of the base user config. |
| `--sandbox, -s` | `read-only | workspace-write | danger-full-access` | Sandbox policy for model-generated commands. Defaults to configuration. |
| `--skip-git-repo-check` | `boolean` | Allow running outside a Git repository (useful for one-off directories). |
| `-c, --config` | `key=value` | Inline configuration override for the non-interactive run (repeatable). |
| `PROMPT` | `string | - (read stdin)` | Initial instruction for the task. Use `-` to pipe the prompt from stdin. |
| `Resume subcommand` | `codex exec resume [SESSION_ID]` | Resume an exec session by ID or add `--last` to continue the most recent session from the current working directory. Add `--all` to consider sessions from any directory. Accepts an optional follow-up prompt. |

Key

`--cd, -C`

Type / Values

`path`

Details

Set the workspace root before executing the task.

Key

`--color`

Type / Values

`always | never | auto`

Details

Control ANSI color in stdout.

Key

`--dangerously-bypass-approvals-and-sandbox, --yolo`

Type / Values

`boolean`

Details

Bypass approval prompts and sandboxing. Dangerous—only use inside an isolated runner.

Key

`--dangerously-bypass-hook-trust`

Type / Values

`boolean`

Details

Run enabled hooks without requiring persisted hook trust for this invocation. Intended only for automation that already vets hook sources.

Key

`--ephemeral`

Type / Values

`boolean`

Details

Run without persisting session rollout files to disk.

Key

`--full-auto`

Type / Values

`boolean`

Details

Deprecated compatibility flag. Prefer `--sandbox workspace-write`; Codex prints a warning when this flag is used.

Key

`--ignore-rules`

Type / Values

`boolean`

Details

Do not load user or project execpolicy `.rules` files for this run.

Key

`--ignore-user-config`

Type / Values

`boolean`

Details

Do not load `$CODEX_HOME/config.toml`. Authentication still uses `CODEX_HOME`.

Key

`--image, -i`

Type / Values

`path[,path...]`

Details

Attach images to the first message. Repeatable; supports comma-separated lists.

Key

`--json, --experimental-json`

Type / Values

`boolean`

Details

Print newline-delimited JSON events instead of formatted text.

Key

`--local-provider`

Type / Values

`lmstudio | ollama`

Details

Choose the local provider used with `--oss`, overriding `oss_provider` for this run.

Key

`--model, -m`

Type / Values

`string`

Details

Override the configured model for this run.

Key

`--oss`

Type / Values

`boolean`

Details

Use a local open source provider. Codex uses `--local-provider` or your configured `oss_provider`, and exits with an error if neither is set.

Key

`--output-last-message, -o`

Type / Values

`path`

Details

Write the assistant’s final message to a file. Useful for downstream scripting.

Key

`--output-schema`

Type / Values

`path`

Details

JSON Schema file describing the expected final response shape. Codex validates tool output against it.

Key

`--profile, -p`

Type / Values

`string`

Details

Layer `$CODEX_HOME/profile-name.config.toml` on top of the base user config.

Key

`--sandbox, -s`

Type / Values

`read-only | workspace-write | danger-full-access`

Details

Sandbox policy for model-generated commands. Defaults to configuration.

Key

`--skip-git-repo-check`

Type / Values

`boolean`

Details

Allow running outside a Git repository (useful for one-off directories).

Key

`-c, --config`

Type / Values

`key=value`

Details

Inline configuration override for the non-interactive run (repeatable).

Key

`PROMPT`

Type / Values

`string | - (read stdin)`

Details

Initial instruction for the task. Use `-` to pipe the prompt from stdin.

Key

`Resume subcommand`

Type / Values

`codex exec resume [SESSION_ID]`

Details

Resume an exec session by ID or add `--last` to continue the most recent session from the current working directory. Add `--all` to consider sessions from any directory. Accepts an optional follow-up prompt.

Expand to view all

Codex writes formatted output by default. Add `--json` to receive newline-delimited JSON events (one per state change). The optional `resume` subcommand lets you continue non-interactive tasks. Use `--last` to pick the most recent session from the current working directory, or add `--all` to search across all sessions:

| Key | Type / Values | Details |
| --- | --- | --- |
| `--all` | `boolean` | Include sessions outside the current working directory when selecting the most recent session. |
| `--image, -i` | `path[,path...]` | Attach one or more images to the follow-up prompt. Separate multiple paths with commas or repeat the flag. |
| `--last` | `boolean` | Resume the most recent chat from the current working directory. |
| `PROMPT` | `string | - (read stdin)` | Optional follow-up instruction sent immediately after resuming. |
| `SESSION_ID` | `uuid | session name` | Resume the specified session. Omit and use `--last` to continue the most recent session. |

Key

`--all`

Type / Values

`boolean`

Details

Include sessions outside the current working directory when selecting the most recent session.

Key

`--image, -i`

Type / Values

`path[,path...]`

Details

Attach one or more images to the follow-up prompt. Separate multiple paths with commas or repeat the flag.

Key

`--last`

Type / Values

`boolean`

Details

Resume the most recent chat from the current working directory.

Key

`PROMPT`

Type / Values

`string | - (read stdin)`

Details

Optional follow-up instruction sent immediately after resuming.

Key

`SESSION_ID`

Type / Values

`uuid | session name`

Details

Resume the specified session. Omit and use `--last` to continue the most recent session.

### `codex execpolicy`

Check `execpolicy` rule files before you save them. `codex execpolicy check` accepts one or more `--rules` flags (for example, files under `~/.codex/rules`) and emits JSON showing the strictest decision and any matching rules. Add `--pretty` to format the output. The `execpolicy` command is currently in preview.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--pretty` | `boolean` | Pretty-print the JSON result. |
| `--rules, -r` | `path (repeatable)` | Path to an execpolicy rule file to evaluate. Provide multiple flags to combine rules across files. |
| `COMMAND...` | `var-args` | Command to be checked against the specified policies. |

Key

`--pretty`

Type / Values

`boolean`

Details

Pretty-print the JSON result.

Key

`--rules, -r`

Type / Values

`path (repeatable)`

Details

Path to an execpolicy rule file to evaluate. Provide multiple flags to combine rules across files.

Key

`COMMAND...`

Type / Values

`var-args`

Details

Command to be checked against the specified policies.

### `codex login`

Authenticate the CLI with a ChatGPT account, API key, or access token. With no flags, Codex opens a browser for the ChatGPT OAuth flow.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--device-auth` | `boolean` | Use OAuth device code flow instead of launching a browser window. |
| `--with-access-token` | `boolean` | Read an access token from stdin (for example `printenv CODEX_ACCESS_TOKEN | codex login --with-access-token`). |
| `--with-api-key` | `boolean` | Read an API key from stdin (for example `printenv OPENAI_API_KEY | codex login --with-api-key`). |
| `status subcommand` | `codex login status` | Print the active authentication mode and exit with 0 when logged in. |

Key

`--device-auth`

Type / Values

`boolean`

Details

Use OAuth device code flow instead of launching a browser window.

Key

`--with-access-token`

Type / Values

`boolean`

Details

Read an access token from stdin (for example `printenv CODEX_ACCESS_TOKEN | codex login --with-access-token`).

Key

`--with-api-key`

Type / Values

`boolean`

Details

Read an API key from stdin (for example `printenv OPENAI_API_KEY | codex login --with-api-key`).

Key

`status subcommand`

Type / Values

`codex login status`

Details

Print the active authentication mode and exit with 0 when logged in.

`codex login status` exits with `0` when credentials are present, which is helpful in automation scripts.

### `codex logout`

Remove saved credentials for both API key and ChatGPT authentication. This command has no flags.

### `codex mcp`

Manage Model Context Protocol server entries stored in `~/.codex/config.toml`.

| Key | Type / Values | Details |
| --- | --- | --- |
| `add <name>` | `-- <command...> | --url <value>` | Register a server using a stdio launcher command or a streamable HTTP URL. Supports `--env KEY=VALUE` for stdio transports. |
| `get <name>` | `--json` | Show a specific server configuration. `--json` prints the raw config entry. |
| `list` | `--json` | List configured MCP servers. Add `--json` for machine-readable output. |
| `login <name>` | `--scopes scope1,scope2` | Start an OAuth login for a streamable HTTP server (servers that support OAuth only). |
| `logout <name>` |  | Remove stored OAuth credentials for a streamable HTTP server. |
| `remove <name>` |  | Delete a stored MCP server definition. |

Key

`add <name>`

Type / Values

`-- <command...> | --url <value>`

Details

Register a server using a stdio launcher command or a streamable HTTP URL. Supports `--env KEY=VALUE` for stdio transports.

Key

`get <name>`

Type / Values

`--json`

Details

Show a specific server configuration. `--json` prints the raw config entry.

Key

`list`

Type / Values

`--json`

Details

List configured MCP servers. Add `--json` for machine-readable output.

Key

`login <name>`

Type / Values

`--scopes scope1,scope2`

Details

Start an OAuth login for a streamable HTTP server (servers that support OAuth only).

Key

`logout <name>`

Details

Remove stored OAuth credentials for a streamable HTTP server.

Key

`remove <name>`

Details

Delete a stored MCP server definition.

The `add` subcommand supports both stdio and streamable HTTP transports:

| Key | Type / Values | Details |
| --- | --- | --- |
| `--bearer-token-env-var` | `ENV_VAR` | Environment variable whose value is sent as a bearer token when connecting to a streamable HTTP server. |
| `--env KEY=VALUE` | `repeatable` | Environment variable assignments applied when launching a stdio server. |
| `--oauth-client-id` | `CLIENT_ID` | OAuth client identifier for a streamable HTTP MCP server. Requires `--url`. |
| `--oauth-resource` | `RESOURCE` | OAuth resource parameter to include during login for a streamable HTTP MCP server. Requires `--url`. |
| `--url` | `https://…` | Register a streamable HTTP server instead of stdio. Mutually exclusive with `COMMAND...`. |
| `COMMAND...` | `stdio transport` | Executable plus arguments to launch the MCP server. Provide after `--`. |

Key

`--bearer-token-env-var`

Type / Values

`ENV_VAR`

Details

Environment variable whose value is sent as a bearer token when connecting to a streamable HTTP server.

Key

`--env KEY=VALUE`

Type / Values

`repeatable`

Details

Environment variable assignments applied when launching a stdio server.

Key

`--oauth-client-id`

Type / Values

`CLIENT_ID`

Details

OAuth client identifier for a streamable HTTP MCP server. Requires `--url`.

Key

`--oauth-resource`

Type / Values

`RESOURCE`

Details

OAuth resource parameter to include during login for a streamable HTTP MCP server. Requires `--url`.

Key

`--url`

Type / Values

`https://…`

Details

Register a streamable HTTP server instead of stdio. Mutually exclusive with `COMMAND...`.

Key

`COMMAND...`

Type / Values

`stdio transport`

Details

Executable plus arguments to launch the MCP server. Provide after `--`.

OAuth actions (`login`, `logout`) only work with streamable HTTP servers (and only when the server supports OAuth).

### `codex plugin`

Install, list, and remove plugins from configured marketplaces.

| Key | Type / Values | Details |
| --- | --- | --- |
| `add <plugin[@marketplace]>` | `[--marketplace, -m NAME] [--json]` | Install a plugin from a configured marketplace. Use `--marketplace` or `-m` when the plugin argument omits `@marketplace`. |
| `list` | `[--marketplace, -m NAME] [--available --json] [--json]` | List installed plugins. With `--json`, output has `installed` and `available` arrays; `--available` includes uninstalled marketplace plugins and requires `--json`. |
| `marketplace` |  | Manage configured marketplace sources. See `codex plugin marketplace` below. |
| `remove <plugin[@marketplace]>` | `[--marketplace, -m NAME] [--json]` | Remove an installed plugin from local config and cache. Use `--json` for automation-friendly output. |

Key

`add <plugin[@marketplace]>`

Type / Values

`[--marketplace, -m NAME] [--json]`

Details

Install a plugin from a configured marketplace. Use `--marketplace` or `-m` when the plugin argument omits `@marketplace`.

Key

`list`

Type / Values

`[--marketplace, -m NAME] [--available --json] [--json]`

Details

List installed plugins. With `--json`, output has `installed` and `available` arrays; `--available` includes uninstalled marketplace plugins and requires `--json`.

Key

`marketplace`

Details

Manage configured marketplace sources. See `codex plugin marketplace` below.

Key

`remove <plugin[@marketplace]>`

Type / Values

`[--marketplace, -m NAME] [--json]`

Details

Remove an installed plugin from local config and cache. Use `--json` for automation-friendly output.

`codex plugin add --json` prints `pluginId`, `name`, `marketplaceName`, `version`, `installedPath`, and `authPolicy`. `codex plugin list --json` prints `installed` and `available` arrays. Entries include `pluginId`, `name`, `marketplaceName`, `version`, `installed`, `enabled`, `source`, `installPolicy`, `authPolicy`, and, when available, `marketplaceSource` with the configured marketplace source type and value. `codex plugin remove --json` prints `pluginId`, `name`, and `marketplaceName`.

### `codex plugin marketplace`

Manage plugin marketplace sources that Codex can browse and install from.

| Key | Type / Values | Details |
| --- | --- | --- |
| `add <source>` | `[--ref REF] [--sparse PATH] [--json]` | Install a plugin marketplace from GitHub shorthand, a Git URL, an SSH URL, or a local marketplace root directory. `--sparse` is supported only for Git sources and can be repeated. |
| `list` | `[--json]` | Show plugin marketplaces Codex is currently considering and the root path for each marketplace. |
| `remove <marketplace-name>` | `[--json]` | Remove a configured plugin marketplace. |
| `upgrade [marketplace-name]` | `[--json]` | Refresh one configured Git marketplace, or all configured Git marketplaces when no name is provided. |

Key

`add <source>`

Type / Values

`[--ref REF] [--sparse PATH] [--json]`

Details

Install a plugin marketplace from GitHub shorthand, a Git URL, an SSH URL, or a local marketplace root directory. `--sparse` is supported only for Git sources and can be repeated.

Key

`list`

Type / Values

`[--json]`

Details

Show plugin marketplaces Codex is currently considering and the root path for each marketplace.

Key

`remove <marketplace-name>`

Type / Values

`[--json]`

Details

Remove a configured plugin marketplace.

Key

`upgrade [marketplace-name]`

Type / Values

`[--json]`

Details

Refresh one configured Git marketplace, or all configured Git marketplaces when no name is provided.

`codex plugin marketplace add` accepts GitHub shorthand such as `owner/repo` or `owner/repo@ref`, HTTP or HTTPS Git URLs, SSH Git URLs, and local marketplace root directories. Use `--ref` to pin a Git ref, and repeat `--sparse PATH` to use a sparse checkout for Git-backed marketplace repositories.

`codex plugin marketplace list` prints in-scope marketplace names and roots, including implicitly discovered default marketplaces and configured marketplace snapshots.

Add `--json` to marketplace add, list, upgrade, or remove commands for automation-friendly output. Marketplace add JSON includes `marketplaceName`, `installedRoot`, and `alreadyAdded`; list JSON includes a `marketplaces` array with `name`, `root`, and optional `marketplaceSource`; upgrade JSON includes `selectedMarketplaces`, `upgradedRoots`, and `errors`; remove JSON includes `marketplaceName` and `installedRoot`.

### `codex mcp-server`

`codex mcp-server` is deprecated. Use the [Codex app server](https://developers.openai.com/codex/app-server) instead. To call Codex from Claude Code, use the [Codex plugin for Claude Code](https://github.com/openai/codex-plugin-cc), which uses the app server.

For existing integrations, the command runs Codex as an MCP server over stdio so that other tools can connect. It inherits global configuration overrides and exits when the downstream client closes the connection.

### `codex resume`

Continue an interactive session by ID or resume the most recent chat. `codex resume` scopes `--last` to the current working directory unless you pass `--all`. It accepts the same global flags as `codex`, including model and sandbox overrides.

If the current working directory differs from the session's saved directory, Codex asks which directory to use. Set [`tui.resume_cwd`](https://developers.openai.com/codex/config-file/config-reference) to `"current"` or `"session"` to reuse that choice without a prompt. An explicit `--cd` (`-C`) override takes precedence over `tui.resume_cwd`.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--all` | `boolean` | Include sessions outside the current working directory when selecting the most recent session. |
| `--include-non-interactive` | `boolean` | Include non-interactive sessions in the picker and `--last` selection. |
| `--last` | `boolean` | Skip the picker and resume the most recent chat from the current working directory. |
| `SESSION_ID` | `uuid | session name` | Resume the specified session. Omit and use `--last` to continue the most recent session. |

Key

`--all`

Type / Values

`boolean`

Details

Include sessions outside the current working directory when selecting the most recent session.

Key

`--include-non-interactive`

Type / Values

`boolean`

Details

Include non-interactive sessions in the picker and `--last` selection.

Key

`--last`

Type / Values

`boolean`

Details

Skip the picker and resume the most recent chat from the current working directory.

Key

`SESSION_ID`

Type / Values

`uuid | session name`

Details

Resume the specified session. Omit and use `--last` to continue the most recent session.

### `codex fork`

Fork a previous interactive session into a new chat. By default, `codex fork` opens the session picker; add `--last` to fork your most recent session instead.

When the current and saved session directories differ, `codex fork` uses the same working-directory prompt and `tui.resume_cwd` setting as `codex resume`.

| Key | Type / Values | Details |
| --- | --- | --- |
| `--all` | `boolean` | Show sessions beyond the current working directory in the picker. |
| `--last` | `boolean` | Skip the picker and fork the most recent chat automatically. |
| `SESSION_ID` | `uuid` | Fork the specified session. Omit and use `--last` to fork the most recent session. |

Key

`--all`

Type / Values

`boolean`

Details

Show sessions beyond the current working directory in the picker.

Key

`--last`

Type / Values

`boolean`

Details

Skip the picker and fork the most recent chat automatically.

Key

`SESSION_ID`

Type / Values

`uuid`

Details

Fork the specified session. Omit and use `--last` to fork the most recent session.

### `codex sandbox`

Use the sandbox helper to run a command under the same policies Codex uses internally.

#### macOS seatbelt

| Key | Type / Values | Details |
| --- | --- | --- |
| `--allow-unix-socket` | `path` | Allow the sandboxed command to bind or connect Unix sockets rooted at this path. Repeat to allow multiple paths. |
| `--cd, -C` | `DIR` | Working directory used for profile resolution and command execution. Requires `--permission-profile`. |
| `--config, -c` | `key=value` | Pass configuration overrides into the sandboxed run (repeatable). |
| `--include-managed-config` | `boolean` | Include managed requirements while resolving an explicit permissions profile. Requires `--permission-profile`. |
| `--log-denials` | `boolean` | Capture macOS sandbox denials with `log stream` while the command runs and print them after exit. |
| `--permission-profile, -P` | `NAME` | Apply a named permissions profile from the active configuration stack. |
| `--profile, -p` | `NAME` | Layer `$CODEX_HOME/NAME.config.toml` on top of the base user config. |
| `COMMAND...` | `var-args` | Shell command to execute under macOS Seatbelt. Everything after `--` is forwarded. |

Key

`--allow-unix-socket`

Type / Values

`path`

Details

Allow the sandboxed command to bind or connect Unix sockets rooted at this path. Repeat to allow multiple paths.

Key

`--cd, -C`

Type / Values

`DIR`

Details

Working directory used for profile resolution and command execution. Requires `--permission-profile`.

Key

`--config, -c`

Type / Values

`key=value`

Details

Pass configuration overrides into the sandboxed run (repeatable).

Key

`--include-managed-config`

Type / Values

`boolean`

Details

Include managed requirements while resolving an explicit permissions profile. Requires `--permission-profile`.

Key

`--log-denials`

Type / Values

`boolean`

Details

Capture macOS sandbox denials with `log stream` while the command runs and print them after exit.

Key

`--permission-profile, -P`

Type / Values

`NAME`

Details

Apply a named permissions profile from the active configuration stack.

Key

`--profile, -p`

Type / Values

`NAME`

Details

Layer `$CODEX_HOME/NAME.config.toml` on top of the base user config.

Key

`COMMAND...`

Type / Values

`var-args`

Details

Shell command to execute under macOS Seatbelt. Everything after `--` is forwarded.

#### Linux Landlock

| Key | Type / Values | Details |
| --- | --- | --- |
| `--cd, -C` | `DIR` | Working directory used for profile resolution and command execution. Requires `--permission-profile`. |
| `--config, -c` | `key=value` | Configuration overrides applied before launching the sandbox (repeatable). |
| `--include-managed-config` | `boolean` | Include managed requirements while resolving an explicit permissions profile. Requires `--permission-profile`. |
| `--permission-profile, -P` | `NAME` | Apply a named permissions profile from the active configuration stack. |
| `--profile, -p` | `NAME` | Layer `$CODEX_HOME/NAME.config.toml` on top of the base user config. |
| `COMMAND...` | `var-args` | Command to execute under Landlock + seccomp. Provide the executable after `--`. |

Key

`--cd, -C`

Type / Values

`DIR`

Details

Working directory used for profile resolution and command execution. Requires `--permission-profile`.

Key

`--config, -c`

Type / Values

`key=value`

Details

Configuration overrides applied before launching the sandbox (repeatable).

Key

`--include-managed-config`

Type / Values

`boolean`

Details

Include managed requirements while resolving an explicit permissions profile. Requires `--permission-profile`.

Key

`--permission-profile, -P`

Type / Values

`NAME`

Details

Apply a named permissions profile from the active configuration stack.

Key

`--profile, -p`

Type / Values

`NAME`

Details

Layer `$CODEX_HOME/NAME.config.toml` on top of the base user config.

Key

`COMMAND...`

Type / Values

`var-args`

Details

Command to execute under Landlock + seccomp. Provide the executable after `--`.

#### Windows

| Key | Type / Values | Details |
| --- | --- | --- |
| `--cd, -C` | `DIR` | Working directory used for profile resolution and command execution. Requires `--permission-profile`. |
| `--config, -c` | `key=value` | Configuration overrides applied before launching the sandbox (repeatable). |
| `--include-managed-config` | `boolean` | Include managed requirements while resolving an explicit permissions profile. Requires `--permission-profile`. |
| `--permission-profile, -P` | `NAME` | Apply a named permissions profile from the active configuration stack. |
| `--profile, -p` | `NAME` | Layer `$CODEX_HOME/NAME.config.toml` on top of the base user config. |
| `COMMAND...` | `var-args` | Command to execute under the native Windows sandbox. Provide the executable after `--`. |

Key

`--cd, -C`

Type / Values

`DIR`

Details

Working directory used for profile resolution and command execution. Requires `--permission-profile`.

Key

`--config, -c`

Type / Values

`key=value`

Details

Configuration overrides applied before launching the sandbox (repeatable).

Key

`--include-managed-config`

Type / Values

`boolean`

Details

Include managed requirements while resolving an explicit permissions profile. Requires `--permission-profile`.

Key

`--permission-profile, -P`

Type / Values

`NAME`

Details

Apply a named permissions profile from the active configuration stack.

Key

`--profile, -p`

Type / Values

`NAME`

Details

Layer `$CODEX_HOME/NAME.config.toml` on top of the base user config.

Key

`COMMAND...`

Type / Values

`var-args`

Details

Command to execute under the native Windows sandbox. Provide the executable after `--`.

### `codex update`

Check for and apply a Codex CLI update when the installed release supports self-update. Debug builds print a message telling you to install a release build instead.

## Flag combinations and safety tips

*   Use `--sandbox workspace-write` for unattended local work that can stay inside the workspace, and avoid `--dangerously-bypass-approvals-and-sandbox` unless you are inside a dedicated sandbox VM.
*   When you need to grant Codex write access to more directories, prefer `--add-dir` rather than forcing `--sandbox danger-full-access`.
*   Pair `--json` with `--output-last-message` in CI to capture machine-readable progress and a final natural-language summary.

## Interactive shortcuts

*   Type `@` to search for a file in the workspace and add its path to the prompt.
*   Press Up or Down to restore draft history.
*   Press Ctrl+R to search prompt history, then press Enter to use a match or Esc to cancel.
*   Press Ctrl+O or run `/copy` to copy the latest completed Codex output.
*   Prefix a line with `!` to run a local shell command under the current approval and sandbox settings.
*   Press Tab while Codex is working to queue a follow-up prompt, slash command, or shell command for the next turn.
*   Press Enter while Codex is working to inject new instructions into the current turn.
*   Press Esc twice with an empty composer to edit the previous user message and fork the chat from that point.
*   Press Ctrl+C or run `/exit` to close the session.

## Related resources

*   [Codex CLI overview](https://developers.openai.com/codex/cli): installation, upgrades, and quick tips.
*   [Config basics](https://developers.openai.com/codex/config-file/config-basic): persist defaults like the model and provider.
*   [Advanced Config](https://developers.openai.com/codex/config-file/config-advanced): profiles, providers, sandbox tuning, and integrations.
*   [AGENTS.md](https://developers.openai.com/codex/agent-configuration/agents-md): conceptual overview of Codex agent capabilities and best practices.

Slash commands give you fast, keyboard-first control over Codex. Type `/` in the composer to open the slash popup, choose a command, and Codex will perform actions such as switching models, adjusting permissions, or summarizing long chats without leaving the terminal.

This guide shows you how to:

*   Find the right built-in slash command for a task
*   Steer an active session with commands like `/model`, `/fast`, `/personality`, `/permissions`, `/approve`, `/raw`, `/agent`, and `/status`

## Built-in slash commands

Codex ships with the following commands. Open the slash popup and start typing the command name to filter the list.

When a chat is already running, you can type a slash command and press `Tab` to queue it for the next turn. Codex parses queued slash commands when they run, so command menus and errors appear after the current turn finishes. Slash completion still works before you queue the command.

| Command | Purpose | When to use it |
| --- | --- | --- |
| [`/permissions`](https://developers.openai.com/codex/developer-commands#update-permissions-with-permissions) | Set what Codex can do without asking first. | Relax or tighten approval requirements mid-session, such as switching between Auto and Read Only. |
| [`/ide`](https://developers.openai.com/codex/developer-commands#include-ide-context-with-ide) | Include open files, current selection, and other IDE context. | Pull editor context into the next prompt without re-explaining what's open in your IDE. |
| [`/keymap`](https://developers.openai.com/codex/developer-commands#remap-tui-shortcuts-with-keymap) | Remap TUI keyboard shortcuts. | Inspect and persist custom shortcut bindings in `config.toml`. |
| [`/vim`](https://developers.openai.com/codex/developer-commands#toggle-vim-mode-with-vim) | Toggle Vim mode for the composer. | Switch between Vim normal/insert behavior and the default composer editing mode. |
| [`/setup-default-sandbox`](https://developers.openai.com/codex/developer-commands#set-up-the-elevated-windows-sandbox-with-setup-default-sandbox) | Set up the elevated agent sandbox (Windows only). | Replace the degraded Windows sandbox after Codex offers the elevated setup. |
| [`/sandbox-add-read-dir`](https://developers.openai.com/codex/developer-commands#grant-sandbox-read-access-with-sandbox-add-read-dir) | Grant sandbox read access to an extra directory (Windows only). | Unblock commands that need to read an absolute directory path outside the current readable roots. |
| [`/agent`, `/subagents`](https://developers.openai.com/codex/developer-commands#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned subagent thread. |
| [`/apps`](https://developers.openai.com/codex/developer-commands#browse-apps-with-apps) | Browse apps (connectors) and insert them into your prompt. | Attach an app as `$app-slug` before asking Codex to use it. |
| [`/plugins`](https://developers.openai.com/codex/developer-commands#browse-plugins-with-plugins) | Browse installed and discoverable plugins. | Inspect plugin tools, install suggested plugins, or manage plugin availability. |
| [`/hooks`](https://developers.openai.com/codex/developer-commands#view-and-manage-lifecycle-hooks-with-hooks) | View and manage lifecycle hooks. | Inspect configured hooks, trust new or changed hooks, or disable non-managed hooks before they run. |
| [`/clear`](https://developers.openai.com/codex/developer-commands#clear-the-terminal-and-start-a-new-chat-with-clear) | Clear the terminal and start a fresh chat. | Reset the visible UI and chat context together when you want a fresh start. |
| [`/rename`](https://developers.openai.com/codex/developer-commands#rename-the-current-chat-with-rename) | Rename the current chat. | Give a saved session a recognizable name without leaving the TUI. |
| [`/archive`](https://developers.openai.com/codex/developer-commands#archive-the-current-session-with-archive) | Archive the current session and exit Codex. | Remove the current session from active session lists without deleting its transcript. |
| [`/delete`](https://developers.openai.com/codex/developer-commands#delete-the-current-session-with-delete) | Permanently delete the current session and exit Codex. | Remove the transcript and descendant sessions when archiving isn't enough. |
| [`/compact`](https://developers.openai.com/codex/developer-commands#keep-transcripts-lean-with-compact) | Summarize the visible chat to free tokens. | Use after long runs so Codex retains key points without blowing the context window. |
| [`/copy`](https://developers.openai.com/codex/developer-commands#copy-the-latest-response-with-copy) | Copy the latest completed Codex output. | Grab the latest finished response or plan text without manually selecting it. You can also press `Ctrl+O`. |
| [`/diff`](https://developers.openai.com/codex/developer-commands#review-changes-with-diff) | Show the Git diff, including files Git isn't tracking yet. | Review Codex's edits before you commit or run tests. |
| [`/exit`](https://developers.openai.com/codex/developer-commands#exit-the-cli-with-quit-or-exit) | Exit the CLI (same as `/quit`). | Alternative spelling; both commands exit the session. |
| [`/experimental`](https://developers.openai.com/codex/developer-commands#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable options such as Network proxy or Prevent sleep while running. |
| [`/approve`](https://developers.openai.com/codex/developer-commands#approve-an-auto-review-denial-with-approve) | Approve one retry of a recent auto review denial. | Retry a command or action that the auto reviewer denied. |
| [`/memories`](https://developers.openai.com/codex/developer-commands#configure-memories-with-memories) | Configure memory use and generation. | Turn memory injection or memory generation on or off without leaving the TUI. |
| [`/skills`](https://developers.openai.com/codex/developer-commands#use-skills-with-skills) | Browse and use skills. | Improve task-specific behavior by selecting a relevant local skill. |
| [`/import`](https://developers.openai.com/codex/developer-commands#import-claude-code-or-cursor-setup-with-import) | Import Claude Code or Cursor setup, projects, and chats. | Migrate supported external-agent artifacts into Codex configuration and local files. |
| [`/feedback`](https://developers.openai.com/codex/developer-commands#send-feedback-with-feedback) | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |
| [`/init`](https://developers.openai.com/codex/developer-commands#generate-agentsmd-with-init) | Generate an `AGENTS.md` scaffold in the current directory. | Capture persistent instructions for the repository or subdirectory you're working in. |
| [`/logout`](https://developers.openai.com/codex/developer-commands#sign-out-with-logout) | Sign out of Codex. | Clear local credentials when using a shared machine. |
| [`/mcp`](https://developers.openai.com/codex/developer-commands#list-mcp-tools-with-mcp) | List configured Model Context Protocol (MCP) tools. | Check which external tools Codex can call during the session; add `verbose` for server details. |
| [`/mention`](https://developers.openai.com/codex/developer-commands#highlight-files-with-mention) | Attach a file to the chat. | Point Codex at specific files or folders you want it to inspect next. |
| [`/model`](https://developers.openai.com/codex/developer-commands#set-the-active-model-with-model) | Choose the active model (and reasoning effort, when available). | Switch between models such as `gpt-5.6-luna` and `gpt-5.6-terra` before running a task. |
| [`/fast`](https://developers.openai.com/codex/developer-commands#toggle-fast-mode-with-fast) | Toggle a Fast service tier when the model catalog exposes one. | Turn the current model's Fast tier on or off and persist the selection. |
| [`/plan`](https://developers.openai.com/codex/developer-commands#switch-to-plan-mode-with-plan) | Switch to plan mode and optionally send a prompt. | Ask Codex to propose an execution plan before implementation work starts. |
| [`/goal`](https://developers.openai.com/codex/developer-commands#set-or-view-a-task-goal-with-goal) | Set, edit, pause, resume, view, or clear a task goal. | Give Codex a persistent target to track while a larger task runs. |
| [`/personality`](https://developers.openai.com/codex/developer-commands#set-a-communication-style-with-personality) | Choose a communication style for responses. | Make Codex more concise, more explanatory, or more collaborative without changing your instructions. |
| [`/ps`](https://developers.openai.com/codex/developer-commands#check-background-terminals-with-ps) | Show background terminals and their recent output. | Check long-running commands without leaving the main transcript. |
| [`/stop`](https://developers.openai.com/codex/developer-commands#stop-background-terminals-with-stop) | Stop all background terminals. | Cancel background terminal work started by the current session. |
| [`/fork`](https://developers.openai.com/codex/developer-commands#fork-the-current-chat-with-fork) | Fork the current chat into a new chat. | Branch the active session to explore a new approach without losing the current transcript. |
| [`/app`](https://developers.openai.com/codex/developer-commands#continue-in-the-desktop-app-with-app) | Continue the current session in the ChatGPT desktop app. | Move from the TUI to the desktop app on macOS or Windows. |
| [`/side`, `/btw`](https://developers.openai.com/codex/developer-commands#start-a-side-chat-with-side) | Start an ephemeral side chat. | Ask a focused follow-up without disrupting the main chat's transcript. |
| [`/raw`](https://developers.openai.com/codex/developer-commands#toggle-raw-scrollback-with-raw) | Toggle raw scrollback mode. | Make terminal selection and copying less formatted while reviewing long output. |
| [`/resume`](https://developers.openai.com/codex/developer-commands#resume-a-saved-chat-with-resume) | Resume a saved chat from your session list. | Continue work from a previous CLI session without starting over. |
| [`/new`](https://developers.openai.com/codex/developer-commands#start-a-new-chat-with-new) | Start a new chat inside the same CLI session. | Reset the chat context without leaving the CLI when you want a fresh prompt in the same repo. |
| [`/quit`](https://developers.openai.com/codex/developer-commands#exit-the-cli-with-quit-or-exit) | Exit the CLI. | Leave the session immediately. |
| [`/review`](https://developers.openai.com/codex/developer-commands#ask-for-a-working-tree-review-with-review) | Ask Codex to review your working tree. | Run after Codex completes work or when you want a second set of eyes on local changes. |
| [`/status`](https://developers.openai.com/codex/developer-commands#inspect-the-session-with-status) | Display session configuration and token usage. | Confirm the active model, approval policy, writable roots, and remaining context capacity. |
| [`/usage`](https://developers.openai.com/codex/developer-commands#view-account-usage-with-usage) | View account token usage or use a rate-limit reset. | Inspect daily, weekly, or cumulative ChatGPT token activity from inside the TUI. |
| [`/debug-config`](https://developers.openai.com/codex/developer-commands#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |
| [`/statusline`](https://developers.openai.com/codex/developer-commands#configure-footer-items-with-statusline) | Configure TUI status-line fields interactively. | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist in config.toml. |
| [`/title`](https://developers.openai.com/codex/developer-commands#configure-terminal-title-items-with-title) | Configure terminal window or tab title fields interactively. | Pick and reorder title items such as project, status, thread, branch, model, and task progress. |
| [`/theme`](https://developers.openai.com/codex/developer-commands#choose-a-syntax-theme-with-theme) | Choose a syntax-highlighting theme. | Preview and persist a terminal syntax-highlighting theme. |
| [`/pets`, `/pet`](https://developers.openai.com/codex/developer-commands#choose-a-terminal-pet-with-pets) | Choose or hide a terminal pet. | Personalize the TUI with a built-in or custom ambient pet. |

`/quit` and `/exit` both exit the CLI. Use them only after you have saved or committed any important work.

Use `/permissions` to adjust what Codex can do without asking first. Use `/approve` only when you need to retry a recent action that automatic review denied.

## Control your session with slash commands

The following workflows keep your session on track without restarting Codex.

### Set the active model with `/model`

1.   Start Codex and open the composer.
2.   Type `/model` and press Enter.
3.   Choose a model such as `gpt-5.6-luna` or `gpt-5.6-terra` from the popup.

Expected: Codex confirms the new model in the transcript. Run `/status` to verify the change.

### Toggle Fast mode with `/fast`

1.   Type `/fast` to turn the current model's Fast service tier on.
2.   Type `/fast` again to turn it off.

Expected: Codex toggles the tier and saves the selection. In the TUI footer, you can also show a Fast mode status-line item with `/statusline`.

Fast tier commands are catalog-driven. If the current model doesn't advertise a Fast tier, Codex won't show `/fast`.

### Set a communication style with `/personality`

Use `/personality` to change how Codex communicates without rewriting your prompt.

1.   In an active chat, type `/personality` and press Enter.
2.   Choose a style from the popup.

Expected: Codex confirms the new style in the transcript and uses it for later responses in the chat.

Codex supports `friendly`, `pragmatic`, and `none` personalities. Use `none` to disable personality instructions.

If the active model doesn't support personality-specific instructions, Codex hides this command.

### Switch to plan mode with `/plan`

1.   Type `/plan` and press Enter to switch the active chat into plan mode.
2.   Optional: provide inline prompt text (for example, 
```
/plan Propose a
migration plan for this service
```
).
3.   You can paste content or attach images while using inline `/plan` arguments.

Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.

While Codex is already working, `/plan` is temporarily unavailable.

### Set or view a task goal with `/goal`

1.   Type `/goal <objective>` to set the goal, for example `/goal Finish the migration and keep tests green`.
2.   Type `/goal` to view the current goal.
3.   Use `/goal edit` to revise the objective. Use `/goal pause`, `/goal resume`, or `/goal clear` to pause, resume, or remove it.

Expected: Codex keeps the goal attached to the active chat while work continues.

Goal objectives must be non-empty and at most 4,000 characters. For longer instructions, put the details in a file and point the goal at that file.

### Toggle experimental features with `/experimental`

1.   Type `/experimental` and press Enter.
2.   Toggle the features you want (for example, Network proxy or Prevent sleep while running), then restart Codex if the prompt asks you to.

Expected: Codex saves your feature choices to config and applies them on restart.

### Approve an auto review denial with `/approve`

Use `/approve` when the automatic reviewer denied a recent action and you want Codex to retry it once.

1.   Type `/approve`.
2.   Confirm the retry when Codex shows the relevant denied action.

Expected: Codex retries that denied action once under the current session policy.

### Configure memories with `/memories`

1.   Type `/memories`.
2.   Choose whether Codex should use existing memories, generate new memories, or keep memory behavior disabled.

Expected: Codex updates the relevant memory settings for future sessions.

### Use skills with `/skills`

1.   Type `/skills`.
2.   Pick the skill you want Codex to apply.

Expected: Codex inserts the selected skill context so the next request follows that skill's instructions.

[](https://developers.openai.com/codex/developer-commands)[](https://developers.openai.com/codex/developer-commands)[](https://developers.openai.com/codex/developer-commands)
### Import Claude Code or Cursor setup with `/import`

1.   Type `/import`.
2.   Choose **Claude Code** or **Cursor**.
3.   Select the setup, project files, or recent chats you want to migrate.

Expected: Codex opens the external-agent import picker and imports the selected supported artifacts into Codex configuration and local files. Session discovery includes up to 50 chats from the last 30 days.

Run `/import` from a local TUI session. It's unavailable while a task is running, in remote sessions, and while connected to the local app-server daemon.

For the desktop app workflow and supported artifact types, see [Import from another agent](https://developers.openai.com/codex/import).

[](https://developers.openai.com/codex/developer-commands)[](https://developers.openai.com/codex/developer-commands)
### Clear the terminal and start a new chat with `/clear`

1.   Type `/clear` and press Enter.

Expected: Codex clears the terminal, resets the visible transcript, and starts a fresh chat in the same CLI session.

To name the new chat as you create it, run `/clear release prep`.

Unlike Ctrl+L, `/clear` starts a new chat.

Ctrl+L only clears the terminal view and keeps the current chat. Codex disables both actions while a task is in progress.

### Archive the current session with `/archive`

1.   Type `/archive` and press Enter.
2.   Confirm that you want to archive the current session and exit Codex.

Expected: Codex archives the current session and closes the interactive TUI. Codex keeps the session transcript stored locally; restore it later with `codex unarchive <SESSION>`.

`/archive` is unavailable while a task is running.

### Delete the current session with `/delete`

1.   Type `/delete` and press Enter.
2.   Confirm that you want to delete the current session and exit Codex.

Expected: Codex deletes the current session transcript and closes the interactive TUI. Deletion is permanent and also removes spawned descendant sessions.

`/delete` is unavailable while a chat is running or in a side chat.

### Update permissions with `/permissions`

1.   Type `/permissions` and press Enter.
2.   Select the approval preset that matches your comfort level, for example `Auto` for hands-off runs or `Read Only` to review edits. When named permission profiles are active, the picker also shows configured custom profiles and their descriptions.

Expected: Codex announces the updated policy. Future actions respect the updated approval mode until you change it again.

### Include IDE context with `/ide`

1.   Type `/ide`.
2.   Add optional inline text if you want to explain what Codex should do with the current IDE selection or open files.

Expected: Codex includes available IDE context in the next prompt.

### Toggle Vim mode with `/vim`

1.   Type `/vim`.
2.   Continue editing in the composer.

Expected: Codex toggles composer Vim mode for the current session. To make Vim mode the default for new sessions, set `tui.vim_mode_default = true` in `config.toml`.

### Set up the elevated Windows sandbox with `/setup-default-sandbox`

This command appears only on Windows when Codex is using the degraded restricted-token sandbox.

1.   Type `/setup-default-sandbox`.
2.   Follow the administrator setup flow.

Expected: Codex configures the elevated Windows sandbox and selects the corresponding automatic approval preset.

### Copy the latest response with `/copy`

1.   Type `/copy` and press Enter.

Expected: Codex copies the latest completed Codex output to your clipboard.

If a turn is still running, `/copy` uses the latest completed output instead of the in-progress response. The command is unavailable before the first completed Codex output and immediately after a rollback.

You can also press Ctrl+O from the main TUI to copy the latest completed response without opening the slash command menu.

### Toggle raw scrollback with `/raw`

1.   Type `/raw`, `/raw on`, or `/raw off`.

Expected: Codex toggles raw scrollback mode, which makes terminal selection and copying more direct. You can also use the default Alt+R binding or persist the default with `tui.raw_output_mode = true`.

### Grant sandbox read access with `/sandbox-add-read-dir`

This command is available only when running the CLI natively on Windows.

1.   Type `/sandbox-add-read-dir C:\absolute\directory\path` and press Enter.
2.   Confirm the path is an existing absolute directory.

Expected: Codex refreshes the Windows sandbox policy and grants read access to that directory for later commands that run in the sandbox.

### Inspect the session with `/status`

1.   In any chat, type `/status`.
2.   Review the output for the active model, approval policy, writable roots, and current token usage. When the TUI connects remotely, the output also shows the remote address and the server version.

Expected: Codex prints a summary confirming that it's operating where you expect.

### View account usage with `/usage`

1.   Type `/usage` to open the usage menu.
2.   Choose whether to show token activity or redeem an available earned reset.
3.   To open token activity directly, type `/usage daily`, `/usage weekly`, or `/usage cumulative`.

Expected: Codex opens usage actions or shows account token activity for the selected view. If the session doesn't have Codex service account auth, Codex shows a sign-in requirement.

### Inspect config layers with `/debug-config`

1.   Type `/debug-config`.
2.   Review the output for config layer order (lowest precedence first), on/off state, and policy sources.

Expected: Codex prints layer diagnostics plus policy details such as `allowed_approval_policies`, `allowed_sandbox_modes`, `mcp_servers`, `rules`, and `experimental_network` when configured.

Use this output to debug why an effective setting differs from `config.toml`.

### Configure footer items with `/statusline`

1.   Type `/statusline`.
2.   Use the picker to toggle and reorder items, then confirm.

Expected: The footer status line updates immediately and persists to `tui.status_line` in `config.toml`.

Available status-line items include model, model+reasoning, context stats, rate limits, git branch, token counters, session id, current directory/project root, and Codex version.

### Configure terminal title items with `/title`

1.   Type `/title`.
2.   Use the picker to toggle and reorder items, then confirm.

Expected: The terminal window or tab title updates immediately and persists to `tui.terminal_title` in `config.toml`.

Available title items include app name, project, spinner, status, thread, git branch, model, and task progress.

### Choose a syntax theme with `/theme`

1.   Type `/theme`.
2.   Preview a theme from the picker, then confirm.

Expected: Codex updates syntax highlighting and persists the choice to `tui.theme` in `config.toml`.

### Choose a terminal pet with `/pets`

1.   Type `/pets` (or `/pet`) to open the pet picker.
2.   Choose a built-in or custom pet, or turn pets off.

Expected: Codex displays the selected ambient pet in supported terminals and persists the selection. You can also type `/pets off` to hide it.

### Remap TUI shortcuts with `/keymap`

Use `/keymap` to inspect, update, and persist keyboard shortcut bindings for the TUI.

1.   Type `/keymap`.
2.   Pick the shortcut context and action you want to change.
3.   Enter the new binding or remove the existing one.

Expected: Codex updates the active keymap and writes the custom binding to `tui.keymap` in `config.toml`.

Key bindings use names such as `ctrl-a`, `shift-enter`, and `page-down`. Context-specific bindings override `tui.keymap.global`; an empty binding list unbinds the action.

### Check background terminals with `/ps`

1.   Type `/ps`.
2.   Review the list of background terminals and their status.

Expected: Codex shows each background terminal's command plus up to three recent, non-empty output lines so you can gauge progress at a glance.

Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.

### Stop background terminals with `/stop`

1.   Type `/stop`.
2.   Confirm if Codex asks before stopping the listed terminals.

Expected: Codex stops all background terminals for the current session. `/clean` is still available as an alias for `/stop`.

### Keep transcripts lean with `/compact`

1.   After a long exchange, type `/compact`.
2.   Confirm when Codex offers to summarize the chat so far.

Expected: Codex replaces earlier turns with a concise summary, freeing context while keeping critical details.

### Review changes with `/diff`

1.   Type `/diff` to inspect the Git diff.
2.   Scroll through the output inside the CLI to review edits and added files.

Expected: Codex shows changes you've staged, changes you haven't staged yet, and files Git hasn't started tracking, so you can decide what to keep.

### Highlight files with `/mention`

1.   Type `/mention` followed by a path, for example `/mention src/lib/api.ts`.
2.   Select the matching result from the popup.

Expected: Codex adds the file to the chat, ensuring follow-up turns reference it directly.

[](https://developers.openai.com/codex/developer-commands)
### Start a new chat with `/new`

1.   Type `/new` and press Enter.

Expected: Codex starts a fresh chat in the same CLI session, so you can switch chats without leaving your terminal.

To name the new chat as you create it, run `/new bug bash`.

Unlike `/clear`, `/new` doesn't clear the current terminal view first.

[](https://developers.openai.com/codex/developer-commands)[](https://developers.openai.com/codex/developer-commands)
### Rename the current chat with `/rename`

1.   Type `/rename <name>`, or type `/rename` to open the naming prompt.
2.   Enter a short name that will help you find the chat later.

Expected: Codex updates the saved chat name without changing its transcript.

[](https://developers.openai.com/codex/developer-commands)
### Resume a saved chat with `/resume`

1.   Type `/resume` and press Enter.
2.   Choose the session you want from the saved-session picker.

Expected: Codex reloads the selected chat's transcript so you can pick up where you left off, keeping the original history intact.

[](https://developers.openai.com/codex/developer-commands)
### Fork the current chat with `/fork`

1.   Type `/fork` and press Enter.

Expected: Codex clones the current chat into a new chat with a fresh ID, leaving the original transcript untouched so you can explore an alternative approach in parallel.

If you need to fork a saved session instead of the current one, run `codex fork` in your terminal to open the session picker.

### Continue in the desktop app with `/app`

On macOS and Windows, type `/app` to open the current session in the ChatGPT desktop app. If the app isn't installed or running, Codex shows an error asking you to install or launch it.

Expected: The desktop app opens the same saved chat so you can continue there.

[](https://developers.openai.com/codex/developer-commands)
### Start a side chat with `/side`

Use `/side` to start an ephemeral fork from the current chat without switching away from the main chat.

1.   Type `/side` to open a side chat.
2.   Optionally add inline text, for example `/side Check whether this plan has an obvious risk`.
3.   Return to the parent chat after the focused detour finishes.

Expected: Codex opens a side chat whose transcript is separate from the parent chat. While you are in side mode, the TUI continues to show the parent chat's status so you can see whether the main chat is still running.

`/side` is unavailable inside another side chat and during review mode.

### Generate `AGENTS.md` with `/init`

1.   Run `/init` in the directory where you want Codex to look for persistent instructions.
2.   Review the generated `AGENTS.md`, then edit it to match your repository conventions.

Expected: Codex creates an `AGENTS.md` scaffold you can refine and commit for future sessions.

### Ask for a working tree review with `/review`

1.   Type `/review`.
2.   Follow up with `/diff` if you want to inspect the exact file changes.

Expected: Codex summarizes issues it finds in your working tree, focusing on behavior changes and missing tests. It uses the current session model unless you set `review_model` in `config.toml`.

### List MCP tools with `/mcp`

1.   Type `/mcp`.
2.   Review the list to confirm which MCP servers and tools are available.

Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.

Use `/mcp verbose` to include detailed server diagnostics. If you pass anything other than `verbose`, Codex shows the command usage.

### Browse apps with `/apps`

1.   Type `/apps`.
2.   Pick an app from the list.

Expected: Codex inserts the app mention into the composer as `$app-slug`, so you can immediately ask Codex to use it.

### Browse plugins with `/plugins`

1.   Type `/plugins`.
2.   Choose a marketplace tab, then pick a plugin to inspect its capabilities or available actions.

Expected: Codex opens the plugin browser so you can review installed plugins, discoverable plugins that your configuration allows, and installed plugin state. Press Space on an installed plugin to toggle its enabled state.

### View and manage lifecycle hooks with `/hooks`

1.   Type `/hooks`.
2.   Choose a hook event to inspect the matching handlers.
3.   Trust, disable, or re-enable non-managed hooks as needed.

Expected: Codex opens the hook browser so you can review configured lifecycle hooks. Managed hooks appear as managed and can't be disabled from the user hook browser.

### Switch agent threads with `/agent`

1.   Type `/agent` or `/subagents` and press Enter.
2.   Select the thread you want from the picker.

Expected: Codex switches the active thread so you can inspect or continue that agent's work.

### Send feedback with `/feedback`

1.   Type `/feedback` and press Enter.
2.   Follow the prompts to include logs or diagnostics.

Expected: Codex collects the requested diagnostics and submits them to the maintainers.

### Sign out with `/logout`

1.   Type `/logout` and press Enter.

Expected: Codex clears local credentials for the current user session.

### Exit the CLI with `/quit` or `/exit`

1.   Type `/quit` (or `/exit`) and press Enter.

Expected: Codex exits immediately. Save or commit any important work first.

Use these commands to control Codex from the VS Code Command Palette. You can also bind them to keyboard shortcuts.

## Assign a key binding

To assign or change a key binding for a Codex command:

1.   Open the Command Palette (**Cmd+Shift+P** on macOS or **Ctrl+Shift+P** on Windows/Linux).
2.   Run **Preferences: Open Keyboard Shortcuts**.
3.   Search for `Codex` or the command ID (for example, `chatgpt.newChat`).
4.   Select the pencil icon, then enter the shortcut you want.

## Extension commands

| Command | Default key binding | Description |
| --- | --- | --- |
| `chatgpt.addToThread` | - | Add selected text range as context for the current chat |
| `chatgpt.addFileToThread` | - | Add the entire file as context for the current chat |
| `chatgpt.newChat` | macOS: `Cmd+N` Windows/Linux: `Ctrl+N` | Create a new chat |
| `chatgpt.newCodexPanel` | - | Create a new Codex panel |
| `chatgpt.openCommandMenu` | - | Open the Codex command menu |
| `chatgpt.openSidebar` | - | Open the Codex sidebar panel |

Slash commands let you control Codex without leaving the composer. Use them to check status, switch between local and cloud mode, or send feedback.

## Use a slash command

1.   In the Codex composer, type `/`.
2.   Select a command from the list, or keep typing to filter (for example, `/status`).
3.   Press **Enter**.

## Available slash commands

| Slash command | Description |
| --- | --- |
| `/approve` | Approve one retry of a recent automatic-review denial, when automatic review is active. |
| `/cloud` | Run the chat in the cloud, when cloud execution is available. |
| `/cloud-environment` | Choose the cloud environment for the chat. |
| `/compact` | Compact the current chat's context. |
| `/fast` | Turn a catalog-provided Fast service tier on or off, when available. |
| `/feedback` | Open the feedback dialog to submit feedback and optionally include logs. |
| `/fork` | Copy a local chat into a new local chat. |
| `/goal` | Set a persistent goal for Codex to work toward. |
| `/ide-context` | Turn automatic IDE context on or off. |
| `/init` | Generate an `AGENTS.md` scaffold for the current project. |
| `/local` | Run the chat in your local workspace. |
| `/mcp` | Open MCP status to view connected servers. |
| `/memories` | Configure whether the chat can use or generate memories, when Memories is available. |
| `/model` | Choose the model for the current chat. |
| `/personality` | Choose how Codex responds, when the current model supports personalities. |
| `/plan` | Toggle plan mode for multi-step planning. |
| `/project` | Choose a project for new chats. |
| `/reasoning` | Choose the reasoning effort for the current chat. |
| `/review` | Start code review mode to review uncommitted changes or compare against a base branch. |
| `/side` | Start a temporary side chat without interrupting the main chat. |
| `/status` | Show the chat ID, context usage, and rate limits. |
| `/worktree` | Run the chat in a new Git worktree. |

[Previous CLI customization](https://developers.openai.com/codex/cli-customization)[Next Developer settings](https://developers.openai.com/codex/developer-settings)

Ask AI

## Docs agent

Loading docs agent...
