tokenmix 0.4.9 → 0.4.10

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 CHANGED
@@ -29,6 +29,7 @@ npx tokenmix roo # print Roo Code VSCode configuration
29
29
  npx tokenmix continue # print Continue config.yaml snippet
30
30
  npx tokenmix codex # install + configure + start Codex
31
31
  npx tokenmix qwen # install + configure + start Qwen Code
32
+ npx tokenmix goose # configure + start Goose (install it first)
32
33
  ```
33
34
 
34
35
  ### Alternative login modes
@@ -51,6 +52,7 @@ npx tokenmix login --key sk-tm-... # supply API key directly (for CI
51
52
  | [Continue](https://github.com/continuedev/continue) | VSCode / JetBrains | config-only |
52
53
  | [Codex](https://github.com/openai/codex) | `npm i -g @openai/codex` | full auto |
53
54
  | [Qwen Code](https://github.com/QwenLM/qwen-code) | `npm i -g @qwen-code/qwen-code` | full auto |
55
+ | [Goose](https://github.com/block/goose) | [install script](https://block.github.io/goose) | semi auto |
54
56
 
55
57
  ## Commands
56
58
 
@@ -72,6 +74,7 @@ tokenmix roo Print Roo Code configuration
72
74
  tokenmix continue Print Continue config.yaml snippet
73
75
  tokenmix codex [args...] Launch Codex via TokenMix
74
76
  tokenmix qwen [args...] Launch Qwen Code via TokenMix
77
+ tokenmix goose [args...] Launch Goose via TokenMix
75
78
  ```
76
79
 
77
80
  ## Language
@@ -0,0 +1,53 @@
1
+ import { commandExists, run, captureRun } from '../utils/exec.js';
2
+ import { t } from '../i18n/index.js';
3
+ const GOOSE_BIN = 'goose';
4
+ // Goose ships as a Rust binary via an official install script. We do NOT auto-run
5
+ // a `curl | bash`; we print it so the user installs it deliberately.
6
+ const GOOSE_INSTALL = 'curl -fsSL https://github.com/block/goose/releases/download/stable/download_cli.sh | bash';
7
+ async function installCheck() {
8
+ const bin = await commandExists(GOOSE_BIN);
9
+ if (!bin) {
10
+ return {
11
+ installed: false,
12
+ hint: t('goose.hintInstall', { cmd: GOOSE_INSTALL }),
13
+ installCmd: GOOSE_INSTALL,
14
+ };
15
+ }
16
+ try {
17
+ const v = await captureRun(GOOSE_BIN, ['--version']);
18
+ return { installed: true, version: v.stdout.trim() };
19
+ }
20
+ catch {
21
+ return { installed: true };
22
+ }
23
+ }
24
+ async function configure(apiKey, baseUrl, defaultModel) {
25
+ // Goose reads GOOSE_PROVIDER/GOOSE_MODEL + OPENAI_HOST/OPENAI_API_KEY. NOTE:
26
+ // OPENAI_HOST is the BARE host — Goose appends /v1/chat/completions itself, so we
27
+ // pass baseUrl WITHOUT /v1 (unlike every other agent). GOOSE_DISABLE_KEYRING
28
+ // avoids an interactive keyring prompt. Verified end-to-end against tokenmix.
29
+ return {
30
+ envVars: {
31
+ GOOSE_PROVIDER: 'openai',
32
+ GOOSE_MODEL: defaultModel,
33
+ OPENAI_HOST: baseUrl,
34
+ OPENAI_API_KEY: apiKey,
35
+ GOOSE_DISABLE_KEYRING: '1',
36
+ },
37
+ notes: [t('goose.noteUsing'), t('goose.noteModel', { model: defaultModel })],
38
+ };
39
+ }
40
+ async function launch(args, env) {
41
+ // Pure pass-through: `tokenmix goose run -t "..."` → `goose run -t "..."` with our
42
+ // env. No flag injection, so info-only (`goose --version`) needs no special-casing.
43
+ await run(GOOSE_BIN, args, { env });
44
+ }
45
+ export const GooseAgent = {
46
+ id: 'goose',
47
+ displayName: 'Goose',
48
+ description: 'block/goose — on-machine AI agent (OpenAI-compatible)',
49
+ installMode: 'manual',
50
+ installCheck,
51
+ configure,
52
+ launch,
53
+ };
@@ -7,6 +7,7 @@ import { RooAgent } from './roo.js';
7
7
  import { ContinueAgent } from './continue.js';
8
8
  import { CodexAgent } from './codex.js';
9
9
  import { QwenAgent } from './qwen.js';
10
+ import { GooseAgent } from './goose.js';
10
11
  // Ordered by historical ARPU on tokenmix (highest first). New agents go to the bottom.
11
12
  export const AGENTS = [
12
13
  OpenCodeAgent,
@@ -18,6 +19,7 @@ export const AGENTS = [
18
19
  ContinueAgent,
19
20
  CodexAgent,
20
21
  QwenAgent,
22
+ GooseAgent,
21
23
  ];
22
24
  export function findAgent(id) {
23
25
  return AGENTS.find((a) => a.id === id);
@@ -37,6 +37,8 @@ function agentDesc(id, fallback) {
37
37
  return t('desc.codex');
38
38
  case 'qwen':
39
39
  return t('desc.qwen');
40
+ case 'goose':
41
+ return t('desc.goose');
40
42
  default:
41
43
  return fallback;
42
44
  }
@@ -88,6 +88,7 @@ export const en = {
88
88
  'desc.continue': 'continuedev/continue — VSCode/JetBrains extension (config file)',
89
89
  'desc.codex': 'openai/codex — OpenAI coding agent CLI',
90
90
  'desc.qwen': 'QwenLM/qwen-code — terminal coding agent (OpenAI-compatible)',
91
+ 'desc.goose': 'block/goose — on-machine AI agent (OpenAI-compatible)',
91
92
  // install hints
92
93
  'install.willInstallVia': 'Will install via: {cmd}',
93
94
  'aider.hintNeedPython': 'Aider requires Python 3. Install Python 3 from https://python.org/downloads, then come back and run `tokenmix aider` again.',
@@ -139,6 +140,10 @@ export const en = {
139
140
  // qwen configure notes (env-based like aider; launched with --auth-type openai)
140
141
  'qwen.noteUsing': 'Qwen Code will use TokenMix via its OpenAI-compatible mode — your ~/.qwen/settings.json is left untouched.',
141
142
  'qwen.noteModel': 'Default model: {model} — override with OPENAI_MODEL or `qwen --model`.',
143
+ // goose configure notes (env-based; Goose appends /v1/chat/completions to OPENAI_HOST)
144
+ 'goose.noteUsing': 'Goose will use TokenMix as its OpenAI provider — its keyring/config is left untouched.',
145
+ 'goose.noteModel': 'Default model: {model} — override with GOOSE_MODEL.',
146
+ 'goose.hintInstall': 'Goose is not installed. Install it (see https://block.github.io/goose), then re-run `tokenmix goose`:\n {cmd}',
142
147
  // command / option descriptions (--help)
143
148
  'cmd.program': 'Zero-config CLI to use any open-source coding agent with TokenMix as the unified LLM backend.',
144
149
  'cmd.login': 'Log in to TokenMix (default: browser device authorization)',
@@ -247,6 +252,7 @@ export const zh = {
247
252
  'desc.continue': 'continuedev/continue — VSCode/JetBrains 扩展(配置文件)',
248
253
  'desc.codex': 'openai/codex — OpenAI 编程 agent CLI',
249
254
  'desc.qwen': 'QwenLM/qwen-code — 终端编程 agent(OpenAI 兼容)',
255
+ 'desc.goose': 'block/goose — 本机 AI agent(OpenAI 兼容)',
250
256
  // install hints
251
257
  'install.willInstallVia': '将自动安装:{cmd}',
252
258
  'aider.hintNeedPython': 'Aider 需要 Python 3。请从 https://python.org/downloads 安装 Python 3,然后重新运行 `tokenmix aider`。',
@@ -293,6 +299,9 @@ export const zh = {
293
299
  'codex.noteModel': '默认模型:{model} —— 可用 `--config model=...` 覆盖。',
294
300
  'qwen.noteUsing': 'Qwen Code 将通过其 OpenAI 兼容模式使用 TokenMix —— 不会改动你的 ~/.qwen/settings.json。',
295
301
  'qwen.noteModel': '默认模型:{model} —— 可用 OPENAI_MODEL 或 `qwen --model` 覆盖。',
302
+ 'goose.noteUsing': 'Goose 将以 TokenMix 作为其 OpenAI provider —— 不会改动它的 keyring/配置。',
303
+ 'goose.noteModel': '默认模型:{model} —— 可用 GOOSE_MODEL 覆盖。',
304
+ 'goose.hintInstall': 'Goose 未安装。请先安装(见 https://block.github.io/goose),然后重新运行 `tokenmix goose`:\n {cmd}',
296
305
  // command / option descriptions (--help)
297
306
  'cmd.program': '零配置 CLI:以 TokenMix 作为统一 LLM 后端,驱动任意开源编程 agent。',
298
307
  'cmd.login': '登录 TokenMix(默认:浏览器设备授权)',
@@ -392,6 +401,7 @@ export const ja = {
392
401
  'desc.continue': 'continuedev/continue — VSCode/JetBrains 拡張機能(設定ファイル)',
393
402
  'desc.codex': 'openai/codex — OpenAI のコーディング agent CLI',
394
403
  'desc.qwen': 'QwenLM/qwen-code — ターミナルのコーディング agent(OpenAI 互換)',
404
+ 'desc.goose': 'block/goose — オンマシン AI agent(OpenAI 互換)',
395
405
  'install.willInstallVia': '次の方法でインストールします:{cmd}',
396
406
  'aider.hintNeedPython': 'Aider には Python 3 が必要です。https://python.org/downloads から Python 3 をインストールし、再度 `tokenmix aider` を実行してください。',
397
407
  'aider.hintNotInstalled': 'Aider はインストールされていません。別のターミナルで次を実行してください:\n {cmd}\nその後 `tokenmix aider` を再実行してください — TokenMix のログインは保存済みなので自動的に反映されます。',
@@ -433,6 +443,9 @@ export const ja = {
433
443
  'codex.noteModel': 'デフォルトモデル:{model} — `--config model=...` で上書きできます。',
434
444
  'qwen.noteUsing': 'Qwen Code は OpenAI 互換モードで TokenMix を使用します —— ~/.qwen/settings.json は変更されません。',
435
445
  'qwen.noteModel': 'デフォルトモデル:{model} — OPENAI_MODEL または `qwen --model` で上書きできます。',
446
+ 'goose.noteUsing': 'Goose は TokenMix を OpenAI プロバイダーとして使用します —— keyring/設定は変更されません。',
447
+ 'goose.noteModel': 'デフォルトモデル:{model} — GOOSE_MODEL で上書きできます。',
448
+ 'goose.hintInstall': 'Goose がインストールされていません。インストール(https://block.github.io/goose 参照)してから `tokenmix goose` を再実行してください:\n {cmd}',
436
449
  'cmd.program': 'TokenMix を統一 LLM バックエンドとして、あらゆるオープンソースのコーディング agent を使うためのゼロ設定 CLI。',
437
450
  'cmd.login': 'TokenMix にログイン(デフォルト:ブラウザでのデバイス認証)',
438
451
  'cmd.loginKey': 'API キーを直接貼り付け(ブラウザ認証をスキップ、CI に便利)',
@@ -531,6 +544,7 @@ export const ko = {
531
544
  'desc.continue': 'continuedev/continue — VSCode/JetBrains 확장 (설정 파일)',
532
545
  'desc.codex': 'openai/codex — OpenAI 코딩 agent CLI',
533
546
  'desc.qwen': 'QwenLM/qwen-code — 터미널 코딩 agent (OpenAI 호환)',
547
+ 'desc.goose': 'block/goose — 온디바이스 AI agent (OpenAI 호환)',
534
548
  'install.willInstallVia': '다음 방법으로 설치합니다: {cmd}',
535
549
  'aider.hintNeedPython': 'Aider에는 Python 3가 필요합니다. https://python.org/downloads 에서 Python 3를 설치한 뒤 다시 `tokenmix aider`를 실행하세요.',
536
550
  'aider.hintNotInstalled': 'Aider가 설치되어 있지 않습니다. 다른 터미널에서 다음을 실행하세요:\n {cmd}\n그런 다음 다시 `tokenmix aider`를 실행하세요 — TokenMix 로그인이 이미 저장되어 있어 자동으로 적용됩니다.',
@@ -572,6 +586,9 @@ export const ko = {
572
586
  'codex.noteModel': '기본 모델: {model} — `--config model=...`으로 재정의할 수 있습니다.',
573
587
  'qwen.noteUsing': 'Qwen Code는 OpenAI 호환 모드로 TokenMix를 사용합니다 — ~/.qwen/settings.json은 변경되지 않습니다.',
574
588
  'qwen.noteModel': '기본 모델: {model} — OPENAI_MODEL 또는 `qwen --model`으로 재정의할 수 있습니다.',
589
+ 'goose.noteUsing': 'Goose는 TokenMix를 OpenAI provider로 사용합니다 — keyring/설정은 변경되지 않습니다.',
590
+ 'goose.noteModel': '기본 모델: {model} — GOOSE_MODEL로 재정의할 수 있습니다.',
591
+ 'goose.hintInstall': 'Goose가 설치되어 있지 않습니다. 설치(https://block.github.io/goose 참조) 후 `tokenmix goose`를 다시 실행하세요:\n {cmd}',
575
592
  'cmd.program': 'TokenMix를 통합 LLM 백엔드로 사용하여 모든 오픈소스 코딩 agent를 쓰는 제로 설정 CLI.',
576
593
  'cmd.login': 'TokenMix에 로그인 (기본값: 브라우저 기기 인증)',
577
594
  'cmd.loginKey': 'API 키를 직접 붙여넣기 (브라우저 절차 생략, CI에 유용)',
@@ -670,6 +687,7 @@ export const es = {
670
687
  'desc.continue': 'continuedev/continue — extensión de VSCode/JetBrains (archivo de configuración)',
671
688
  'desc.codex': 'openai/codex — CLI del agente de programación de OpenAI',
672
689
  'desc.qwen': 'QwenLM/qwen-code — agente de programación de terminal (compatible con OpenAI)',
690
+ 'desc.goose': 'block/goose — agente de IA en tu máquina (compatible con OpenAI)',
673
691
  'install.willInstallVia': 'Se instalará mediante: {cmd}',
674
692
  'aider.hintNeedPython': 'Aider requiere Python 3. Instala Python 3 desde https://python.org/downloads y vuelve a ejecutar `tokenmix aider`.',
675
693
  'aider.hintNotInstalled': 'Aider no está instalado. Ejecuta esto en otra terminal:\n {cmd}\nLuego vuelve a ejecutar `tokenmix aider`: tu sesión de TokenMix ya está guardada, así que se detectará automáticamente.',
@@ -711,6 +729,9 @@ export const es = {
711
729
  'codex.noteModel': 'Modelo por defecto: {model} — anúlalo con `--config model=...`.',
712
730
  'qwen.noteUsing': 'Qwen Code usará TokenMix mediante su modo compatible con OpenAI: tu ~/.qwen/settings.json no se modifica.',
713
731
  'qwen.noteModel': 'Modelo por defecto: {model} — anúlalo con OPENAI_MODEL o `qwen --model`.',
732
+ 'goose.noteUsing': 'Goose usará TokenMix como su proveedor de OpenAI: su keyring/configuración no se modifica.',
733
+ 'goose.noteModel': 'Modelo por defecto: {model} — anúlalo con GOOSE_MODEL.',
734
+ 'goose.hintInstall': 'Goose no está instalado. Instálalo (consulta https://block.github.io/goose) y vuelve a ejecutar `tokenmix goose`:\n {cmd}',
714
735
  'cmd.program': 'CLI sin configuración para usar cualquier agent de programación de código abierto con TokenMix como backend LLM unificado.',
715
736
  'cmd.login': 'Inicia sesión en TokenMix (predeterminado: autorización de dispositivo por navegador)',
716
737
  'cmd.loginKey': 'Pega una clave de API directamente (omite el navegador, útil para CI)',
@@ -809,6 +830,7 @@ export const fr = {
809
830
  'desc.continue': 'continuedev/continue — extension VSCode/JetBrains (fichier de configuration)',
810
831
  'desc.codex': 'openai/codex — CLI de l’agent de codage d’OpenAI',
811
832
  'desc.qwen': 'QwenLM/qwen-code — agent de codage en terminal (compatible OpenAI)',
833
+ 'desc.goose': 'block/goose — agent IA sur votre machine (compatible OpenAI)',
812
834
  'install.willInstallVia': 'Sera installé via : {cmd}',
813
835
  'aider.hintNeedPython': 'Aider nécessite Python 3. Installez Python 3 depuis https://python.org/downloads, puis relancez `tokenmix aider`.',
814
836
  'aider.hintNotInstalled': 'Aider n’est pas installé. Exécutez ceci dans un autre terminal :\n {cmd}\nPuis relancez `tokenmix aider` — votre connexion TokenMix est déjà enregistrée, elle sera donc prise en compte automatiquement.',
@@ -850,6 +872,9 @@ export const fr = {
850
872
  'codex.noteModel': 'Modèle par défaut : {model} — remplacez-le avec `--config model=...`.',
851
873
  'qwen.noteUsing': 'Qwen Code utilisera TokenMix via son mode compatible OpenAI — votre ~/.qwen/settings.json n’est pas modifié.',
852
874
  'qwen.noteModel': 'Modèle par défaut : {model} — remplacez-le avec OPENAI_MODEL ou `qwen --model`.',
875
+ 'goose.noteUsing': 'Goose utilisera TokenMix comme fournisseur OpenAI — son keyring/sa configuration n’est pas modifié.',
876
+ 'goose.noteModel': 'Modèle par défaut : {model} — remplacez-le avec GOOSE_MODEL.',
877
+ 'goose.hintInstall': 'Goose n’est pas installé. Installez-le (voir https://block.github.io/goose), puis relancez `tokenmix goose` :\n {cmd}',
853
878
  'cmd.program': 'CLI sans configuration pour utiliser n’importe quel agent de codage open source avec TokenMix comme backend LLM unifié.',
854
879
  'cmd.login': 'Se connecter à TokenMix (par défaut : autorisation de l’appareil via le navigateur)',
855
880
  'cmd.loginKey': 'Coller directement une clé API (ignore le navigateur, utile pour la CI)',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenmix",
3
- "version": "0.4.9",
3
+ "version": "0.4.10",
4
4
  "description": "Zero-config CLI to use any open-source coding agent with TokenMix as the unified LLM backend.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -32,6 +32,7 @@
32
32
  "continue",
33
33
  "codex",
34
34
  "qwen-code",
35
+ "goose",
35
36
  "coding-agent"
36
37
  ],
37
38
  "license": "MIT",