cli/reference.md +190 −871
11# Developer commands# Commands
2 2
3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.
4 4
55## How to read this referenceUse these commands and keyboard shortcuts to navigate the app.
6 6
77This page catalogs every documented Codex CLI command and flag. Use the interactive tables to search by key or description. Each section indicates whether the option is stable or experimental and calls out risky combinations.## Keyboard shortcuts
88
99The CLI inherits most defaults from `~/.codex/config.toml`. Any| | Action | Shortcut |
1010 `-c key=value` overrides you pass at the command line take| ----------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------- |
1111 precedence for that invocation. See [Config| **General** | | |
1212 basics](https://learn.chatgpt.com/docs/config-file/config-basic#configuration-precedence) for more| | Command menu | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>K</kbd> |
1313 information.| | Settings | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>,</kbd> |
1414 | | Keyboard shortcuts | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>/</kbd> |
1515## Global flags| | Open folder | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>O</kbd> |
1616 | | Navigate back | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>[</kbd> |
1717<ConfigTable client:load options={globalFlagOptions} />| | Navigate forward | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>]</kbd> |
1818 | | Increase font size | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>+</kbd> |
1919These options apply to the base `codex` command. Most propagate to commands;| | Decrease font size | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>-</kbd> |
2020see the notes above or the relevant command help for exceptions. For propagated| | Toggle sidebar | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>B</kbd> |
2121flags, follow the relevant command help. For example, `codex exec --oss ...`| | Open review tab | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>G</kbd> |
2222applies `--oss` to `exec`.| | Toggle review panel | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>B</kbd> |
2323 | | Toggle bottom panel | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>J</kbd> |
2424## Command overview| | Toggle terminal | <kbd>Ctrl</kbd> + <kbd>`</kbd> |
2525 | | Clear the terminal | <kbd>Ctrl</kbd> + <kbd>L</kbd> |
2626The Maturity column uses feature maturity labels such as Experimental, Beta,| **Chat** | Quick chat | <kbd>Cmd</kbd> + <kbd>Option</kbd> + <kbd>N</kbd> (macOS) or <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>N</kbd> (Windows) |
2727 and Stable. See [Feature Maturity](https://learn.chatgpt.com/docs/feature-maturity) for how to| | New chat | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>N</kbd> or <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd> |
2828 interpret these labels.| | Search chats | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>G</kbd> |
2929 | | Find in chat | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>F</kbd> |
3030<ConfigTable| | Previous chat | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>[</kbd> |
3131 client:load| | Next chat | <kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>]</kbd> |
3232 options={commandOverview}| **Input** | Dictation | <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>D</kbd> |
3333 secondColumnTitle="Maturity"
3434 secondColumnVariant="maturity"To find, customize, or reset shortcuts, open **Settings > Keyboard Shortcuts**.
3535/>You can search by command name or switch the search field into keystroke mode
3636 and press the shortcut you want to find.
3737## Command details
3838 <a id="search-past-tasks-and-find-in-a-task"></a>
3939### `codex` (interactive)
4040 ## Search past chats and find in a chat
4141Running `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`.
4242 Use chat search (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>G</kbd>) to reopen a past
4343Use `--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.chat. When expanded matching is available, it can also match chat content and
4444 Git branch names, so you can search for a phrase from the chat or a
4545### `codex app-server`branch such as `fix/login-redirect`.
4646
4747Launch the Codex app server locally. This is primarily for development and debugging and may change without notice.Use **Find in chat** (<kbd>Cmd</kbd>/<kbd>Ctrl</kbd> + <kbd>F</kbd>) after opening
4848 a chat to find text within it. It doesn't search across other chats.
4949<ConfigTable client:load options={appServerOptions} />
5050 For actions that start with `/`, see [Slash commands](https://learn.chatgpt.com/docs/reference/slash-commands).
5151`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.
5252 ## Deep links
5353Add `--code-mode-host wss://code-mode.example.com/host` to connect app-server to
5454a remote Code Mode host instead of starting a local host. This outboundThe ChatGPT desktop app keeps the `codex://` URL scheme for compatibility, so
5555connection is separate from `--listen` and shared by every thread in thelinks can open specific parts of the app directly. Encode query string values
5656app-server process. Use `ws://` only for a localhost or SSH-forwarded host.before adding them to a URL.
5757
5858### `codex remote-control`### Supported links
5959
6060Run `codex remote-control` to start remote control in the foreground. UseUse these canonical forms when you create links. The sections below list the full reference by link type.
6161`codex remote-control start` to start the local app-server daemon with remote
6262control enabled, and `codex remote-control stop` to stop it. Managed| Deep link | Opens |
6363remote-control clients and SSH remote workflows use these commands; they aren't| --------------------------------------------------------------------------- | ------------------------------------------------------- |
6464a replacement for `codex app-server --listen` when you're building a local| `codex://threads/new` | A new local chat. |
6565protocol client.| `codex://new?<query>` | A new local chat with at least one query parameter. |
6666 | `codex://threads/<thread-id>` | A local chat. `<thread-id>` is its technical thread ID. |
6767After the daemon is running, use `codex remote-control pair` to create and| `codex://settings` | Settings. |
6868print a short-lived manual pairing code. Add `--json` to any remote-control| `codex://settings/connections/<connection-type>` | Computer, device, or SSH connection settings. |
6969command for machine-readable output. For `pair`, the JSON response includes| `codex://settings/connections/ssh/add?name=<ssh-config-host>` | Adds a host from your SSH config to Codex. |
7070`pairingCode`, `manualPairingCode`, `environmentId`, and `expiresAt`.| `codex://skills` | Skills. |
7171 | `codex://automations` | Scheduled with the create flow open. |
7272### `codex app`| `codex://plugins/install/<plugin-name>?marketplace=<marketplace-name>` | The install flow for a plugin from a known marketplace. |
7373 | `codex://plugins/<plugin-id>` | A plugin detail page. |
7474Launch the ChatGPT desktop app from the terminal on macOS or Windows. On macOS,| `codex://plugins/<plugin-name>?marketplacePath=<absolute-marketplace-path>` | A local plugin detail page from a local marketplace. |
7575Codex can open a specific workspace path; on Windows, Codex prints the path to| `codex://pets/install?name=<pet-name>&imageUrl=<https-image-url>` | The pet install flow. |
7676open.
7777 <a id="tasks"></a>
7878<ConfigTable client:load options={appOptions} />
7979 ### Chats
8080`codex app` opens an installed ChatGPT desktop app, or starts the installer when
8181the app is missing. On macOS, Codex opens the provided workspace path; onUse these links when you need to open an existing local chat or start a new one.
8282Windows, it prints the path to open after installation.
8383 | Deep link | Opens |
8484### `codex debug app-server send-message-v2`| ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
8585 | `codex://threads/<thread-id>` | A local chat. `<thread-id>` is its technical thread ID. |
8686Send one message through app-server's V2 thread/turn flow using the built-in app-server test client.| `codex://threads/new` | A new local chat. |
8787 | `codex://threads/new?<query>` | A new local chat with optional query parameters. |
8888<ConfigTable client:load options={debugAppServerSendMessageV2Options} />| `codex://new?<query>` | A new local chat. Include at least one of `prompt`, `path`, or `originUrl`; otherwise the link does nothing. |
8989
9090This 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.For `codex://threads/new` or `codex://new`, add any of these query parameters as needed; you can combine them in the same URL.
9191
9292### `codex debug models`| Query parameter | Required | What it does |
9393 | ---------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9494Print the raw model catalog Codex sees as JSON.| `prompt=<text>` | No | Sets the initial composer text. |
9595 | `path=<absolute-path>` | No | Opens the new chat in a local workspace. `path` must be an absolute path to a local directory. When valid, Codex uses that directory as the active workspace. |
9696<ConfigTable client:load options={debugModelsOptions} />| `originUrl=<git-remote-url>` | No | Matches one of your current workspace roots by Git remote URL. If `path` is also present, Codex resolves `path` first. |
9797
9898Use `--bundled` when you want to inspect only the catalog bundled with the current binary, without refreshing from the remote models endpoint.Example: [Show me some fun stats about how I've been using Codex](codex://threads/new?prompt=Show%20me%20some%20fun%20stats%20about%20how%20I%27ve%20been%20using%20Codex)
9999
100100### `codex debug prompt-input`<a id="start-a-task-with-a-plugin"></a>
101101
102102Render the exact model-visible prompt input list as JSON. Use this when#### Start a chat with a plugin
103103debugging instruction discovery, session context, or prompt construction.
104104 To help users start a plugin-backed chat, include a plugin mention in the
105105<ConfigTable client:load options={debugPromptInputOptions} />prompt before you encode it:
106106
107107### `codex apply````text
108108 [@Example](plugin://example@openai-curated) Summarize this document: https://example.com/document/123
109Apply the most recent diff from a Codex cloud chat to your local repository. You must authenticate and have access to the chat.
110
111<ConfigTable client:load options={applyOptions} />
112
113Codex prints the patched files and exits non-zero if `git apply` fails (for example, due to conflicts).
114
115### `codex review`
116
117Run a code review non-interactively. Choose exactly one review target, or pass
118custom review instructions as a prompt.
119
120<ConfigTable client:load options={reviewOptions} />
121
122`--uncommitted`, `--base`, `--commit`, and a custom `PROMPT` conflict with one
123another. Use `--title` only with `--commit`.
124
125### `codex archive` and `codex unarchive`
126
127Archive or restore a saved interactive session by session ID or session name.
128Use these commands when you want to clean up the session picker without deleting
129the transcript. Session IDs take precedence over session names.
130
131```bash
132codex archive <SESSION>
133codex unarchive <SESSION>
134```109```
135 110
136111<ConfigTable client:load options={archiveOptions} />Encode the complete prompt as a URI component—for example, with
112`encodeURIComponent` in JavaScript—and pass it to the `prompt` parameter:
137 113
138114### `codex delete````text
139115 codex://new?prompt=%5B%40Example%5D(plugin%3A%2F%2Fexample%40openai-curated)%20Summarize%20this%20document%3A%20https%3A%2F%2Fexample.com%2Fdocument%2F123
140Permanently delete a saved interactive session by session ID or session name.
141Use this only when you want to remove the transcript instead of hiding it from
142active session lists.
143
144```bash
145codex delete <SESSION>
146codex delete <SESSION_UUID> --force
147```116```
148 117
149118<ConfigTable client:load options={deleteOptions} />The link opens a new chat with the decoded prompt in the composer. It doesn't
150119 send the prompt automatically. After the user sends it, Codex can use an
151120Use `--force` only with a session UUID. Named sessions still requireinstalled plugin in that chat. If the plugin isn't installed but is available
152121confirmation so Codex doesn't delete a repeated or ambiguous name without a prompt.to the user, Codex asks the user to install it and connect any required connectors.
153122 After setup, the user can select **Continue** to resume the same chat. Workspace
154123### `codex cloud`settings can limit which plugins a user can install. For plugin installation
155124 and permission details, see [Plugins](https://learn.chatgpt.com/docs/plugins).
156Interact 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.
157
158<ConfigTable client:load options={cloudExecOptions} />
159
160Authentication follows the same credentials as the main CLI. Codex exits non-zero if the task submission fails.
161
162#### `codex cloud list`
163
164List recent cloud chats with optional filtering and pagination.
165
166<ConfigTable client:load options={cloudListOptions} />
167
168Plain-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`.
169
170### `codex completion`
171
172Generate shell completion scripts and redirect the output to the appropriate location, for example `codex completion zsh > "${fpath[1]}/_codex"`.
173
174<ConfigTable client:load options={completionOptions} />
175
176### `codex doctor`
177
178Generate a local diagnostic report before filing a support issue or
179while investigating a broken Codex installation. The report checks installation,
180configuration, authentication, runtime, Git, terminal, app-server, and thread
181inventory health.
182
183<ConfigTable client:load options={doctorOptions} />
184
185### `codex features`
186
187Manage feature flags stored in `$CODEX_HOME/config.toml`. The `enable` and
188`disable` commands persist changes so they apply to future sessions. The
189`features` subcommand doesn't accept `--profile`.
190
191<ConfigTable client:load options={featuresOptions} />
192
193### `codex exec`
194
195Use `codex exec` (or the short form `codex e`) for scripted or CI-style runs that should finish without human interaction.
196
197<ConfigTable client:load options={execOptions} />
198
199Codex 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:
200
201<ConfigTable client:load options={execResumeOptions} />
202
203### `codex execpolicy`
204
205Check `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.
206
207<ConfigTable client:load options={execpolicyOptions} />
208
209### `codex login`
210
211Authenticate the CLI with a ChatGPT account, API key, or access token. With no flags, Codex opens a browser for the ChatGPT OAuth flow.
212
213<ConfigTable client:load options={loginOptions} />
214
215`codex login status` exits with `0` when credentials are present, which is helpful in automation scripts.
216
217### `codex logout`
218
219Remove saved credentials for both API key and ChatGPT authentication. This command has no flags.
220
221### `codex mcp`
222
223Manage Model Context Protocol server entries stored in `~/.codex/config.toml`.
224
225<ConfigTable client:load options={mcpCommands} />
226
227The `add` subcommand supports both stdio and streamable HTTP transports:
228
229<ConfigTable client:load options={mcpAddOptions} />
230
231OAuth actions (`login`, `logout`) only work with streamable HTTP servers (and only when the server supports OAuth).
232
233### `codex plugin`
234
235Install, list, and remove plugins from configured marketplaces.
236
237<ConfigTable client:load options={pluginCommands} />
238
239`codex plugin add --json` prints `pluginId`, `name`, `marketplaceName`,
240`version`, `installedPath`, and `authPolicy`. `codex plugin list --json` prints
241`installed` and `available` arrays. Entries include `pluginId`, `name`,
242`marketplaceName`, `version`, `installed`, `enabled`, `source`, `installPolicy`,
243`authPolicy`, and, when available, `marketplaceSource` with the configured
244marketplace source type and value. `codex plugin remove --json` prints
245`pluginId`, `name`, and `marketplaceName`.
246
247### `codex plugin marketplace`
248
249Manage plugin marketplace sources that Codex can browse and install from.
250
251<ConfigTable client:load options={marketplaceCommands} />
252
253`codex plugin marketplace add` accepts GitHub shorthand such as `owner/repo` or
254`owner/repo@ref`, HTTP or HTTPS Git URLs, SSH Git URLs, and local marketplace
255root directories. Use `--ref` to pin a Git ref, and repeat `--sparse PATH` to
256use a sparse checkout for Git-backed marketplace repositories.
257
258`codex plugin marketplace list` prints in-scope marketplace names and roots,
259including implicitly discovered default marketplaces and configured marketplace
260snapshots.
261
262Add `--json` to marketplace add, list, upgrade, or remove commands for
263automation-friendly output. Marketplace add JSON includes `marketplaceName`,
264`installedRoot`, and `alreadyAdded`; list JSON includes a `marketplaces` array
265with `name`, `root`, and optional `marketplaceSource`; upgrade JSON includes
266`selectedMarketplaces`, `upgradedRoots`, and `errors`; remove JSON includes
267`marketplaceName` and `installedRoot`.
268
269### `codex mcp-server`
270
271Run Codex as an MCP server over stdio so that other tools can connect. This command inherits global configuration overrides and exits when the downstream client closes the connection.
272
273### `codex resume`
274
275Continue 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.
276
277If the current working directory differs from the session's saved directory,
278Codex asks which directory to use. Set
279[`tui.resume_cwd`](https://learn.chatgpt.com/docs/config-file/config-reference) to `"current"` or
280`"session"` to reuse that choice without a prompt. An explicit `--cd` (`-C`)
281override takes precedence over `tui.resume_cwd`.
282
283<ConfigTable client:load options={resumeOptions} />
284
285### `codex fork`
286
287Fork 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.
288
289When the current and saved session directories differ, `codex fork` uses the
290same working-directory prompt and `tui.resume_cwd` setting as `codex resume`.
291
292<ConfigTable client:load options={forkOptions} />
293
294### `codex sandbox`
295
296Use the sandbox helper to run a command under the same policies Codex uses internally.
297
298#### macOS seatbelt
299
300<ConfigTable client:load options={sandboxMacOptions} />
301
302#### Linux Landlock
303
304<ConfigTable client:load options={sandboxLinuxOptions} />
305
306#### Windows
307
308<ConfigTable client:load options={sandboxWindowsOptions} />
309
310### `codex update`
311
312Check 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.
313
314## Flag combinations and safety tips
315
316- 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.
317- When you need to grant Codex write access to more directories, prefer `--add-dir` rather than forcing `--sandbox danger-full-access`.
318- Pair `--json` with `--output-last-message` in CI to capture machine-readable progress and a final natural-language summary.
319
320## Interactive shortcuts
321
322- Type `@` to search for a file in the workspace and add its path to the prompt.
323- Press <kbd>Up</kbd> or <kbd>Down</kbd> to restore draft history.
324- Press <kbd>Ctrl</kbd>+<kbd>R</kbd> to search prompt history, then press <kbd>Enter</kbd> to use a match or <kbd>Esc</kbd> to cancel.
325- Press <kbd>Ctrl</kbd>+<kbd>O</kbd> or run `/copy` to copy the latest completed Codex output.
326- Prefix a line with `!` to run a local shell command under the current approval and sandbox settings.
327- Press <kbd>Tab</kbd> while Codex is working to queue a follow-up prompt, slash command, or shell command for the next turn.
328- Press <kbd>Enter</kbd> while Codex is working to inject new instructions into the current turn.
329- Press <kbd>Esc</kbd> twice with an empty composer to edit the previous user message and fork the chat from that point.
330- Press <kbd>Ctrl</kbd>+<kbd>C</kbd> or run `/exit` to close the session.
331
332## Related resources
333
334- [Codex CLI overview](https://learn.chatgpt.com/docs/codex/cli): installation, upgrades, and quick tips.
335- [Config basics](https://learn.chatgpt.com/docs/config-file/config-basic): persist defaults like the model and provider.
336- [Advanced Config](https://learn.chatgpt.com/docs/config-file/config-advanced): profiles, providers, sandbox tuning, and integrations.
337- [AGENTS.md](https://learn.chatgpt.com/docs/agent-configuration/agents-md): conceptual overview of Codex agent capabilities and best practices.
338
339Slash commands give you fast, keyboard-first control over Codex. Type `/` in
340the composer to open the slash popup, choose a command, and Codex will perform
341actions such as switching models, adjusting permissions, or summarizing long
342chats without leaving the terminal.
343
344This guide shows you how to:
345
346- Find the right built-in slash command for a task
347- Steer an active session with commands like `/model`, `/fast`,
348 `/personality`, `/permissions`, `/approve`, `/raw`, `/agent`, and `/status`
349
350## Built-in slash commands
351
352Codex ships with the following commands. Open the slash popup and start typing
353the command name to filter the list.
354
355When a chat is already running, you can type a slash command and press `Tab` to
356queue it for the next turn. Codex parses queued slash commands when they run, so
357command menus and errors appear after the current turn finishes. Slash
358completion still works before you queue the command.
359
360| Command | Purpose | When to use it |
361| ------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
362| [`/permissions`](#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. |
363| [`/ide`](#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. |
364| [`/keymap`](#remap-tui-shortcuts-with-keymap) | Remap TUI keyboard shortcuts. | Inspect and persist custom shortcut bindings in `config.toml`. |
365| [`/vim`](#toggle-vim-mode-with-vim) | Toggle Vim mode for the composer. | Switch between Vim normal/insert behavior and the default composer editing mode. |
366| [`/setup-default-sandbox`](#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. |
367| [`/sandbox-add-read-dir`](#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. |
368| [`/agent`, `/subagents`](#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned subagent thread. |
369| [`/apps`](#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. |
370| [`/plugins`](#browse-plugins-with-plugins) | Browse installed and discoverable plugins. | Inspect plugin tools, install suggested plugins, or manage plugin availability. |
371| [`/hooks`](#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. |
372| [`/clear`](#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. |
373| [`/rename`](#rename-the-current-chat-with-rename) | Rename the current chat. | Give a saved session a recognizable name without leaving the TUI. |
374| [`/archive`](#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. |
375| [`/delete`](#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. |
376| [`/compact`](#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. |
377| [`/copy`](#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`. |
378| [`/diff`](#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. |
379| [`/exit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI (same as `/quit`). | Alternative spelling; both commands exit the session. |
380| [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable options such as Network proxy or Prevent sleep while running. |
381| [`/approve`](#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. |
382| [`/memories`](#configure-memories-with-memories) | Configure memory use and generation. | Turn memory injection or memory generation on or off without leaving the TUI. |
383| [`/skills`](#use-skills-with-skills) | Browse and use skills. | Improve task-specific behavior by selecting a relevant local skill. |
384| [`/import`](#import-claude-code-or-cursor-configuration-with-import) | Import Claude Code or Cursor setup, projects, and recent chats. | Migrate supported external-agent artifacts into Codex configuration and local files. |
385| [`/feedback`](#send-feedback-with-feedback) | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |
386| [`/init`](#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. |
387| [`/logout`](#sign-out-with-logout) | Sign out of Codex. | Clear local credentials when using a shared machine. |
388| [`/mcp`](#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. |
389| [`/mention`](#highlight-files-with-mention) | Attach a file to the chat. | Point Codex at specific files or folders you want it to inspect next. |
390| [`/model`](#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. |
391| [`/fast`](#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. |
392| [`/plan`](#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. |
393| [`/goal`](#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. |
394| [`/personality`](#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. |
395| [`/ps`](#check-background-terminals-with-ps) | Show background terminals and their recent output. | Check long-running commands without leaving the main transcript. |
396| [`/stop`](#stop-background-terminals-with-stop) | Stop all background terminals. | Cancel background terminal work started by the current session. |
397| [`/fork`](#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. |
398| [`/app`](#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. |
399| [`/side`, `/btw`](#start-a-side-chat-with-side) | Start an ephemeral side chat. | Ask a focused follow-up without disrupting the main chat's transcript. |
400| [`/raw`](#toggle-raw-scrollback-with-raw) | Toggle raw scrollback mode. | Make terminal selection and copying less formatted while reviewing long output. |
401| [`/resume`](#resume-a-saved-chat-with-resume) | Resume a saved chat from your session list. | Continue work from a previous CLI session without starting over. |
402| [`/new`](#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. |
403| [`/quit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI. | Leave the session immediately. |
404| [`/review`](#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. |
405| [`/status`](#inspect-the-session-with-status) | Display session configuration and token usage. | Confirm the active model, approval policy, writable roots, and remaining context capacity. |
406| [`/usage`](#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. |
407| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |
408| [`/statusline`](#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. |
409| [`/title`](#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. |
410| [`/theme`](#choose-a-syntax-theme-with-theme) | Choose a syntax-highlighting theme. | Preview and persist a terminal syntax-highlighting theme. |
411| [`/pets`, `/pet`](#choose-a-terminal-pet-with-pets) | Choose or hide a terminal pet. | Personalize the TUI with a built-in or custom ambient pet. |
412
413`/quit` and `/exit` both exit the CLI. Use them only after you have saved or
414committed any important work.
415
416Use `/permissions` to adjust what Codex can do without asking first. Use
417`/approve` only when you need to retry a recent action that automatic review
418denied.
419
420## Control your session with slash commands
421
422The following workflows keep your session on track without restarting Codex.
423
424### Set the active model with `/model`
425
4261. Start Codex and open the composer.
4272. Type `/model` and press Enter.
4283. Choose a model such as `gpt-5.6-luna` or `gpt-5.6-terra` from the popup.
429
430Expected: Codex confirms the new model in the transcript. Run `/status` to verify the change.
431
432### Toggle Fast mode with `/fast`
433
4341. Type `/fast` to turn the current model's Fast service tier on.
4352. Type `/fast` again to turn it off.
436
437Expected: Codex toggles the tier and saves the selection. In the TUI footer,
438you can also show a Fast mode status-line item with `/statusline`.
439
440Fast tier commands are catalog-driven. If the current model doesn't advertise a
441Fast tier, Codex won't show `/fast`.
442
443### Set a communication style with `/personality`
444
445Use `/personality` to change how Codex communicates without rewriting your prompt.
446
4471. In an active chat, type `/personality` and press Enter.
4482. Choose a style from the popup.
449
450Expected: Codex confirms the new style in the transcript and uses it for later
451responses in the chat.
452
453Codex supports `friendly`, `pragmatic`, and `none` personalities. Use `none`
454to disable personality instructions.
455
456If the active model doesn't support personality-specific instructions, Codex hides this command.
457
458### Switch to plan mode with `/plan`
459
4601. Type `/plan` and press Enter to switch the active chat into plan
461 mode.
4622. Optional: provide inline prompt text (for example, `/plan Propose a
463migration plan for this service`).
4643. You can paste content or attach images while using inline `/plan` arguments.
465
466Expected: Codex enters plan mode and uses your optional inline prompt as the first planning request.
467
468While Codex is already working, `/plan` is temporarily unavailable.
469
470### Set or view a task goal with `/goal`
471
4721. Type `/goal <objective>` to set the goal, for example `/goal Finish the migration and keep tests green`.
4732. Type `/goal` to view the current goal.
4743. Use `/goal edit` to revise the objective. Use `/goal pause`, `/goal resume`, or `/goal clear` to pause, resume, or remove it.
475
476Expected: Codex keeps the goal attached to the active chat while work continues.
477
478Goal objectives must be non-empty and at most 4,000 characters. For longer
479instructions, put the details in a file and point the goal at that file.
480
481### Toggle experimental features with `/experimental`
482
4831. Type `/experimental` and press Enter.
4842. Toggle the features you want (for example, Network proxy or Prevent sleep while running), then restart Codex if the prompt asks you to.
485
486Expected: Codex saves your feature choices to config and applies them on restart.
487
488### Approve an auto review denial with `/approve`
489
490Use `/approve` when the automatic reviewer denied a recent action and you want
491Codex to retry it once.
492
4931. Type `/approve`.
4942. Confirm the retry when Codex shows the relevant denied action.
495
496Expected: Codex retries that denied action once under the current session
497policy.
498
499### Configure memories with `/memories`
500
5011. Type `/memories`.
5022. Choose whether Codex should use existing memories, generate new memories, or
503 keep memory behavior disabled.
504
505Expected: Codex updates the relevant memory settings for future sessions.
506
507### Use skills with `/skills`
508
5091. Type `/skills`.
5102. Pick the skill you want Codex to apply.
511
512Expected: Codex inserts the selected skill context so the next request follows
513that skill's instructions.
514
515<a id="import-claude-code-configuration-with-import"></a>
516
517### Import Claude Code or Cursor configuration with `/import`
518
5191. Type `/import`.
5202. Choose **Claude Code** or **Cursor**.
5213. Select the setup, project files, or recent chats you want to migrate.
522
523Expected: Codex opens the external-agent import picker and imports the selected
524supported artifacts into Codex configuration and local files. Session discovery
525includes up to 50 chats from the last 30 days.
526
527Run `/import` from a local TUI session. It's unavailable while a task is running,
528in remote sessions, and while connected to the local app-server daemon.
529
530For the desktop app workflow and supported artifact types, see [Import from
531another agent](https://learn.chatgpt.com/docs/import).
532
533<a id="clear-the-terminal-and-start-a-new-chat-with-clear"></a>
534<a id="clear-the-terminal-and-start-a-new-task-with-clear"></a>
535
536### Clear the terminal and start a new chat with `/clear`
537
5381. Type `/clear` and press Enter.
539
540Expected: Codex clears the terminal, resets the visible transcript, and starts
541a fresh chat in the same CLI session.
542
543To name the new chat as you create it, run `/clear release prep`.
544
545Unlike <kbd>Ctrl</kbd>+<kbd>L</kbd>, `/clear` starts a new chat.
546
547<kbd>Ctrl</kbd>+<kbd>L</kbd> only clears the terminal view and keeps the current
548chat. Codex disables both actions while a task is in progress.
549
550### Archive the current session with `/archive`
551
5521. Type `/archive` and press Enter.
5532. Confirm that you want to archive the current session and exit Codex.
554
555Expected: Codex archives the current session and closes the interactive TUI.
556Codex keeps the session transcript stored locally; restore it later with
557`codex unarchive <SESSION>`.
558
559`/archive` is unavailable while a task is running.
560
561### Delete the current session with `/delete`
562
5631. Type `/delete` and press Enter.
5642. Confirm that you want to delete the current session and exit Codex.
565
566Expected: Codex deletes the current session transcript and closes the
567interactive TUI. Deletion is permanent and also removes spawned descendant
568sessions.
569
570`/delete` is unavailable while a chat is running or in a side chat.
571
572### Update permissions with `/permissions`
573
5741. Type `/permissions` and press Enter.
5752. Select the approval preset that matches your comfort level, for example
576 `Auto` for hands-off runs or `Read Only` to review edits. When named
577 permission profiles are active, the picker also shows configured custom
578 profiles and their descriptions.
579
580Expected: Codex announces the updated policy. Future actions respect the
581updated approval mode until you change it again.
582
583### Include IDE context with `/ide`
584
5851. Type `/ide`.
5862. Add optional inline text if you want to explain what Codex should do with the
587 current IDE selection or open files.
588
589Expected: Codex includes available IDE context in the next prompt.
590
591### Toggle Vim mode with `/vim`
592
5931. Type `/vim`.
5942. Continue editing in the composer.
595
596Expected: Codex toggles composer Vim mode for the current session. To make Vim
597mode the default for new sessions, set `tui.vim_mode_default = true` in
598`config.toml`.
599
600### Set up the elevated Windows sandbox with `/setup-default-sandbox`
601
602This command appears only on Windows when Codex is using the degraded
603restricted-token sandbox.
604
6051. Type `/setup-default-sandbox`.
6062. Follow the administrator setup flow.
607
608Expected: Codex configures the elevated Windows sandbox and selects the
609corresponding automatic approval preset.
610
611### Copy the latest response with `/copy`
612
6131. Type `/copy` and press Enter.
614
615Expected: Codex copies the latest completed Codex output to your clipboard.
616
617If a turn is still running, `/copy` uses the latest completed output instead of
618the in-progress response. The command is unavailable before the first completed
619Codex output and immediately after a rollback.
620
621You can also press <kbd>Ctrl</kbd>+<kbd>O</kbd> from the main TUI to copy the
622latest completed response without opening the slash command menu.
623
624### Toggle raw scrollback with `/raw`
625
6261. Type `/raw`, `/raw on`, or `/raw off`.
627
628Expected: Codex toggles raw scrollback mode, which makes terminal selection and
629copying more direct. You can also use the default <kbd>Alt</kbd>+<kbd>R</kbd>
630binding or persist the default with `tui.raw_output_mode = true`.
631
632### Grant sandbox read access with `/sandbox-add-read-dir`
633
634This command is available only when running the CLI natively on Windows.
635
6361. Type `/sandbox-add-read-dir C:\absolute\directory\path` and press Enter.
6372. Confirm the path is an existing absolute directory.
638
639Expected: Codex refreshes the Windows sandbox policy and grants read access to
640that directory for later commands that run in the sandbox.
641
642### Inspect the session with `/status`
643
6441. In any chat, type `/status`.
6452. Review the output for the active model, approval policy, writable roots, and
646 current token usage. When the TUI connects remotely, the output also
647 shows the remote address and the server version.
648
649Expected: Codex prints a summary confirming that it's operating where you
650expect.
651
652### View account usage with `/usage`
653
6541. Type `/usage` to open the usage menu.
6552. Choose whether to show token activity or redeem an available earned reset.
6563. To open token activity directly, type `/usage daily`, `/usage weekly`, or `/usage cumulative`.
657
658Expected: Codex opens usage actions or shows account token activity for the
659selected view. If the session doesn't have Codex service account auth, Codex
660shows a sign-in requirement.
661
662### Inspect config layers with `/debug-config`
663
6641. Type `/debug-config`.
6652. Review the output for config layer order (lowest precedence first), on/off
666 state, and policy sources.
667
668Expected: Codex prints layer diagnostics plus policy details such as
669`allowed_approval_policies`, `allowed_sandbox_modes`, `mcp_servers`, `rules`,
670`enforce_residency`, and `experimental_network` when configured.
671
672Use this output to debug why an effective setting differs from `config.toml`.
673
674### Configure footer items with `/statusline`
675
6761. Type `/statusline`.
6772. Use the picker to toggle and reorder items, then confirm.
678
679Expected: The footer status line updates immediately and persists to
680`tui.status_line` in `config.toml`.
681
682Available status-line items include model, model+reasoning, context stats, rate
683limits, git branch, token counters, session id, current directory/project root,
684and Codex version.
685
686### Configure terminal title items with `/title`
687
6881. Type `/title`.
6892. Use the picker to toggle and reorder items, then confirm.
690
691Expected: The terminal window or tab title updates immediately and persists to
692`tui.terminal_title` in `config.toml`.
693
694Available title items include app name, project, spinner, status, thread, git
695branch, model, and task progress.
696
697### Choose a syntax theme with `/theme`
698
6991. Type `/theme`.
7002. Preview a theme from the picker, then confirm.
701
702Expected: Codex updates syntax highlighting and persists the choice to
703`tui.theme` in `config.toml`.
704
705### Choose a terminal pet with `/pets`
706
7071. Type `/pets` (or `/pet`) to open the pet picker.
7082. Choose a built-in or custom pet, or turn pets off.
709
710Expected: Codex displays the selected ambient pet in supported terminals and
711persists the selection. You can also type `/pets off` to hide it.
712
713### Remap TUI shortcuts with `/keymap`
714
715Use `/keymap` to inspect, update, and persist keyboard shortcut bindings for the TUI.
716
7171. Type `/keymap`.
7182. Pick the shortcut context and action you want to change.
7193. Enter the new binding or remove the existing one.
720
721Expected: Codex updates the active keymap and writes the custom binding to `tui.keymap` in `config.toml`.
722
723Key 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.
724
725### Check background terminals with `/ps`
726
7271. Type `/ps`.
7282. Review the list of background terminals and their status.
729
730Expected: Codex shows each background terminal's command plus up to three
731recent, non-empty output lines so you can gauge progress at a glance.
732
733Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.
734
735### Stop background terminals with `/stop`
736
7371. Type `/stop`.
7382. Confirm if Codex asks before stopping the listed terminals.
739
740Expected: Codex stops all background terminals for the current session. `/clean`
741is still available as an alias for `/stop`.
742
743### Keep transcripts lean with `/compact`
744
7451. After a long exchange, type `/compact`.
7462. Confirm when Codex offers to summarize the chat so far.
747
748Expected: Codex replaces earlier turns with a concise summary, freeing context
749while keeping critical details.
750
751### Review changes with `/diff`
752
7531. Type `/diff` to inspect the Git diff.
7542. Scroll through the output inside the CLI to review edits and added files.
755
756Expected: Codex shows changes you've staged, changes you haven't staged yet,
757and files Git hasn't started tracking, so you can decide what to keep.
758
759### Highlight files with `/mention`
760
7611. Type `/mention` followed by a path, for example `/mention src/lib/api.ts`.
7622. Select the matching result from the popup.
763
764Expected: Codex adds the file to the chat, ensuring follow-up turns reference it directly.
765
766<a id="start-a-new-conversation-with-new"></a>
767
768### Start a new chat with `/new`
769
7701. Type `/new` and press Enter.
771
772Expected: Codex starts a fresh chat in the same CLI session, so you
773can switch chats without leaving your terminal.
774
775To name the new chat as you create it, run `/new bug bash`.
776
777Unlike `/clear`, `/new` doesn't clear the current terminal view first.
778
779<a id="rename-the-current-chat-with-rename"></a>
780<a id="rename-the-current-task-with-rename"></a>
781
782### Rename the current chat with `/rename`
783
7841. Type `/rename <name>`, or type `/rename` to open the naming prompt.
7852. Enter a short name that will help you find the chat later.
786
787Expected: Codex updates the saved chat name without changing its transcript.
788
789<a id="resume-a-saved-conversation-with-resume"></a>
790
791### Resume a saved chat with `/resume`
792
7931. Type `/resume` and press Enter.
7942. Choose the session you want from the saved-session picker.
795
796Expected: Codex reloads the selected chat's transcript so you can pick
797up where you left off, keeping the original history intact.
798
799<a id="fork-the-current-conversation-with-fork"></a>
800
801### Fork the current chat with `/fork`
802
8031. Type `/fork` and press Enter.
804
805Expected: Codex clones the current chat into a new chat with a fresh
806ID, leaving the original transcript untouched so you can explore an alternative
807approach in parallel.
808
809If you need to fork a saved session instead of the current one, run
810`codex fork` in your terminal to open the session picker.
811
812### Continue in the desktop app with `/app`
813
814On macOS and Windows, type `/app` to open the current session in the ChatGPT
815desktop app. If the app isn't installed or running, Codex shows an error asking
816you to install or launch it.
817
818Expected: The desktop app opens the same saved chat so you can continue there.
819
820<a id="start-a-side-conversation-with-side"></a>
821
822### Start a side chat with `/side`
823 125
824126Use `/side` to start an ephemeral fork from the current chat without switching away from the main chat.### Settings
825 127
8261281. Type `/side` to open a side chat.Use these links when you need to open Settings or a specific settings page.
8272. Optionally add inline text, for example `/side Check whether this plan has an obvious risk`.
8283. Return to the parent chat after the focused detour finishes.
829 129
830130Expected: Codex opens a side chat whose transcript is separate from| Deep link | Opens |
831131the parent chat. While you are in side mode, the TUI continues to show the| ------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
832132parent chat's status so you can see whether the main chat is still running.| `codex://settings` | Settings. |
133| `codex://settings/browser-use` | Browser settings. |
134| `codex://settings/computer-use/google-chrome` | Google Chrome settings for computer use. |
135| `codex://settings/connections` | Remote connections settings. |
136| `codex://settings/connections/computer` | Settings for controlling this Mac or PC from another device. |
137| `codex://settings/connections/devices` | Settings for controlling other devices. |
138| `codex://settings/connections/ssh` | SSH connection settings. |
139| `codex://settings/connections/ssh/add?name=<ssh-config-host>` | Adds the named host alias as a Codex-managed connection, then opens SSH connection settings. |
833 140
834141`/side` is unavailable inside another side chat and during review mode.The `name` value must match a host alias in `~/.ssh/config`. The link disables
142automatic connection for the added host. If Codex can't find the named host, it
143opens SSH connection settings and shows an error.
835 144
836145### Generate `AGENTS.md` with `/init`Unsupported `codex://settings/...` paths open the main Settings page.
837 146
8381471. Run `/init` in the directory where you want Codex to look for persistent instructions.### Skills
8392. Review the generated `AGENTS.md`, then edit it to match your repository conventions.
840 148
841149Expected: Codex creates an `AGENTS.md` scaffold you can refine and commit forUse these links when you need to open Skills.
842future sessions.
843 150
844151### Ask for a working tree review with `/review`| Deep link | Opens |
152| ---------------- | ------- |
153| `codex://skills` | Skills. |
845 154
8461551. Type `/review`.### Scheduled
8472. Follow up with `/diff` if you want to inspect the exact file changes.
848 156
849157Expected: Codex summarizes issues it finds in your working tree, focusing onUse these links when you need to open **Scheduled**.
850behavior changes and missing tests. It uses the current session model unless
851you set `review_model` in `config.toml`.
852 158
853159### List MCP tools with `/mcp`| Deep link | Opens |
160| --------------------- | ------------------------------------ |
161| `codex://automations` | Scheduled with the create flow open. |
854 162
8551631. Type `/mcp`.### Plugins
8562. Review the list to confirm which MCP servers and tools are available.
857 164
858165Expected: You see the configured Model Context Protocol (MCP) tools Codex can call in this session.Plugin links use different forms depending on whether you are installing from a marketplace, opening a plugin, or working from a local `marketplace.json`. For plugin basics, see [Plugins](https://learn.chatgpt.com/docs/plugins). For local or repo marketplace setup, see [Build plugins](https://developers.openai.com/plugins/build/plugins#build-your-own-curated-plugin-list).
859 166
860167Use `/mcp verbose` to include detailed server diagnostics. If you pass anything other than `verbose`, Codex shows the command usage.#### Plugin install
861 168
862169### Browse apps with `/apps`Use this form to open the install flow for a plugin from a marketplace that Codex already knows about.
863 170
8641711. Type `/apps`.| Deep link | Opens |
8651722. Pick an app from the list.| ---------------------------------------------------------------------- | ----------------------------------------------- |
173| `codex://plugins/install/<plugin-name>?marketplace=<marketplace-name>` | The plugin detail or install flow for a plugin. |
866 174
867175Expected: Codex inserts the app mention into the composer as `$app-slug`, so| Query parameter | Required | What it does |
868176you can immediately ask Codex to use it.| -------------------------------- | -------- | ------------------------------------------------------------------------------- |
177| `marketplace=<marketplace-name>` | Yes | Identifies the marketplace. For an OpenAI-curated plugin, use `openai-curated`. |
869 178
870179### Browse plugins with `/plugins`The install link accepts only the `marketplace` query parameter. If Codex can't find the requested marketplace or plugin, it opens the Plugins page instead.
871 180
8721811. Type `/plugins`.#### Plugin detail
8732. Choose a marketplace tab, then pick a plugin to inspect its capabilities or available actions.
874 182
875183Expected: Codex opens the plugin browser so you can review installed plugins,| Deep link | Opens |
876184discoverable plugins that your configuration allows, and installed plugin state.| ----------------------------- | --------------------- |
877185Press <kbd>Space</kbd> on an installed plugin to toggle its enabled state.| `codex://plugins/<plugin-id>` | A plugin detail page. |
878 186
879187### View and manage lifecycle hooks with `/hooks``<plugin-id>` must identify the plugin. For an OpenAI-curated plugin, use the form `<plugin-name>@openai-curated`.
880 188
8811891. Type `/hooks`.Codex-generated plugin links can also include these query parameters. Omit both when you write a link manually.
8822. Choose a hook event to inspect the matching handlers.
8833. Trust, disable, or re-enable non-managed hooks as needed.
884 190
885191Expected: Codex opens the hook browser so you can review configured lifecycle| Query parameter | Required | What it does |
886192hooks. Managed hooks appear as managed and can't be disabled from the user hook| ------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
887193browser.| `hostId=<host-id>` | No | Identifies the Codex host that owns the plugin context, such as `local` or one of your configured remote connections. Codex provides these IDs. |
194| `source=manage` | No | Preserves the app's plugin-management entry point. It's not admin-only. |
888 195
889196### Switch agent threads with `/agent`Example: [Open the OpenAI Developers plugin](codex://plugins/openai-developers@openai-curated)
890 197
8911981. Type `/agent` or `/subagents` and press Enter.#### Local plugin
8922. Select the thread you want from the picker.
893 199
894200Expected: Codex switches the active thread so you can inspect or continue thatFor local or repo marketplace setup, see [Build plugins](https://developers.openai.com/plugins/build/plugins#build-your-own-curated-plugin-list).
895agent's work.
896 201
897202### Send feedback with `/feedback`| Deep link | Opens |
203| --------------------------------------------------------------------------- | ---------------------------------------------------- |
204| `codex://plugins/<plugin-name>?marketplacePath=<absolute-marketplace-path>` | A local plugin detail page from a local marketplace. |
898 205
8992061. Type `/feedback` and press Enter.| Query parameter | Required | What it does |
9002072. Follow the prompts to include logs or diagnostics.| --------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------- |
208| `marketplacePath=<absolute-marketplace-path>` | Yes | Absolute path to the local `marketplace.json`, for example `/Users/alex/.agents/plugins/marketplace.json`. |
209| `mode=share` | No | Opens the share flow for that local plugin. |
901 210
902211Expected: Codex collects the requested diagnostics and submits them to the### Pets
903maintainers.
904 212
905213### Sign out with `/logout`Use these links to open the pet install flow when that feature is enabled.
906 214
9072151. Type `/logout` and press Enter.| Deep link | Opens |
216| ----------------------------------------------------------------- | --------------------- |
217| `codex://pets/install?name=<pet-name>&imageUrl=<https-image-url>` | The pet install flow. |
908 218
909219Expected: Codex clears local credentials for the current user session.| Query parameter | Required | What it does |
220| ------------------------------ | -------- | ------------------------------------------------------------------------------------------- |
221| `name=<pet-name>` | Yes | Sets the pet name. The value must contain at least one non-whitespace character. |
222| `imageUrl=<https-image-url>` | Yes | Provides an absolute HTTPS URL for the pet image or sprite sheet. |
223| `description=<text>` | No | Adds a description to the install flow. |
224| `spriteVersionNumber=<1-or-2>` | No | Selects the sprite-sheet format. The default is `1`; the only other supported value is `2`. |
910 225
911226### Exit the CLI with `/quit` or `/exit`The install link accepts only these query parameters. Invalid names, non-HTTPS
227image URLs, unsupported sprite versions, or extra path segments cause the link
228to do nothing.
912 229
9132301. Type `/quit` (or `/exit`) and press Enter.## See also
914 231
915232Expected: Codex exits immediately. Save or commit any important work first.- [Features](https://learn.chatgpt.com/docs/features)
233- [Settings](https://learn.chatgpt.com/docs/reference/settings)
234- [Slash commands](https://learn.chatgpt.com/docs/reference/slash-commands)