Skip to content

feat(installer): add Codex CLI engine option to install.sh#219

Open
FanqingM wants to merge 2 commits intoxvirobotics:mainfrom
FanqingM:feat/installer-codex-support
Open

feat(installer): add Codex CLI engine option to install.sh#219
FanqingM wants to merge 2 commits intoxvirobotics:mainfrom
FanqingM:feat/installer-codex-support

Conversation

@FanqingM
Copy link
Copy Markdown

Summary

  • Add option 3) Codex CLI to the installer's Agent Engine menu so it matches the README's "三引擎 (Claude / Kimi / Codex)" promise.
  • Detect codex on PATH during install and print install/login hints when missing — MetaBot still gets fully configured so users can install Codex after.
  • When engine=codex is picked, generate bots.json entries with engine: "codex" and codex: { approvalPolicy: "never", sandbox: "workspace-write" } for Feishu / Telegram / WeChat bots. Matches bots.example.json and honors the CLAUDE.md note that interactive approvals can't be surfaced back to IM under Codex.
  • .env now emits a Codex auth comment block with CODEX_EXECUTABLE_PATH / CODEX_APPROVAL_POLICY / CODEX_SANDBOX placeholders instead of forcing a Claude/Kimi header.
  • "Next Steps" suggests codex login (and the Codex CLI install link if the binary is missing).

Before this PR, users who wanted Codex had to finish the installer with Claude and then hand-edit bots.json — the runtime already supported it, the installer just didn't expose it.

Context

Reported by a user running install.sh who saw only Claude / Kimi in the menu despite CLAUDE.md and README promising Codex support. Runtime side (src/engines/codex/executor.ts, bots.example.json, README) was already in place — this patch is installer-only.

Test plan

  • bash -n install.sh — syntax OK
  • Smoke-tested the node -e JSON generator with engine=codex — produces valid JSON matching bots.example.json
  • End-to-end installer run picking option 3 on a clean machine (recommend a reviewer spot-check)
  • codex login flow works after install on a machine with Codex CLI present

🤖 Generated with Claude Code

FanqingM and others added 2 commits April 24, 2026 21:51
The installer's interactive menu previously only exposed Claude Code and
Kimi, even though the runtime has supported `engine: "codex"` since the
Codex CLI integration landed. Users following the README's "三引擎" promise
had to hand-edit bots.json afterwards. This patch surfaces Codex as a
first-class choice:

- Phase 4b: add "3) Codex CLI" option; detects `codex` on PATH and prints
  install/login hints when missing.
- Phase 5 bots.json generation: when engine=codex, emit
  `engine: "codex"` with `codex: { approvalPolicy: "never", sandbox:
  "workspace-write" }` for Feishu, Telegram, and WeChat bot entries
  (matches bots.example.json).
- .env: new comment block with CODEX_EXECUTABLE_PATH /
  CODEX_APPROVAL_POLICY / CODEX_SANDBOX hints.
- Next Steps: add `codex login` reminder and Codex CLI install pointer
  when the binary is missing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…flow

Previously the Codex branch only detected the CLI on PATH and printed a
"go install it yourself" warning, which was inconsistent with how
Claude Code and Kimi engines behave (both auto-install their CLIs).

Now the Codex branch runs `npm install -g @openai/codex` via the existing
npm_install_global helper — same path Claude Code uses. Fallback warning
is still there if the npm install fails.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@FanqingM
Copy link
Copy Markdown
Author

Follow-up: added auto-install of Codex CLI via npm install -g @openai/codex so the flow matches how Claude Code and Kimi engines behave (both auto-install their CLIs). Falls back to a manual-install warning if the npm install fails.

Confirmed @openai/codex is the official OpenAI npm package (v0.124.0+). Commit: e4d8f50.

Copy link
Copy Markdown
Contributor

@floodsung floodsung left a comment

Choose a reason for hiding this comment

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

Looks good — installer changes match the runtime support already in place (engines/codex, bots.example.json) and the auto-install via npm install -g @openai/codex keeps parity with how Claude Code and Kimi engines are bootstrapped. Codex defaults (approvalPolicy: never, sandbox: workspace-write) align with the CLAUDE.md note that interactive approvals can't be surfaced back through IM.

Suggesting maintainer spot-check the end-to-end installer run on a clean machine before merge (item still unchecked in the test plan).

@sunjiahao1999
Copy link
Copy Markdown

When can this PR be officially merged?

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.

3 participants