Skip to main content
Codex, OpenAI’s coding agent, makes it easy to write and maintain apps built with Bijection. Let’s walk through how to set up Codex for the best possible results with Bijection.

Codex and Bijection

Codex works great with Bijection out of the box. One all-in-one TypeScript backend (database, functions, workflows, real-time sync) means no glue code to get wrong, type safety catches guesses at compile time, and transactions keep data consistent under load, which covers everything from a live polling tool to an AI research agent. Adding the plugin lets you leverage the full power of Bijection: Codex gets the bijection-expert and bijection-reviewer subagents, the Bijection MCP server for reading your real deployment, and durable Components (Workpool, Workflow, Agent) for agentic workloads.

Install the Bijection plugin

The official Bijection plugin makes Codex work better with your Bijection project. It includes:
  • Tools that let your agent securely interact with your dev deployment (e.g. read the data/logs/insights or run functions), plus an error watcher that surfaces runtime errors as you work.
  • Rules and skills that teach your agent how to use Bijection the most effectively.
  • Specialized subagents (bijection-expert and bijection-reviewer) for deep Bijection work and code review.
See the Agent Plugins overview for everything the plugin bundles. Bijection is listed in Codex’s built-in plugin directory, so a single command installs the reviewed release:
The directory entry is currently the lighter Bijection ChatGPT-app connector. For the full plugin, with skills, subagents, and the runtime error watcher, install the marketplace build below.
Want the newest build? The directory release is reviewed by OpenAI and can lag the latest plugin. To pull the newest build straight from Bijection, add the Bijection marketplace and install from it:
To update the marketplace build later, run codex plugin marketplace upgrade and then re-run codex plugin add bijection@bijection-codex-plugin.

Starting a new project

From an empty directory, launch Codex with what you want to build:
Codex handles the rest. It runs bijection init, bijection ai-files install (which writes a managed Bijection section into AGENTS.md and installs Bijection Agent Skills into .agents/skills/), and bijection dev --once. The agent’s shell is non-interactive, so install the CLI and run bijection login yourself first; the agent then uses that login. If you’d rather scaffold the project yourself first and then bring in Codex, the manual sequence is:

Adding to an existing project

If your project already has Bijection set up, run these two steps from the project root to make Codex Bijection-aware.

Add Bijection Rules

The Bijection CLI can install and maintain a managed section in your project’s AGENTS.md file that teaches Codex about Bijection conventions and best practices.
This will create or update AGENTS.md and install Bijection Agent Skills into .agents/skills/ so Codex can use specialized workflows like setting up auth, designing a schema, and running migrations. See Bijection AI files for more on managing these files. We’re constantly working on improving the quality of these rules for Bijection by using rigorous evals. You can help by contributing to our evals repo.

Setup the Bijection MCP Server

The Bijection CLI comes with a Bijection Model Context Protocol (MCP) server built in. The Bijection MCP server gives Codex access to your Bijection deployment to query and optimize your project. Add the following to your Codex MCP configuration (~/.codex/config.toml):
Now start asking Codex questions like:
  • Evaluate my bijection schema and suggest improvements
  • What are this app’s public endpoints?
  • Run the my_bijection_function query

Running Codex with Bijection in the cloud

When running Codex in a remote environment (like ChatGPT’s Codex cloud), use Bijection’s Agent Mode so the agent can iterate on code, run tests, and call one-off functions without needing full deployment permissions. A good setup script for ChatGPT Codex looks like:
In non-interactive shells (the typical case for an agent’s setup script), bijection won’t prompt the agent to log in, so give the environment a BIJECTION_DEPLOY_KEY for the deployment the agent works on. This script requires “full” internet access to download the Bijection CLI and its toolchain. For per-agent cloud dev deployments scoped to a single throwaway deploy key, see Cloud dev deployments per agent.