Two terminal agents with different home bases
GitHub Copilot CLI brings Copilot's agent to the terminal. GitHub's docs say you can use it to answer questions, write and debug code, and work with GitHub.com, for example by making changes in a project and opening a pull request. It is included with all Copilot plans. If you get Copilot through an organization, an admin has to enable the Copilot CLI policy first. It runs on Linux, macOS and Windows (PowerShell and WSL).
Codex is OpenAI's coding agent. The CLI is one of several surfaces: Codex also runs in the ChatGPT desktop app, on the web, in an IDE extension and on iOS, and it offers cloud integrations such as automatic code review and Slack. The Codex CLI is open source under the Apache-2.0 licence in the openai/codex repository on GitHub.
Models
Copilot CLI is multi-vendor. You switch models with /model or --model, and GitHub's supported-models reference lists Anthropic Claude, OpenAI GPT, Google Gemini and xAI Grok models. GitHub says the latest models support a 1 million token context window and configurable reasoning levels, both of which consume more AI credits. You can also point Copilot CLI at your own provider: an OpenAI-compatible endpoint (including Ollama or vLLM), Azure OpenAI or Anthropic, configured through environment variables. The model must support tool calling and streaming.
Codex runs OpenAI models. With ChatGPT sign-in, Plus and higher plans get GPT-6.1 Sol and GPT-6 Luna, and the usage table also lists GPT-6 Astra and GPT-6 Sol. You choose the model and reasoning effort with /model or --model, and an Ultra mode splits larger tasks across subagents. GPT-5.5 was retired from Codex for ChatGPT sign-in on October 14, 2026, though API-key sessions are unaffected. With an API key, model availability follows the API models your key can access.
Pricing
Copilot CLI is billed through GitHub AI credits, consumed by the tokens each interaction processes. Copilot Free gives an allowance with Auto model selection only, and Copilot Student is free. Copilot Pro is $10 per month with 1,500 total monthly credits (1,000 base plus 500 flex), Pro+ is $39 with 7,000, and Max is $100 with 20,000. For organizations, Business is $19 per granted seat per month with 1,900 credits per user, and Enterprise is $39 per seat with 3,900. GitHub says verified teachers and maintainers of popular open source projects may be eligible for free Copilot Pro.
Codex is included in ChatGPT plans. Free ($0) and Go ($8 per month) get GPT-6 Luna in the desktop app, subject to rollout. Plus ($20) adds Codex on the web, in the CLI, in the IDE extension and on iOS, plus cloud integrations. Pro costs $100, $200 or $500 per month and currently has no five-hour limit. Business costs $20 per user per month billed annually for two or more users, or $25 billed monthly; Enterprise and Edu are custom. On Plus, OpenAI estimates 15 to 160 local messages per five hours with GPT-6.1 Sol and 350 to 3,000 with GPT-6 Luna, and says these are estimates, not fixed limits. You can also run the CLI, SDK and IDE extension on an API key at API prices, without the cloud features.
Working in the terminal
Copilot CLI has an interactive mode, started with copilot, with a default ask/execute mode and a plan mode that asks clarifying questions and builds a plan before writing code. A programmatic mode (-p) runs one prompt and exits. Tool approvals can be pre-granted with options such as --allow-tool. You can sandbox commands locally with /sandbox enable, or start a whole session in a cloud sandbox with copilot --cloud, which is in public preview. In local sessions on macOS and Windows, you can enable computer use to drive desktop apps. Customization covers custom instructions, MCP servers, custom agents, hooks, skills and Copilot Memory, and Copilot CLI can act as an agent for other tools over ACP.
Codex CLI works against your local repository with the tools already installed on your machine. You choose the model, reasoning effort, permissions and commands per task. Slash commands include /init to create an AGENTS.md file, /permissions, /model and /review for reviewing changes. For automation, codex exec runs Codex non-interactively in scripts and CI pipelines. OpenAI documents sandboxing and approval controls for the agent. Codex installs with a standalone script on macOS and Linux, and its install page also has Windows, npm and Homebrew options.
Who should pick which
- Pick Copilot CLI if your work centers on GitHub issues and pull requests, if you already pay for Copilot, or if you want to switch between Claude, GPT, Gemini and Grok models in one tool.
- Pick Codex if you want OpenAI's latest models with ChatGPT-plan usage instead of per-token credits, an open-source CLI, and the same agent in the ChatGPT desktop app, the web and an IDE extension.
- For CI-only use, compare Copilot CLI's -p mode on a Copilot plan with codex exec on an API key; Codex's API-key mode has no cloud features.
The Bottom Line
Copilot CLI and Codex CLI now cover much of the same ground: plan modes, approvals, sandboxes, MCP and scripted runs. Copilot CLI's advantages are model choice and GitHub integration, metered in AI credits from a Copilot plan. Codex's advantages are an open-source CLI, OpenAI's newest models and usage included in ChatGPT plans you may already pay for. Choose based on where your code and subscriptions already live.




