consult-llm-mcp 2.5.2 → 2.5.3
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 +14 -11
- package/dist/config.d.ts +2 -0
- package/dist/config.js +15 -3
- package/dist/config.test.js +12 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ to bring in the heavy artillery. Supports multi-turn conversations.
|
|
|
64
64
|
-e OPENAI_API_KEY=your_openai_key \
|
|
65
65
|
-e GEMINI_API_KEY=your_gemini_key \
|
|
66
66
|
-e DEEPSEEK_API_KEY=your_deepseek_key \
|
|
67
|
-
-e
|
|
67
|
+
-e CONSULT_LLM_GEMINI_BACKEND=gemini-cli \
|
|
68
68
|
-- npx -y consult-llm-mcp
|
|
69
69
|
```
|
|
70
70
|
|
|
@@ -344,7 +344,7 @@ or use your Google AI Pro subscription.
|
|
|
344
344
|
**Setup:**
|
|
345
345
|
|
|
346
346
|
```bash
|
|
347
|
-
claude mcp add consult-llm -e
|
|
347
|
+
claude mcp add consult-llm -e CONSULT_LLM_GEMINI_BACKEND=gemini-cli -- npx -y consult-llm-mcp
|
|
348
348
|
```
|
|
349
349
|
|
|
350
350
|
#### Codex CLI
|
|
@@ -359,12 +359,12 @@ Use OpenAI's Codex CLI for OpenAI models.
|
|
|
359
359
|
**Setup:**
|
|
360
360
|
|
|
361
361
|
```bash
|
|
362
|
-
claude mcp add consult-llm -e
|
|
362
|
+
claude mcp add consult-llm -e CONSULT_LLM_OPENAI_BACKEND=codex-cli -- npx -y consult-llm-mcp
|
|
363
363
|
```
|
|
364
364
|
|
|
365
365
|
<!-- prettier-ignore -->
|
|
366
366
|
> [!TIP]
|
|
367
|
-
> Set reasoning effort with `-e
|
|
367
|
+
> Set reasoning effort with `-e CONSULT_LLM_CODEX_REASONING_EFFORT=high`. Options:
|
|
368
368
|
> `none`, `minimal`, `low`, `medium`, `high`, `xhigh`.
|
|
369
369
|
|
|
370
370
|
#### Cursor CLI
|
|
@@ -380,15 +380,17 @@ Use Cursor's agent CLI to route GPT and Gemini models through one tool.
|
|
|
380
380
|
|
|
381
381
|
```bash
|
|
382
382
|
# Route GPT models through Cursor CLI
|
|
383
|
-
claude mcp add consult-llm -e
|
|
383
|
+
claude mcp add consult-llm -e CONSULT_LLM_OPENAI_BACKEND=cursor-cli -- npx -y consult-llm-mcp
|
|
384
384
|
|
|
385
385
|
# Route Gemini models through Cursor CLI
|
|
386
|
-
claude mcp add consult-llm -e
|
|
386
|
+
claude mcp add consult-llm -e CONSULT_LLM_GEMINI_BACKEND=cursor-cli -- npx -y consult-llm-mcp
|
|
387
387
|
|
|
388
388
|
# Route everything through Cursor CLI
|
|
389
389
|
claude mcp add consult-llm \
|
|
390
|
-
-e
|
|
391
|
-
-e
|
|
390
|
+
-e CONSULT_LLM_OPENAI_BACKEND=cursor-cli \
|
|
391
|
+
-e CONSULT_LLM_GEMINI_BACKEND=cursor-cli \
|
|
392
|
+
-e CONSULT_LLM_CODEX_REASONING_EFFORT=high \
|
|
393
|
+
-e CONSULT_LLM_ALLOWED_MODELS="gemini-3-pro-preview,gpt-5.3-codex" \
|
|
392
394
|
-- npx -y consult-llm-mcp
|
|
393
395
|
```
|
|
394
396
|
|
|
@@ -459,11 +461,12 @@ See the "Using web mode..." example above for a concrete transcript.
|
|
|
459
461
|
- Options: `gpt-5.2` (default), `gpt-5.4`, `gemini-2.5-pro`,
|
|
460
462
|
`gemini-3-pro-preview`, `gemini-3.1-pro-preview`, `deepseek-reasoner`,
|
|
461
463
|
`gpt-5.3-codex`, `gpt-5.2-codex`
|
|
462
|
-
- `
|
|
464
|
+
- `CONSULT_LLM_GEMINI_BACKEND` - Backend for Gemini models (optional)
|
|
463
465
|
- Options: `api` (default), `gemini-cli`, `cursor-cli`
|
|
464
|
-
- `
|
|
466
|
+
- `CONSULT_LLM_OPENAI_BACKEND` - Backend for OpenAI models (optional)
|
|
465
467
|
- Options: `api` (default), `codex-cli`, `cursor-cli`
|
|
466
|
-
- `
|
|
468
|
+
- `CONSULT_LLM_CODEX_REASONING_EFFORT` - Configure reasoning effort for Codex
|
|
469
|
+
CLI (optional)
|
|
467
470
|
- See [Codex CLI](#codex-cli) for details and available options
|
|
468
471
|
- `CONSULT_LLM_EXTRA_MODELS` - Add models not in the built-in list (optional)
|
|
469
472
|
- Comma-separated list, e.g., `grok-3,kimi-k2.5`
|
package/dist/config.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ type ParsedConfig = z.infer<typeof Config>;
|
|
|
45
45
|
export type Config = ParsedConfig & {
|
|
46
46
|
allowedModels: string[];
|
|
47
47
|
};
|
|
48
|
+
/** Prefer CONSULT_LLM_-prefixed env var, fall back to unprefixed with deprecation warning. */
|
|
49
|
+
export declare function migratePrefixedEnv(prefixed: string | undefined, unprefixed: string | undefined, unprefixedName: string, prefixedName: string): string | undefined;
|
|
48
50
|
export declare function migrateBackendEnv(newVar: string | undefined, oldVar: string | undefined, providerCliValue: string, legacyName: string, newName: string): string | undefined;
|
|
49
51
|
export declare const config: Config;
|
|
50
52
|
export {};
|
package/dist/config.js
CHANGED
|
@@ -39,8 +39,11 @@ export function buildModelCatalog(builtinModels, extraModelsRaw, allowedModelsRa
|
|
|
39
39
|
: allAvailable;
|
|
40
40
|
}
|
|
41
41
|
// Resolve backends early (needed for availability filtering)
|
|
42
|
-
|
|
43
|
-
const
|
|
42
|
+
// Priority: CONSULT_LLM_*_BACKEND > *_BACKEND > *_MODE (deprecated)
|
|
43
|
+
const geminiBackendRaw = migratePrefixedEnv(process.env.CONSULT_LLM_GEMINI_BACKEND, process.env.GEMINI_BACKEND, 'GEMINI_BACKEND', 'CONSULT_LLM_GEMINI_BACKEND');
|
|
44
|
+
const resolvedGeminiBackend = migrateBackendEnv(geminiBackendRaw, process.env.GEMINI_MODE, 'gemini-cli', 'GEMINI_MODE', 'CONSULT_LLM_GEMINI_BACKEND');
|
|
45
|
+
const openaiBackendRaw = migratePrefixedEnv(process.env.CONSULT_LLM_OPENAI_BACKEND, process.env.OPENAI_BACKEND, 'OPENAI_BACKEND', 'CONSULT_LLM_OPENAI_BACKEND');
|
|
46
|
+
const resolvedOpenaiBackend = migrateBackendEnv(openaiBackendRaw, process.env.OPENAI_MODE, 'codex-cli', 'OPENAI_MODE', 'CONSULT_LLM_OPENAI_BACKEND');
|
|
44
47
|
// Build catalog, then filter to only available providers
|
|
45
48
|
const catalogModels = buildModelCatalog(ALL_MODELS, process.env.CONSULT_LLM_EXTRA_MODELS, process.env.CONSULT_LLM_ALLOWED_MODELS);
|
|
46
49
|
const enabledModels = filterByAvailability(catalogModels, {
|
|
@@ -73,6 +76,15 @@ const Config = z.object({
|
|
|
73
76
|
.optional(),
|
|
74
77
|
systemPromptPath: z.string().optional(),
|
|
75
78
|
});
|
|
79
|
+
/** Prefer CONSULT_LLM_-prefixed env var, fall back to unprefixed with deprecation warning. */
|
|
80
|
+
export function migratePrefixedEnv(prefixed, unprefixed, unprefixedName, prefixedName) {
|
|
81
|
+
if (prefixed)
|
|
82
|
+
return prefixed;
|
|
83
|
+
if (!unprefixed)
|
|
84
|
+
return undefined;
|
|
85
|
+
logToFile(`DEPRECATED: ${unprefixedName}=${unprefixed} → use ${prefixedName}=${unprefixed} instead`);
|
|
86
|
+
return unprefixed;
|
|
87
|
+
}
|
|
76
88
|
// Migrate legacy GEMINI_MODE / OPENAI_MODE env vars
|
|
77
89
|
export function migrateBackendEnv(newVar, oldVar, providerCliValue, legacyName, newName) {
|
|
78
90
|
if (newVar)
|
|
@@ -90,7 +102,7 @@ const parsedConfig = Config.safeParse({
|
|
|
90
102
|
defaultModel: process.env.CONSULT_LLM_DEFAULT_MODEL,
|
|
91
103
|
geminiBackend: resolvedGeminiBackend,
|
|
92
104
|
openaiBackend: resolvedOpenaiBackend,
|
|
93
|
-
codexReasoningEffort: process.env.CODEX_REASONING_EFFORT,
|
|
105
|
+
codexReasoningEffort: migratePrefixedEnv(process.env.CONSULT_LLM_CODEX_REASONING_EFFORT, process.env.CODEX_REASONING_EFFORT, 'CODEX_REASONING_EFFORT', 'CONSULT_LLM_CODEX_REASONING_EFFORT'),
|
|
94
106
|
systemPromptPath: process.env.CONSULT_LLM_SYSTEM_PROMPT_PATH,
|
|
95
107
|
});
|
|
96
108
|
if (!parsedConfig.success) {
|
package/dist/config.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect, vi } from 'vitest';
|
|
2
|
-
import { migrateBackendEnv, buildModelCatalog, filterByAvailability, } from './config.js';
|
|
2
|
+
import { migrateBackendEnv, migratePrefixedEnv, buildModelCatalog, filterByAvailability, } from './config.js';
|
|
3
3
|
import { ALL_MODELS } from './models.js';
|
|
4
4
|
vi.mock('./logger.js', () => ({ logToFile: vi.fn() }));
|
|
5
5
|
describe('migrateBackendEnv', () => {
|
|
@@ -19,6 +19,17 @@ describe('migrateBackendEnv', () => {
|
|
|
19
19
|
expect(migrateBackendEnv(undefined, 'cli', 'codex-cli', 'OPENAI_MODE', 'OPENAI_BACKEND')).toBe('codex-cli');
|
|
20
20
|
});
|
|
21
21
|
});
|
|
22
|
+
describe('migratePrefixedEnv', () => {
|
|
23
|
+
it('returns prefixed value when set', () => {
|
|
24
|
+
expect(migratePrefixedEnv('codex-cli', 'api', 'OPENAI_BACKEND', 'CONSULT_LLM_OPENAI_BACKEND')).toBe('codex-cli');
|
|
25
|
+
});
|
|
26
|
+
it('falls back to unprefixed value with deprecation', () => {
|
|
27
|
+
expect(migratePrefixedEnv(undefined, 'gemini-cli', 'GEMINI_BACKEND', 'CONSULT_LLM_GEMINI_BACKEND')).toBe('gemini-cli');
|
|
28
|
+
});
|
|
29
|
+
it('returns undefined when both are missing', () => {
|
|
30
|
+
expect(migratePrefixedEnv(undefined, undefined, 'OPENAI_BACKEND', 'CONSULT_LLM_OPENAI_BACKEND')).toBeUndefined();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
22
33
|
describe('filterByAvailability', () => {
|
|
23
34
|
const allModels = ['gemini-2.5-pro', 'gpt-5.2', 'deepseek-reasoner'];
|
|
24
35
|
it('includes gemini models when using gemini-cli backend', () => {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GIT_HASH = "
|
|
1
|
+
export declare const GIT_HASH = "0b76ca4";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const GIT_HASH = "
|
|
1
|
+
export const GIT_HASH = "0b76ca4";
|