October 23, 2026

Codex CLI installieren und einrichten

Codex CLI ist der Open-Source-Coding-Agent von OpenAI für das Terminal. Diese Anleitung behandelt alle Installationsmöglichkeiten für Codex CLI unter macOS, Linux und Windows, die Anmeldung, deine erste Sitzung, die Konfiguration und die Aktualisierung. Danach erfährst du, wie du Codex neben Claude Code in Chief nutzt.

Schnellinstallation

PlattformBefehl
macOS und Linuxcurl -fsSL https://chatgpt.com/codex/install.sh | sh
Windows (PowerShell)powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"
npm (jede Plattform)npm install -g @openai/codex
Homebrewbrew install --cask codex

Führe dann codex in deinem Projektordner aus und wähle Sign in with ChatGPT.

Die Befehle stammen aus dem Codex-README und der Dokumentation von OpenAI, geprüft im Oktober 2026. Den aktuellen Stand findest du in der Codex-Dokumentation von OpenAI.


Schritt 1: Codex CLI installieren

macOS und Linux

Der eigenständige Installer von OpenAI ist der empfohlene Weg, Codex CLI unter macOS und Linux zu installieren:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

Codex CLI unterstützt macOS auf Apple Silicon und Intel sowie Linux auf x86_64 und arm64.

Du nutzt lieber einen Paketmanager? Dann verwende Homebrew:

brew install --cask codex

oder npm:

npm install -g @openai/codex

Du kannst auch auf der Seite Codex-GitHub-Releases ein Binary für deine Plattform herunterladen und es in codex umbenennen.

Windows

Codex CLI läuft nativ unter Windows. Um Codex CLI unter Windows zu installieren, führe Folgendes in PowerShell aus:

powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"

Unter Windows nutzt Codex standardmäßig eine native Windows-Sandbox, du brauchst also weder WSL noch eine virtuelle Maschine. OpenAI schlägt WSL2 vor, wenn du Linux-native Tools brauchst oder dein Workflow bereits dort läuft. Installiere Codex in diesem Fall innerhalb von WSL mit dem obigen Befehl für macOS und Linux.

Installation prüfen

codex --version

Wenn etwas nicht richtig aussieht, prüft codex doctor deine Installation, Konfiguration, Anmeldung und den Zustand der Laufzeitumgebung.

Schritt 2: Anmelden

Führe codex in einem beliebigen Ordner aus. Beim ersten Start wirst du gebeten, eine Anmeldemethode zu wählen:

  • Sign in with ChatGPT nutzt deinen ChatGPT-Plan, die Codex-Nutzung ist also in deinem Abo enthalten. Das ist die empfohlene Option für die Pläne Plus, Pro, Business, Edu und Enterprise.
  • Sign in with an API key rechnet die Nutzung über dein OpenAI-API-Konto ab.

Du kannst dich auch über die Kommandozeile anmelden:

codex login                                            # browser sign-in
printenv OPENAI_API_KEY | codex login --with-api-key   # API key from stdin
codex login --device-auth                              # device code, for remote or headless machines
codex login status                                     # show the active sign-in
codex logout                                           # clear stored credentials

Auf einem Server oder einem Rechner ohne Browser empfiehlt OpenAI die Anmeldung per Gerätecode. Codex speichert die Zugangsdaten in ~/.codex/auth.json oder im Anmeldedatenspeicher deines Betriebssystems.

Schritt 3: Deine erste Sitzung starten

Öffne dein Projekt und starte Codex:

cd my-project
codex

Gib eine Aufgabe in natürlicher Sprache ein, etwa „Füge dem Registrierungsformular eine Eingabevalidierung und einen Test dafür hinzu“. Ein paar Slash-Befehle lohnt es sich, schon am ersten Tag zu kennen:

BefehlFunktion
/initErstellt eine AGENTS.md-Datei mit Anweisungen für Codex
/modelWählt das Modell und den Reasoning-Aufwand
/permissionsLegt fest, was Codex ohne Nachfrage tun darf
/statusZeigt die aktuelle Sitzungskonfiguration
/reviewPrüft deine Änderungen und findet Probleme

In AGENTS.md erklärst du Codex, wie dein Projekt funktioniert: wie die Tests laufen, welche Konventionen gelten und was zu vermeiden ist. Führe /init einmal aus und bearbeite das Ergebnis.

Schritt 4: Berechtigungen und Standardwerte festlegen

Codex fragt nach, bevor es Dateien bearbeitet oder Befehle außerhalb der von dir gesetzten Grenzen ausführt. Du kannst das pro Sitzung mit /permissions ändern oder Codex mit Flags starten:

codex --sandbox workspace-write --ask-for-approval on-request

Die Sandbox-Modi sind read-only, workspace-write und danger-full-access. Für dauerhafte Standardwerte setzt du dieselben Optionen in ~/.codex/config.toml:

model = "gpt-6.1-sol"
approval_policy = "on-request"
sandbox_mode = "workspace-write"

Mit codex --profile <name> legst du ein benanntes Profil über deine Basiskonfiguration, zum Beispiel ein Profil für sorgfältige Arbeit und ein anderes für schnelle Experimente.

Schritt 5: Codex CLI aktualisieren

Codex wird häufig aktualisiert. Am einfachsten aktualisierst du so:

codex update

Oder aktualisiere mit dem Tool, mit dem du Codex installiert hast:

curl -fsSL https://chatgpt.com/codex/install.sh | sh   # standalone installer: rerun it
npm install -g @openai/codex@latest                    # npm
brew upgrade --cask codex                              # Homebrew

Führe danach codex --version aus, um die neue Version zu bestätigen.

Nützliche Codex-CLI-Befehle

BefehlFunktion
codexStartet eine interaktive Sitzung
codex exec "<task>"Führt eine Aufgabe nicht interaktiv aus, für Skripte und CI
codex reviewFührt ein Code-Review nicht interaktiv aus
codex resumeSetzt eine frühere Sitzung fort (--last für die neueste)
codex --worktreeFührt die Sitzung in einem neuen Git-Worktree aus
codex mcpVerwaltet MCP-Server
codex appStartet die Codex-Desktop-App

Codex neben Claude Code in Chief nutzen

Sobald Codex CLI installiert und angemeldet ist, ist es bereit für Chief. Chief ist ein KI-Agenten-Manager: Du setzt ein Ziel, Chief plant es als Meilensteine und führt jeden davon mit dem Agenten deiner Wahl aus.

  • Codex und Claude Code in einem Plan. Lege pro Projekt einen Standard-Agenten fest und wähle für jeden Meilenstein Codex oder Claude Code. In Claude Code vs. Codex erfährst du, wo die Stärken der beiden liegen.
  • Nutzt das Codex, das du gerade installiert hast. Das Chief-Relay läuft unter macOS, Linux und Windows und startet codex auf deinem Rechner, angemeldet mit deinem eigenen ChatGPT-Konto. Dein Code bleibt, wo er ist.
  • Unabhängige Arbeit läuft parallel. Chief führt alle Meilensteine, deren Abhängigkeiten erledigt sind, gleichzeitig aus und prüft jedes Ergebnis anhand seiner Definition of Done.
  • Mit Chief aus Codex heraus sprechen. Füge den MCP-Server von Chief mit codex mcp hinzu und frag, was auf eine Aktion von dir wartet, ohne deine Sitzung zu verlassen.

Codex mit Chief nutzen. Kostenlos starten →

Mehr zur Kombination: Chief + Codex.


FAQ

Wie installiere ich Codex CLI?

Unter macOS und Linux führst du curl -fsSL https://chatgpt.com/codex/install.sh | sh aus. Unter Windows führst du den PowerShell-Installer aus. Du kannst auch npm install -g @openai/codex oder brew install --cask codex verwenden. Führe dann codex aus und melde dich an.

Funktioniert Codex CLI unter Windows?

Ja. Codex CLI läuft nativ unter Windows mit einer Windows-Sandbox, WSL ist also nicht erforderlich. Wenn deine Tools Linux-nativ sind, kannst du trotzdem WSL2 nutzen.

Wie aktualisiere ich Codex CLI?

Führe codex update aus oder aktualisiere mit dem Tool, mit dem du Codex installiert hast: Führe das Installationsskript erneut aus oder nutze npm install -g @openai/codex@latest bzw. brew upgrade --cask codex.

Ist Codex CLI kostenlos?

Codex CLI ist Open Source unter der Apache-2.0-Lizenz. Für die Nutzung brauchst du einen ChatGPT-Plan, der Codex enthält, oder einen OpenAI-API-Key, der pro Token abgerechnet wird. Die aktuellen Pläne findest du auf der Preisseite von OpenAI.

Brauche ich Node.js, um Codex CLI zu installieren?

Nein. Die eigenständigen Installer und Homebrew brauchen kein Node.js. Node.js brauchst du nur, wenn du mit npm installierst.

Kann ich Codex CLI und Claude Code zusammen nutzen?

Ja. Gib jedem einen eigenen Branch oder Git-Worktree, damit sie nicht dieselben Dateien bearbeiten, oder lass Chief die Arbeit planen und jeden Meilenstein an den Agenten deiner Wahl senden.

More articles

AI Agent Orchestration Guide

What AI agent orchestration is, how multi-agent orchestration works for Claude Code and Codex, and a comparison of orchestration approaches. Free guide.

What Is Agentic Engineering?

Agentic engineering means directing AI coding agents that write and test code while you set goals and review results. How it differs from agentic coding.

AI Code Review at Scale

What AI code review is, the main types of AI code review tools, and five workflows for reviewing AI-generated code from several coding agents at once.

Claude Code and Codex Pricing

Claude Code pricing from $20/mo (Pro) to $200/mo (Max 20x), Codex pricing from ChatGPT Free to Pro, usage limits and a comparison table, checked Oct 2026.

From Single Agent to Multi-Agent

Already using one AI coding agent? Here's how to scale to multiple instances running in parallel — the concurrency patterns, worktree isolation, and task decomposition strategies that make it work.

Vibe Coding at Scale

Vibe coding with one agent is fun. Vibe coding with five is chaos — unless you have orchestration. Here's how to scale the vibe without losing the quality.

Why AI Agents Need an Orchestration Layer

Running AI coding agents in terminal tabs works for two. Five signs you've outgrown it, tabs vs an orchestration layer, and what to look for in one.

Multi-Provider AI Orchestration

Claude Code, Codex, Cursor, Aider — each excels at different work. Here's how to combine providers into one coordinated workflow and why cross-provider review catches bugs single-provider setups miss.

Use Chief From Your AI Assistant

Add Chief's remote MCP server to Claude, Claude Code or Codex. Ask what's waiting on you, catch up on what shipped and propose milestones from chat.

Claude Code vs Codex: When to Use Each

Codex vs Claude Code: when each fits, a comparison table and FAQ. Claude Code vs Codex isn't either-or; Chief runs both on your projects.

Claude Code vs Cursor: When to Use Each

Cursor vs Claude Code: when each fits, a comparison table and FAQ. Claude Code vs Cursor isn't either-or; keep Cursor and let Chief run Claude Code.

How to Run Multiple Claude Code Agents in Parallel

Run multiple Claude Code agents in parallel, step by step: worktrees, background agents, subagents and review. Then let Chief orchestrate them for you.

Git Worktrees for AI Coding Agents

How to use git worktrees with Claude Code and Codex: one per agent, parallel runs, .env files, merging and cleanup. Every command, step by step.

How to Run Claude Code From Your Phone

Run Claude Code from your phone: Remote Control, cloud sessions in the Claude mobile app, or SSH and tmux, step by step. Plus approving agents in Discord.

The Best AI Coding Agents in 2026

The best AI coding agents of 2026: Claude Code, Codex, Cursor, Copilot and more agentic AI coding tools compared, and how to run several with Chief.

Subagents vs Parallel Agents

What is a subagent? How Claude Code subagents and Codex subagents work, how they differ from parallel agents, and when to use each one.

Ready to manage your agents?

_Codex ist eine Marke von OpenAI. Claude Code ist eine Marke von Anthropic. Chief ist ein unabhängiges Produkt und steht in keiner Verbindung zu einem der beiden Unternehmen, wird von keinem gesponsert und von keinem empfohlen._