Codex CLI-Referenz mit Grundbefehlen, wichtigen Optionen, Einrichtung und praktischen Workflows
Switch between Core Commands, Key Options, Setup, and Workflow Examples to focus on the commands you need.
Use keyword search to match command names, option notes, and example commands at once.
Copy the command snippet with one click, then run it directly in your terminal.
codexLaunch interactive mode in the current directory.codex "Summarize this repository structure"Start a session with a task-focused prompt.codex exec "Review this PR diff"Run a one-shot review task from the CLI.cat plan.md | codex exec -Read instructions from stdin.codex review --uncommittedReview local changes before committing.codex review --base mainReview changes against main branch.codex resume --lastContinue the latest session quickly.codex resume <SESSION_ID>Resume a specific saved session.codex fork --lastVerzweigt die letzte Sitzung und arbeitet in neuer Richtung weiter.codex fork <SESSION_ID> "Versuche eine alternative Implementierung"Startet einen neuen Zweig aus einer bestimmten Sitzung.codex apply <TASK_ID>Wendet den neuesten Diff der angegebenen Task an.codex cloud diff <TASK_ID>Zeigt den Patch vor dem lokalen Anwenden an.codex cloud listZeigt verfügbare Cloud-Tasks an.codex cloud diff <TASK_ID>Zeigt den Diff vor lokaler Anwendung.codex appStartet die App (oder installiert und startet sie).codex app --helpPrüft Plattformunterstützung und Startoptionen.codex exec --profile fast "Inspect routing"Run a low-cost analysis task.codex exec --profile deep "Design refactor plan"Use deeper reasoning for architecture tasks.codex exec --sandbox read-only "List potential bugs"Analyze code without changing files.codex exec --sandbox workspace-write "Apply the fix"Allow edits in the current workspace.codex -a on-requestStart interactive mode with request-based approvals.codex exec -a never "Run checks and summarize"Use no-approval policy for scripted runs.codex exec --full-auto "Implementiere und teste diesen Fix"Startet mit anfragebasierten Freigaben und workspace-write.codex resume --last --full-autoSetzt die letzte Sitzung mit denselben Defaults fort.codex --search "Check latest framework changes"Start with web search enabled.codex resume --last --searchContinue the latest session with web search.codex -c model="gpt-5-codex"Launch with a specific model override.codex exec -c 'sandbox_permissions=["workspace-write"]' "Explain risk"Override sandbox permissions inline.printenv OPENAI_API_KEY | codex login --with-api-keyLogin non-interactively with environment variable.codex login --device-authStart interactive device authentication.codex mcp add docs -- command --flagRegister a new MCP server command.codex mcp get docsInspect details of a configured MCP server.codex mcp-serverStartet den MCP-Server-Modus auf stdio.codex mcp-server -c model="gpt-5-codex"Startet mit einer einmaligen Konfigurationsüberschreibung.codex features listPrüft gestufte und experimentelle Flags vor der Aktivierung.codex features enable <feature_name>Aktiviert ein Feature-Flag in der lokalen Codex-Konfiguration.codex completion zsh > ~/.zsh/completions/_codexInstall zsh completion manually.codex completion fish > ~/.config/fish/completions/codex.fishInstall fish completion script.codex exec --profile fast --sandbox read-only "Find dead code candidates"Run static analysis without editing files.codex exec --profile fast --sandbox read-only "Map i18n key usage"Inspect translation usage safely.codex exec --profile default --sandbox workspace-write "Implement tooltip improvements"Run a typical implementation task.codex exec --profile default --sandbox workspace-write "Update docs and tests"Apply code and documentation updates together.codex review --uncommittedRun a quick local review pass.codex review --uncommitted --title "before-merge-check"Attach a custom review title.codex exec --json -o result.json "List migration risks"Capture structured events and final summary.codex exec --json "Generate release notes draft"Use JSONL stream in custom tooling.This page consolidates Codex CLI essentials into one searchable reference so you can move from lookup to execution quickly.
It covers Codex CLI basics, major options, setup commands, and reusable workflow examples in a single searchable view.
Examples are templates. Replace placeholder prompts and choose sandbox/approval settings appropriate for your environment.
Review after CLI updates and when your team changes profiles, sandbox policies, or automation scripts.
Yes. Each card has a copy button that copies the command string so you can paste it into your terminal immediately.