Skip to content

Conversation

@RamXX
Copy link
Contributor

@RamXX RamXX commented Dec 24, 2025

Summary

Add a new CLI provider that integrates with OpenAI's Codex CLI tool, allowing users to use their ChatGPT Plus/Pro subscription through goose's interface. This follows the same pattern as the existing Claude Code provider.

Features:

  • Subprocess-based provider using codex exec command for non-interactive mode
  • Configurable reasoning effort levels (low/medium/high) via CODEX_REASONING_EFFORT
  • Optional skills support via CODEX_ENABLE_SKILLS
  • GOOSE_MODE permission mapping (auto->--yolo, smart-approve->--full-auto, etc.)
  • JSONL response parsing for structured output
  • Automatic filtering of goose extensions from system prompts
  • Optional --skip-git-repo-check via CODEX_SKIP_GIT_CHECK

Supported models (Codex CLI v0.77.0):

  • gpt-5.2-codex, gpt-5.2: 400K (auto-compacting)
  • gpt-5.1-codex-max, gpt-5.1-codex-mini: 256K

Configuration:

  • GOOSE_PROVIDER=codex to enable
  • CODEX_COMMAND for custom CLI path (default: codex)
  • CODEX_REASONING_EFFORT: low, medium, high (default: high)
  • CODEX_ENABLE_SKILLS: true/false (default: true)
  • CODEX_SKIP_GIT_CHECK: true/false (default: false)

Type of Change

  • Feature
  • Documentation
  • Tests

AI Assistance

  • This PR was created or reviewed with AI assistance

This PR was developed with Claude Code assistance. All code was reviewed, tested manually with real Codex CLI integration, and validated against existing patterns in the codebase (particularly claude_code.rs). Unit tests achieve comprehensive coverage of the provider functionality.

Test plan

  • Unit tests (20 tests, all passing): cargo test --package goose --lib providers::codex::tests
  • Manual integration testing with actual Codex CLI
  • Verified JSONL parsing matches real Codex output format
  • Tested CODEX_SKIP_GIT_CHECK=true for non-git directories

Manual test:

echo "What is 2+2? Reply in one word only." | GOOSE_PROVIDER=codex goose run -q -i -
# Output: 4

Requirements

  • Codex CLI installed (npm i -g @openai/codex or brew install --cask codex)
  • Active ChatGPT Plus/Pro subscription or OpenAI API credits
  • CLI tool authenticated with OpenAI account
  • By default, must run from a git repository (or set CODEX_SKIP_GIT_CHECK=true)

🤖 Generated with Claude Code

@RamXX RamXX requested a review from a team as a code owner December 24, 2025 02:51
@RamXX RamXX force-pushed the feature/codex-provider branch from 4624f3c to a0bd834 Compare December 24, 2025 18:17
@RamXX RamXX force-pushed the feature/codex-provider branch from a0bd834 to 7bb96e5 Compare December 24, 2025 18:19
@RamXX RamXX mentioned this pull request Dec 24, 2025
1 task
…RamXX-feature/codex-provider

* 'feature/codex-provider' of github.com:RamXX/goose:
  feat: add OpenAI Codex CLI provider
@michaelneale michaelneale self-assigned this Dec 29, 2025
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I like this. Thanks for this, was timely as I was playing around with codex separately.

@michaelneale
Copy link
Collaborator

I had some issues with my codex install and the desktop - might have to have a follow on, but ran out of time for it. Something to do with path maybe.

@michaelneale michaelneale changed the base branch from main to micn/test-merge December 29, 2025 03:11
@michaelneale michaelneale changed the base branch from micn/test-merge to main December 29, 2025 03:11
@michaelneale
Copy link
Collaborator

cc @blackgirlbytes FYI - looks good

@RamXX
Copy link
Contributor Author

RamXX commented Dec 29, 2025

Thanks. I've been using it for a few days with no issues. Let me know if there is anything I can do to help you replicate the behavior.

@michaelneale michaelneale merged commit 31eaa47 into block:main Dec 29, 2025
20 checks passed
@michaelneale
Copy link
Collaborator

nice one @RamXX - very handy.

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.

4 participants