{"schema_version":"1.2","slug":"openai-codex-cli","url":"https://www.launchpadhq.io/platform/openai-codex-cli/guide","data_url":"https://www.launchpadhq.io/data/v1/guides/openai-codex-cli.json","title":"Getting Started with OpenAI Codex CLI","tagline":"OpenAI's coding assistant for the command line: your machine, one project folder, paid for by your ChatGPT sign-in.","archetype":"prompts","last_reviewed_at":"2026-09-08","changelog_url":"https://github.com/openai/codex/releases","how_it_works":"You open a project folder on your computer and start Codex in a terminal (a text window where you type instructions instead of clicking). Describe the change you want in plain English. It reads the files, shows you the edits and commands it proposes, and waits for your approval. You read the result and say what to fix.","what_it_is":["Codex CLI is OpenAI's coding agent — AI that takes actions on its own rather than only answering — running on your own machine: it opens your real files and runs commands rather than handing you code to paste.","It is one front door onto one product: Codex also lives in the ChatGPT app, a VS Code extension and a desktop app. The CLI is the one you drive where the code sits.","The name is recycled, so older search results mislead: the 2021 \"Codex\" was a model OpenAI sold through its API and retired in March 2023. Today's is a different thing, a coding agent from 2025."],"before_you_start":["The entry requirement is code already on your disk and comfort opening a command line. Never used one? A browser-based coding assistant is the better first step; this will still be here.","You do not buy Codex; you sign in with a ChatGPT account and your plan pays for it. OpenAI's pricing page lists it on every plan including the free one, while its own CLI documentation still says Plus or above — so expect to need a paid plan (Go at $8/month, or Plus at $20/month). Billing your own OpenAI developer account per use is the other route.","Usage runs as rolling five-hour and weekly windows rather than a balance you can watch, and Plus and Pro can buy extra credits instead of upgrading."],"getting_set_up_safely":{"official_source":"OpenAI's official Codex CLI documentation","body":["It installs in one command: use OpenAI's installer, the official Homebrew cask or npm package, or the GitHub releases page — lookalikes exist. On Windows the fence that keeps Codex inside your folder behaves most predictably under WSL2.","Open it in a project that is saved and tracked, with nothing uncommitted — that tracking is how you read back and undo every line it changed.","/permissions sets what it may do: read-only, a workspace default that edits inside the folder you opened and asks first about anything else, or full access, which removes both the fence and the questions — one keystroke, and it stays granted."],"vendor_docs_url":"https://learn.chatgpt.com/docs/cli"},"security":[{"kind":"text","text":"Your code goes to OpenAI's servers to be worked on — the mechanism, not a leak, but the line to check before a client's private project."},{"kind":"list","label":"The setting most people miss","items":["On personal ChatGPT plans OpenAI may train on your Codex content, and its own data-controls FAQ says the opt-out in ChatGPT's settings does not affect Codex's. You turn that off inside Codex.","Everything it reads is input, including text other people wrote: a README can be phrased to steer the agent rather than inform you. The approval prompts are the check on that."]}],"triad":{"best_at":["A change spanning several files, watched and approved step by step","Getting oriented in a project whose build and test commands nobody wrote down","Chores you can describe precisely: tidying, dependency bumps, filling in missing tests"],"okay_at":["Predicting your spend, since usage runs as rolling windows rather than a visible balance","Unattended runs: codex exec works inside a script, but nobody is approving anything"],"avoid":["Depending on a particular Codex model staying put — OpenAI shut off its gpt-5-codex and gpt-5.1-codex variants in July 2026","Code you are not permitted to send off your machine"]},"starter_actions":[{"title":"Start read-only and make it explain the project back to you","what_it_does":null,"why_here":"Codex picks its opening permissions by checking whether the folder is under version control, so your first session may already be allowed to write. Asking a question with /permissions on read-only shows which preset you landed in.","tweak":null,"prompt":"Before changing anything: list the commands this project uses to build, test and run, and name the files you would touch to add one new setting. Do not edit anything."},{"title":"Have it write the project's AGENTS.md, then fix the file by hand","what_it_does":null,"why_here":"Codex reads AGENTS.md before doing any work, merging a global one in ~/.codex with the project's. It is a shared convention with a published spec, not a Codex-only file, so rules you write once travel to other agents.","tweak":"It writes a draft — add your exact test command and anything it must never touch.","prompt":"/init"},{"title":"Give it a build task while the internet is still switched off","what_it_does":null,"why_here":"Codex's fence has network access turned off by default, so this matches what it can actually do: a package it cannot download becomes a question, not an install you find later.","tweak":null,"prompt":"Add [the feature] using only what is already in this project — do not add a dependency. If you need something that is not here, stop and tell me what and why."}],"pitfalls":["Following instructions written for a different Codex: the CLI, the ChatGPT app and the editor extension are three front doors onto one product, and anything from before 2025 describes the retired model.","Turning off model training in ChatGPT and believing Codex is covered. It keeps its own setting."],"where_to_next":[{"label":"Other coding agents and assistants","url":"https://www.launchpadhq.io/discover?category=ai-coding-development"},{"label":"Developer APIs and services","url":"https://www.launchpadhq.io/discover?category=ai-apis-developer-services"},{"label":"Run models on your own machine","url":"https://www.launchpadhq.io/discover?category=local-open-source-ai"}],"tool":{"slug":"openai-codex-cli","name":"OpenAI Codex CLI","url":"https://www.launchpadhq.io/platform/openai-codex-cli","data_url":"https://www.launchpadhq.io/data/v1/tools/openai-codex-cli.json","category":{"slug":"ai-coding-development","name":"AI Coding & Development"},"cost_tier":"FREE","lifecycle":"active","free_tier":{"available":true,"summary":"Free and open-source; uses your own OpenAI API key"},"starting_price":"Free","lowest_paid":null,"data_as_of":null},"prices_removed":0,"pricing_note":"Prices in this text come from the catalog, the same data as each tool's page and its record (tool.starting_price, tool.lowest_paid, and plans in /data/v1/tools/{slug}.json). Any sentence that typed a price by hand is removed; prices_removed counts them.","generated_at":"2026-10-27T01:59:10.743Z","sponsored":false,"attribution":"Data from Launchpad HQ (https://www.launchpadhq.io). Please credit Launchpad HQ and link to the tool's Launchpad HQ page."}