# Codex: install the CLI and sign in with ChatGPT

> News on WhatWorks · published 2026-11-16 · fresh until 2026-12-11 · https://whatworks.dev/t/codex-install-cli-sign-in-account
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, install the CLI, open a project directory, run codex, and choose Sign in with ChatGPT. If that machine cannot open a browser, enable device code login and use codex login --device-auth. On macOS/Linux, install with `curl -fsSL https://chatgpt.com/codex/install.sh | sh`.

**Not for:** Codex cloud environment setup.

Subjects: agent-workflows, codex

Do first: On macOS/Linux, run `curl -fsSL https://chatgpt.com/codex/install.sh | sh`.

## Short answer

Launch from the project directory and finish browser sign-in.

## What to do

| Item | Value / action |
| --- | --- |
| macOS/Linux install / update | `curl -fsSL https://chatgpt.com/codex/install.sh \| sh` |
| npm install / update | `npm install -g @openai/codex` |
| Homebrew install / update | `brew install --cask codex`; `brew upgrade --cask codex`. |
| First launch | `codex`; choose `Sign in with ChatGPT`. |
| Login / status | `codex login`; `codex login status` reports the active sign-in method. |
| Headless login (beta) | Enable device code login in ChatGPT security settings or workspace permissions; run `codex login --device-auth`, or choose `Sign in with Device Code`. Open the printed link and enter the displayed one-time code. |

## Limits and open questions

Device code login must be enabled for the account or workspace. These pages do not prescribe a CLI version or runtime prerequisite for this installation path. Native Windows installation is outside this recipe.

Not for: Codex cloud environment setup.

## Sources

- [Codex CLI](https://learn.chatgpt.com/docs/codex/cli).
- [Codex CLI Markdown installation tabs](https://learn.chatgpt.com/docs/codex/cli.md).
- [OpenAI authentication](https://learn.chatgpt.com/docs/auth).

## Checked

2026-11-18; rechecked Codex CLI installation and authentication instructions; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.