AI IDE List
AI IDE List
OpenAI CodexZuletzt geprüft am 18. Juni 2026

Codex CLI Cheatsheet

Eine kompakte Referenz für dokumentierte Codex CLI-Befehle, häufige Flags, nicht interaktive Läufe, MCP, Plugin-Verwaltung und integrierte Slash Commands.

codex

Interaktive Arbeit im lokalen Repo

codex exec

Skripte und einmalige Aufgaben

codex cloud

Cloud-Task-Workflows

/permissions

Live-Steuerung der Sitzung

Schnellstart

Befehle, die Sie zuerst brauchen

Deckt die häufigsten lokalen, automatisierten, Cloud- und interaktiven Kontrollabläufe ab.

Interaktive Arbeit
codex

Öffnet die Terminal-UI im aktuellen Workspace.

Einmalige Automatisierung
codex exec "fix the failing test"

Führt Codex nicht interaktiv aus und streamt das Ergebnis.

Arbeit fortsetzen
codex resume --last

Kehrt zur neuesten interaktiven Sitzung zurück.

Cloud-Ausgabe anwenden
codex apply TASK_ID

Wendet den neuesten Diff einer Codex Cloud-Aufgabe an.

Sitzungsberechtigungen
/permissions

Legt fest, was Codex ohne Nachfrage tun darf.

Modellsteuerung
/model

Wählt das aktive Modell und den Reasoning-Aufwand.

Globale Optionen

codex [OPTIONS] [PROMPT]

Diese Optionen gelten hauptsächlich für den Basisbefehl codex. Viele werden auch von Unterbefehlen akzeptiert.

--add-dir

Typ / Werte

path

Zweck

Add another writable directory beside the main workspace.

--ask-for-approval, -a

Typ / Werte

untrusted | on-request | never

Zweck

Choose when Codex asks before running commands.

--cd, -C

Typ / Werte

path

Zweck

Set the working directory before the agent starts.

--config, -c

Typ / Werte

key=value

Zweck

Override configuration values inline.

--dangerously-bypass-approvals-and-sandbox

Typ / Werte

boolean

Zweck

Disable approvals and sandboxing for externally isolated environments.

--yolo

Typ / Werte

boolean

Zweck

Alias for the dangerous bypass mode.

--dangerously-bypass-hook-trust

Typ / Werte

boolean

Zweck

Run enabled hooks without persisted trust for this run.

--disable

Typ / Werte

feature

Zweck

Force-disable a feature flag.

--enable

Typ / Werte

feature

Zweck

Force-enable a feature flag.

--image, -i

Typ / Werte

path[,path...]

Zweck

Attach images to the initial prompt.

--model, -m

Typ / Werte

string

Zweck

Override the configured model.

--no-alt-screen

Typ / Werte

boolean

Zweck

Disable alternate-screen mode in the terminal UI.

--oss

Typ / Werte

boolean

Zweck

Use a local open-source model provider, commonly with Ollama.

--profile, -p

Typ / Werte

string

Zweck

Load a named Codex config profile.

--remote

Typ / Werte

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

Zweck

Connect the TUI to a remote app-server.

--remote-auth-token-env

Typ / Werte

ENV_VAR

Zweck

Read the remote bearer token from an environment variable.

--sandbox, -s

Typ / Werte

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

Zweck

Select the sandbox policy for shell commands.

--search

Typ / Werte

boolean

Zweck

Enable live web search.

--strict-config

Typ / Werte

boolean

Zweck

Error on unknown config fields.

PROMPT

Typ / Werte

string

Zweck

Optional starting instruction.

Verwenden Sie --dangerously-bypass-approvals-and-sandbox oder --yolo nur, wenn die Umgebung bereits stark isoliert ist.

Befehlsübersicht

Dokumentierte Top-Level-Befehle

Stable-Befehle sind für den regulären Einsatz gedacht. Experimental-Befehle können sich mit Codex ändern.

codexStable

Startet die interaktive Terminal-UI.

codex appStable

Öffnet die Codex Desktop-App.

codex app-serverExperimental

Start the local app server for development or debugging.

codex applyStable

Apply a Codex Cloud task diff locally.

codex aStable

Alias for codex apply.

codex archiveStable

Archive a saved interactive session.

codex cloudExperimental

Browse or run Codex Cloud tasks from the terminal.

codex cloud-tasksExperimental

Alias for codex cloud.

codex completionStable

Generate shell completion scripts.

codex debug app-server send-message-v2Experimental

Send a V2 test message to app-server.

codex debug modelsExperimental

Print the model catalog Codex sees.

codex doctorStable

Create a local diagnostic report.

codex execStable

Führt Codex nicht interaktiv aus.

codex eStable

Alias for codex exec.

codex execpolicyExperimental

Evaluate command execution policy rules.

codex featuresStable

List or persist feature flag overrides.

codex forkStable

Fork a previous session into a new thread.

codex loginStable

Authentifiziert Codex.

codex logoutStable

Entfernt gespeicherte Zugangsdaten.

codex mcpExperimental

Manage MCP server definitions and auth.

codex mcp-serverExperimental

Run Codex itself as an MCP server.

codex pluginExperimental

Install, list, and remove Codex plugins.

codex plugin marketplaceExperimental

Manage plugin marketplace sources.

codex remote-controlExperimental

Ensure app-server remote control support is enabled.

codex resumeStable

Resume a previous interactive session.

codex sandboxExperimental

Run commands inside Codex sandboxes.

codex unarchiveStable

Restore an archived session.

codex updateStable

Check for or apply a CLI update when supported.

Unterbefehle

Befehlsmatrix nach Workflow

Nach Workflow gruppiert, damit die Seite gut scanbar bleibt und trotzdem die dokumentierte Befehlsfläche abdeckt.

codex

Zweck

Startet die interaktive Terminal-UI.

codex "PROMPT"

Zweck

Start the TUI with an initial instruction.

codex --image path

Typ / Werte

path[,path...]

Zweck

Start with one or more image attachments.

codex --remote ENDPOINT

Typ / Werte

ws://, wss://, unix://

Zweck

Connect the TUI to a remote app-server.

codex app

Zweck

Open the desktop app.

codex app PATH

Typ / Werte

path

Zweck

Open a workspace path in Codex Desktop.

codex app --download-url URL

Typ / Werte

url

Zweck

Override the desktop installer download URL.

codex app-server

Zweck

Start the local app server.

codex app-server --listen VALUE

Typ / Werte

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

Zweck

Set the transport listener.

codex app-server --stdio

Typ / Werte

boolean

Zweck

Use stdio transport.

codex app-server --analytics-default-enabled

Typ / Werte

boolean

Zweck

Default analytics to enabled for app-server clients.

codex app-server --ws-auth MODE

Typ / Werte

capability-token | signed-bearer-token

Zweck

Choose WebSocket authentication mode.

codex app-server --ws-audience VALUE

Typ / Werte

string

Zweck

Expected JWT audience.

codex app-server --ws-issuer VALUE

Typ / Werte

string

Zweck

Expected JWT issuer.

codex app-server --ws-max-clock-skew-seconds N

Typ / Werte

number

Zweck

Allow clock skew for token time checks.

codex app-server --ws-shared-secret-file PATH

Typ / Werte

absolute path

Zweck

HMAC secret file for signed bearer tokens.

codex app-server --ws-token-file PATH

Typ / Werte

absolute path

Zweck

Capability token file.

codex app-server --ws-token-sha256 HEX

Typ / Werte

hex SHA-256

Zweck

Expected SHA-256 digest for a token.

codex remote-control

Zweck

Ensure the local app-server daemon is running with remote-control enabled.

codex apply TASK_ID

Typ / Werte

string

Zweck

Apply a Codex Cloud task diff locally.

codex a TASK_ID

Typ / Werte

string

Zweck

Alias for codex apply.

codex archive SESSION

Typ / Werte

session ID | session name

Zweck

Archive a saved session by ID or name.

codex unarchive SESSION

Typ / Werte

session ID | session name

Zweck

Restore an archived session by ID or name.

codex archive --remote ENDPOINT SESSION

Typ / Werte

endpoint

Zweck

Connect to remote app-server before changing archive state.

codex cloud

Zweck

Browse or run Cloud tasks from the terminal.

codex cloud exec QUERY

Typ / Werte

string

Zweck

Submit a Cloud task directly.

codex cloud exec --attempts N

Typ / Werte

1-4

Zweck

Set the number of assistant attempts.

codex cloud exec --env ENV_ID

Typ / Werte

ENV_ID

Zweck

Target a Codex Cloud environment.

codex cloud list

Zweck

List recent Cloud tasks.

codex cloud list --cursor VALUE

Typ / Werte

string

Zweck

Use a pagination cursor.

codex cloud list --env ENV_ID

Typ / Werte

ENV_ID

Zweck

Filter by environment.

codex cloud list --json

Typ / Werte

boolean

Zweck

Emit JSON output.

codex cloud list --limit N

Typ / Werte

1-20

Zweck

Limit the number of tasks returned.

codex cloud-tasks

Zweck

Alias for codex cloud.

codex resume

Zweck

Resume an interactive session.

codex resume SESSION_ID

Typ / Werte

uuid

Zweck

Resume a specific interactive session.

codex resume --all

Typ / Werte

boolean

Zweck

Show sessions outside the current directory.

codex resume --last

Typ / Werte

boolean

Zweck

Resume the most recent session.

codex fork

Zweck

Fork a previous session into a new thread.

codex fork SESSION_ID

Typ / Werte

uuid

Zweck

Fork a specific session.

codex fork --all

Typ / Werte

boolean

Zweck

Show sessions outside the current directory.

codex fork --last

Typ / Werte

boolean

Zweck

Fork the most recent session.

Nicht interaktiver Modus

codex exec Optionen

Diese Flags werden genutzt, wenn Codex als einmaliger Befehl im Terminal, Skript oder in Automatisierung läuft.

--cd, -C

Typ / Werte

path

Zweck

Set the workspace root.

--color

Typ / Werte

always | never | auto

Zweck

Control ANSI color output.

--dangerously-bypass-approvals-and-sandbox

Typ / Werte

boolean

Zweck

Disable approvals and sandboxing.

--yolo

Typ / Werte

boolean

Zweck

Alias for dangerous bypass mode.

--dangerously-bypass-hook-trust

Typ / Werte

boolean

Zweck

Run hooks without persisted trust.

--ephemeral

Typ / Werte

boolean

Zweck

Do not persist session rollout files.

--full-auto

Typ / Werte

boolean

Zweck

Deprecated compatibility option.

--ignore-rules

Typ / Werte

boolean

Zweck

Do not load execpolicy rule files.

--ignore-user-config

Typ / Werte

boolean

Zweck

Do not load user config.

--image, -i

Typ / Werte

path[,path...]

Zweck

Attach images to the first message.

--json

Typ / Werte

boolean

Zweck

Emit NDJSON events.

--experimental-json

Typ / Werte

boolean

Zweck

Older alias for JSON event output.

--model, -m

Typ / Werte

string

Zweck

Override the model.

--oss

Typ / Werte

boolean

Zweck

Use a local OSS model provider.

--output-last-message, -o

Typ / Werte

path

Zweck

Write the final assistant message to a file.

--output-schema

Typ / Werte

path

Zweck

Validate the final output against a JSON Schema.

--profile, -p

Typ / Werte

string

Zweck

Load a config profile.

--sandbox, -s

Typ / Werte

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

Zweck

Choose the sandbox policy.

--skip-git-repo-check

Typ / Werte

boolean

Zweck

Allow running outside a Git repository.

--config, -c

Typ / Werte

key=value

Zweck

Override config inline.

PROMPT

Typ / Werte

string | -

Zweck

Initial instruction. Use - to read from stdin.

Interaktive TUI

Integrierte Slash Commands

Geben Sie / im Codex Composer ein, um das Slash-Command-Popup zu öffnen.

/permissions

Set what Codex may do without asking.

/ide

Include IDE context such as open files and selection.

/keymap

Remap TUI keyboard shortcuts.

/vim

Toggle Vim mode for the composer.

/sandbox-add-read-dir

Add sandbox read access to a directory on Windows.

/agent

Switch the active agent thread.

/apps

Browse apps or connectors and insert one into the prompt.

/plugins

Browse installed and discoverable plugins.

/hooks

Review lifecycle hooks.

/clear

Clear the terminal and start a fresh chat.

/archive

Archive the current session and exit Codex.

/compact

Summarize visible conversation to free tokens.

/copy

Copy the latest completed Codex output.

/diff

Show Git diff, including untracked files.

/exit

Exit the CLI.

/experimental

Toggle experimental features.

/approve

Approve one retry after an auto-review denial.

/memories

Configure memory usage and generation.

/skills

Browse and use skills.

/feedback

Send logs to Codex maintainers.

/init

Generate an AGENTS.md scaffold.

/logout

Sign out of Codex.

/mcp

List configured MCP tools.

/mcp verbose

Show MCP server details.

/mention

Attach a file or folder to the conversation.

/model

Choose model and reasoning effort.

/fast

Toggle or inspect the Fast service tier.

/plan

Switch to plan mode.

/goal

Set, view, pause, resume, or clear a goal.

/personality

Choose communication style.

/ps

Show experimental background terminals.

/stop

Stop all background terminals.

/fork

Fork the current conversation into a new thread.

/side

Start an ephemeral side conversation.

/btw

Start a short side conversation.

/raw

Toggle raw scrollback mode.

/resume

Resume a saved conversation.

/new

Start a new conversation in the same CLI session.

/quit

Exit the CLI.

/review

Ask Codex to review the working tree.

/status

Display session config and token usage.

/debug-config

Print config-layer diagnostics.

/statusline

Configure TUI status-line fields.

/title

Configure terminal title fields.

/theme

Choose syntax-highlighting theme.

Häufige Formen

/fast on

Turn the Fast tier on.

/fast off

Turn the Fast tier off.

/fast status

Show Fast tier status.

/personality friendly

Use the friendly communication style.

/personality pragmatic

Use the pragmatic communication style.

/personality none

Disable personality styling.

/goal <objective>

Set a task goal.

/goal pause

Pause the current goal.

/goal resume

Resume the current goal.

/goal clear

Clear the current goal.

/prompts:<name>

Run a local custom prompt. Custom prompts are deprecated in favor of skills.

Lokale Erweiterungen

Die integrierten Slash Commands sind begrenzt, aber installierte Skills, Plugins, MCP Server und veraltete /prompts:*-Dateien können lokale Fähigkeiten ergänzen.

Quellen

Offizielle Dokumentation

Befehlsnamen, Flags, Reifegradlabels und Slash-Command-Abdeckung basieren auf der offiziellen OpenAI Codex CLI-Dokumentation.

Hinweis

Diese Seite ist eine Kurzreferenz, keine vollständige Wiedergabe der offiziellen Dokumentation.