feat(adapters): Codex CLI adapter — export + import (#32)#45
Open
nanookclaw wants to merge 1 commit intoopen-gitagent:mainfrom
Open
feat(adapters): Codex CLI adapter — export + import (#32)#45nanookclaw wants to merge 1 commit intoopen-gitagent:mainfrom
nanookclaw wants to merge 1 commit intoopen-gitagent:mainfrom
Conversation
Add OpenAI Codex CLI adapter, closing open-gitagent#32 (help wanted). ## What - New — and - New — 15 tests, 29/29 total suite pass - Updated — re-exports the new adapter - Updated — adds 'codex' format case - Updated — adds importFromCodex() for 'codex' source ## Why Codex CLI (openai/codex) is OpenAI's open-source terminal coding agent. Gitagent can now round-trip agents to/from Codex CLI format. ## Format mapping | gitagent | Codex CLI | |---------------------|----------------------| | agent.yaml + SOUL.md + RULES.md | AGENTS.md | | model.preferred | codex.json model | | model → claude/gemini | provider: openai-compatible | | model → llama/mistral | provider: ollama | | model → gpt/o-series | (default, no provider field) | ## Export ``` gitagent export --format codex ``` Emits: - AGENTS.md — identity (SOUL.md), rules (RULES.md), skills, compliance - codex.json — { model, provider? } ## Import ``` gitagent import --from codex <path> ``` Reads AGENTS.md + codex.json, writes: - agent.yaml — name, model (from codex.json) - SOUL.md — all non-rule sections - RULES.md — rule/constraint/compliance sections (when present) ## Tests 15 new tests covering: struct shape, SOUL/RULES/skill content, config model/provider inference for OpenAI/o-series/Claude/Llama/Mistral, string export section headers, JSON validity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds an adapter for OpenAI Codex CLI, closing #32 (help wanted).
New files:
src/adapters/codex.ts—exportToCodex()andexportToCodexString()src/adapters/codex.test.ts— 15 new tests (29/29 full suite pass)Updated files:
src/adapters/index.ts— re-exports the new adaptersrc/commands/export.ts— adds'codex'format casesrc/commands/import.ts— addsimportFromCodex()for'codex'sourceFormat mapping
Codex CLI uses
AGENTS.mdfor instructions (identical to OpenCode) andcodex.jsonfor model config.agent.yaml+SOUL.md+RULES.mdAGENTS.mdmodel.preferredcodex.jsonmodelprovider: "openai-compatible"provider: "ollama"providerfield)Usage
Export:
Emits
AGENTS.md(identity, rules, skills, compliance) andcodex.json(model + provider).Import:
Reads
AGENTS.md+codex.json, producesagent.yaml+SOUL.md+ optionalRULES.md.Tests
15 new tests across two suites:
exportToCodex: struct shape, SOUL/RULES/skill content, model/provider inference for 5 provider familiesexportToCodexString: section headers, JSON validity, empty configFollows the pattern of the existing
cursor.test.tsandopencode.tsadapters.