# Codex CLI setup kit: install notes Checked 2026-10-22 against openai/codex at commit 83086188ae0614bd882818ff1aa23f3194962012 (tag rust-v0.163.0) and the official Codex docs. ## Requirements (from upstream docs/install.md) - macOS 12+, Ubuntu 20.04+ or Debian 10+, or Windows 11 via WSL2 (install doc) - Native Windows is also supported: the README gives a PowerShell installer, and Codex has a native Windows sandbox. WSL1 has been unsupported since 0.115 - 4 GB RAM minimum, 8 GB recommended - Git 2.23+ (optional, recommended) - A ChatGPT plan that includes Codex, or an OpenAI API key (billed at API rates) - For the npm route only: Node.js 16 or later (package engines field) ## Install (pick one) ```bash # Standalone installer, macOS and Linux (also used to update) curl -fsSL https://chatgpt.com/codex/install.sh | sh # npm npm install -g @openai/codex@0.163.0 # Homebrew brew install --cask codex ``` ```powershell # Windows (native) powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex" ``` Check `codex --version` afterwards; this kit was checked against codex-cli 0.163.0. To update later, rerun the installer or run `codex update`. A pinned npm install (`npm install -g @openai/codex@`) keeps you on an exact release. Updating moves you off this kit's pin, so re-check flags. ## Sign in ```bash codex login # browser sign-in with ChatGPT printenv OPENAI_API_KEY | codex login --with-api-key # or an API key from stdin codex login status # confirm which method is active ``` On a headless machine, `codex login --device-auth` is the documented route (beta). Turn on device code login in your ChatGPT security settings first, or ask your workspace admin to allow it. Credentials are cached in `~/.codex/auth.json` or the OS credential store. Treat that file like a password. ## Start the first session ```bash cd /path/to/your-repo git status # start clean, or know what is already changed codex --sandbox workspace-write --ask-for-approval on-request ``` Or, with the kit profile saved as `~/.codex/first-run.config.toml`, run `codex --profile first-run`. Then type `/status` to confirm the sandbox, approval policy and writable roots before giving the task.