@eve-horizon/cli 0.2.30 → 0.2.31
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/index.js +101 -24
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -51204,7 +51204,7 @@ Requires Docker Desktop; k3d and kubectl are auto-managed by the CLI.`,
|
|
|
51204
51204
|
]
|
|
51205
51205
|
},
|
|
51206
51206
|
ollama: {
|
|
51207
|
-
description: "Manage inference targets, installs, models, and
|
|
51207
|
+
description: "Manage inference targets, installs, models, aliases, and platform managed availability.",
|
|
51208
51208
|
usage: "eve ollama <subcommand> [options]",
|
|
51209
51209
|
subcommands: {
|
|
51210
51210
|
targets: {
|
|
@@ -51217,7 +51217,7 @@ Requires Docker Desktop; k3d and kubectl are auto-managed by the CLI.`,
|
|
|
51217
51217
|
options: [
|
|
51218
51218
|
"add: --name <name> --base-url <url> [--scope-kind <kind>] [--scope-id <id>] [--target-type <type>] [--transport-profile <profile>] [--api-key-ref <secret-ref>]",
|
|
51219
51219
|
"rm: <target-id>",
|
|
51220
|
-
"test: <target-id>
|
|
51220
|
+
"test: <target-id>"
|
|
51221
51221
|
]
|
|
51222
51222
|
},
|
|
51223
51223
|
models: {
|
|
@@ -51267,15 +51267,25 @@ Requires Docker Desktop; k3d and kubectl are auto-managed by the CLI.`,
|
|
|
51267
51267
|
"set: --scope-kind <kind> [--scope-id <id>] --preferred-target-id <target-id> [--fallback-to-alias-target true|false]",
|
|
51268
51268
|
"rm: --scope-kind <kind> [--scope-id <id>]"
|
|
51269
51269
|
]
|
|
51270
|
+
},
|
|
51271
|
+
managed: {
|
|
51272
|
+
description: "List, publish, and unpublish platform-managed catalog models",
|
|
51273
|
+
usage: "eve ollama managed <list|publish|unpublish> [options]",
|
|
51274
|
+
options: [
|
|
51275
|
+
"list: [--json]",
|
|
51276
|
+
"publish: --canonical <id> --provider <name> --slug <provider_model_slug> --target-id <id> [--requires-warm-start true|false] [--enabled true|false] [--json]",
|
|
51277
|
+
"unpublish: --canonical <id> [--json]"
|
|
51278
|
+
]
|
|
51270
51279
|
}
|
|
51271
51280
|
},
|
|
51272
51281
|
examples: [
|
|
51273
51282
|
"eve ollama target add --name local --base-url http://localhost:11434 --scope-kind platform --target-type external_ollama",
|
|
51274
51283
|
"eve ollama model add --canonical gpt-oss:120b --provider ollama --slug gpt-oss:120b",
|
|
51275
51284
|
"eve ollama install add --target-id itgt_xxx --model-id imod_xxx --min-target-capacity 1",
|
|
51276
|
-
"eve ollama
|
|
51277
|
-
"eve ollama
|
|
51278
|
-
"eve ollama
|
|
51285
|
+
"eve ollama assignments --scope-kind platform",
|
|
51286
|
+
"eve ollama managed list",
|
|
51287
|
+
"eve ollama managed publish --canonical deepseek-r1 --provider ollama --slug deepseek-r1:latest --target-id itgt_xxx",
|
|
51288
|
+
"eve ollama managed unpublish --canonical deepseek-r1"
|
|
51279
51289
|
]
|
|
51280
51290
|
},
|
|
51281
51291
|
migrate: {
|
|
@@ -56809,9 +56819,6 @@ var EnvironmentListResponseSchema = external_exports.object({
|
|
|
56809
56819
|
data: external_exports.array(EnvironmentResponseSchema),
|
|
56810
56820
|
pagination: PaginationSchema
|
|
56811
56821
|
});
|
|
56812
|
-
var DeleteEnvironmentRequestSchema = external_exports.object({
|
|
56813
|
-
force: external_exports.boolean().optional()
|
|
56814
|
-
}).optional().default({});
|
|
56815
56822
|
var EnvLogEntrySchema = external_exports.object({
|
|
56816
56823
|
timestamp: external_exports.string(),
|
|
56817
56824
|
line: external_exports.string(),
|
|
@@ -75237,20 +75244,18 @@ async function handleModels(subcommand, positionals, flags, context2) {
|
|
|
75237
75244
|
switch (subcommand) {
|
|
75238
75245
|
case "list":
|
|
75239
75246
|
case void 0:
|
|
75240
|
-
return handleList8(
|
|
75247
|
+
return handleList8(context2, json);
|
|
75241
75248
|
default:
|
|
75242
|
-
throw new Error("Usage: eve models list [--
|
|
75249
|
+
throw new Error("Usage: eve models list [--json]");
|
|
75243
75250
|
}
|
|
75244
75251
|
}
|
|
75245
|
-
async function handleList8(
|
|
75246
|
-
const
|
|
75247
|
-
const query = managedOnly ? "?managed=true" : "";
|
|
75248
|
-
const response = await requestJson(context2, `/models${query}`);
|
|
75252
|
+
async function handleList8(context2, json) {
|
|
75253
|
+
const response = await requestJson(context2, "/models");
|
|
75249
75254
|
if (json) {
|
|
75250
75255
|
outputJson(response, json);
|
|
75251
75256
|
return;
|
|
75252
75257
|
}
|
|
75253
|
-
if (response.byok
|
|
75258
|
+
if (response.byok) {
|
|
75254
75259
|
console.log("BYOK (Bring Your Own Key)");
|
|
75255
75260
|
console.log("========================");
|
|
75256
75261
|
console.log(` ${response.byok.description}`);
|
|
@@ -78057,6 +78062,14 @@ function requireString(flags, key) {
|
|
|
78057
78062
|
if (!value) throw new Error(`Missing required flag --${key}`);
|
|
78058
78063
|
return value;
|
|
78059
78064
|
}
|
|
78065
|
+
function asBoolean(flags, key) {
|
|
78066
|
+
const value = asString(flags, key);
|
|
78067
|
+
if (value === void 0) return void 0;
|
|
78068
|
+
return value === "true" || value === "1";
|
|
78069
|
+
}
|
|
78070
|
+
function normalizeManagedModelRows(payload) {
|
|
78071
|
+
return Array.isArray(payload) ? payload : payload.data;
|
|
78072
|
+
}
|
|
78060
78073
|
function printTable(headers, rows) {
|
|
78061
78074
|
const widths = headers.map((header, idx) => Math.max(header.length, ...rows.map((row) => row[idx]?.length ?? 0)));
|
|
78062
78075
|
const line = `+${widths.map((w) => "-".repeat(w + 2)).join("+")}+`;
|
|
@@ -78147,14 +78160,8 @@ async function handleOllama(subcommand, positionals, flags, context2) {
|
|
|
78147
78160
|
}
|
|
78148
78161
|
if (action === "test") {
|
|
78149
78162
|
const targetId = positionals[1];
|
|
78150
|
-
if (!targetId) throw new Error("Usage: eve ollama target test <target-id>
|
|
78151
|
-
const
|
|
78152
|
-
const orgId = asString(flags, "org-id");
|
|
78153
|
-
const projectId = asString(flags, "project-id");
|
|
78154
|
-
if (orgId) query.set("org_id", orgId);
|
|
78155
|
-
if (projectId) query.set("project_id", projectId);
|
|
78156
|
-
const suffix = query.toString() ? `?${query.toString()}` : "";
|
|
78157
|
-
const result = await requestJson(context2, `/inference/targets/${targetId}/test${suffix}`, {
|
|
78163
|
+
if (!targetId) throw new Error("Usage: eve ollama target test <target-id>");
|
|
78164
|
+
const result = await requestJson(context2, `/inference/targets/${targetId}/test`, {
|
|
78158
78165
|
method: "POST"
|
|
78159
78166
|
});
|
|
78160
78167
|
outputJson(result, json);
|
|
@@ -78439,8 +78446,78 @@ async function handleOllama(subcommand, positionals, flags, context2) {
|
|
|
78439
78446
|
}
|
|
78440
78447
|
throw new Error("Usage: eve ollama install <add|rm> --target-id <id> --model-id <id>");
|
|
78441
78448
|
}
|
|
78449
|
+
case "managed": {
|
|
78450
|
+
const action = positionals[0];
|
|
78451
|
+
if (action === "list") {
|
|
78452
|
+
const response = await requestJson(
|
|
78453
|
+
context2,
|
|
78454
|
+
"/inference/managed-models"
|
|
78455
|
+
);
|
|
78456
|
+
const managed = normalizeManagedModelRows(response);
|
|
78457
|
+
outputJson(managed, json);
|
|
78458
|
+
if (json) return;
|
|
78459
|
+
if (managed.length === 0) {
|
|
78460
|
+
console.log("No managed models published.");
|
|
78461
|
+
return;
|
|
78462
|
+
}
|
|
78463
|
+
printTable(
|
|
78464
|
+
["Canonical", "Provider", "Slug", "Target ID", "Warm Start", "Enabled"],
|
|
78465
|
+
managed.map((item) => [
|
|
78466
|
+
item.canonical_model_id,
|
|
78467
|
+
item.provider,
|
|
78468
|
+
item.provider_model_slug,
|
|
78469
|
+
item.target_id,
|
|
78470
|
+
item.requires_warm_start ? "yes" : "no",
|
|
78471
|
+
item.enabled ? "yes" : "no"
|
|
78472
|
+
])
|
|
78473
|
+
);
|
|
78474
|
+
return;
|
|
78475
|
+
}
|
|
78476
|
+
if (action === "publish") {
|
|
78477
|
+
const body = {
|
|
78478
|
+
canonical_model_id: requireString(flags, "canonical"),
|
|
78479
|
+
provider: requireString(flags, "provider"),
|
|
78480
|
+
provider_model_slug: requireString(flags, "slug"),
|
|
78481
|
+
target_id: requireString(flags, "target-id")
|
|
78482
|
+
};
|
|
78483
|
+
const requiresWarmStart = asBoolean(flags, "requires-warm-start");
|
|
78484
|
+
const enabled = asBoolean(flags, "enabled");
|
|
78485
|
+
if (requiresWarmStart !== void 0) {
|
|
78486
|
+
body.requires_warm_start = requiresWarmStart;
|
|
78487
|
+
}
|
|
78488
|
+
if (enabled !== void 0) {
|
|
78489
|
+
body.enabled = enabled;
|
|
78490
|
+
}
|
|
78491
|
+
const result = await requestJson(context2, "/inference/managed-models", {
|
|
78492
|
+
method: "POST",
|
|
78493
|
+
body
|
|
78494
|
+
});
|
|
78495
|
+
outputJson(result, json);
|
|
78496
|
+
if (!json) {
|
|
78497
|
+
console.log(
|
|
78498
|
+
`Published managed model ${result.data.canonical_model_id} (install ${result.created_install ? "created" : "already present"}).`
|
|
78499
|
+
);
|
|
78500
|
+
}
|
|
78501
|
+
return;
|
|
78502
|
+
}
|
|
78503
|
+
if (action === "unpublish") {
|
|
78504
|
+
const canonicalModelId = requireString(flags, "canonical");
|
|
78505
|
+
await requestJson(context2, `/inference/managed-models/${encodeURIComponent(canonicalModelId)}`, {
|
|
78506
|
+
method: "DELETE"
|
|
78507
|
+
});
|
|
78508
|
+
const payload = { canonical_model_id: canonicalModelId };
|
|
78509
|
+
outputJson(payload, json);
|
|
78510
|
+
if (!json) {
|
|
78511
|
+
console.log(`Unpublished managed model ${canonicalModelId}`);
|
|
78512
|
+
}
|
|
78513
|
+
return;
|
|
78514
|
+
}
|
|
78515
|
+
throw new Error("Usage: eve ollama managed <list|publish|unpublish> ...");
|
|
78516
|
+
}
|
|
78442
78517
|
default:
|
|
78443
|
-
throw new Error(
|
|
78518
|
+
throw new Error(
|
|
78519
|
+
"Usage: eve ollama <targets|target|models|model|aliases|alias|installs|install|assignments|route-policies|route-policy|managed>"
|
|
78520
|
+
);
|
|
78444
78521
|
}
|
|
78445
78522
|
}
|
|
78446
78523
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eve-horizon/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.31",
|
|
4
4
|
"description": "Eve Horizon CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"assets",
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"
|
|
23
|
+
},
|
|
21
24
|
"publishConfig": {
|
|
22
25
|
"access": "public"
|
|
23
26
|
},
|
|
@@ -28,14 +31,11 @@
|
|
|
28
31
|
"yaml": "^2.5.1"
|
|
29
32
|
},
|
|
30
33
|
"devDependencies": {
|
|
34
|
+
"@eve/migrate": "workspace:*",
|
|
35
|
+
"@eve/shared": "workspace:*",
|
|
31
36
|
"@types/node": "^22.0.0",
|
|
32
37
|
"esbuild": "^0.27.3",
|
|
33
38
|
"postgres": "^3.4.0",
|
|
34
|
-
"typescript": "^5.7.0"
|
|
35
|
-
"@eve/shared": "0.0.1",
|
|
36
|
-
"@eve/migrate": "0.0.1"
|
|
37
|
-
},
|
|
38
|
-
"scripts": {
|
|
39
|
-
"build": "rm -rf dist && esbuild src/index.ts --bundle --platform=node --target=node22 --outfile=dist/index.js --format=cjs --external:yaml"
|
|
39
|
+
"typescript": "^5.7.0"
|
|
40
40
|
}
|
|
41
|
-
}
|
|
41
|
+
}
|