Skip to content

feat: add brev open codex for remote Codex CLI sessions#352

Open
theFong wants to merge 5 commits intofeat/open-claudefrom
feat/open-codex
Open

feat: add brev open codex for remote Codex CLI sessions#352
theFong wants to merge 5 commits intofeat/open-claudefrom
feat/open-codex

Conversation

@theFong
Copy link
Copy Markdown
Member

@theFong theFong commented Apr 10, 2026

Stacked on #351 (feat/open-claude)

Summary

  • Adds codex as a new editor type for brev open, mirroring the claude implementation
  • Auto-installs Codex CLI remotely via npm install -g @openai/codex if not present
  • Auto-authenticates by detecting OPENAI_API_KEY env var and forwarding only when the remote doesn't already have it set
  • Launches Codex in a tmux session for persistence across disconnects
  • Supports passing arbitrary codex flags via -- separator

Usage

brev open my-instance codex
brev open my-instance codex -d /path/to/project
brev open my-instance codex -- --model o3

Test plan

  • go build ./... passes
  • go test ./pkg/cmd/open/... passes
  • Manual test: brev open <instance> codex installs and launches codex remotely
  • Manual test: OPENAI_API_KEY forwarding from env var
  • Manual test: -- flag passthrough works
  • Manual test: -d directory override works

@theFong theFong requested a review from a team as a code owner April 10, 2026 00:32
Comment on lines 389 to +393
return breverrors.WrapAndTrace(err)
}
if strings.Contains(err.Error(), "failed to install Codex") {
return breverrors.WrapAndTrace(err)
}
Copy link
Copy Markdown
Contributor

@patelspratik patelspratik Apr 10, 2026

Choose a reason for hiding this comment

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

these just do the same thing as the base case, should it handlePathError instead?

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.

2 participants