@orchagent/cli 0.3.35 → 0.3.36
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/dist/commands/agents.js +2 -2
- package/dist/commands/call.js +16 -13
- package/dist/commands/config.js +26 -1
- package/dist/commands/fork.js +1 -1
- package/dist/commands/install.js +3 -2
- package/dist/lib/config.js +13 -1
- package/dist/lib/output.js +2 -2
- package/package.json +2 -3
package/dist/commands/agents.js
CHANGED
|
@@ -85,8 +85,8 @@ function registerAgentsCommand(program) {
|
|
|
85
85
|
const price = (0, pricing_1.formatPrice)(agent);
|
|
86
86
|
const coloredPrice = (0, pricing_1.isPaidAgent)(agent) ? chalk_1.default.yellow(price) : chalk_1.default.green(price);
|
|
87
87
|
const desc = agent.description
|
|
88
|
-
? agent.description.length >
|
|
89
|
-
? agent.description.slice(0,
|
|
88
|
+
? agent.description.length > 60
|
|
89
|
+
? agent.description.slice(0, 57) + '...'
|
|
90
90
|
: agent.description
|
|
91
91
|
: '-';
|
|
92
92
|
table.push([name, version, type, stars.toString(), coloredPrice, desc]);
|
package/dist/commands/call.js
CHANGED
|
@@ -295,14 +295,17 @@ Paid Agents:
|
|
|
295
295
|
const supportedProviders = agentMeta.supported_providers || ['any'];
|
|
296
296
|
let llmKey;
|
|
297
297
|
let llmProvider;
|
|
298
|
+
// Resolve effective provider: CLI flag > config default
|
|
299
|
+
const configDefaultProvider = await (0, config_1.getDefaultProvider)();
|
|
300
|
+
const effectiveProvider = options.provider ?? configDefaultProvider;
|
|
298
301
|
if (options.key) {
|
|
299
302
|
// Explicit key provided - require provider
|
|
300
|
-
if (!
|
|
303
|
+
if (!effectiveProvider) {
|
|
301
304
|
throw new errors_1.CliError('When using --key, you must also specify --provider (openai, anthropic, or gemini)');
|
|
302
305
|
}
|
|
303
|
-
(0, llm_1.validateProvider)(
|
|
306
|
+
(0, llm_1.validateProvider)(effectiveProvider);
|
|
304
307
|
// Warn on potential model/provider mismatch
|
|
305
|
-
if (options.model &&
|
|
308
|
+
if (options.model && effectiveProvider) {
|
|
306
309
|
const modelLower = options.model.toLowerCase();
|
|
307
310
|
const providerPatterns = {
|
|
308
311
|
openai: /^(gpt-|o1-|o3-|davinci|text-)/,
|
|
@@ -310,21 +313,21 @@ Paid Agents:
|
|
|
310
313
|
gemini: /^gemini-/,
|
|
311
314
|
ollama: /^(llama|mistral|deepseek|phi|qwen)/,
|
|
312
315
|
};
|
|
313
|
-
const expectedPattern = providerPatterns[
|
|
316
|
+
const expectedPattern = providerPatterns[effectiveProvider];
|
|
314
317
|
if (expectedPattern && !expectedPattern.test(modelLower)) {
|
|
315
|
-
process.stderr.write(`Warning: Model '${options.model}' may not be a ${
|
|
318
|
+
process.stderr.write(`Warning: Model '${options.model}' may not be a ${effectiveProvider} model.\n\n`);
|
|
316
319
|
}
|
|
317
320
|
}
|
|
318
321
|
llmKey = options.key;
|
|
319
|
-
llmProvider =
|
|
322
|
+
llmProvider = effectiveProvider;
|
|
320
323
|
}
|
|
321
324
|
else {
|
|
322
325
|
// Try to detect from environment or server
|
|
323
|
-
// If
|
|
326
|
+
// If provider specified (flag or config default), prioritize that provider
|
|
324
327
|
let providersToCheck = supportedProviders;
|
|
325
|
-
if (
|
|
326
|
-
(0, llm_1.validateProvider)(
|
|
327
|
-
providersToCheck = [
|
|
328
|
+
if (effectiveProvider) {
|
|
329
|
+
(0, llm_1.validateProvider)(effectiveProvider);
|
|
330
|
+
providersToCheck = [effectiveProvider];
|
|
328
331
|
// Warn on potential model/provider mismatch
|
|
329
332
|
if (options.model) {
|
|
330
333
|
const modelLower = options.model.toLowerCase();
|
|
@@ -334,9 +337,9 @@ Paid Agents:
|
|
|
334
337
|
gemini: /^gemini-/,
|
|
335
338
|
ollama: /^(llama|mistral|deepseek|phi|qwen)/,
|
|
336
339
|
};
|
|
337
|
-
const expectedPattern = providerPatterns[
|
|
340
|
+
const expectedPattern = providerPatterns[effectiveProvider];
|
|
338
341
|
if (expectedPattern && !expectedPattern.test(modelLower)) {
|
|
339
|
-
process.stderr.write(`Warning: Model '${options.model}' may not be a ${
|
|
342
|
+
process.stderr.write(`Warning: Model '${options.model}' may not be a ${effectiveProvider} model.\n\n`);
|
|
340
343
|
}
|
|
341
344
|
}
|
|
342
345
|
}
|
|
@@ -358,7 +361,7 @@ Paid Agents:
|
|
|
358
361
|
}
|
|
359
362
|
else if (agentMeta.type === 'prompt') {
|
|
360
363
|
// Warn if no key found for prompt-based agent
|
|
361
|
-
const searchedProviders =
|
|
364
|
+
const searchedProviders = effectiveProvider ? [effectiveProvider] : supportedProviders;
|
|
362
365
|
const providerList = searchedProviders.join(', ');
|
|
363
366
|
process.stderr.write(`Warning: No LLM key found for provider(s): ${providerList}\n` +
|
|
364
367
|
`Set an env var (e.g., OPENAI_API_KEY), run 'orchagent keys add <provider>', use --key, or configure in web dashboard\n\n`);
|
package/dist/commands/config.js
CHANGED
|
@@ -10,7 +10,7 @@ function getAllValidFormatIds() {
|
|
|
10
10
|
const skillFormatIds = [...config_1.VALID_FORMAT_IDS];
|
|
11
11
|
return [...new Set([...adapterIds, ...skillFormatIds])];
|
|
12
12
|
}
|
|
13
|
-
const SUPPORTED_KEYS = ['default-format', 'default-scope'];
|
|
13
|
+
const SUPPORTED_KEYS = ['default-format', 'default-scope', 'default-provider'];
|
|
14
14
|
function isValidKey(key) {
|
|
15
15
|
return SUPPORTED_KEYS.includes(key);
|
|
16
16
|
}
|
|
@@ -36,6 +36,14 @@ async function setConfigValue(key, value) {
|
|
|
36
36
|
await (0, config_1.setDefaultScope)(value);
|
|
37
37
|
process.stdout.write(`Set default-scope to: ${value}\n`);
|
|
38
38
|
}
|
|
39
|
+
if (key === 'default-provider') {
|
|
40
|
+
const validProviders = [...config_1.VALID_PROVIDERS];
|
|
41
|
+
if (!validProviders.includes(value)) {
|
|
42
|
+
throw new errors_1.CliError(`Invalid provider: ${value}. Valid providers: ${validProviders.join(', ')}`);
|
|
43
|
+
}
|
|
44
|
+
await (0, config_1.setDefaultProvider)(value);
|
|
45
|
+
process.stdout.write(`Set default-provider to: ${value}\n`);
|
|
46
|
+
}
|
|
39
47
|
}
|
|
40
48
|
async function getConfigValue(key) {
|
|
41
49
|
if (!isValidKey(key)) {
|
|
@@ -60,6 +68,15 @@ async function getConfigValue(key) {
|
|
|
60
68
|
process.stdout.write(`${scope}\n`);
|
|
61
69
|
}
|
|
62
70
|
}
|
|
71
|
+
if (key === 'default-provider') {
|
|
72
|
+
const provider = await (0, config_1.getDefaultProvider)();
|
|
73
|
+
if (!provider) {
|
|
74
|
+
process.stdout.write('(not set)\n');
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
process.stdout.write(`${provider}\n`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
63
80
|
}
|
|
64
81
|
async function listConfigValues() {
|
|
65
82
|
const config = await (0, config_1.loadConfig)();
|
|
@@ -80,6 +97,14 @@ async function listConfigValues() {
|
|
|
80
97
|
else {
|
|
81
98
|
process.stdout.write(' default-scope: (not set)\n');
|
|
82
99
|
}
|
|
100
|
+
// default-provider
|
|
101
|
+
const provider = config.default_provider;
|
|
102
|
+
if (provider) {
|
|
103
|
+
process.stdout.write(` default-provider: ${provider}\n`);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
process.stdout.write(' default-provider: (not set)\n');
|
|
107
|
+
}
|
|
83
108
|
process.stdout.write('\n');
|
|
84
109
|
}
|
|
85
110
|
function registerConfigCommand(program) {
|
package/dist/commands/fork.js
CHANGED
|
@@ -35,7 +35,7 @@ function registerForkCommand(program) {
|
|
|
35
35
|
process.stdout.write(`Forked ${org}/${name}/${version} to your account\n`);
|
|
36
36
|
process.stdout.write(`\nYour forked agent: ${myOrg.slug}/${name}/v1\n`);
|
|
37
37
|
process.stdout.write(`\nNext steps:\n`);
|
|
38
|
-
process.stdout.write(` 1. Run: orchagent
|
|
38
|
+
process.stdout.write(` 1. Run: orchagent install ${myOrg.slug}/${name}\n`);
|
|
39
39
|
process.stdout.write(` 2. Edit the prompt and schemas locally\n`);
|
|
40
40
|
process.stdout.write(` 3. Run: orchagent publish\n`);
|
|
41
41
|
});
|
package/dist/commands/install.js
CHANGED
|
@@ -125,6 +125,7 @@ function registerInstallCommand(program) {
|
|
|
125
125
|
.description('Install agent as sub-agent (Claude Code, Cursor, etc.)')
|
|
126
126
|
.option('--format <formats>', 'Comma-separated format IDs (e.g., claude-code,cursor)')
|
|
127
127
|
.option('--scope <scope>', 'Install scope: user (home dir) or project (current dir)')
|
|
128
|
+
.option('--global', 'Install to home directory (alias for --scope user)')
|
|
128
129
|
.option('--dry-run', 'Show what would be installed without making changes')
|
|
129
130
|
.option('--json', 'Output result as JSON (for automation/tooling)')
|
|
130
131
|
.addHelpText('after', `
|
|
@@ -188,8 +189,8 @@ Note: Paid agents cannot be installed locally - they run on server only.
|
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
result.formats = targetFormats;
|
|
191
|
-
// Resolve scope:
|
|
192
|
-
let scope = (options.scope ?? await (0, config_1.getDefaultScope)() ?? 'user');
|
|
192
|
+
// Resolve scope: --global > --scope > config default > fallback to 'user'
|
|
193
|
+
let scope = (options.global ? 'user' : (options.scope ?? await (0, config_1.getDefaultScope)() ?? 'user'));
|
|
193
194
|
if (scope !== 'user' && scope !== 'project') {
|
|
194
195
|
const errMsg = 'Scope must be "user" or "project"';
|
|
195
196
|
if (jsonMode) {
|
package/dist/lib/config.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.FORMAT_SKILL_DIRS = exports.VALID_FORMAT_IDS = void 0;
|
|
39
|
+
exports.VALID_PROVIDERS = exports.FORMAT_SKILL_DIRS = exports.VALID_FORMAT_IDS = void 0;
|
|
40
40
|
exports.loadConfig = loadConfig;
|
|
41
41
|
exports.saveConfig = saveConfig;
|
|
42
42
|
exports.getResolvedConfig = getResolvedConfig;
|
|
@@ -45,6 +45,8 @@ exports.getDefaultFormats = getDefaultFormats;
|
|
|
45
45
|
exports.setDefaultFormats = setDefaultFormats;
|
|
46
46
|
exports.getDefaultScope = getDefaultScope;
|
|
47
47
|
exports.setDefaultScope = setDefaultScope;
|
|
48
|
+
exports.getDefaultProvider = getDefaultProvider;
|
|
49
|
+
exports.setDefaultProvider = setDefaultProvider;
|
|
48
50
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
49
51
|
const path_1 = __importDefault(require("path"));
|
|
50
52
|
const os_1 = __importDefault(require("os"));
|
|
@@ -140,3 +142,13 @@ async function setDefaultScope(scope) {
|
|
|
140
142
|
config.default_scope = scope;
|
|
141
143
|
await saveConfig(config);
|
|
142
144
|
}
|
|
145
|
+
exports.VALID_PROVIDERS = ['openai', 'anthropic', 'gemini'];
|
|
146
|
+
async function getDefaultProvider() {
|
|
147
|
+
const config = await loadConfig();
|
|
148
|
+
return config.default_provider;
|
|
149
|
+
}
|
|
150
|
+
async function setDefaultProvider(provider) {
|
|
151
|
+
const config = await loadConfig();
|
|
152
|
+
config.default_provider = provider;
|
|
153
|
+
await saveConfig(config);
|
|
154
|
+
}
|
package/dist/lib/output.js
CHANGED
|
@@ -30,8 +30,8 @@ function printAgentsTable(agents, options) {
|
|
|
30
30
|
const price = (0, pricing_1.formatPrice)(agent);
|
|
31
31
|
const priceColored = (0, pricing_1.isPaidAgent)(agent) ? chalk_1.default.yellow(price) : chalk_1.default.green(price);
|
|
32
32
|
const desc = agent.description
|
|
33
|
-
? agent.description.length >
|
|
34
|
-
? agent.description.slice(0,
|
|
33
|
+
? agent.description.length > 60
|
|
34
|
+
? agent.description.slice(0, 57) + '...'
|
|
35
35
|
: agent.description
|
|
36
36
|
: '-';
|
|
37
37
|
const visibility = agent.is_public === false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchagent/cli",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.36",
|
|
4
4
|
"description": "Command-line interface for the orchagent AI agent marketplace",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "orchagent <hello@orchagent.io>",
|
|
@@ -40,8 +40,7 @@
|
|
|
40
40
|
"test:coverage": "vitest run --coverage",
|
|
41
41
|
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
42
42
|
"test:all": "vitest run && vitest run --config vitest.e2e.config.ts",
|
|
43
|
-
"prepublishOnly": "npm run build"
|
|
44
|
-
"postpublish": "cd ../cli-wrapper && npm version $npm_package_version --no-git-tag-version --allow-same-version && npm publish && echo '\n✓ Wrapper published at orchagent@'$npm_package_version"
|
|
43
|
+
"prepublishOnly": "npm run build"
|
|
45
44
|
},
|
|
46
45
|
"dependencies": {
|
|
47
46
|
"@sentry/node": "^9.3.0",
|