Skip to content

feat: add Codex CLI backend support#3

Open
CCALITA wants to merge 1 commit intomainfrom
feat/codex-backend
Open

feat: add Codex CLI backend support#3
CCALITA wants to merge 1 commit intomainfrom
feat/codex-backend

Conversation

@CCALITA
Copy link
Copy Markdown
Owner

@CCALITA CCALITA commented Apr 14, 2026

Summary

  • Add OpenAI Codex CLI as a new backend option (backend = "codex" in config)
  • New CodexBackend in internal/backend/codex.go that invokes codex -q --approval-mode suggest <prompt> for non-interactive streaming output
  • Add codex_path config field and INLINE_CLI_CODEX_PATH env var override for custom binary path
  • Wire the new backend into the daemon's createBackend() switch in server.go

The implementation follows the same pattern as the existing Claude CLI backend (cli.go), reusing the scanChunks splitter for streaming stdout and handling conversation history by prepending it to the prompt.

Test plan

  • Set backend = "codex" in ~/.inline-cli/config.toml and verify the daemon starts with the codex backend
  • With codex installed, send a query and verify streaming response works
  • Verify INLINE_CLI_CODEX_PATH env var overrides the binary path
  • Verify that setting an invalid backend name now lists "codex" in the supported backends error message
  • Verify go build ./... passes cleanly
  • Verify conversation history context is passed correctly in multi-turn sessions

Add OpenAI Codex CLI as a new backend option. The codex backend
invokes `codex -q --approval-mode suggest <prompt>` for non-interactive
streaming output, following the same pattern as the existing Claude
CLI backend.

- New file: internal/backend/codex.go (CodexBackend implementation)
- Config: CodexPath field + INLINE_CLI_CODEX_PATH env var
- Daemon: "codex" case in createBackend switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant