tokenmix 0.4.6 → 0.4.8

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
@@ -4,6 +4,15 @@ Zero-config CLI to use any open-source coding agent with [TokenMix](https://toke
4
4
 
5
5
  One account, one balance, 160+ models routed automatically across Claude / GPT / Gemini / DeepSeek / Qwen / Moonshot / ...
6
6
 
7
+ ## Why TokenMix
8
+
9
+ Behind the zero-config CLI is a gateway built to be the **honest, transparent** LLM backend for BYOK coding agents:
10
+
11
+ - **Transparent, real-time billing.** `tokenmix balance` shows your actual balance, gift credit, and total spent — to micro-USD precision, not opaque "credits". `tokenmix models` lists every model's real price (free models show `$0`, not a dash).
12
+ - **Prompt caching that saves you money — automatically.** Cache hits bill at the discounted rate with nothing to configure: OpenAI / DeepSeek / Gemini / Qwen via their `cached_tokens`, Anthropic via `cache_control` pass-through (cache reads ≈10% of the input price). The savings are yours, and you can see them.
13
+ - **One key, every protocol.** OpenAI Chat Completions, Anthropic Messages, and the Responses API — all on one account, which is why every agent below (terminal and editor alike) runs on a single balance.
14
+ - **Non-invasive by design.** Configuring an agent never clobbers your setup: your Claude settings are backed up and restored, Codex's provider is injected at launch (your `~/.codex/config.toml` stays untouched), and `tokenmix logout` reverts everything. Credentials are stored locally at `0600`.
15
+
7
16
  ## Quick Start
8
17
 
9
18
  ```bash
@@ -18,6 +27,7 @@ npx tokenmix kilo # print Kilo Code VSCode configuration
18
27
  npx tokenmix cline # print Cline VSCode configuration
19
28
  npx tokenmix roo # print Roo Code VSCode configuration
20
29
  npx tokenmix continue # print Continue config.yaml snippet
30
+ npx tokenmix codex # install + configure + start Codex
21
31
  ```
22
32
 
23
33
  ### Alternative login modes
@@ -38,6 +48,7 @@ npx tokenmix login --key sk-tm-... # supply API key directly (for CI
38
48
  | [Cline](https://github.com/cline/cline) | VSCode extension | config-only |
39
49
  | [Roo Code](https://github.com/RooCodeInc/Roo-Code) | VSCode extension | config-only |
40
50
  | [Continue](https://github.com/continuedev/continue) | VSCode / JetBrains | config-only |
51
+ | [Codex](https://github.com/openai/codex) | `npm i -g @openai/codex` | full auto |
41
52
 
42
53
  ## Commands
43
54
 
@@ -57,6 +68,7 @@ tokenmix kilo Print Kilo Code configuration
57
68
  tokenmix cline Print Cline configuration
58
69
  tokenmix roo Print Roo Code configuration
59
70
  tokenmix continue Print Continue config.yaml snippet
71
+ tokenmix codex [args...] Launch Codex via TokenMix
60
72
  ```
61
73
 
62
74
  ## Language
@@ -0,0 +1,80 @@
1
+ import { commandExists, run, captureRun } from '../utils/exec.js';
2
+ import { t } from '../i18n/index.js';
3
+ const CODEX_BIN = 'codex';
4
+ const CODEX_NPM_PACKAGE = '@openai/codex';
5
+ // Codex custom provider id. Must NOT collide with Codex's reserved built-in
6
+ // provider ids (openai / ollama / lmstudio).
7
+ const PROVIDER_ID = 'tokenmix';
8
+ // Env var Codex reads for the bearer token (the provider's `env_key`). We set it
9
+ // at launch from the user's TokenMix key — nothing is written to ~/.codex.
10
+ const KEY_ENV = 'TOKENMIX_API_KEY';
11
+ async function installCheck() {
12
+ const bin = await commandExists(CODEX_BIN);
13
+ if (!bin) {
14
+ const cmd = `npm install -g ${CODEX_NPM_PACKAGE}`;
15
+ return {
16
+ installed: false,
17
+ hint: t('install.willInstallVia', { cmd }),
18
+ installCmd: cmd,
19
+ };
20
+ }
21
+ try {
22
+ const v = await captureRun(CODEX_BIN, ['--version']);
23
+ return { installed: true, version: v.stdout.trim() };
24
+ }
25
+ catch {
26
+ return { installed: true };
27
+ }
28
+ }
29
+ async function install() {
30
+ await run('npm', ['install', '-g', CODEX_NPM_PACKAGE]);
31
+ }
32
+ async function configure(apiKey, baseUrl, defaultModel) {
33
+ // We do NOT write ~/.codex/config.toml. Codex accepts a whole custom provider
34
+ // via `--config` overrides at launch, and reads the key from the env var named
35
+ // by the provider's env_key — so we pass everything through env and inject the
36
+ // overrides in launch(). This never touches the user's Codex config or login.
37
+ return {
38
+ envVars: {
39
+ [KEY_ENV]: apiKey,
40
+ TOKENMIX_BASE_URL: `${baseUrl}/v1`,
41
+ },
42
+ notes: [t('codex.noteUsing'), t('codex.noteModel', { model: defaultModel })],
43
+ };
44
+ }
45
+ // Build the `--config key=value` overrides that register tokenmix as a custom
46
+ // OpenAI-compatible provider. wire_api MUST be "responses": Codex 0.135+ dropped
47
+ // support for "chat" (openai/codex#7782), and tokenmix's gateway implements the
48
+ // Responses API specifically for Codex clients (POST /v1/responses).
49
+ export function providerOverrides(baseUrl, model) {
50
+ return [
51
+ '--config', `model_provider="${PROVIDER_ID}"`,
52
+ '--config', `model="${model}"`,
53
+ '--config', `model_providers.${PROVIDER_ID}.name="TokenMix"`,
54
+ '--config', `model_providers.${PROVIDER_ID}.base_url="${baseUrl}"`,
55
+ '--config', `model_providers.${PROVIDER_ID}.env_key="${KEY_ENV}"`,
56
+ '--config', `model_providers.${PROVIDER_ID}.wire_api="responses"`,
57
+ ];
58
+ }
59
+ async function launch(args, env) {
60
+ const baseUrl = env.TOKENMIX_BASE_URL;
61
+ // Info-only invocations (`codex --version` / `--help`) reach launch with an
62
+ // empty env (no credentials). Just forward — don't inject a half-built provider.
63
+ if (!baseUrl) {
64
+ await run(CODEX_BIN, args, { env });
65
+ return;
66
+ }
67
+ const model = env.TOKENMIX_DEFAULT_MODEL ?? 'claude-sonnet-4.6';
68
+ // Our overrides go first so user-supplied args (e.g. `--config model=...`) win.
69
+ await run(CODEX_BIN, [...providerOverrides(baseUrl, model), ...args], { env });
70
+ }
71
+ export const CodexAgent = {
72
+ id: 'codex',
73
+ displayName: 'Codex',
74
+ description: 'openai/codex — OpenAI coding agent CLI',
75
+ installMode: 'auto-npm',
76
+ installCheck,
77
+ install,
78
+ configure,
79
+ launch,
80
+ };
@@ -5,6 +5,7 @@ import { KiloAgent } from './kilo.js';
5
5
  import { ClineAgent } from './cline.js';
6
6
  import { RooAgent } from './roo.js';
7
7
  import { ContinueAgent } from './continue.js';
8
+ import { CodexAgent } from './codex.js';
8
9
  // Ordered by historical ARPU on tokenmix (highest first). New agents go to the bottom.
9
10
  export const AGENTS = [
10
11
  OpenCodeAgent,
@@ -14,6 +15,7 @@ export const AGENTS = [
14
15
  ClineAgent,
15
16
  RooAgent,
16
17
  ContinueAgent,
18
+ CodexAgent,
17
19
  ];
18
20
  export function findAgent(id) {
19
21
  return AGENTS.find((a) => a.id === id);
@@ -33,6 +33,8 @@ function agentDesc(id, fallback) {
33
33
  return t('desc.roo');
34
34
  case 'continue':
35
35
  return t('desc.continue');
36
+ case 'codex':
37
+ return t('desc.codex');
36
38
  default:
37
39
  return fallback;
38
40
  }
@@ -31,9 +31,20 @@ export function formatPrice(p) {
31
31
  return '0';
32
32
  return p.toFixed(6).replace(/\.?0+$/, '');
33
33
  }
34
+ // Apply --type and --search filters. Exported for unit testing.
35
+ export function filterModels(all, opts) {
36
+ let r = all;
37
+ if (opts.type)
38
+ r = r.filter((m) => m.model_type === opts.type);
39
+ if (opts.search) {
40
+ const kw = opts.search.toLowerCase();
41
+ r = r.filter((m) => (m.short_id || m.model_id || '').toLowerCase().includes(kw));
42
+ }
43
+ return r;
44
+ }
34
45
  export async function modelsCommand(opts) {
35
46
  const all = await listPublicModels();
36
- const filtered = opts.type ? all.filter((m) => m.model_type === opts.type) : all;
47
+ const filtered = filterModels(all, opts);
37
48
  if (filtered.length === 0) {
38
49
  logger.warn(t('models.none'));
39
50
  return;
@@ -45,6 +56,8 @@ export async function modelsCommand(opts) {
45
56
  grouped.set(m.model_type, list);
46
57
  }
47
58
  for (const [type, list] of grouped) {
59
+ // Stable, readable order within a type (the API order is arbitrary).
60
+ list.sort((a, b) => (a.short_id || a.model_id || '').localeCompare(b.short_id || b.model_id || ''));
48
61
  console.log();
49
62
  console.log(chalk.bold(`${typeLabel(type)} (${list.length})`));
50
63
  for (const m of list) {
@@ -85,6 +85,7 @@ export const en = {
85
85
  'desc.cline': 'cline/cline — VSCode extension (config-only)',
86
86
  'desc.roo': 'RooCodeInc/Roo-Code — VSCode extension (config-only)',
87
87
  'desc.continue': 'continuedev/continue — VSCode/JetBrains extension (config file)',
88
+ 'desc.codex': 'openai/codex — OpenAI coding agent CLI',
88
89
  // install hints
89
90
  'install.willInstallVia': 'Will install via: {cmd}',
90
91
  'aider.hintNeedPython': 'Aider requires Python 3. Install Python 3 from https://python.org/downloads, then come back and run `tokenmix aider` again.',
@@ -130,6 +131,9 @@ export const en = {
130
131
  'continue.noteKeepPrivate': 'Keep this API key private — anyone with it can spend your TokenMix balance.',
131
132
  'continue.hintMarketplace': 'Install "Continue" from the VSCode marketplace, then add the config below.',
132
133
  'continue.hintNoVscode': 'VSCode not detected on PATH. Install VSCode, then add the Continue extension, then use the config below.',
134
+ // codex configure notes (auto-npm CLI; launched with --config provider injection)
135
+ 'codex.noteUsing': 'Codex will use TokenMix via an OpenAI-compatible provider — your ~/.codex/config.toml is left untouched.',
136
+ 'codex.noteModel': 'Default model: {model} — override with `--config model=...`.',
133
137
  // command / option descriptions (--help)
134
138
  'cmd.program': 'Zero-config CLI to use any open-source coding agent with TokenMix as the unified LLM backend.',
135
139
  'cmd.login': 'Log in to TokenMix (default: browser device authorization)',
@@ -141,6 +145,7 @@ export const en = {
141
145
  'cmd.topup': 'Open the browser to top up your account',
142
146
  'cmd.models': 'List available models with prices',
143
147
  'cmd.modelsType': 'Filter by type: chat | embedding | image | audio | video',
148
+ 'cmd.modelsSearch': 'Filter models by name (substring match)',
144
149
  'cmd.list': 'List supported coding agents',
145
150
  'cmd.doctor': 'Diagnose CLI configuration and agent installation',
146
151
  'cmd.agent': 'Configure and launch {name} via TokenMix',
@@ -234,6 +239,7 @@ export const zh = {
234
239
  'desc.cline': 'cline/cline — VSCode 扩展(仅配置)',
235
240
  'desc.roo': 'RooCodeInc/Roo-Code — VSCode 扩展(仅配置)',
236
241
  'desc.continue': 'continuedev/continue — VSCode/JetBrains 扩展(配置文件)',
242
+ 'desc.codex': 'openai/codex — OpenAI 编程 agent CLI',
237
243
  // install hints
238
244
  'install.willInstallVia': '将自动安装:{cmd}',
239
245
  'aider.hintNeedPython': 'Aider 需要 Python 3。请从 https://python.org/downloads 安装 Python 3,然后重新运行 `tokenmix aider`。',
@@ -276,6 +282,8 @@ export const zh = {
276
282
  'continue.noteKeepPrivate': '请妥善保管此 API 密钥 —— 任何人拿到它都能消耗你的 TokenMix 余额。',
277
283
  'continue.hintMarketplace': '从 VSCode 应用市场安装 "Continue",然后添加下面的配置。',
278
284
  'continue.hintNoVscode': '未在 PATH 中检测到 VSCode。请先安装 VSCode,再添加 Continue 扩展,然后使用下面的配置。',
285
+ 'codex.noteUsing': 'Codex 将通过 OpenAI 兼容的 provider 使用 TokenMix —— 不会改动你的 ~/.codex/config.toml。',
286
+ 'codex.noteModel': '默认模型:{model} —— 可用 `--config model=...` 覆盖。',
279
287
  // command / option descriptions (--help)
280
288
  'cmd.program': '零配置 CLI:以 TokenMix 作为统一 LLM 后端,驱动任意开源编程 agent。',
281
289
  'cmd.login': '登录 TokenMix(默认:浏览器设备授权)',
@@ -287,6 +295,7 @@ export const zh = {
287
295
  'cmd.topup': '打开浏览器为账户充值',
288
296
  'cmd.models': '列出可用模型及价格',
289
297
  'cmd.modelsType': '按类型筛选:chat | embedding | image | audio | video',
298
+ 'cmd.modelsSearch': '按名称筛选模型(子串匹配)',
290
299
  'cmd.list': '列出支持的编程 agent',
291
300
  'cmd.doctor': '诊断 CLI 配置与 agent 安装情况',
292
301
  'cmd.agent': '通过 TokenMix 配置并启动 {name}',
@@ -371,6 +380,7 @@ export const ja = {
371
380
  'desc.cline': 'cline/cline — VSCode 拡張機能(設定のみ)',
372
381
  'desc.roo': 'RooCodeInc/Roo-Code — VSCode 拡張機能(設定のみ)',
373
382
  'desc.continue': 'continuedev/continue — VSCode/JetBrains 拡張機能(設定ファイル)',
383
+ 'desc.codex': 'openai/codex — OpenAI のコーディング agent CLI',
374
384
  'install.willInstallVia': '次の方法でインストールします:{cmd}',
375
385
  'aider.hintNeedPython': 'Aider には Python 3 が必要です。https://python.org/downloads から Python 3 をインストールし、再度 `tokenmix aider` を実行してください。',
376
386
  'aider.hintNotInstalled': 'Aider はインストールされていません。別のターミナルで次を実行してください:\n {cmd}\nその後 `tokenmix aider` を再実行してください — TokenMix のログインは保存済みなので自動的に反映されます。',
@@ -408,6 +418,8 @@ export const ja = {
408
418
  'continue.noteKeepPrivate': 'この API キーは公開しないでください — 入手した人は誰でもあなたの TokenMix 残高を使えます。',
409
419
  'continue.hintMarketplace': 'VSCode マーケットプレイスから "Continue" をインストールし、下の設定を追加してください。',
410
420
  'continue.hintNoVscode': 'PATH に VSCode が見つかりません。VSCode をインストールし、Continue 拡張機能を追加してから、下の設定を使用してください。',
421
+ 'codex.noteUsing': 'Codex は OpenAI 互換プロバイダー経由で TokenMix を使用します — ~/.codex/config.toml は変更されません。',
422
+ 'codex.noteModel': 'デフォルトモデル:{model} — `--config model=...` で上書きできます。',
411
423
  'cmd.program': 'TokenMix を統一 LLM バックエンドとして、あらゆるオープンソースのコーディング agent を使うためのゼロ設定 CLI。',
412
424
  'cmd.login': 'TokenMix にログイン(デフォルト:ブラウザでのデバイス認証)',
413
425
  'cmd.loginKey': 'API キーを直接貼り付け(ブラウザ認証をスキップ、CI に便利)',
@@ -418,6 +430,7 @@ export const ja = {
418
430
  'cmd.topup': 'ブラウザを開いてアカウントにチャージ',
419
431
  'cmd.models': '利用可能なモデルと価格を一覧表示',
420
432
  'cmd.modelsType': 'タイプで絞り込み:chat | embedding | image | audio | video',
433
+ 'cmd.modelsSearch': '名前でモデルを絞り込み(部分一致)',
421
434
  'cmd.list': '対応しているコーディング agent を一覧表示',
422
435
  'cmd.doctor': 'CLI 設定と agent のインストール状況を診断',
423
436
  'cmd.agent': 'TokenMix 経由で {name} を設定して起動',
@@ -502,6 +515,7 @@ export const ko = {
502
515
  'desc.cline': 'cline/cline — VSCode 확장 (설정 전용)',
503
516
  'desc.roo': 'RooCodeInc/Roo-Code — VSCode 확장 (설정 전용)',
504
517
  'desc.continue': 'continuedev/continue — VSCode/JetBrains 확장 (설정 파일)',
518
+ 'desc.codex': 'openai/codex — OpenAI 코딩 agent CLI',
505
519
  'install.willInstallVia': '다음 방법으로 설치합니다: {cmd}',
506
520
  'aider.hintNeedPython': 'Aider에는 Python 3가 필요합니다. https://python.org/downloads 에서 Python 3를 설치한 뒤 다시 `tokenmix aider`를 실행하세요.',
507
521
  'aider.hintNotInstalled': 'Aider가 설치되어 있지 않습니다. 다른 터미널에서 다음을 실행하세요:\n {cmd}\n그런 다음 다시 `tokenmix aider`를 실행하세요 — TokenMix 로그인이 이미 저장되어 있어 자동으로 적용됩니다.',
@@ -539,6 +553,8 @@ export const ko = {
539
553
  'continue.noteKeepPrivate': '이 API 키를 비공개로 유지하세요 — 키를 가진 사람은 누구나 당신의 TokenMix 잔액을 쓸 수 있습니다.',
540
554
  'continue.hintMarketplace': 'VSCode 마켓플레이스에서 "Continue"를 설치한 뒤 아래 설정을 추가하세요.',
541
555
  'continue.hintNoVscode': 'PATH에서 VSCode를 찾을 수 없습니다. VSCode를 설치하고 Continue 확장을 추가한 뒤 아래 설정을 사용하세요.',
556
+ 'codex.noteUsing': 'Codex는 OpenAI 호환 provider를 통해 TokenMix를 사용합니다 — ~/.codex/config.toml은 변경되지 않습니다.',
557
+ 'codex.noteModel': '기본 모델: {model} — `--config model=...`으로 재정의할 수 있습니다.',
542
558
  'cmd.program': 'TokenMix를 통합 LLM 백엔드로 사용하여 모든 오픈소스 코딩 agent를 쓰는 제로 설정 CLI.',
543
559
  'cmd.login': 'TokenMix에 로그인 (기본값: 브라우저 기기 인증)',
544
560
  'cmd.loginKey': 'API 키를 직접 붙여넣기 (브라우저 절차 생략, CI에 유용)',
@@ -549,6 +565,7 @@ export const ko = {
549
565
  'cmd.topup': '브라우저를 열어 계정 충전',
550
566
  'cmd.models': '사용 가능한 모델과 가격 목록 표시',
551
567
  'cmd.modelsType': '유형으로 필터링: chat | embedding | image | audio | video',
568
+ 'cmd.modelsSearch': '이름으로 모델 필터링 (부분 일치)',
552
569
  'cmd.list': '지원하는 코딩 agent 목록 표시',
553
570
  'cmd.doctor': 'CLI 구성과 agent 설치 상태 진단',
554
571
  'cmd.agent': 'TokenMix를 통해 {name} 구성 및 실행',
@@ -633,6 +650,7 @@ export const es = {
633
650
  'desc.cline': 'cline/cline — extensión de VSCode (solo configuración)',
634
651
  'desc.roo': 'RooCodeInc/Roo-Code — extensión de VSCode (solo configuración)',
635
652
  'desc.continue': 'continuedev/continue — extensión de VSCode/JetBrains (archivo de configuración)',
653
+ 'desc.codex': 'openai/codex — CLI del agente de programación de OpenAI',
636
654
  'install.willInstallVia': 'Se instalará mediante: {cmd}',
637
655
  'aider.hintNeedPython': 'Aider requiere Python 3. Instala Python 3 desde https://python.org/downloads y vuelve a ejecutar `tokenmix aider`.',
638
656
  '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.',
@@ -670,6 +688,8 @@ export const es = {
670
688
  'continue.noteKeepPrivate': 'Mantén privada esta clave de API: cualquiera que la tenga puede gastar tu saldo de TokenMix.',
671
689
  'continue.hintMarketplace': 'Instala "Continue" desde el marketplace de VSCode y luego añade la configuración de abajo.',
672
690
  'continue.hintNoVscode': 'No se detectó VSCode en el PATH. Instala VSCode, añade la extensión Continue y luego usa la configuración de abajo.',
691
+ 'codex.noteUsing': 'Codex usará TokenMix mediante un proveedor compatible con OpenAI: tu ~/.codex/config.toml no se modifica.',
692
+ 'codex.noteModel': 'Modelo por defecto: {model} — anúlalo con `--config model=...`.',
673
693
  'cmd.program': 'CLI sin configuración para usar cualquier agent de programación de código abierto con TokenMix como backend LLM unificado.',
674
694
  'cmd.login': 'Inicia sesión en TokenMix (predeterminado: autorización de dispositivo por navegador)',
675
695
  'cmd.loginKey': 'Pega una clave de API directamente (omite el navegador, útil para CI)',
@@ -680,6 +700,7 @@ export const es = {
680
700
  'cmd.topup': 'Abre el navegador para recargar tu cuenta',
681
701
  'cmd.models': 'Lista los modelos disponibles con precios',
682
702
  'cmd.modelsType': 'Filtrar por tipo: chat | embedding | image | audio | video',
703
+ 'cmd.modelsSearch': 'Filtrar modelos por nombre (coincidencia parcial)',
683
704
  'cmd.list': 'Lista los agents de programación compatibles',
684
705
  'cmd.doctor': 'Diagnostica la configuración de la CLI y la instalación de los agents',
685
706
  'cmd.agent': 'Configura e inicia {name} vía TokenMix',
@@ -764,6 +785,7 @@ export const fr = {
764
785
  'desc.cline': 'cline/cline — extension VSCode (configuration seule)',
765
786
  'desc.roo': 'RooCodeInc/Roo-Code — extension VSCode (configuration seule)',
766
787
  'desc.continue': 'continuedev/continue — extension VSCode/JetBrains (fichier de configuration)',
788
+ 'desc.codex': 'openai/codex — CLI de l’agent de codage d’OpenAI',
767
789
  'install.willInstallVia': 'Sera installé via : {cmd}',
768
790
  'aider.hintNeedPython': 'Aider nécessite Python 3. Installez Python 3 depuis https://python.org/downloads, puis relancez `tokenmix aider`.',
769
791
  '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.',
@@ -801,6 +823,8 @@ export const fr = {
801
823
  'continue.noteKeepPrivate': 'Gardez cette clé API privée — quiconque la détient peut dépenser votre solde TokenMix.',
802
824
  'continue.hintMarketplace': 'Installez « Continue » depuis la marketplace VSCode, puis ajoutez la configuration ci-dessous.',
803
825
  'continue.hintNoVscode': 'VSCode introuvable dans le PATH. Installez VSCode, ajoutez l’extension Continue, puis utilisez la configuration ci-dessous.',
826
+ 'codex.noteUsing': 'Codex utilisera TokenMix via un fournisseur compatible OpenAI — votre ~/.codex/config.toml n’est pas modifié.',
827
+ 'codex.noteModel': 'Modèle par défaut : {model} — remplacez-le avec `--config model=...`.',
804
828
  'cmd.program': 'CLI sans configuration pour utiliser n’importe quel agent de codage open source avec TokenMix comme backend LLM unifié.',
805
829
  'cmd.login': 'Se connecter à TokenMix (par défaut : autorisation de l’appareil via le navigateur)',
806
830
  'cmd.loginKey': 'Coller directement une clé API (ignore le navigateur, utile pour la CI)',
@@ -811,6 +835,7 @@ export const fr = {
811
835
  'cmd.topup': 'Ouvrir le navigateur pour recharger votre compte',
812
836
  'cmd.models': 'Lister les modèles disponibles avec les prix',
813
837
  'cmd.modelsType': 'Filtrer par type : chat | embedding | image | audio | video',
838
+ 'cmd.modelsSearch': 'Filtrer les modèles par nom (correspondance partielle)',
814
839
  'cmd.list': 'Lister les agents de codage pris en charge',
815
840
  'cmd.doctor': 'Diagnostiquer la configuration de la CLI et l’installation des agents',
816
841
  'cmd.agent': 'Configurer et lancer {name} via TokenMix',
package/dist/program.js CHANGED
@@ -46,6 +46,7 @@ export function buildProgram(deps = {}) {
46
46
  .command('models')
47
47
  .description(t('cmd.models'))
48
48
  .option('-t, --type <type>', t('cmd.modelsType'))
49
+ .option('-s, --search <keyword>', t('cmd.modelsSearch'))
49
50
  .action(modelsCommand);
50
51
  program
51
52
  .command('list')
@@ -1,5 +1,15 @@
1
1
  import chalk from 'chalk';
2
2
  // Minimal CLI logger. Symbols are ASCII-friendly Unicode, not emoji.
3
+ //
4
+ // Output-stream contract (deliberate — keep it this way):
5
+ // • step() → STDERR: progress narration ("Configuring…", "Launching…").
6
+ // Off stdout so `tokenmix kilo > config.txt`, piping an agent, or scripting
7
+ // `tokenmix balance` isn't polluted with our progress chatter.
8
+ // • error() → STDERR: failures.
9
+ // • success()/info()/warn()/dim() → STDOUT: these carry user-facing OUTPUT,
10
+ // not just chatter — `balance` prints figures via success(), `doctor` prints
11
+ // its report (incl. "not logged in"/"not installed") via success()/warn().
12
+ // Moving those to stderr would split a command's report across two streams.
3
13
  export const logger = {
4
14
  info(msg) {
5
15
  console.log(msg);
@@ -14,7 +24,7 @@ export const logger = {
14
24
  console.error(chalk.red('✗'), msg);
15
25
  },
16
26
  step(msg) {
17
- console.log(chalk.cyan('→'), msg);
27
+ console.error(chalk.cyan('→'), msg);
18
28
  },
19
29
  dim(msg) {
20
30
  console.log(chalk.dim(msg));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenmix",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
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": {
@@ -30,6 +30,7 @@
30
30
  "cline",
31
31
  "roo-code",
32
32
  "continue",
33
+ "codex",
33
34
  "coding-agent"
34
35
  ],
35
36
  "license": "MIT",