Install Codex CLI for Teams
Install Codex CLI with AGENTS.md, MCP boundaries, and a verification loop your team can reuse for reviewable diffs.

Install the Codex CLI with the official OpenAI package, verify the version, then run it inside a real repository with team instructions and tests. OpenAI Codex, OpenAI’s coding agent for software work, is most useful when the install is paired with AGENTS.md, MCP boundaries, and a repeatable verification loop.
Codex CLI is the terminal interface for running Codex workflows from your local development environment. As of June 18, 2026, the official Codex changelog lists Codex CLI 0.141.0; use that release as a checkpoint to refresh your openai codex cli setup, not as a reason to skip normal review.
Install the CLI and prove it works
Start with the official install path from OpenAI’s Codex CLI docs. On a typical Node-based workstation, that means installing the package globally, then opening a repository and launching codex from the project root.
npm install -g @openai/codex
codex --version
codex
When someone asks how to install codex cli, the team answer should include one extra step: confirm the CLI runs in the same shell where developers build and test production code. A clean install that only works in a demo folder is not enough.
The trap is letting every developer improvise their own setup. Pin the expected version in your onboarding notes, ask people to paste codex --version during rollout, and keep the official changelog as the source of truth for itemized 0.141.0 changes.
Add an AGENTS.md before the first serious task
Create an AGENTS.md at the repo root before handing Codex a production task. This file gives the codex agent durable instructions about architecture, commands, style, and review expectations.
A useful first version is short. For example, a Rails app might say: use service objects for external API calls, do not edit migrations after they are merged, run bundle exec rspec for touched areas, and include screenshots for UI changes.
The trap is turning AGENTS.md into a motivational poster. Codex does not need vague values like write clean code. It needs repo-specific constraints, names of test commands, and the places where humans want a pause before editing.
Nested files are often better than one giant root file. A frontend/AGENTS.md can explain React conventions, while infra/AGENTS.md can warn Codex not to change Terraform state paths without an explicit human approval.
Connect MCP only where it changes the answer
Model Context Protocol, or MCP, is an integration layer that lets tools expose external systems such as GitHub, issue trackers, document stores, databases, and private knowledge bases to coding agents. In a codex mcp workflow, the goal is not more context; the goal is better-grounded changes.
Start with one integration that removes real friction. A good first MCP server might expose GitHub issues so Codex can read the acceptance criteria before editing code, or a docs store so it can follow your internal API rules.
The trap is connecting everything at once. Each integration changes the risk surface. Write a small boundary note in AGENTS.md: which systems Codex may read, which systems it may write to, and which actions require a human to run the final command.
For example, it is reasonable to let Codex read a Jira ticket and linked design notes. It is usually not reasonable to let any agent deploy, rotate secrets, or write production database rows without a separate approval path.
Use a verification loop, not a vibe check
After installation, run Codex through a small production-shaped task. Ask it to make one contained change, show the diff, run the repo’s tests, fix failures, and summarize what changed.
A solid Codex CLI verification loop looks like this: describe the task, let Codex inspect the repo, approve the plan, review the patch, run tests, then ask for a final summary with files changed and commands run. This is the habit that turns codex workflows into reviewable engineering work.
The trap is accepting a plausible explanation instead of a verified diff. For Codex CLI training, make the proof boring: the changed files are visible, the commands are named, and the reviewer can reproduce the result.
If the task touches a risky path, narrow the scope. Ask Codex to modify one function, one test file, or one feature flag path first. Small diffs make the codex team faster because reviewers spend less time guessing what happened.
Keep rollout small and reviewable
Treat Codex CLI 0.141.0 like any other developer-tool update. Roll it to a few engineers first, collect one or two real diffs, update the checklist, then expand to the rest of the team.
This is especially important for codex for engineering teams because the CLI sits inside existing habits: branches, pull requests, CI, code owners, and incident rules. A good rollout respects those habits instead of replacing them.
The trap is measuring success by how many tasks Codex attempted. Measure the healthier signals: fewer unclear PRs, better test notes, faster local reproduction, and fewer review comments asking where a change came from.
For a deeper training path, pair this setup with the related training topic. It keeps the focus on practical Codex CLI workflows rather than one-off prompts.
Copyable Codex rollout checklist
# Codex CLI team rollout checklist
## Install
- [ ] Install Codex CLI from the official OpenAI docs.
- [ ] Run `codex --version` and record the expected team version.
- [ ] Confirm `codex` launches from the repository root.
- [ ] Add the install command and version check to onboarding docs.
## Repository instructions
- [ ] Add a root `AGENTS.md` with build, test, style, and review rules.
- [ ] Add nested `AGENTS.md` files for areas with different conventions.
- [ ] Name commands exactly as humans run them locally.
- [ ] Mark risky paths that require human approval before editing.
## MCP boundary
- [ ] Start with one MCP integration that removes a real workflow gap.
- [ ] Document read-only systems and write-capable systems separately.
- [ ] Keep deploys, secrets, and production data behind human approval.
- [ ] Review MCP permissions during each CLI version rollout.
## Verification loop
- [ ] Ask Codex for a plan before broad edits.
- [ ] Review the diff before accepting the result.
- [ ] Run the smallest relevant test command first.
- [ ] Run the broader test or CI path before merging.
- [ ] Ask Codex to summarize files changed, commands run, and remaining risks.
## Pull request review
- [ ] Keep the first team tasks small enough to review in one sitting.
- [ ] Require test output or a clear reason tests were not run.
- [ ] Ask reviewers to flag unclear agent changes, not just broken code.
- [ ] Update `AGENTS.md` when the same correction appears twice.
Common questions
-
How do I install Codex CLI on a new machine?
Install Codex CLI from OpenAI’s official CLI docs, then run
codex --versionand launchcodexfrom your repository root. The install command many teams use isnpm install -g @openai/codex, but the docs should remain your source of truth because package and authentication details can change. -
Should AGENTS.md live at the root or inside folders?
Use a root
AGENTS.mdfor rules that apply everywhere, then add nested files for local conventions. One root file is enough for a small repo; larger production codebases usually need folder-level instructions so frontend, backend, data, and infrastructure work do not share the wrong assumptions. -
Do we need MCP before Codex is useful?
No, Codex CLI can be useful without MCP when the repo and prompt contain enough context. Add MCP when an external system changes the quality of the answer, such as linked GitHub issues, internal API docs, or design notes that Codex would otherwise have to guess from memory.
-
What should we check after upgrading to Codex CLI 0.141.0?
Check the official changelog, confirm
codex --version, rerun one known repository task, and compare the diff quality against your previous baseline. The important artifact is not a screenshot of the version; it is a reviewed patch with named tests and a clear summary. -
Is the Codex GitHub repo useful for team setup?
Yes, the Codex GitHub repository is useful for understanding the CLI project surface and following product-owned updates. For day-to-day rollout, pair it with your own
AGENTS.md, onboarding checklist, MCP permission notes, and pull request review rules.
Further reading
- OpenAI Developers — Codex quickstart
- OpenAI Developers — Codex CLI
- OpenAI Developers — Codex CLI features
- OpenAI Developers — Codex slash commands
- Model Context Protocol — specification
- GitHub — openai/codex
- GitHub — openai/skills
- OpenAI Developers — Codex changelog
Start with one real repo
Install the CLI, add a small AGENTS.md, and ask Codex to make one reviewable change with tests. If that loop feels boring and reproducible, your team is ready to expand it.
One methodology lens
One useful way to read this through our methodology is the Plan step: delegate first-pass decomposition and dependency mapping, review the sequencing and assumptions, and keep ownership of scope and priorities. If that split is still fuzzy, the workflow usually is too.
Related training topics
Related research

What Dan Luu Learned About Agentic Coding
Dan Luu published field notes on coding with AI agents. This piece explains what he found and why bounded loops keep Codex work reviewable.

AI Code Review Tools Need Receipts
A practical read on the workflow, tradeoffs, and next steps. Read the workflow, review rules, and team training patterns for AI coding tooling.

AI Code Review Workflow for Teams
A practical team convention for reviewing AI-assisted code without slowing delivery or losing ownership.