Skip to content

Codex

Target id Package Ship with
codex @oiap/exporter-codex oiap sync (git install) or install-agent-plugin
Terminal window
npx oiap build oiap.plugin.ts --target codex --out dist/codex
npx install-agent-plugin <owner>/<repo> --plugin <plugin-id> --agent codex

Codex target exporter for Open Interoperable Agent Plugins.

This package lowers OIAP plugin primitives into Codex-compatible plugin and project-configuration files. The generated bundle uses the documented Codex plugin layout where possible:

.codex-plugin/plugin.json
skills/<skill>/SKILL.md
hooks/hooks.json
.mcp.json

Codex also has project-scoped surfaces that are not part of the plugin manifest, so the exporter can emit companion files such as AGENTS.md, .codex/agents/*.toml, and .codex/rules/*.rules when the OIAP plugin defines those surfaces.

Most authors should use the CLI:

Terminal window
bun run oiap build ./oiap.plugin.ts --target codex --out ./build/codex

The exporter renders Codex command-hook configuration that calls the generated .oiap/runtime/runner.mjs raw-JS hook runtime. Portable function handlers are bundled into .oiap/runtime/hooks.mjs; unsupported lifecycle events and non-portable target-module hooks are reported as degraded metadata.

Where install-agent-plugin and installPlugin() write the bundle, from the target profile. --out <dir> overrides them.

Scope Path
Local (default) ./.codex/plugins/<plugin-id>
Global (--global) ~/.codex/plugins/<plugin-id>

From the platform support matrix (see its legend).

Profile Package Rules Skills Commands Hooks Agents MCP Runtime Policy
core Y Y Y P Y Y Y F Y

High-fidelity config/package target. Verify skills, plugins, hooks, MCP, AGENTS.md, approval rules, sandbox settings, and custom agents.