Skip to content

OpenAI Codex CLI

OpenAI Codex CLI is OpenAI's command-line coding assistant.

Plugin Structure

my-plugin/
├── agents.yaml          # Agent definitions (optional)
└── commands/            # Slash commands
    └── build.md

Commands

Commands are Markdown files with YAML frontmatter:

---
name: build
description: Build the project
---

Build the project using the appropriate build system.
Detect the project type and run the correct command.

Agents (Optional)

If you need agent-like behavior, define in agents.yaml:

agents:
  - name: code-reviewer
    description: Reviews code for quality
    instructions: |
      You review code for best practices...

Installation

Copy your plugin to the Codex plugins directory:

cp -r my-plugin ~/.codex/plugins/

Available Tools

Tool Description
read Read file contents
write Write files
shell Execute shell commands
search Search files

MCP Server Configuration

Codex CLI supports MCP servers in configuration:

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-server-filesystem"]
    }
  }
}

Converting from Canonical

import (
    "github.com/agentplexus/assistantkit/commands/core"
    "github.com/agentplexus/assistantkit/commands/codex"
)

canonical := core.Command{
    Name:        "build",
    Description: "Build the project",
    Prompt:      "Build the project...",
}

codexCmd := codex.FromCanonical(canonical)

Limitations

  • No Skills: Codex CLI does not have a dedicated skills system
  • Limited Agent Support: Basic agent configuration only
  • Simpler Structure: Fewer configuration options than Claude Code

Tool Mapping

Canonical Codex
Read read
Write write
Edit edit
Bash shell
Glob search
Grep search