@koreanhole/opencodex 2.95.10 → 2.96.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/AGENTS_INSTALL.md CHANGED
@@ -1,4 +1,4 @@
1
- # Installing and Operating the Cline-only Proxy
1
+ # Installing and Operating the Cline + Gemini CLI Proxy
2
2
 
3
3
  This file is for an agent that is installing or operating this package, not for
4
4
  an agent changing its source code.
@@ -19,13 +19,24 @@ ocx provider add cline-cli --set-default
19
19
  ocx start
20
20
  ```
21
21
 
22
+ To use Gemini instead, authenticate it through its official CLI and select the
23
+ provider:
24
+
25
+ ```bash
26
+ gemini # official login or existing GEMINI_API_KEY configuration
27
+ ocx provider add gemini-cli --set-default
28
+ ocx start
29
+ ```
30
+
22
31
  ## Credential rules
23
32
 
24
- - Use the operator's existing Cline CLI sign-in. Do not copy vendor tokens into
25
- config, environment files, logs, prompts, or package content.
33
+ - Use the operator's existing Cline or Gemini CLI sign-in. Do not copy vendor
34
+ tokens into config, environment files, logs, prompts, or package content.
26
35
  - Do not authenticate on a request path. If Cline reports `auth_required`, stop
27
36
  and ask the operator to run `ocx login cline-cli`.
28
37
  - Do not edit the operator's real Cline provider store unless the operator asks.
38
+ - Do not import or replay Gemini OAuth/API-key material; the Gemini CLI remains
39
+ the authentication authority.
29
40
  - The proxy writes only under `$OPENCODEX_HOME` (default `~/.opencodex`).
30
41
 
31
42
  ## Operation
@@ -46,7 +57,11 @@ Before claiming the proxy works, run:
46
57
  ```bash
47
58
  bun run typecheck
48
59
  bun test tests/e2e/cline-only.test.ts
60
+ bun run test:e2e:gemini
61
+ bun run test:e2e:gemini-tool
49
62
  ```
50
63
 
51
- Report whether the evidence used the deterministic ACP fixture or a real Cline
52
- binary/account. Never report a skipped or synthetic run as a real login.
64
+ Report whether each evidence path used a deterministic ACP fixture or a real
65
+ vendor binary/account. The Gemini command above is a hard live gate: missing
66
+ binaries, authentication, a Flash Lite model, or cleanup evidence must fail.
67
+ Never report a skipped or synthetic run as a real login.
package/README.md CHANGED
@@ -1,112 +1,149 @@
1
- # opencodex: Cline-only proxy
1
+ # opencodex: Cline + Gemini CLI proxy
2
2
 
3
3
  `ocx` is a small local proxy that lets OpenAI Codex and Claude Code use a locally
4
- installed Cline CLI as their model transport.
4
+ installed Cline CLI or Gemini CLI as their model transport.
5
5
 
6
- This fork contains only that path. There is no dashboard, desktop app, macOS
7
- widget, client-config integration writer, multi-provider router, account pool, or
6
+ This fork contains only those two local CLI paths. There is no dashboard, desktop
7
+ app, macOS widget, client-config integration writer, account pool, docs site, or
8
8
  GitHub Actions workflow.
9
9
 
10
10
  ## Requirements
11
11
 
12
12
  - Bun 1.4.4 (the npm launcher installs the pinned runtime)
13
- - A locally installed and authenticated `cline` CLI
13
+ - A locally installed and authenticated Cline CLI, Gemini CLI, or both
14
14
 
15
15
  ```bash
16
16
  npm install -g cline
17
17
  cline auth
18
+
19
+ npm install -g @google/gemini-cli
20
+ gemini # use the official login or configure GEMINI_API_KEY
18
21
  ```
19
22
 
23
+ Gemini authentication remains in Gemini CLI's own home/settings. The proxy never
24
+ copies, logs, or stores an API key, OAuth token, bearer token, or full request
25
+ body.
26
+
20
27
  ## Install
21
28
 
22
29
  ```bash
23
30
  bun install
24
- bun run src/cli/index.ts login cline-cli
25
31
  bun run src/cli/index.ts provider add cline-cli --set-default
26
32
  bun run src/cli/index.ts start
27
33
  ```
28
34
 
35
+ Select the Gemini transport instead with:
36
+
37
+ ```bash
38
+ bun run src/cli/index.ts provider add gemini-cli --set-default
39
+ bun run src/cli/index.ts start
40
+ ```
41
+
29
42
  The default config is `~/.opencodex/config.json`; set `OPENCODEX_HOME` to isolate
30
- it. The proxy listens on `http://127.0.0.1:10100/v1` by default.
43
+ it. The proxy listens on `http://127.0.0.1:10100/v1` by default. Existing
44
+ Cline-only configs load unchanged and keep Cline as the default.
31
45
 
32
46
  ## Codex
33
47
 
34
48
  Use a Responses provider pointed at the proxy:
35
49
 
36
50
  ```toml
37
- model = "cline-cli/default"
51
+ model = "gemini-cli/gemini-3.5-flash-lite"
38
52
  model_provider = "opencodex"
39
53
 
40
54
  [model_providers.opencodex]
41
- name = "opencodex (Cline CLI)"
55
+ name = "opencodex (Cline or Gemini CLI)"
42
56
  base_url = "http://127.0.0.1:10100/v1"
43
57
  wire_api = "responses"
44
58
  requires_openai_auth = false
45
59
  ```
46
60
 
47
- The model list is live: Cline's ACP session supplies native model ids, exposed as
48
- `cline-cli/<encoded-id>`. `cline-cli/default` always remains available.
61
+ The model list is live. Cline ACP models are exposed as `cline-cli/<encoded-id>`;
62
+ Gemini ACP models are exposed as `gemini-cli/<encoded-id>`. Each provider keeps a
63
+ `default` selector. A provider prefix routes only to that vendor; unprefixed
64
+ `default` uses the configured default provider.
49
65
 
50
66
  ## Claude Code
51
67
 
52
68
  ```bash
53
69
  ANTHROPIC_BASE_URL=http://127.0.0.1:10100 \
54
70
  ANTHROPIC_AUTH_TOKEN=local \
55
- ANTHROPIC_MODEL=cline-cli/default \
71
+ ANTHROPIC_MODEL=gemini-cli/gemini-3.5-flash-lite \
56
72
  claude
57
73
  ```
58
74
 
59
- The proxy translates `/v1/messages` to the same Cline turn and returns Anthropic
60
- JSON or SSE.
75
+ Use a `cline-cli/...` model to route the same Messages surface to Cline.
61
76
 
62
77
  ## Security boundary
63
78
 
64
- - Cline receives no filesystem or terminal capability from the proxy.
65
- - Cline permission requests are denied; tool intent is returned to Codex for its
66
- own approval and execution.
67
- - Vendor credentials remain in Cline's real home. The proxy stores no Cline token.
79
+ - Neither Cline nor Gemini receives filesystem or terminal capability from the proxy.
80
+ - Gemini native tools are removed by a per-turn deny policy; permission requests
81
+ are cancelled, and no ACP filesystem/terminal client capabilities are advertised.
82
+ User MCP servers, extensions, skills, and hooks are disabled for the session; only
83
+ the isolated `opencodex` MCP catalog can receive a client tool call.
84
+ - Declared client tools are exposed only through a request-scoped MCP process that
85
+ records bounded intent and never executes; Codex owns approval and execution.
86
+ - Vendor credentials remain in the vendor's real home or authenticated
87
+ environment. The proxy stores no vendor token.
68
88
  - Request-path traffic never starts an interactive login.
69
89
  - The listener is loopback-only by default; a non-loopback listener requires an
70
90
  explicit API token.
71
- - Image, video, and audio input are rejected before a Cline process starts.
91
+ - Image, video, and audio input are rejected before a vendor process starts.
72
92
 
73
93
  ## Commands
74
94
 
75
95
  ```bash
76
96
  bun run src/cli/index.ts login cline-cli [--json] [--no-wait]
77
- bun run src/cli/index.ts provider add cline-cli [--set-default]
78
- bun run src/cli/index.ts provider use cline-cli
97
+ bun run src/cli/index.ts provider add <cline-cli|gemini-cli> [--set-default]
98
+ bun run src/cli/index.ts provider use <cline-cli|gemini-cli>
79
99
  bun run src/cli/index.ts provider list [--json]
80
100
  bun run src/cli/index.ts start [--port 10100] [--host 127.0.0.1]
81
101
  bun run src/cli/index.ts status [--json]
82
102
  bun run src/cli/index.ts stop [--json]
83
103
  ```
84
104
 
105
+ Gemini has no proxy login command. Authenticate it through the official CLI
106
+ (`gemini` or its API-key configuration); `ocx login gemini-cli` returns that
107
+ guidance without prompting for or accepting a credential.
108
+
85
109
  ## Tests
86
110
 
87
111
  ```bash
88
112
  bun run typecheck
89
113
  bun test tests
90
114
  bun run test:e2e
115
+ bun run test:e2e:gemini
116
+ bun run test:e2e:gemini-tool
91
117
  bun run privacy:scan
92
118
  bun run structure:check
93
119
  ```
94
120
 
95
- The end-to-end test starts the real HTTP server, uses the deterministic ACP
96
- fixture, exercises model discovery, buffered and streamed Responses, Anthropic
97
- Messages, a native model selection, and child-process cleanup. It fails rather
98
- than skipping when any part is missing.
121
+ The deterministic suite uses ACP fixtures for both providers and fails rather than
122
+ skipping missing fixture/process behavior. `test:e2e` covers Cline HTTP behavior.
123
+
124
+ `test:e2e:gemini` is the one-completion text gate. It starts an isolated
125
+ opencodex listener, discovers the real authenticated Gemini roster, chooses an
126
+ advertised Flash Lite model, writes an isolated `CODEX_HOME`, runs one real Codex
127
+ prompt, and asserts the response marker, observed model, and child cleanup.
128
+
129
+ `test:e2e:gemini-tool` exercises the two-completion tool loop: Gemini requests
130
+ Codex's `exec_command`, Codex executes a fixed read-only `printf`, and Gemini
131
+ returns the final answer. Both commands use no retries. Missing binaries,
132
+ authentication, or a Flash Lite model cause a hard failure.
99
133
 
100
- To exercise a real Cline binary, set `CLINE_BIN_PATH` to its executable and run
101
- the same test. A real account is not required by the automated fixture; never
102
- describe synthetic evidence as a real-account verification.
134
+ Optional overrides are `CLINE_BIN_PATH`, `GEMINI_BIN_PATH`, and `CODEX_BIN_PATH`.
103
135
 
104
136
  ## Troubleshooting
105
137
 
106
138
  - **Cline not found**: install `cline` and verify `cline --help` works.
107
- - **Authentication required**: run `ocx login cline-cli`, then retry the turn.
108
- - **ACP unavailable**: the adapter falls back to the one-shot JSON path when the
109
- model is `default`; native model selection requires ACP.
139
+ - **Cline authentication required**: run `ocx login cline-cli`, then retry.
140
+ - **Cline ACP unavailable**: the adapter falls back to the one-shot JSON path when
141
+ the model is `default`; native model selection requires ACP.
142
+ - **Gemini not found**: install it and verify `gemini --help` works, or set
143
+ `GEMINI_BIN_PATH`.
144
+ - **Gemini authentication required**: configure Gemini CLI's official login or API
145
+ key; do not pass the key to opencodex.
146
+ - **Gemini ACP unavailable**: upgrade Gemini CLI to a version advertising `--acp`.
110
147
  - **Port in use**: choose another port with `ocx start --port <port>`.
111
148
  - **Stale runtime state**: run `ocx stop`; it removes stale state only when the
112
149
  recorded process and health endpoint cannot be verified.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koreanhole/opencodex",
3
- "version": "2.95.10",
4
- "description": "Cline CLI-only provider proxy for OpenAI Codex and Claude Code",
3
+ "version": "2.96.0",
4
+ "description": "Cline and Gemini CLI provider proxy for OpenAI Codex and Claude Code",
5
5
  "type": "module",
6
6
  "main": "./bin/package-main.mjs",
7
7
  "exports": {
@@ -30,6 +30,8 @@
30
30
  "start": "bun run src/cli/index.ts start",
31
31
  "test": "bun test tests",
32
32
  "test:e2e": "bun test tests/e2e/cline-only.test.ts",
33
+ "test:e2e:gemini": "bun test ./tests/e2e/gemini-codex.live.ts -t \"one minimal Flash Lite completion\"",
34
+ "test:e2e:gemini-tool": "bun test ./tests/e2e/gemini-codex.live.ts -t \"one short Gemini tool call\"",
33
35
  "typecheck": "bun check --no-script --noEmit",
34
36
  "privacy:scan": "bun scripts/privacy-scan.ts",
35
37
  "structure:check": "bun scripts/structure-check.ts",
@@ -47,6 +49,7 @@
47
49
  },
48
50
  "keywords": [
49
51
  "cline",
52
+ "gemini",
50
53
  "codex",
51
54
  "claude-code",
52
55
  "proxy",