@euraika-bert/claude-model-router 0.1.2 → 0.1.4
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/README.md +10 -1
- package/bin/claude-model-router.mjs +11 -1
- package/files/update-check.mjs +1 -1
- package/install.sh +7 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,6 +27,15 @@ npm install -g @euraika-bert/claude-model-router
|
|
|
27
27
|
claude-model-router install
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
+
**Upgraden** naar de nieuwste versie:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx @euraika-bert/claude-model-router@latest install # met npx
|
|
34
|
+
claude-model-router upgrade # na npm install -g
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`upgrade` haalt altijd de nieuwste versie van npm op, ook als je globale installatie zelf nog oud is. Je keys, logins en instellingen blijven behouden. Gebruik na `npm install -g` dus niet `claude-model-router install` om te upgraden: dat draait de installer van de versie die je al hebt.
|
|
38
|
+
|
|
30
39
|
De installer vraagt je API-keys (Enter slaat een provider over), zet alleen de providers aan waarvoor je een key of login hebt en start de router als achtergrondservice. Herstart daarna Claude Code en kies een model met `/model`. Bij een nieuwe versie toont Claude Code een melding; zie [Installeren en updaten via npm](#installeren-en-updaten-via-npm-macos-linux-windows).
|
|
31
40
|
|
|
32
41
|
De repository bevat **geen API-keys, OAuth-tokens of persoonlijke `settings.json`**.
|
|
@@ -112,7 +121,7 @@ Wat de sync doet:
|
|
|
112
121
|
npx @euraika-bert/claude-model-router@latest install
|
|
113
122
|
```
|
|
114
123
|
|
|
115
|
-
Met `npm install -g @euraika-bert/claude-model-router` en daarna `claude-model-router install` werkt het ook; updaten doe je dan met `
|
|
124
|
+
Met `npm install -g @euraika-bert/claude-model-router` en daarna `claude-model-router install` werkt het ook; updaten doe je dan met `claude-model-router upgrade` (haalt de nieuwste versie op, ook als de globale installatie nog oud is).
|
|
116
125
|
|
|
117
126
|
Dit start de installer van je platform (`install.sh` op macOS en Linux, `install.ps1` op Windows) uit het npm-pakket. Hetzelfde commando werkt ook om te **updaten**. Je instellingen, keys en logins blijven behouden.
|
|
118
127
|
|
|
@@ -11,7 +11,15 @@ const command = process.argv[2] ?? 'install';
|
|
|
11
11
|
|
|
12
12
|
if (command === 'version' || command === '--version' || command === '-v') {
|
|
13
13
|
console.log(VERSION);
|
|
14
|
-
} else if (command === '
|
|
14
|
+
} else if (command === 'upgrade' || command === 'update') {
|
|
15
|
+
// A global install would otherwise run its own (old) installer: always fetch the latest release.
|
|
16
|
+
// shell on Windows: npx is npx.cmd, which Node only spawns through a shell (static args, no user input).
|
|
17
|
+
const result = spawnSync(process.platform === 'win32' ? 'npx.cmd' : 'npx',
|
|
18
|
+
['--yes', '@euraika-bert/claude-model-router@latest', 'install'],
|
|
19
|
+
{ stdio: 'inherit', shell: process.platform === 'win32' });
|
|
20
|
+
if (result.error) console.error(result.error.message);
|
|
21
|
+
process.exit(result.status ?? 1);
|
|
22
|
+
} else if (command === 'install') {
|
|
15
23
|
const result = process.platform === 'win32'
|
|
16
24
|
? spawnSync(
|
|
17
25
|
path.join(process.env.SystemRoot || 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),
|
|
@@ -26,6 +34,8 @@ if (command === 'version' || command === '--version' || command === '-v') {
|
|
|
26
34
|
|
|
27
35
|
Gebruik:
|
|
28
36
|
npx @euraika-bert/claude-model-router@latest install installeren of updaten (macOS, Linux, Windows)
|
|
37
|
+
claude-model-router upgrade na npm install -g: nieuwste versie ophalen en installeren
|
|
38
|
+
claude-model-router install installer van deze geïnstalleerde versie opnieuw draaien
|
|
29
39
|
npx @euraika-bert/claude-model-router version geïnstalleerde pakketversie tonen`);
|
|
30
40
|
process.exit(command === 'help' || command === '--help' || command === '-h' ? 0 : 1);
|
|
31
41
|
}
|
package/files/update-check.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
6
|
|
|
7
|
-
export const VERSION = '0.1.
|
|
7
|
+
export const VERSION = '0.1.4'; // keep equal to package.json (test/usage.test.mjs checks it)
|
|
8
8
|
const PACKAGE = '@euraika-bert/claude-model-router';
|
|
9
9
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
10
10
|
let latestVersion = null;
|
package/install.sh
CHANGED
|
@@ -142,8 +142,13 @@ for _ in {1..20}; do
|
|
|
142
142
|
fi
|
|
143
143
|
sleep 0.5
|
|
144
144
|
done
|
|
145
|
-
curl --fail --silent http://127.0.0.1:8765/__health
|
|
146
|
-
printf '
|
|
145
|
+
HEALTH="$(curl --fail --silent http://127.0.0.1:8765/__health)" || {
|
|
146
|
+
printf 'De router reageert niet op poort 8765; zie %s\n' "$CLAUDE_DIR/logs/kimi-router.error.log" >&2
|
|
147
|
+
exit 1
|
|
148
|
+
}
|
|
149
|
+
ROUTER_VERSION="$(printf '%s' "$HEALTH" | "$NODE_BIN" -e 'let s="";process.stdin.on("data",(d)=>(s+=d)).on("end",()=>{try{console.log(JSON.parse(s).version??"?")}catch{console.log("?")}})')"
|
|
150
|
+
printf '\nHerstel voltooid. Alle ingebouwde Claude-modellen blijven beschikbaar via /model.\n'
|
|
151
|
+
printf 'Router %s: http://127.0.0.1:8765 (logs in %s). Herstart Claude Code.\n' "$ROUTER_VERSION" "$CLAUDE_DIR/logs"
|
|
147
152
|
if [[ "$OS" == Linux ]] && ! loginctl show-user "$USER" -p Linger 2>/dev/null | grep -q yes; then
|
|
148
153
|
printf 'Tip: de router start nu bij je login. Wil je hem ook zonder login (bv. via SSH): loginctl enable-linger %s\n' "$USER"
|
|
149
154
|
fi
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@euraika-bert/claude-model-router",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Local router that adds Kimi, Mistral/GLM, Aliyun Qwen/DeepSeek, ChatGPT/Codex and MiniMax models to Claude Code without replacing the built-in Claude models (macOS, Linux, Windows).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|