> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bossmode.ing/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI Integration

> Run BossMode directives through OpenAI's Codex CLI. Your Codex agent harness, governed by BossMode's standing orders and reporting layer.

<Warning>🚧 Expanding soon — full Codex CLI integration documentation is in progress.</Warning>

## BossMode + Codex CLI

OpenAI's Codex CLI is a terminal-native agent runner. The BossMode-Codex integration connects your Codex CLI sessions to BossMode's governance layer — standing orders enforced, moves logged, and results surfaced in your Daily Report.

## How it works

BossMode provides a Codex-compatible MCP server that injects operational context into every Codex CLI session. When you run a Codex task, BossMode:

1. Provides your standing orders as system constraints
2. Supplies buyer profiles and business context
3. Logs every action to the audit feed
4. Queues output for approval per your governance settings

## Setup

Install the BossMode MCP server:

```bash theme={null}
npm i -g @bossmode/mcp-server
```

Configure Codex CLI to use it. In `~/.codex/config.json`:

```json theme={null}
{
  "mcpServers": {
    "bossmode": {
      "command": "bossmode-mcp-server",
      "env": {
        "BOSSMODE_API_TOKEN": "bm_live_your_token"
      }
    }
  }
}
```

## Using BossMode context in Codex

Once connected, reference BossMode in your Codex prompts:

```bash theme={null}
codex "Using the BossMode context, draft a re-engagement email for leads who completed 
       the trust score but haven't booked a call in 7 days."
```

Codex pulls standing orders and buyer profiles automatically via the MCP server.

## Logging back to BossMode

Codex executions are logged via the MCP server automatically when `logAllMoves: true` in your BossMode settings.

Manual logging from a Codex session:

```bash theme={null}
# After Codex completes a task
bossmode-mcp-server log \
  --capo capo_marketing \
  --action "email-drafted" \
  --description "Re-engagement email drafted for 7-day trust-score leads"
```

## Your ChatGPT Plus subscription

If you're using Codex CLI with your ChatGPT Plus subscription, BossMode governance works the same way — it's inference-provider agnostic. Set `OPENAI_API_KEY` per Codex CLI docs and `BOSSMODE_API_TOKEN` for governance.

The only limitation is that BossMode's Trust Intelligence score generation uses Gemini (for AvatarCzar). All other governance features work with any inference provider.

## Requirements

* Codex CLI v0.8.0 or higher
* BossMode Pro account
* `BOSSMODE_API_TOKEN` set in your environment
* `OPENAI_API_KEY` for Codex CLI inference
