Skip to content

Repository files navigation

Codex plugin for Kimi Code

Use the local Codex CLI from inside Kimi Code for code reviews, adversarial second opinions, and delegated coding tasks.

This project follows the runtime design of openai/codex-plugin-cc, adapted to Kimi Code's native plugin manifest, session-start Skills, slash commands, and Hooks.

What you get

  • /codex:review — native, read-only Codex review of uncommitted work or a branch
  • /codex:adversarial-review — steerable challenge review of design choices and assumptions
  • /codex:prompt — send an exact custom prompt with explicit read/write and model controls
  • /codex:rescue — delegate diagnosis, implementation, research, or follow-up work
  • /codex:status, /codex:result, and /codex:cancel — manage persistent background jobs
  • /codex:setup — check Node.js, Codex installation, authentication, and the optional review gate

The runtime talks to codex app-server, reuses the local Codex login and configuration, and keeps job state per Git working tree.

Requirements

  • Kimi Code with plugin support
  • Node.js 18.18 or newer
  • A local Codex CLI login (ChatGPT subscription or OpenAI API key)

Install

From a local checkout:

/plugins install /absolute/path/to/codex-plugin-kimi-code
/reload
/codex:setup

From GitHub:

/plugins install https://github.com/winmin/codex-plugin-kimi-code
/reload
/codex:setup

Kimi copies plugins into its managed plugin directory. After changing a local checkout, reinstall the plugin; editing the original directory alone does not update the managed copy.

If Codex is installed but not logged in:

codex login

Usage

Review current work

/codex:review
/codex:review --wait
/codex:review --background
/codex:review --base main

review maps directly to Codex's built-in reviewer. It accepts working-tree or base-branch targets and does not take custom focus text.

Challenge the approach

/codex:adversarial-review
/codex:adversarial-review --base main challenge the retry and rollback design
/codex:adversarial-review --background look for race conditions

This mode questions architecture, tradeoffs, hidden assumptions, and failure modes. It remains read-only.

Delegate a task

/codex:rescue investigate why the integration tests are flaky
/codex:rescue fix the failing test with the smallest safe patch
/codex:rescue --background redesign the connection retry path
/codex:rescue --resume apply the top fix from the previous run
/codex:rescue --model gpt-5.4-mini --effort medium diagnose the regression

Rescue runs are write-capable by default when the request asks for an implementation or fix. Diagnosis, planning, research, and review remain read-only unless write access is explicitly requested. If no model or effort is supplied, Codex uses the local defaults.

Send an exact custom prompt

/codex:prompt analyze the retry path and return only a risk table
/codex:prompt --write implement the instructions exactly as provided
/codex:prompt --model gpt-5.4-mini --effort high audit the authentication flow
/codex:prompt --prompt-file ./prompts/my-task.md
/codex:prompt --background --prompt-file ./prompts/large-audit.md

Unlike rescue, prompt does not infer write access or rewrite the request. It starts read-only unless --write is explicitly present. --prompt-file is resolved by the companion relative to the current project.

Manage jobs

/codex:status
/codex:status <job-id>
/codex:result <job-id>
/codex:cancel <job-id>

Kimi-managed background reviews also appear in /codex:status after the companion process has started. Background rescue jobs are queued directly by the companion runtime.

Optional stop-time review gate

Enable or disable a per-repository gate:

/codex:setup --enable-review-gate
/codex:setup --disable-review-gate

When enabled, the plugin's Kimi Stop Hook asks Codex to inspect the current repository changes before Kimi ends a turn. A blocking result is returned to Kimi once so it can address the findings. The Hook is fail-open when Codex is missing, unauthenticated, crashes, or times out.

The gate can consume substantial Codex usage and lengthen turns. Enable it only when you intend to monitor the session.

Codex configuration

The plugin uses the same Codex CLI configuration as a direct codex invocation:

  • user configuration: ~/.codex/config.toml
  • trusted project configuration: .codex/config.toml

For example:

model = "gpt-5.4-mini"
model_reasoning_effort = "high"

Development

npm install
npm test
npm run build
npm run check-version
node scripts/validate-kimi-plugin.mjs

To test the managed installation, reinstall it in Kimi and run /reload or start a new session.

Attribution

The companion runtime is adapted from openai/codex-plugin-cc, licensed under Apache-2.0. See NOTICE.

About

Use Codex from Kimi Code for reviews, custom prompts, and delegated coding tasks.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages