@elvatis_com/openclaw-cli-bridge-elvatis 1.5.1 → 1.6.2
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/CONTRIBUTING.md +93 -0
- package/README.md +50 -3
- package/SKILL.md +16 -5
- package/index.ts +528 -7
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/src/proxy-server.ts +127 -0
- package/test/chatgpt-proxy.test.ts +153 -0
- package/test/claude-proxy.test.ts +140 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Contributing & Release Checklist
|
|
2
|
+
|
|
3
|
+
## 🚨 Pflicht-Workflow vor jedem Release
|
|
4
|
+
|
|
5
|
+
**Kein Publish ohne erfolgreichen `/bridge-status` Test!**
|
|
6
|
+
|
|
7
|
+
### 1. Build
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm run build
|
|
11
|
+
# Exit 0 erwartet — TS-Fehler sind ok (--noEmitOnError false), aber Exit != 0 blockiert
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### 2. Gateway neu starten
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
openclaw gateway restart
|
|
18
|
+
# oder via Chat: gateway restart
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 3. Smoke Tests (alle müssen grün sein)
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
/bridge-status → Grok ✅ + Gemini ✅ (beide connected, nicht "not connected")
|
|
25
|
+
/cli-test → CLI bridge OK, Latency < 10s
|
|
26
|
+
/grok-status → valid (Cookie-Expiry prüfen)
|
|
27
|
+
/gemini-status → valid (Cookie-Expiry prüfen)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Erst wenn alle Tests grün sind → publishen!**
|
|
31
|
+
|
|
32
|
+
### 4. Publish (Reihenfolge einhalten)
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# 1. Version bump in package.json + openclaw.plugin.json (beide!)
|
|
36
|
+
# 2. Git commit + tag
|
|
37
|
+
git add package.json openclaw.plugin.json
|
|
38
|
+
git commit -m "chore: bump to vX.Y.Z — <kurze Beschreibung>"
|
|
39
|
+
git tag vX.Y.Z
|
|
40
|
+
git push origin main vX.Y.Z
|
|
41
|
+
|
|
42
|
+
# 3. GitHub Release erstellen (Tag ≠ Release!)
|
|
43
|
+
gh release create vX.Y.Z --title "vX.Y.Z — <Titel>" --notes "<Notes>" --latest
|
|
44
|
+
|
|
45
|
+
# 4. npm publish
|
|
46
|
+
npm publish --access public
|
|
47
|
+
|
|
48
|
+
# 5. ClawHub publish (aus tmp-Dir, nicht direkt aus Repo)
|
|
49
|
+
TMPDIR=$(mktemp -d)
|
|
50
|
+
rsync -a --exclude='node_modules' --exclude='.git' --exclude='dist' \
|
|
51
|
+
--exclude='package-lock.json' --exclude='test' ./ "$TMPDIR/"
|
|
52
|
+
clawhub publish "$TMPDIR" --slug openclaw-cli-bridge-elvatis --version X.Y.Z \
|
|
53
|
+
--tags "latest" --changelog "<Changelog>"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
> ⚠️ **ClawHub Bug (CLI v0.7.0):** `acceptLicenseTerms: invalid value` — Workaround: `publish.js` vor dem Publish patchen und danach zurücksetzen. Details in AGENTS.md / MEMORY.md des Workspaces.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Versionsstellen — alle prüfen vor Release
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
grep -rn "X\.Y\.Z\|version" \
|
|
64
|
+
--include="*.md" --include="*.json" \
|
|
65
|
+
--exclude-dir=node_modules --exclude-dir=dist --exclude-dir=.git \
|
|
66
|
+
| grep -i "version"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Typische Stellen:
|
|
70
|
+
- `package.json` → `"version": "..."`
|
|
71
|
+
- `openclaw.plugin.json` → `"version": "..."`
|
|
72
|
+
- `README.md` → `**Current version:** ...` (falls vorhanden)
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Breaking Changes
|
|
77
|
+
|
|
78
|
+
Bei Breaking Changes (Major oder entfernte Commands):
|
|
79
|
+
- Version-Bump auf nächste **Minor** (z.B. 1.4.x → 1.5.0)
|
|
80
|
+
- GitHub Release Notes: `## ⚠️ Breaking Change` Sektion
|
|
81
|
+
- README Changelog: Was wurde entfernt + warum
|
|
82
|
+
- `/bridge-status` muss die entfernten Provider NICHT mehr zeigen
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## TS-Build-Fehler
|
|
87
|
+
|
|
88
|
+
Die folgenden TS-Fehler sind bekannt und ignorierbar (kein Runtime-Problem):
|
|
89
|
+
- `TS2307: Cannot find module 'openclaw/plugin-sdk'` — Typ-Deklarationen fehlen in npm-Paket
|
|
90
|
+
- `TS2339: Property 'handler' does not exist on type 'unknown'` — folgt aus TS2307
|
|
91
|
+
- `TS7006: Parameter implicitly has 'any' type` — minor, kein Effekt
|
|
92
|
+
|
|
93
|
+
Build läuft mit `--noEmitOnError false` durch. `npm run build` → Exit 0 ist das Kriterium, nicht null TS-Fehler.
|
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.
|
|
5
|
+
**Current version:** `1.6.2`
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -115,11 +115,42 @@ Routes requests through real browser sessions on the provider's web UI. Requires
|
|
|
115
115
|
| `/gemini-status` | Show session validity + cookie expiry |
|
|
116
116
|
| `/gemini-logout` | Clear session |
|
|
117
117
|
|
|
118
|
+
**Claude.ai** (claude.ai — Pro/Team subscription):
|
|
119
|
+
|
|
120
|
+
| Model | Notes |
|
|
121
|
+
|---|---|
|
|
122
|
+
| `web-claude/claude-sonnet` | Claude Sonnet (web) |
|
|
123
|
+
| `web-claude/claude-opus` | Claude Opus (web) |
|
|
124
|
+
| `web-claude/claude-haiku` | Claude Haiku (web) |
|
|
125
|
+
|
|
126
|
+
| Command | What it does |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `/claude-login` | Authenticate, save cookies to `~/.openclaw/claude-profile/` |
|
|
129
|
+
| `/claude-status` | Show session validity + cookie expiry |
|
|
130
|
+
| `/claude-logout` | Clear session |
|
|
131
|
+
|
|
132
|
+
**ChatGPT** (chatgpt.com — Plus/Pro subscription):
|
|
133
|
+
|
|
134
|
+
| Model | Notes |
|
|
135
|
+
|---|---|
|
|
136
|
+
| `web-chatgpt/gpt-4o` | GPT-4o |
|
|
137
|
+
| `web-chatgpt/gpt-4o-mini` | GPT-4o Mini |
|
|
138
|
+
| `web-chatgpt/gpt-o3` | GPT o3 |
|
|
139
|
+
| `web-chatgpt/gpt-o4-mini` | GPT o4-mini |
|
|
140
|
+
| `web-chatgpt/gpt-5` | GPT-5 |
|
|
141
|
+
|
|
142
|
+
| Command | What it does |
|
|
143
|
+
|---|---|
|
|
144
|
+
| `/chatgpt-login` | Authenticate, save cookies to `~/.openclaw/chatgpt-profile/` |
|
|
145
|
+
| `/chatgpt-status` | Show session validity + cookie expiry |
|
|
146
|
+
| `/chatgpt-logout` | Clear session |
|
|
147
|
+
|
|
118
148
|
**Session lifecycle:**
|
|
119
|
-
- First use: run `/xxx-login` once
|
|
149
|
+
- First use: run `/xxx-login` once — authenticates and saves cookies to persistent Chromium profile
|
|
120
150
|
- **No CDP required:** `/xxx-login` no longer depends on the OpenClaw browser (CDP port 18800). If CDP is available, cookies are imported from it; otherwise a standalone persistent Chromium is launched automatically.
|
|
151
|
+
- If headless login fails, a **headed browser** opens for manual login (5 min timeout)
|
|
121
152
|
- After gateway restart: sessions are **automatically restored** from saved profiles on startup (sequential, ~25s after start)
|
|
122
|
-
- `/bridge-status` — shows all providers at a glance with login state + expiry info
|
|
153
|
+
- `/bridge-status` — shows all 4 providers at a glance with login state + expiry info
|
|
123
154
|
|
|
124
155
|
---
|
|
125
156
|
|
|
@@ -329,6 +360,22 @@ npm test # vitest run (83 tests)
|
|
|
329
360
|
|
|
330
361
|
## Changelog
|
|
331
362
|
|
|
363
|
+
### v1.6.2
|
|
364
|
+
- **docs:** Add missing changelog entries (v1.5.1, v1.6.0, v1.6.1), fix /cli-codex54 command name in SKILL.md, add startup re-login alert description to SKILL.md.
|
|
365
|
+
|
|
366
|
+
### v1.6.1
|
|
367
|
+
- **feat:** WhatsApp re-login alerts on startup. After each gateway restart, the session restore loop collects any providers that failed to restore (cookies expired) and sends a single batched WhatsApp notification with the exact `/xxx-login` commands needed. No credential storage — remains fully 2FA-safe.
|
|
368
|
+
|
|
369
|
+
### v1.6.0
|
|
370
|
+
- **feat:** Persistent Chromium profiles for all 4 web providers (Grok, Gemini, Claude.ai, ChatGPT). Browser sessions now survive gateway restarts — cookies are stored in `~/.openclaw/{grok,gemini,claude,chatgpt}-profile/` and restored automatically on startup.
|
|
371
|
+
- **feat:** Re-added `/claude-login`, `/claude-status`, `/claude-logout`, `/chatgpt-login`, `/chatgpt-status`, `/chatgpt-logout` commands with full persistent profile support.
|
|
372
|
+
- **feat:** `/bridge-status` now shows all 4 providers with session state and cookie expiry at a glance.
|
|
373
|
+
- **fix:** Startup restore guard (`_startupRestoreDone`) prevents duplicate browser launches on hot-reloads (SIGUSR1).
|
|
374
|
+
|
|
375
|
+
### v1.5.1
|
|
376
|
+
- **fix:** Hardcoded plugin version `1.3.1` in plugin object updated to `1.5.1`.
|
|
377
|
+
- **docs:** Added `CONTRIBUTING.md` with release checklist and smoketest workflow.
|
|
378
|
+
|
|
332
379
|
### v1.5.0
|
|
333
380
|
- **refactor:** Removed `/claude-login`, `/claude-logout`, `/claude-status`, `/chatgpt-login`, `/chatgpt-logout`, `/chatgpt-status` commands and all related browser automation code. Claude is fully covered by `cli-claude/*` via CLI proxy, ChatGPT by `openai-codex` + `copilot-proxy`.
|
|
334
381
|
- **refactor:** Removed `web-claude/*` and `web-chatgpt/*` proxy routes and model entries from proxy server.
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: openclaw-cli-bridge-elvatis
|
|
3
|
-
description: Bridge local
|
|
3
|
+
description: Bridge local AI CLIs + web browser sessions (Grok, Gemini, Claude.ai, ChatGPT) into OpenClaw as model providers. Includes /cli-* slash commands for instant model switching and persistent browser profiles for all 4 web providers.
|
|
4
4
|
homepage: https://github.com/elvatis/openclaw-cli-bridge-elvatis
|
|
5
5
|
metadata:
|
|
6
6
|
{
|
|
@@ -15,7 +15,7 @@ metadata:
|
|
|
15
15
|
|
|
16
16
|
# OpenClaw CLI Bridge
|
|
17
17
|
|
|
18
|
-
Bridges locally installed AI CLIs
|
|
18
|
+
Bridges locally installed AI CLIs + web browser sessions into OpenClaw as model providers. Four phases:
|
|
19
19
|
|
|
20
20
|
## Phase 1 — Codex Auth Bridge
|
|
21
21
|
Registers `openai-codex` provider from existing `~/.codex/auth.json` tokens. No re-login.
|
|
@@ -39,11 +39,22 @@ Six instant model-switch commands (authorized senders only):
|
|
|
39
39
|
| `/cli-gemini-flash` | `vllm/cli-gemini/gemini-2.5-flash` |
|
|
40
40
|
| `/cli-gemini3` | `vllm/cli-gemini/gemini-3-pro` |
|
|
41
41
|
| `/cli-codex` | `openai-codex/gpt-5.3-codex` |
|
|
42
|
-
| `/cli-
|
|
42
|
+
| `/cli-codex54` | `openai-codex/gpt-5.4` |
|
|
43
43
|
| `/cli-back` | Restore previous model |
|
|
44
44
|
| `/cli-test [model]` | Health check (no model switch) |
|
|
45
45
|
|
|
46
|
-
Each command
|
|
46
|
+
Each command uses staged switching by default (apply with `/cli-apply`).
|
|
47
|
+
|
|
48
|
+
## Phase 4 — Web Browser Providers
|
|
49
|
+
Persistent Chromium profiles for 4 web providers (no API key needed):
|
|
50
|
+
- **Grok** (`web-grok/*`): `/grok-login`, `/grok-status`, `/grok-logout`
|
|
51
|
+
- **Gemini** (`web-gemini/*`): `/gemini-login`, `/gemini-status`, `/gemini-logout`
|
|
52
|
+
- **Claude.ai** (`web-claude/*`): `/claude-login`, `/claude-status`, `/claude-logout`
|
|
53
|
+
- **ChatGPT** (`web-chatgpt/*`): `/chatgpt-login`, `/chatgpt-status`, `/chatgpt-logout`
|
|
54
|
+
|
|
55
|
+
Sessions survive gateway restarts. `/bridge-status` shows all 4 at a glance.
|
|
56
|
+
|
|
57
|
+
On gateway restart, if any session has expired, a **WhatsApp alert** is sent automatically with the exact `/xxx-login` commands needed — no guessing required.
|
|
47
58
|
|
|
48
59
|
## Setup
|
|
49
60
|
|
|
@@ -53,4 +64,4 @@ Each command runs `openclaw models set <model>` atomically and replies with a co
|
|
|
53
64
|
|
|
54
65
|
See `README.md` for full configuration reference and architecture diagram.
|
|
55
66
|
|
|
56
|
-
**Version:** 1.
|
|
67
|
+
**Version:** 1.6.2
|