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

Point the assistant at the actual app tree (bijection/app.ts), its tables, labels, roles and guards, and the committed bijection.lock. Types catch a call to a function that does not exist or with the wrong arguments, and bijection check explains label flow and lexicon problems in remedy sentences. Review the lock diff and the tasks a change submits as you would a person’s. The assistant runs bijection with the same verbs and tree paths as the code: bijection check checks the source and writes the lock, bijection query notes.list and bijection mutate notes.add text=Hi call functions, bijection trial shows what a mutation would write without committing it, bijection list notes.items --first 5 reads facts and bijection watch sys.logs follows function logs. bijection status request observes or resumes a deploy request whose reply was lost.

Set up the Bijection CLI

Install the CLI, then add Bijection’s guidance for coding agents from your project directory:
This writes a managed pointer section into the project’s AGENTS.md and CLAUDE.md, a bijection stub skill for each selected agent (Claude Code and Codex by default) and a bijection entry in .mcp.json that runs bijection mcp serve. The guidance itself ships as Agent Skills inside the installed @bijectionhq/bijection, so it matches the project’s SDK version: the MCP server serves it with the Skills extension, and bijection skills list and bijection skills show <name> print it. An application can also declare an MCP server for its queries and mutations. Connect the host to that HTTP endpoint as a person or an issued session. Each tool call runs under the caller’s own grants, and a write carries its once, so a retry is the same effect.

Starting a new project

Install the CLI. Local development can use the starter’s development identity. For hosted work, run bijection login yourself or configure a deployment-scoped credential before the non-interactive agent starts. From an empty directory, launch Codex with what you want to build:
Codex can create the project with bijection create and push it with bijection dev --once. 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, set up the CLI and start asking Codex questions like:
  • Review my tables and indexes, and suggest the index a selection needs
  • Which functions are exposed, and to which roles? (read bijection.lock)
  • Run bijection trial on the orders.place mutation and explain its writes

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.