Hamburger Cross Icon
Codex Collector - Lunar Collector

Codex Collector

Collector Experimental Code Analysis

Detects OpenAI Codex CLI invocations in CI pipelines. Records command strings, versions, and flags for policy-level analysis. Writes to ai.native.codex under the unified ai.* namespace.

Add codex to your lunar-config.yml:
uses: github://earthly/lunar-lib/collectors/codex@v1.0.5

What This Integration Collects

This integration includes 2 collectors that gather metadata from your systems.

Collector code

instruction-file

Discovers CODEX.md instruction files across the repository. Records file path, line count, byte size, and whether it is a symlink to AGENTS.md. Writes to ai.native.codex.instruction_file and appends to ai.instructions.all[] for normalized cross-tool access.

codex.md instruction file agent context
Book a demo
Collector ci-after-command

cicd

Detects OpenAI Codex CLI invocations in CI pipelines. Records the command string and version for policy-level flag analysis (dangerous flags, sandbox mode, approval mode).

codex openai ai ci ci safety
Book a demo

How Collectors Fit into Lunar

Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.

Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.

Learn How Lunar Works
1
Collectors Gather Data This Integration
Triggered by code changes or CI pipelines, collectors extract metadata from config files, tool outputs, test results, and scans
2
{ } Centralized as JSON
All data merged into each component's unified metadata document
3
Guardrails Enforce Standards
Real-time feedback in PRs and AI workflows

Example Collected Data

This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:

{ } component.json Component JSON
{
  "ai": {
    "instructions": {
      "all": [
        {
          "path": "CODEX.md",
          "dir": ".",
          "filename": "CODEX.md",
          "lines": 60,
          "bytes": 2400,
          "is_symlink": false,
          "symlink_target": null
        }
      ]
    },
    "native": {
      "codex": {
        "instruction_file": {
          "exists": true,
          "path": "CODEX.md",
          "lines": 60,
          "bytes": 2400,
          "is_symlink": false,
          "symlink_target": null
        },
        "cicd": {
          "cmds": [
            {
              "cmd": "codex exec --json 'review this PR'",
              "tool": "codex",
              "version": "0.1.0"
            }
          ]
        }
      }
    }
  }
}

Documentation

View on GitHub

Codex Collector

Detect OpenAI Codex CLI usage, instruction files, and CI invocations.

Overview

This collector detects OpenAI Codex usage: discovers CODEX.md instruction files and captures CLI invocations in CI pipelines. Writes to ai.native.codex under the unified ai.* namespace.

Collected Data

This collector writes to the following Component JSON paths:

Path Type Description
.ai.instructions.all[] array append CODEX.md entry appended to the normalized instruction files array
.ai.native.codex.instruction_file object CODEX.md file: existence, path, line count, byte size, symlink status
.ai.native.codex.cicd.cmds[] array Codex CLI invocations in CI: command string, version, and flags

Collectors

This integration provides the following collectors:

Collector Hook Description
instruction-file code Discovers CODEX.md instruction files with metadata and symlink status
cicd ci-after-command (binary: codex) Captures Codex CLI invocations in CI with flag extraction

Installation

Add to your lunar-config.yml:

collectors:
  - uses: github://earthly/lunar-lib/collectors/codex@main
    on: ["domain:your-domain"]

Open Source

This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.

View Repository

Ready to Automate Your Standards?

See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.

Works with any process
check AI agent rules & prompt files
check Post-mortem action items
check Security & compliance policies
check Testing & quality requirements
Automate Now
Paste your AGENTS.md or manual process doc and get guardrails in minutes
Book a Demo