Skip to content

Codex

LNAI exports unified configuration to Codex Team Config under the .codex/ directory.

AGENTS.md # Symlink -> .ai/AGENTS.md (at project root)
.codex/
├── config.toml # Generated (MCP servers)
├── skills/<name>/ # Symlinks -> ../../.ai/skills/<name>/
└── <overrides> # Symlinks from .ai/.codex/
<dir>/AGENTS.md # Generated (rules per directory)
SourceOutputType
.ai/AGENTS.mdAGENTS.mdSymlink
.ai/rules/*.md<dir>/AGENTS.mdGenerated
.ai/skills/<name>/.codex/skills/<name>Symlink
.ai/settings.json.codex/config.tomlGenerated
.ai/.codex/<path>.codex/<path>Symlink

MCP servers are exported into Codex’s mcp_servers blocks:

// Input (LNAI format)
{
"mcpServers": {
"db": {
"command": "npx",
"args": ["-y", "@example/db"],
"env": { "DB_URL": "${DB_URL}" }
},
"remote": {
"url": "https://mcp.example.com",
"headers": { "Authorization": "Bearer ${API_KEY}" }
}
}
}
# Output (Codex format)
[mcp_servers.db]
command = "npx"
args = ["-y", "@example/db"]
env = { DB_URL = "${DB_URL}" }
[mcp_servers.remote]
url = "https://mcp.example.com"
http_headers = { Authorization = "Bearer ${API_KEY}" }

Rules are grouped by directory using their paths globs and written to <dir>/AGENTS.md files. Only subdirectory rules are exported; rules targeting project root (.) are skipped and reported as warnings.

Codex permissions rules are not generated from LNAI permissions. If your .ai/settings.json contains a permissions block, LNAI will display a “skipped” notice but continue syncing other configuration.

Place Codex-specific files in .ai/.codex/ to have them symlinked directly:

.ai/.codex/
└── custom-config.toml -> .codex/custom-config.toml

When an override file exists at the same path as a generated file (e.g., config.toml), the override takes priority.