@elvatis_com/openclaw-cli-bridge-elvatis 1.9.0 → 2.0.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/.ai/handoff/STATUS.md +53 -50
- package/CONTRIBUTING.md +18 -0
- package/README.md +20 -2
- package/SKILL.md +1 -1
- package/index.ts +152 -1
- package/openclaw.plugin.json +2 -2
- package/package.json +1 -1
- package/src/cli-runner.ts +178 -19
- package/src/grok-client.ts +1 -1
- package/src/proxy-server.ts +141 -22
- package/src/session-manager.ts +307 -0
- package/test/chatgpt-proxy.test.ts +2 -2
- package/test/claude-proxy.test.ts +2 -2
- package/test/cli-runner-extended.test.ts +267 -0
- package/test/grok-proxy.test.ts +2 -2
- package/test/proxy-e2e.test.ts +274 -2
- package/test/session-manager.test.ts +339 -0
package/.ai/handoff/STATUS.md
CHANGED
|
@@ -1,55 +1,58 @@
|
|
|
1
1
|
# STATUS — openclaw-cli-bridge-elvatis
|
|
2
2
|
|
|
3
|
-
## Current Version: 1.
|
|
3
|
+
## Current Version: 1.9.2
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
|
11
|
-
|
|
5
|
+
- **npm:** @elvatis_com/openclaw-cli-bridge-elvatis (not yet published to npm)
|
|
6
|
+
- **ClawHub:** openclaw-cli-bridge-elvatis@1.9.2
|
|
7
|
+
- **GitHub:** https://github.com/elvatis/openclaw-cli-bridge-elvatis/releases/tag/v1.9.2
|
|
8
|
+
|
|
9
|
+
## CLI Model Token Limits (corrected in v1.9.2)
|
|
10
|
+
| Model | Context Window | Max Output |
|
|
11
|
+
|---|---|---|
|
|
12
|
+
| Claude Opus 4.6 (CLI) | 1,000,000 | 128,000 |
|
|
13
|
+
| Claude Sonnet 4.6 (CLI) | 1,000,000 | 64,000 |
|
|
14
|
+
| Claude Haiku 4.5 (CLI) | 200,000 | 64,000 |
|
|
15
|
+
| Gemini 2.5 Pro (CLI) | 1,048,576 | 65,535 |
|
|
16
|
+
| Gemini 2.5 Flash (CLI) | 1,048,576 | 65,535 |
|
|
17
|
+
| Gemini 3 Pro Preview (CLI) | 1,048,576 | 65,536 |
|
|
18
|
+
| Gemini 3 Flash Preview (CLI) | 1,048,576 | 65,536 |
|
|
19
|
+
|
|
20
|
+
## Architecture
|
|
21
|
+
- **Proxy server:** `http://127.0.0.1:31337/v1` (OpenAI-compatible)
|
|
22
|
+
- **OpenClaw connects via** `vllm` provider with `api: openai-completions`
|
|
23
|
+
- **CLI models** (`cli-claude/*`, `cli-gemini/*`): plain text completions only — NO tool/function call support
|
|
24
|
+
- **Web-session models** (`web-grok/*`, `web-gemini/*`): browser-based, require `/xxx-login`
|
|
25
|
+
- **Codex models** (`openai-codex/*`): OAuth auth bridge
|
|
26
|
+
- **BitNet** (`local-bitnet/*`): local CPU inference
|
|
27
|
+
|
|
28
|
+
## Tool Support Limitation
|
|
29
|
+
CLI models explicitly reject tool/function call requests (HTTP 400):
|
|
30
|
+
```
|
|
31
|
+
Model cli-claude/claude-opus-4-6 does not support tool/function calls.
|
|
32
|
+
Use a native API model (e.g. github-copilot/gpt-5-mini) for agents that need tools.
|
|
33
|
+
```
|
|
34
|
+
This is by design — CLI tools output plain text only.
|
|
35
|
+
|
|
36
|
+
## All 4 Browser Providers
|
|
37
|
+
| Provider | Models | Login Cmd | Profile Dir |
|
|
38
|
+
|---|---|---|---|
|
|
39
|
+
| Grok | web-grok/grok-3, grok-3-fast, grok-3-mini, grok-3-mini-fast | /grok-login | ~/.openclaw/grok-profile/ |
|
|
40
|
+
| Gemini | web-gemini/gemini-2-5-pro, gemini-2-5-flash, gemini-3-pro, gemini-3-flash | /gemini-login | ~/.openclaw/gemini-profile/ |
|
|
41
|
+
| Claude | web-claude/* (removed in v1.6.x) | /claude-login | ~/.openclaw/claude-profile/ |
|
|
42
|
+
| ChatGPT | web-chatgpt/* (removed in v1.6.x) | /chatgpt-login | ~/.openclaw/chatgpt-profile/ |
|
|
12
43
|
|
|
13
44
|
## Stats
|
|
14
|
-
- 22 total models (
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- 🔴 session expired — needs /xxx-login
|
|
29
|
-
- ⚪ never logged in
|
|
30
|
-
|
|
31
|
-
## Cookie Expiry Tracking (fixed in v1.7.3)
|
|
32
|
-
All 4 providers now track the **longest-lived** auth cookie instead of the shortest:
|
|
33
|
-
- Claude: `sessionKey` (~1 year) — was `__cf_bm` (Cloudflare, ~30 min) causing false alerts
|
|
34
|
-
- ChatGPT: longest of `__Secure-next-auth.session-token` / `_puid` / `oai-did`
|
|
35
|
-
- Gemini: longest of `__Secure-1PSID` / `__Secure-3PSID` / `SID`
|
|
36
|
-
- Grok: longest of `sso` / `sso-rw`
|
|
37
|
-
|
|
38
|
-
## Release History
|
|
39
|
-
- v1.7.3 (2026-03-13): Fix cookie expiry tracking — use longest-lived auth cookie for all 4 providers
|
|
40
|
-
- v1.7.2 (2026-03-13): Cookie-first startup restore (skip fragile browser selector check)
|
|
41
|
-
- v1.7.1 (2026-03-13): /status HTML dashboard at :31337
|
|
42
|
-
- v1.7.0 (2026-03-13): Startup restore timeout fix, auto-relogin, keep-alive verification, vitest suite
|
|
43
|
-
- v1.6.1 (2026-03-13): Fix /bridge-status — use cookie expiry as source of truth
|
|
44
|
-
- v1.6.0 (2026-03-13): Persistent Chromium profiles for all 4 providers (Claude web + ChatGPT)
|
|
45
|
-
- v1.5.1 (2026-03-12): Fix hardcoded plugin version
|
|
46
|
-
- v1.5.0 (2026-03-12): Remove /claude-login and /chatgpt-login (pre-v1.6.0 interim)
|
|
47
|
-
- v1.4.0 (2026-03-12): Persistent browser fallback for Claude/Gemini/ChatGPT (no CDP required)
|
|
48
|
-
- v1.3.5 (2026-03-12): Startup restore guard (SIGUSR1 OOM fix)
|
|
49
|
-
- v1.3.0 (2026-03-11): Browser auto-reconnect after gateway restart
|
|
50
|
-
- v1.0.0 (2026-03-11): All 4 providers headless — 96/96 tests
|
|
51
|
-
|
|
52
|
-
## Next Steps
|
|
53
|
-
- /chatgpt-login should be re-run soon (~6d left on _puid cookie)
|
|
54
|
-
- Gemini model switching via UI (2.5 Pro vs Flash vs 3)
|
|
55
|
-
- Context-window management for long conversations
|
|
45
|
+
- 22+ total models (7 CLI + 5 Codex + 4 Grok + 4 Gemini + 1 BitNet)
|
|
46
|
+
- Persistent Chromium profiles survive gateway restarts
|
|
47
|
+
- /bridge-status shows cookie-based status
|
|
48
|
+
|
|
49
|
+
## Release History (recent)
|
|
50
|
+
- v1.9.2 (2026-03-15): Fix maxTokens/contextWindow for all CLI_MODELS (were 8192, now correct per vendor specs)
|
|
51
|
+
- v1.9.1: Previous stable
|
|
52
|
+
- v1.7.3 (2026-03-13): Fix cookie expiry tracking
|
|
53
|
+
- v1.7.0 (2026-03-13): Startup restore timeout fix, auto-relogin, vitest suite
|
|
54
|
+
- v1.6.0 (2026-03-13): Persistent Chromium profiles for all 4 providers
|
|
55
|
+
|
|
56
|
+
## Known Issues
|
|
57
|
+
- CLI models cannot do tool calls (by design — plain text proxy)
|
|
58
|
+
- Opus via CLI proxy may halluzinate XML tool-call tags when maxTokens was too low (fixed in v1.9.2)
|
package/CONTRIBUTING.md
CHANGED
|
@@ -57,6 +57,24 @@ clawhub publish "$TMPDIR" --slug openclaw-cli-bridge-elvatis --version X.Y.Z \
|
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
60
|
+
## 🚨 Doku-Regel (PFLICHT)
|
|
61
|
+
|
|
62
|
+
**Wenn ein Feature hinzukommt, geändert oder entfernt wird → SOFORT in ALLEN Doku-Dateien aktualisieren.**
|
|
63
|
+
|
|
64
|
+
Gilt für: `README.md`, `SKILL.md`, `CONTRIBUTING.md`, `openclaw.plugin.json`, ClawHub, npm, GitHub.
|
|
65
|
+
|
|
66
|
+
**Konkret für Slash Commands:**
|
|
67
|
+
- Neuer Command (`/cli-xyz`) → sofort in README Utility-Tabelle + ASCII-Beispielblock eintragen
|
|
68
|
+
- Command entfernt → sofort aus README + SKILL.md entfernen, nicht beim nächsten Release
|
|
69
|
+
- Command umbenannt → beide Stellen gleichzeitig ändern
|
|
70
|
+
|
|
71
|
+
**Tested Badge:**
|
|
72
|
+
- Neues Feature getestet → sofort `✅ Tested` Badge in README setzen
|
|
73
|
+
|
|
74
|
+
Kein "machen wir beim nächsten Release" — immer sofort, im gleichen Commit.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
60
78
|
## Versionsstellen — alle prüfen vor Release
|
|
61
79
|
|
|
62
80
|
```bash
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> OpenClaw plugin that bridges locally installed AI CLIs (Codex, Gemini, Claude Code) as model providers — with slash commands for instant model switching, restore, health testing, and model listing.
|
|
4
4
|
|
|
5
|
-
**Current version:** `1.9.
|
|
5
|
+
**Current version:** `1.9.2`
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -70,6 +70,7 @@ All commands use gateway-level `commands.allowFrom` for authorization (`requireA
|
|
|
70
70
|
| `/cli-back` | Restore the model active **before** the last `/cli-*` switch |
|
|
71
71
|
| `/cli-test [model]` | One-shot proxy health check — **does NOT switch your active model** |
|
|
72
72
|
| `/cli-list` | Show all registered CLI bridge models with commands |
|
|
73
|
+
| `/cli-help` | Full reference card — CLI/Codex/Web/BitNet sections, expiry info, quick examples, dashboard links |
|
|
73
74
|
|
|
74
75
|
**`/cli-back` details:**
|
|
75
76
|
- Before every `/cli-*` switch the current model is saved to `~/.openclaw/cli-bridge-state.json`
|
|
@@ -217,7 +218,8 @@ openclaw models auth login --provider openai-codex
|
|
|
217
218
|
Utility
|
|
218
219
|
/cli-back Restore previous model
|
|
219
220
|
/cli-test [model] Health check (no model switch)
|
|
220
|
-
/cli-list
|
|
221
|
+
/cli-list All models with slash commands + dashboard URL
|
|
222
|
+
/cli-help Full reference card (sections, expiry, examples, links)
|
|
221
223
|
|
|
222
224
|
Proxy: 127.0.0.1:31337
|
|
223
225
|
```
|
|
@@ -356,6 +358,22 @@ npm run ci # lint + typecheck + test
|
|
|
356
358
|
|
|
357
359
|
## Changelog
|
|
358
360
|
|
|
361
|
+
### v1.9.2
|
|
362
|
+
- **fix:** Correct `maxTokens` and `contextWindow` for all CLI_MODELS — were hardcoded to 8192 output tokens
|
|
363
|
+
- Claude Opus 4.6: 1M context / 128k output (was 200k/8k)
|
|
364
|
+
- Claude Sonnet 4.6: 1M context / 64k output (was 200k/8k)
|
|
365
|
+
- Claude Haiku 4.5: 200k context / 64k output (was 200k/8k)
|
|
366
|
+
- Gemini 2.5 Pro/Flash: 1M context / 65k output (was 1M/8k)
|
|
367
|
+
- Gemini 3 Pro/Flash Preview: 1M context / 65k output (was 1M/8k)
|
|
368
|
+
- Web-session Gemini models: same corrections
|
|
369
|
+
|
|
370
|
+
### v1.9.1
|
|
371
|
+
- **feat:** Full slash command mapping on status page — all models now show their /cli-* command
|
|
372
|
+
- **fix:** Register missing slash commands: /cli-codex-spark, /cli-codex52, /cli-codex-mini, /cli-gemini3-flash (documented but never registered)
|
|
373
|
+
- **feat:** /cli-help command — full reference with CLI/Codex/Web/BitNet sections, expiry info, quick examples, dashboard links
|
|
374
|
+
- **feat:** /cli-list now references /cli-help and shows dashboard URL
|
|
375
|
+
|
|
376
|
+
/
|
|
359
377
|
### v1.9.0
|
|
360
378
|
- **feat:** Auto-source version from `package.json` — eliminates hardcoded version string sync issues (was stale across v1.8.2–v1.8.8)
|
|
361
379
|
- **feat:** ESLint config (`eslint.config.js`) — TypeScript-aware linting with `npm run lint`, integrated into CI pipeline
|
package/SKILL.md
CHANGED
package/index.ts
CHANGED
|
@@ -752,9 +752,13 @@ const CLI_MODEL_COMMANDS = [
|
|
|
752
752
|
{ name: "cli-gemini", model: "vllm/cli-gemini/gemini-2.5-pro", description: "Gemini 2.5 Pro (Gemini CLI)", label: "Gemini 2.5 Pro (CLI)" },
|
|
753
753
|
{ name: "cli-gemini-flash", model: "vllm/cli-gemini/gemini-2.5-flash", description: "Gemini 2.5 Flash (Gemini CLI)", label: "Gemini 2.5 Flash (CLI)" },
|
|
754
754
|
{ name: "cli-gemini3", model: "vllm/cli-gemini/gemini-3-pro-preview", description: "Gemini 3 Pro (Gemini CLI)", label: "Gemini 3 Pro (CLI)" },
|
|
755
|
+
{ name: "cli-gemini3-flash", model: "vllm/cli-gemini/gemini-3-flash-preview", description: "Gemini 3 Flash (Gemini CLI)", label: "Gemini 3 Flash (CLI)" },
|
|
755
756
|
// ── Codex CLI (openai-codex provider, OAuth auth) ────────────────────────────
|
|
756
757
|
{ name: "cli-codex", model: "openai-codex/gpt-5.3-codex", description: "GPT-5.3 Codex (Codex CLI auth)", label: "GPT-5.3 Codex" },
|
|
758
|
+
{ name: "cli-codex-spark", model: "openai-codex/gpt-5.3-codex-spark", description: "GPT-5.3 Codex Spark (Codex CLI auth)", label: "GPT-5.3 Codex Spark" },
|
|
759
|
+
{ name: "cli-codex52", model: "openai-codex/gpt-5.2-codex", description: "GPT-5.2 Codex (Codex CLI auth)", label: "GPT-5.2 Codex" },
|
|
757
760
|
{ name: "cli-codex54", model: "openai-codex/gpt-5.4", description: "GPT-5.4 (Codex CLI auth)", label: "GPT-5.4" },
|
|
761
|
+
{ name: "cli-codex-mini", model: "openai-codex/gpt-5.1-codex-mini", description: "GPT-5.1 Codex Mini (Codex CLI auth)", label: "GPT-5.1 Codex Mini" },
|
|
758
762
|
// ── BitNet local inference (via local proxy → llama-server) ─────────────────
|
|
759
763
|
{ name: "cli-bitnet", model: "vllm/local-bitnet/bitnet-2b", description: "BitNet b1.58 2B (local CPU, no API key)", label: "BitNet 2B (local)" },
|
|
760
764
|
] as const;
|
|
@@ -1646,12 +1650,158 @@ const plugin = {
|
|
|
1646
1650
|
lines.push(" /cli-back Restore previous model + clear staged");
|
|
1647
1651
|
lines.push(" /cli-test [model] Health check (no model switch)");
|
|
1648
1652
|
lines.push(" /cli-list This overview");
|
|
1653
|
+
lines.push(" /cli-help Connected providers + examples + dashboard link");
|
|
1649
1654
|
lines.push("");
|
|
1650
1655
|
lines.push("*Switching safely:*");
|
|
1651
1656
|
lines.push(" /cli-sonnet → stages switch (safe, apply later)");
|
|
1652
1657
|
lines.push(" /cli-sonnet --now → immediate switch (only between sessions!)");
|
|
1653
1658
|
lines.push("");
|
|
1654
|
-
lines.push(`Proxy: \`127.0.0.1:${port}
|
|
1659
|
+
lines.push(`Proxy: \`127.0.0.1:${port}\` · Dashboard: http://127.0.0.1:${port}/status`);
|
|
1660
|
+
|
|
1661
|
+
return { text: lines.join("\n") };
|
|
1662
|
+
},
|
|
1663
|
+
} satisfies OpenClawPluginCommandDefinition);
|
|
1664
|
+
|
|
1665
|
+
// ── Phase 3e: /cli-help — context-aware help with connected providers ─────
|
|
1666
|
+
api.registerCommand({
|
|
1667
|
+
name: "cli-help",
|
|
1668
|
+
description: "Show available models based on currently connected providers, with example commands and status page link.",
|
|
1669
|
+
requireAuth: false,
|
|
1670
|
+
handler: async (): Promise<PluginCommandResult> => {
|
|
1671
|
+
const lines: string[] = [`🌉 *CLI Bridge Help* — v${plugin.version}`, ""];
|
|
1672
|
+
|
|
1673
|
+
// ── CLI models (always available — spawns local CLI) ────────────────
|
|
1674
|
+
lines.push("*CLI Models* (always available — uses locally installed CLIs)");
|
|
1675
|
+
lines.push("");
|
|
1676
|
+
const cliGroups: Record<string, typeof CLI_MODEL_COMMANDS[number][]> = {
|
|
1677
|
+
"Claude Code": [],
|
|
1678
|
+
"Gemini": [],
|
|
1679
|
+
};
|
|
1680
|
+
for (const c of CLI_MODEL_COMMANDS) {
|
|
1681
|
+
if (c.model.startsWith("vllm/cli-claude/")) cliGroups["Claude Code"].push(c);
|
|
1682
|
+
else if (c.model.startsWith("vllm/cli-gemini/")) cliGroups["Gemini"].push(c);
|
|
1683
|
+
}
|
|
1684
|
+
for (const [group, entries] of Object.entries(cliGroups)) {
|
|
1685
|
+
if (entries.length === 0) continue;
|
|
1686
|
+
lines.push(` *${group}*`);
|
|
1687
|
+
for (const c of entries) {
|
|
1688
|
+
const modelShort = c.model.replace(/^vllm\/cli-(claude|gemini)\//, "");
|
|
1689
|
+
lines.push(` \`/${c.name}\` → ${modelShort}`);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
lines.push("");
|
|
1693
|
+
|
|
1694
|
+
// ── Codex models (OAuth — always registered) ────────────────────────
|
|
1695
|
+
const codexEntries = CLI_MODEL_COMMANDS.filter(c => c.model.startsWith("openai-codex/"));
|
|
1696
|
+
if (codexEntries.length > 0) {
|
|
1697
|
+
lines.push("*Codex* (OAuth — direct API, no proxy)");
|
|
1698
|
+
for (const c of codexEntries) {
|
|
1699
|
+
const modelShort = c.model.replace(/^openai-codex\//, "");
|
|
1700
|
+
lines.push(` \`/${c.name}\` → ${modelShort}`);
|
|
1701
|
+
}
|
|
1702
|
+
lines.push("");
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
// ── Web session models (only if connected) ──────────────────────────
|
|
1706
|
+
const webProviders: Array<{
|
|
1707
|
+
name: string;
|
|
1708
|
+
ctx: BrowserContext | null;
|
|
1709
|
+
models: string[];
|
|
1710
|
+
cmds: string[];
|
|
1711
|
+
loginCmd: string;
|
|
1712
|
+
expiry: string | null;
|
|
1713
|
+
}> = [
|
|
1714
|
+
{
|
|
1715
|
+
name: "Grok",
|
|
1716
|
+
ctx: grokContext,
|
|
1717
|
+
models: ["web-grok/grok-3", "web-grok/grok-3-fast", "web-grok/grok-3-mini", "web-grok/grok-3-mini-fast"],
|
|
1718
|
+
cmds: ["openclaw models set vllm/web-grok/grok-3"],
|
|
1719
|
+
loginCmd: "/grok-login",
|
|
1720
|
+
expiry: (() => { const e = loadGrokExpiry(); return e ? formatExpiryInfo(e) : null; })(),
|
|
1721
|
+
},
|
|
1722
|
+
{
|
|
1723
|
+
name: "Gemini (web)",
|
|
1724
|
+
ctx: geminiContext,
|
|
1725
|
+
models: ["web-gemini/gemini-2-5-pro", "web-gemini/gemini-2-5-flash", "web-gemini/gemini-3-pro", "web-gemini/gemini-3-flash"],
|
|
1726
|
+
cmds: ["openclaw models set vllm/web-gemini/gemini-2-5-pro"],
|
|
1727
|
+
loginCmd: "/gemini-login",
|
|
1728
|
+
expiry: (() => { const e = loadGeminiExpiry(); return e ? formatGeminiExpiry(e) : null; })(),
|
|
1729
|
+
},
|
|
1730
|
+
{
|
|
1731
|
+
name: "Claude.ai (web)",
|
|
1732
|
+
ctx: claudeWebContext,
|
|
1733
|
+
models: ["web-claude/*"],
|
|
1734
|
+
cmds: [],
|
|
1735
|
+
loginCmd: "/claude-login",
|
|
1736
|
+
expiry: (() => { const e = loadClaudeExpiry(); return e ? formatClaudeExpiry(e) : null; })(),
|
|
1737
|
+
},
|
|
1738
|
+
{
|
|
1739
|
+
name: "ChatGPT (web)",
|
|
1740
|
+
ctx: chatgptContext,
|
|
1741
|
+
models: ["web-chatgpt/*"],
|
|
1742
|
+
cmds: [],
|
|
1743
|
+
loginCmd: "/chatgpt-login",
|
|
1744
|
+
expiry: (() => { const e = loadChatGPTExpiry(); return e ? formatChatGPTExpiry(e) : null; })(),
|
|
1745
|
+
},
|
|
1746
|
+
];
|
|
1747
|
+
|
|
1748
|
+
const connectedWeb = webProviders.filter(p => p.ctx !== null);
|
|
1749
|
+
const disconnectedWeb = webProviders.filter(p => p.ctx === null);
|
|
1750
|
+
|
|
1751
|
+
if (connectedWeb.length > 0) {
|
|
1752
|
+
lines.push("*Web Session Models* (connected)");
|
|
1753
|
+
for (const p of connectedWeb) {
|
|
1754
|
+
const expiryNote = p.expiry ? ` — ${p.expiry}` : "";
|
|
1755
|
+
lines.push(` 🟢 *${p.name}*${expiryNote}`);
|
|
1756
|
+
lines.push(` Models: ${p.models.join(", ")}`);
|
|
1757
|
+
if (p.cmds.length > 0) {
|
|
1758
|
+
lines.push(` Example: \`${p.cmds[0]}\``);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
lines.push("");
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
if (disconnectedWeb.length > 0) {
|
|
1765
|
+
lines.push("*Web Session Models* (not connected)");
|
|
1766
|
+
for (const p of disconnectedWeb) {
|
|
1767
|
+
const expiryNote = p.expiry && !p.expiry.startsWith("⚠️ EXPIRED") ? " (cookies valid, auto-connects on use)" : "";
|
|
1768
|
+
lines.push(` ⚪ *${p.name}*${expiryNote} → run \`${p.loginCmd}\``);
|
|
1769
|
+
}
|
|
1770
|
+
lines.push("");
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
// ── BitNet ──────────────────────────────────────────────────────────
|
|
1774
|
+
const bitnetOk = await checkBitNetServer();
|
|
1775
|
+
if (bitnetOk) {
|
|
1776
|
+
lines.push("*Local Inference*");
|
|
1777
|
+
lines.push(" 🟢 *BitNet 2B* — running → \`/cli-bitnet\`");
|
|
1778
|
+
} else {
|
|
1779
|
+
lines.push("*Local Inference*");
|
|
1780
|
+
lines.push(" ⚪ *BitNet 2B* — not running → \`sudo systemctl start bitnet-server\`");
|
|
1781
|
+
}
|
|
1782
|
+
lines.push("");
|
|
1783
|
+
|
|
1784
|
+
// ── Utility commands ────────────────────────────────────────────────
|
|
1785
|
+
lines.push("*Utility Commands*");
|
|
1786
|
+
lines.push(" \`/cli-help\` This help");
|
|
1787
|
+
lines.push(" \`/cli-list\` All models (no status check)");
|
|
1788
|
+
lines.push(" \`/cli-test [model]\` Health check (no model switch)");
|
|
1789
|
+
lines.push(" \`/cli-back\` Restore previous model");
|
|
1790
|
+
lines.push(" \`/cli-apply\` Apply staged model switch");
|
|
1791
|
+
lines.push(" \`/bridge-status\` Full provider diagnostics");
|
|
1792
|
+
lines.push("");
|
|
1793
|
+
|
|
1794
|
+
// ── Quick examples ──────────────────────────────────────────────────
|
|
1795
|
+
lines.push("*Quick Examples*");
|
|
1796
|
+
lines.push(" \`/cli-sonnet\` Switch to Claude Sonnet (staged)");
|
|
1797
|
+
lines.push(" \`/cli-sonnet --now\` Switch immediately");
|
|
1798
|
+
lines.push(" \`/cli-gemini\` Switch to Gemini 2.5 Pro");
|
|
1799
|
+
lines.push(" \`/cli-codex\` Switch to GPT-5.3 Codex");
|
|
1800
|
+
lines.push("");
|
|
1801
|
+
|
|
1802
|
+
// ── Status page link ────────────────────────────────────────────────
|
|
1803
|
+
lines.push(`📊 Dashboard: http://127.0.0.1:${port}/status`);
|
|
1804
|
+
lines.push(`🔍 Health JSON: http://127.0.0.1:${port}/healthz`);
|
|
1655
1805
|
|
|
1656
1806
|
return { text: lines.join("\n") };
|
|
1657
1807
|
},
|
|
@@ -2262,6 +2412,7 @@ const plugin = {
|
|
|
2262
2412
|
"/chatgpt-status",
|
|
2263
2413
|
"/chatgpt-logout",
|
|
2264
2414
|
"/bridge-status",
|
|
2415
|
+
"/cli-help",
|
|
2265
2416
|
];
|
|
2266
2417
|
api.logger.info(`[cli-bridge] registered ${allCommands.length} commands: ${allCommands.join(", ")}`);
|
|
2267
2418
|
},
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "openclaw-cli-bridge-elvatis",
|
|
3
3
|
"slug": "openclaw-cli-bridge-elvatis",
|
|
4
4
|
"name": "OpenClaw CLI Bridge",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "2.0.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "Phase 1: openai-codex auth bridge. Phase 2: local HTTP proxy routing model calls through gemini/claude CLIs (vllm provider).",
|
|
8
8
|
"providers": [
|
|
@@ -38,4 +38,4 @@
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elvatis_com/openclaw-cli-bridge-elvatis",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Bridges gemini, claude, and codex CLI tools as OpenClaw model providers. Reads existing CLI auth without re-login.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"openclaw": {
|