trainfabric 0.1.51 → 0.1.53
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.cjs +15 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9364,7 +9364,7 @@ function buildComputeSpec(options) {
|
|
|
9364
9364
|
|
|
9365
9365
|
// src/index.ts
|
|
9366
9366
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
9367
|
-
var CLI_VERSION = "0.1.
|
|
9367
|
+
var CLI_VERSION = "0.1.53";
|
|
9368
9368
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
9369
9369
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
9370
9370
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|
|
@@ -9718,8 +9718,8 @@ function printInvoiceSummary(invoices) {
|
|
|
9718
9718
|
console.log(`${invoice.id}${invoice.runId ? ` (${invoice.runId})` : ""}`);
|
|
9719
9719
|
console.log(` status: ${invoice.status}`);
|
|
9720
9720
|
console.log(` amount due: ${formatUsd(invoice.amountDueUsd)}`);
|
|
9721
|
-
if (typeof invoice.customerChargeUsd === "number") {
|
|
9722
|
-
console.log(` run charge: ${formatUsd(invoice.customerChargeUsd)}`);
|
|
9721
|
+
if (typeof invoice.usageChargeUsd === "number" || typeof invoice.customerChargeUsd === "number") {
|
|
9722
|
+
console.log(` run charge: ${formatUsd(invoice.usageChargeUsd ?? invoice.customerChargeUsd)}`);
|
|
9723
9723
|
}
|
|
9724
9724
|
if (typeof invoice.creditAppliedUsd === "number") {
|
|
9725
9725
|
console.log(` credits applied: ${formatUsd(invoice.creditAppliedUsd)}`);
|
|
@@ -10323,7 +10323,7 @@ program2.command("runs:list").option("--project <projectId>").option("--status <
|
|
|
10323
10323
|
const runs = await createClient(loadConfig()).runs.list(normalizeOptionalId(options.project, "project", "Project ID"));
|
|
10324
10324
|
printJson(status ? runs.filter((run) => run.status === status) : runs);
|
|
10325
10325
|
});
|
|
10326
|
-
program2.command("runs:status").argument("<runId>").description("Fetch full run detail").action(async (runId) => {
|
|
10326
|
+
program2.command("runs:status").argument("<runId>").option("--json", "print raw JSON output; this is the default").description("Fetch full run detail").action(async (runId) => {
|
|
10327
10327
|
const detail = await createClient(loadConfig()).runs.get(normalizeId(runId, "run", "Run ID"));
|
|
10328
10328
|
printJson({ ...detail, ...detail.run });
|
|
10329
10329
|
});
|
|
@@ -10375,10 +10375,10 @@ program2.command("runs:resume").argument("<runId>").description("Resume a run fr
|
|
|
10375
10375
|
program2.command("runs:terminate").argument("<runId>").description("Terminate a queued, launchable, or active run").action(async (runId) => {
|
|
10376
10376
|
printJson(await createClient(loadConfig()).runs.terminate(normalizeId(runId, "run", "Run ID")));
|
|
10377
10377
|
});
|
|
10378
|
-
program2.command("cluster:capacity").description("Fetch cluster capacity view").action(async () => {
|
|
10378
|
+
program2.command("cluster:capacity").option("--json", "print raw JSON output; this is the default").description("Fetch cluster capacity view").action(async () => {
|
|
10379
10379
|
printJson(await createClient(loadConfig()).cluster.getCapacity());
|
|
10380
10380
|
});
|
|
10381
|
-
program2.command("cluster:pools").description("List inventory pools").action(async () => {
|
|
10381
|
+
program2.command("cluster:pools").option("--json", "print raw JSON output; this is the default").description("List inventory pools").action(async () => {
|
|
10382
10382
|
printJson(await createClient(loadConfig()).cluster.listInventoryPools());
|
|
10383
10383
|
});
|
|
10384
10384
|
program2.command("models:list").option("--json", "print raw JSON output; this is the default").description("List exported models").action(async () => {
|
|
@@ -10416,7 +10416,7 @@ program2.command("deployments:delete").argument("<deploymentId>").description("D
|
|
|
10416
10416
|
program2.command("billing:summary").option("--json", "print raw JSON output; this is the default").description("Fetch billing summary").action(async () => {
|
|
10417
10417
|
printJson(await createClient(loadConfig()).billing.getSummary());
|
|
10418
10418
|
});
|
|
10419
|
-
program2.command("billing:usage").option("--unit <unit>", "normalized_tflop_seconds, reserved_gpu_seconds, or usd").option("--run <runId>", "filter usage records to one run").description("List billing usage records").action(async (options) => {
|
|
10419
|
+
program2.command("billing:usage").option("--json", "print raw JSON output; this is the default").option("--unit <unit>", "normalized_tflop_seconds, reserved_gpu_seconds, or usd").option("--run <runId>", "filter usage records to one run").description("List billing usage records").action(async (options) => {
|
|
10420
10420
|
const runId = normalizeOptionalId(options.run, "run", "Run ID");
|
|
10421
10421
|
const unit = normalizeOptionalBillingUnit(options.unit);
|
|
10422
10422
|
const client = createClient(loadConfig());
|
|
@@ -10425,7 +10425,14 @@ program2.command("billing:usage").option("--unit <unit>", "normalized_tflop_seco
|
|
|
10425
10425
|
printJson(unit ? { ...summary, unit, usage: summary.usage.filter((entry) => entry.unit === unit) } : summary);
|
|
10426
10426
|
return;
|
|
10427
10427
|
}
|
|
10428
|
-
|
|
10428
|
+
const usage = await client.billing.getUsage(unit);
|
|
10429
|
+
printJson({
|
|
10430
|
+
recordCount: usage.length,
|
|
10431
|
+
responseShape: "usage_summary",
|
|
10432
|
+
runId: null,
|
|
10433
|
+
unit: unit ?? "all",
|
|
10434
|
+
usage
|
|
10435
|
+
});
|
|
10429
10436
|
});
|
|
10430
10437
|
program2.command("billing:invoices").option("--json", "print raw JSON output; this is the default unless --summary is used").option("--summary", "print a human-readable invoice reconciliation summary").description("List invoices").action(async (options) => {
|
|
10431
10438
|
const invoices = await createClient(loadConfig()).billing.listInvoices();
|