Codex

Codex is OpenAI's agentic coding tool that lives in your terminal. It works with the full context of your project - reading across the codebase, running shell commands, editing files wherever changes are needed, and taking care of git along the way. Paired with Buddy, Codex can deploy your project and let Buddy handle the entire deployment workflow. On top of that, it can trigger and monitor your pipelines, ship changes across environments, and dig through build output and logs when something needs fixing.

Info
This page covers working with Buddy from within Codex. On top of that, you can run AI coding agents in a fully isolated Buddy sandbox - see Run agents in a sandbox - or as an action in a pipeline.

Quick start

1

Install the Buddy CLI

bash
npm install -g bdy $
2

Log in to Buddy

bash
bdy login $
3

Link your project

Run this inside your project directory to connect it to a Buddy project:

bash
bdy proj link $
4

Install the Buddy skill

bash
npx skills add buddy/buddy-plugin $
5

Start Codex

bash
codex $
6

Prompt the agent

Ask it to build and ship something end to end, for example:

prompt
Create a snake app and deploy it for me

Example prompts

Once the agent is running and your project is linked to Buddy, try prompts like:

  • Create a Next.js app and deploy it to production.
  • Deploy an Umami analytics instance and wire it into my app.
  • Deploy an AI chatbot with Postgres for history and Redis for rate limiting.
  • Deploy my app, set up a CDN, and buy and configure a domain with SSL.
  • Add a pipeline that runs on every change in the repository and executes my test suite.
  • Add a pipeline that runs every minute, checks that my site is up, and sends a notification to Slack, email, Telegram, or SMS if anything is wrong.
  • Check the last few CI pipeline runs for failures, read the logs, and fix the failing tests.
  • Analyze the logs from the last production deployment and fix the errors.
  • Find the last successful production deployment and roll back to it.
  • Check my app logs and open issues based on what you find.

Run Codex in a pipeline

Codex also runs the other way around: as the Codex CLI action inside a Buddy pipeline. Instead of you prompting the agent from the terminal, the pipeline does it on an event - a pull request, a failed deploy, a cron schedule - with access to the repository, artifacts, and variables of that run.

1

Connect OpenAI

Add an OpenAI integration with your API key. The action reads the credentials from it, so the key never lands in the repository.
2

Add the Codex CLI action

In the pipeline, click Add action and pick Codex CLI. Set the integration, the model, and the sandbox mode.

Image loading...Codex CLI action configuration

3

Write the prompt

Add one or more prompts - inline, or read from a file in the repository such as .buddy/codex-prompt.md.

Or define it in YAML:

yaml
- action: Codex CLI type: CODEX_CLI integration: openai prompts: - make pull request review model: gpt-5-codex sandbox_mode: WORKSPACE_WRITE

See Run agents in a pipeline for sandbox modes, prompt files, and what you can trigger the agent on, and Codex CLI with YAML for the full field reference.

Connect MCP

Give Codex access to Buddy over MCP so it can run pipelines, manage deployments, and read logs. See the MCP page for the regional server URLs and how to filter the exposed tool categories.

Add the server to ~/.codex/config.toml (the transport is inferred from the url key):

toml
[mcp_servers.buddy] url = "https://mcp.buddy.works/mcp"

Or ask Codex to set it up for you:

prompt
Add the Buddy MCP server (https://mcp.buddy.works/mcp) to your MCP configuration.

Last modified on Aug 18, 2026