@koreanhole/opencodex
v3.2.32
Published
Full opencodex runtime with Cline 2.2.0+ JSON and Gemini CLI headless provider adapters
Maintainers
Readme
opencodex: full upstream runtime + Cline JSON and Gemini CLI headless adapters
This distribution keeps the complete original
@bitkyc08/opencodex runtime and adds
locally installed Cline CLI and Gemini CLI as model providers. Cline turns use
the CLI's one-shot --json mode after a runtime --help capability check and
support both the Cline 2.2.0 raw-message contract and the current structured
contract; Gemini turns use the CLI's one-shot -p stream-json mode.
The original package is an exact npm dependency. This repository does not copy,
patch, delete, or rewrite upstream source files. The ocx entrypoint loads the
original CLI in-process and attaches the two CLI adapters through a loopback
Responses gateway.
Install
npm install -g @koreanhole/opencodexThat single package installs the pinned upstream runtime as a normal dependency. Do not install the original package separately and do not clone either project just to run this distribution.
Vendor prerequisites remain separate:
npm install -g cline
cline auth
npm install -g @google/gemini-cli
geminiGemini headless turns support an explicit Gemini Developer API key, Vertex AI
GenAI configuration, or the operator's existing Gemini CLI OAuth login. opencodex
does not automate Google OAuth. OAuth reuse requires an account and tier eligible
for the installed Gemini CLI's service. Explicit environment configuration takes
precedence, then the vendor's selected authentication method; a vendor-selected
API-key login uses its .env, while an OAuth selection keeps OAuth-only
behavior. Without a readable vendor selection, the previous OAuth-first fallback
applies, including logins stored in the vendor keychain or under a custom
GEMINI_CLI_HOME. Linux keyring access and the vendor encrypted credential file
are preserved for isolated OAuth turns.
Vertex AI (enterprise)
Select Vertex AI in the vendor settings and authenticate with Application Default Credentials:
{
"security": {
"auth": {
"selectedType": "vertex-ai"
}
}
}gcloud auth application-default login
export GOOGLE_CLOUD_PROJECT="your-project"
export GOOGLE_CLOUD_LOCATION="us-central1"
# Optional: use a service-account ADC file instead of the gcloud login.
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/adc.json"opencodex mirrors the vendor vertex-ai selection into its isolated Gemini
settings, forwards those three variables unchanged, and adds neither
GOOGLE_GENAI_USE_GCA nor encrypted-storage forcing. Gemini CLI's
oauth_creds.json is not used in this mode; an existing cached OAuth login
does not override the Vertex selection.
Cline 2.2.0 is the minimum supported release. Newer options are used only when the installed binary advertises them.
Start
ocx provider add gemini-cli --set-default
ocx provider add cline-cli
ocx startThe original opencodex commands, dashboard, client integrations, account and
model management, service lifecycle, and restore behavior remain available
through the same ocx command.
The managed provider rows appear as gemini-cli/... and cline-cli/....
Cline does not require ACP: it exposes a stable default selector that follows
the model already selected in Cline, while Cline model turns use the installed
CLI's JSON transport across the 2.2.0 and current output contracts. Explicit
ocx login cline-cli delegates to the vendor cline auth command. Gemini runtime
model discovery uses the
installed CLI's ACP session, while reasoning metadata and model turns use the
installed CLI's headless transport. Parent-declared tools are exposed through a
request-scoped capture MCP server.
Commands
Adapter-specific compatibility commands:
ocx login cline-cli [--json] [--no-wait]
ocx provider add <cline-cli|gemini-cli> [--set-default]
ocx provider use <cline-cli|gemini-cli>
ocx provider list [--json]
ocx adapter detachAll other commands are delegated to the immutable upstream CLI. Examples:
ocx start
ocx status
ocx stop
ocx restore
ocx sync
ocx service install
ocx gui
ocx doctorocx adapter detach removes only the two managed provider rows or restores
their previous values from the mode-0600 journal.
Upstream updates
The dependency is pinned exactly:
{
"@bitkyc08/opencodex": "2.94.0"
}To adopt an upstream release:
- Change only the exact dependency version and refresh the lockfile.
- Run
bun run verify:upstream. - Run
bun run typecheck,bun test tests,bun run test:e2e, andbun run test:e2e:gemini. - Accept the update only when every gate passes.
No patch series or upstream source tree is maintained in this repository.
ocx update and ocx system update are owned by this distribution because the
upstream updater is hardcoded to the original package name. They install the
selected release of this fork:
ocx update
ocx update --tag preview
ocx update --jsonRestart any running ocx process after an update. Automatic upstream update
checks are disabled for the delegated runtime.
Release
After every required verification and live E2E gate passes, bump the package to
the next semver patch version, commit and push main, then publish:
npm publish --access publicNever force-publish or reuse an already published version. If any gate is missing, failing, or blocked, stop before commit, push, or publish and report the blocker.
Security boundary
- Cline does not receive filesystem or terminal capability from the proxy.
- Cline runs with request-scoped, mode-0600 settings. Its built-in tools, user
MCP servers, hooks, plugins, telemetry, updates, and self-approval are disabled.
Modern provider state and legacy global/secrets state are copied privately;
the originals are never modified. No Cline runtime path requires ACP. Its turn
options are used only after the installed binary's
--helpoutput advertises them. - Gemini headless turns run in a request-scoped workspace with
GEMINI_CLI_TRUST_WORKSPACE=true,--skip-trust, and--approval-mode auto_edit, but the generated isolated Gemini home settings scopetools.coretomcp_opencodex_*and expose only the request-scoped capture MCP server. No built-in, file-edit, shell, network, user-MCP, extension, skill, or hook tool executes;yoloremains disabled. - Gemini JSON schema instructions are prompt-only: a schema already present in the client's system/developer instructions is accompanied by a JSON-only and pre-response validation contract. The adapter does not parse, repair, or reject the model's JSON.
- Cline tool intent is returned to Codex for approval and execution.
- Gemini tool intent is returned to Codex through the capture-only MCP server; the parent agent performs approval and execution.
- Vendor credentials stay in vendor homes or authenticated environments. The proxy does not store or log vendor tokens.
- The adapter gateway binds
127.0.0.1only and uses a per-run bearer token. - Request bodies, API keys, bearer tokens, and full vendor diagnostics are never logged.
Tests
bun run verify:upstream
bun run typecheck
bun test tests
bun run test:e2e
bun run test:e2e:cline-live
bun run test:e2e:gemini
bun run test:e2e:gemini-oauth-only
bun run test:e2e:gemini-slow
bun run test:e2e:gemini-parent-tool
bun run privacy:scan
bun run structure:checktest:e2e:gemini starts the original runtime and the adapter gateway, then uses
a real Codex client and a real authenticated Gemini CLI. It runs both the minimal
completion and a 12-second pre-event slow-start regression. It fails, not skips,
on a missing binary, authentication, Flash Lite model, response marker, timeout,
or child cleanup assertion. test:e2e:gemini-slow runs only the slow-start case.
test:e2e exercises the Cline 2.2.0-compatible contract through the real HTTP
server. test:e2e:cline-live additionally requires the installed Cline CLI and
its existing authentication, and fails rather than skipping on a missing
binary, response marker, or cleanup assertion.
Optional overrides are CLINE_BIN_PATH, GEMINI_BIN_PATH, and
CODEX_BIN_PATH.
