trainfabric 0.1.48 → 0.1.49
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 +80 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9362,7 +9362,7 @@ function buildComputeSpec(options) {
|
|
|
9362
9362
|
|
|
9363
9363
|
// src/index.ts
|
|
9364
9364
|
var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
|
|
9365
|
-
var CLI_VERSION = "0.1.
|
|
9365
|
+
var CLI_VERSION = "0.1.49";
|
|
9366
9366
|
var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
|
|
9367
9367
|
var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
|
|
9368
9368
|
var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
|
|
@@ -10034,6 +10034,73 @@ async function login(config) {
|
|
|
10034
10034
|
}
|
|
10035
10035
|
var program2 = new Command();
|
|
10036
10036
|
program2.name("trainfabric").description("Trainfabric CLI for launching and monitoring GPU training jobs").version(CLI_VERSION);
|
|
10037
|
+
program2.command("runs").description("Show run command group help").addHelpText(
|
|
10038
|
+
"after",
|
|
10039
|
+
`
|
|
10040
|
+
Run commands:
|
|
10041
|
+
trainfabric runs:quote Preview Efficient, Balanced, and Power launch options
|
|
10042
|
+
trainfabric runs:create Launch a run from an accepted quote
|
|
10043
|
+
trainfabric runs:list List runs
|
|
10044
|
+
trainfabric runs:status Fetch full run detail
|
|
10045
|
+
trainfabric runs:logs Fetch run logs
|
|
10046
|
+
trainfabric runs:wait Wait for a terminal state
|
|
10047
|
+
trainfabric runs:watch Stream run events
|
|
10048
|
+
trainfabric runs:usage Show run usage and charges
|
|
10049
|
+
trainfabric runs:cancel Cancel a queued or active run
|
|
10050
|
+
trainfabric runs:terminate Terminate an active run
|
|
10051
|
+
|
|
10052
|
+
Use --help on any command for options.`
|
|
10053
|
+
).action(() => {
|
|
10054
|
+
console.log(`Run commands:
|
|
10055
|
+
trainfabric runs:quote Preview Efficient, Balanced, and Power launch options
|
|
10056
|
+
trainfabric runs:create Launch a run from an accepted quote
|
|
10057
|
+
trainfabric runs:list List runs
|
|
10058
|
+
trainfabric runs:status Fetch full run detail
|
|
10059
|
+
trainfabric runs:logs Fetch run logs
|
|
10060
|
+
trainfabric runs:wait Wait for a terminal state
|
|
10061
|
+
trainfabric runs:watch Stream run events
|
|
10062
|
+
trainfabric runs:usage Show run usage and charges
|
|
10063
|
+
trainfabric runs:cancel Cancel a queued or active run
|
|
10064
|
+
trainfabric runs:terminate Terminate an active run
|
|
10065
|
+
|
|
10066
|
+
Use --help on any command for options.`);
|
|
10067
|
+
});
|
|
10068
|
+
program2.command("datasets").description("Show dataset command group help").addHelpText(
|
|
10069
|
+
"after",
|
|
10070
|
+
`
|
|
10071
|
+
Dataset commands:
|
|
10072
|
+
trainfabric datasets:validate Validate a JSONL dataset file
|
|
10073
|
+
trainfabric datasets:upload Upload a dataset
|
|
10074
|
+
trainfabric datasets:list List datasets
|
|
10075
|
+
trainfabric datasets:get Fetch dataset detail
|
|
10076
|
+
trainfabric datasets:delete Delete a dataset
|
|
10077
|
+
|
|
10078
|
+
Use --help on any command for options.`
|
|
10079
|
+
).action(() => {
|
|
10080
|
+
console.log(`Dataset commands:
|
|
10081
|
+
trainfabric datasets:validate Validate a JSONL dataset file
|
|
10082
|
+
trainfabric datasets:upload Upload a dataset
|
|
10083
|
+
trainfabric datasets:list List datasets
|
|
10084
|
+
trainfabric datasets:get Fetch dataset detail
|
|
10085
|
+
trainfabric datasets:delete Delete a dataset
|
|
10086
|
+
|
|
10087
|
+
Use --help on any command for options.`);
|
|
10088
|
+
});
|
|
10089
|
+
program2.command("models").description("Show model command group help").addHelpText(
|
|
10090
|
+
"after",
|
|
10091
|
+
`
|
|
10092
|
+
Model commands:
|
|
10093
|
+
trainfabric models:list List ready/exported models
|
|
10094
|
+
trainfabric models:export Fetch the export package path for a model
|
|
10095
|
+
|
|
10096
|
+
Use --help on any command for options.`
|
|
10097
|
+
).action(() => {
|
|
10098
|
+
console.log(`Model commands:
|
|
10099
|
+
trainfabric models:list List ready/exported models
|
|
10100
|
+
trainfabric models:export Fetch the export package path for a model
|
|
10101
|
+
|
|
10102
|
+
Use --help on any command for options.`);
|
|
10103
|
+
});
|
|
10037
10104
|
program2.command("login").description("Paste and store a TrainFabric API key").action(async () => {
|
|
10038
10105
|
await login(loadConfig());
|
|
10039
10106
|
});
|
|
@@ -10131,10 +10198,10 @@ program2.command("datasets:validate").argument("<file>").description("Validate a
|
|
|
10131
10198
|
process.exitCode = 1;
|
|
10132
10199
|
}
|
|
10133
10200
|
});
|
|
10134
|
-
program2.command("datasets:list").option("--project <projectId>").description("List datasets").action(async (options) => {
|
|
10201
|
+
program2.command("datasets:list").option("--project <projectId>").option("--json", "print raw JSON output; this is the default").description("List datasets").action(async (options) => {
|
|
10135
10202
|
printJson(await createClient(loadConfig()).datasets.list(normalizeOptionalId(options.project, "project", "Project ID")));
|
|
10136
10203
|
});
|
|
10137
|
-
program2.command("datasets:get").argument("<datasetId>").description("Fetch dataset detail").action(async (datasetId) => {
|
|
10204
|
+
program2.command("datasets:get").argument("<datasetId>").option("--json", "print raw JSON output; this is the default").description("Fetch dataset detail").action(async (datasetId) => {
|
|
10138
10205
|
printJson(await createClient(loadConfig()).datasets.get(normalizeId(datasetId, "dataset", "Dataset ID")));
|
|
10139
10206
|
});
|
|
10140
10207
|
program2.command("datasets:delete").argument("<datasetId>").description("Delete a dataset").action(async (datasetId) => {
|
|
@@ -10173,7 +10240,7 @@ program2.command("runs:create").option("--project <projectId>").option("--datase
|
|
|
10173
10240
|
const run = await client.runs.create(runInput);
|
|
10174
10241
|
printJson(run.snapshot);
|
|
10175
10242
|
});
|
|
10176
|
-
program2.command("runtime:detect").option("--project <projectId>").option("--repo <path>").option("--git <url>").option("--branch <branch>").description("Detect a supported runtime from a local repo snapshot or git metadata").action(async (options) => {
|
|
10243
|
+
program2.command("runtime:detect").option("--project <projectId>").option("--repo <path>").option("--git <url>").option("--branch <branch>").option("--json", "print raw JSON output; this is the default").description("Detect a supported runtime from a local repo snapshot or git metadata").action(async (options) => {
|
|
10177
10244
|
const sourceOptions = buildSourceOptions(options);
|
|
10178
10245
|
if (!sourceOptions.source) {
|
|
10179
10246
|
throw new Error("Provide --repo or --git.");
|
|
@@ -10231,7 +10298,7 @@ program2.command("runs:status").argument("<runId>").description("Fetch full run
|
|
|
10231
10298
|
const detail = await createClient(loadConfig()).runs.get(normalizeId(runId, "run", "Run ID"));
|
|
10232
10299
|
printJson({ ...detail, ...detail.run });
|
|
10233
10300
|
});
|
|
10234
|
-
program2.command("runs:logs").argument("<runId>").description("Fetch run logs").action(async (runId) => {
|
|
10301
|
+
program2.command("runs:logs").argument("<runId>").option("--json", "print raw JSON output; this is the default").description("Fetch run logs").action(async (runId) => {
|
|
10235
10302
|
printJson(await createClient(loadConfig()).runs.logs(normalizeId(runId, "run", "Run ID")));
|
|
10236
10303
|
});
|
|
10237
10304
|
program2.command("runs:wait").argument("<runId>").option("--timeout <duration>", "maximum wait duration, for example 30s, 10m, or 1h").option("--poll <duration>", "poll interval, for example 1s or 500ms").option("--summary", "print a compact terminal run summary").description("Wait for a run to reach a terminal state").action(async (runId, options) => {
|
|
@@ -10245,7 +10312,7 @@ program2.command("runs:wait").argument("<runId>").option("--timeout <duration>",
|
|
|
10245
10312
|
program2.command("runs:watch").argument("<runId>").option("--json", "emit event output as JSON").option("--timeout <duration>", "maximum watch duration, for example 30s, 10m, or 1h").option("--poll <duration>", "poll interval, for example 1s or 500ms").description("Stream a run until it completes").action(async (runId, options) => {
|
|
10246
10313
|
await watchRun(normalizeId(runId, "run", "Run ID"), Boolean(options.json), parseDurationMs(options.timeout), parsePositiveMs(options.poll, 1e3));
|
|
10247
10314
|
});
|
|
10248
|
-
program2.command("runs:usage").argument("<runId>").option("--summary", "print a human-readable cost summary instead of raw JSON").description("Fetch run usage summary").action(async (runId, options) => {
|
|
10315
|
+
program2.command("runs:usage").argument("<runId>").option("--json", "print raw JSON output; this is the default unless --summary is used").option("--summary", "print a human-readable cost summary instead of raw JSON").description("Fetch run usage summary").action(async (runId, options) => {
|
|
10249
10316
|
const usage = await createClient(loadConfig()).runs.usage(normalizeId(runId, "run", "Run ID"));
|
|
10250
10317
|
if (options.summary) {
|
|
10251
10318
|
printUsageSummary(usage);
|
|
@@ -10285,7 +10352,7 @@ program2.command("cluster:capacity").description("Fetch cluster capacity view").
|
|
|
10285
10352
|
program2.command("cluster:pools").description("List inventory pools").action(async () => {
|
|
10286
10353
|
printJson(await createClient(loadConfig()).cluster.listInventoryPools());
|
|
10287
10354
|
});
|
|
10288
|
-
program2.command("models:list").description("List exported models").action(async () => {
|
|
10355
|
+
program2.command("models:list").option("--json", "print raw JSON output; this is the default").description("List exported models").action(async () => {
|
|
10289
10356
|
printJson(await createClient(loadConfig()).models.list());
|
|
10290
10357
|
});
|
|
10291
10358
|
program2.command("models:export").argument("<modelId>").description("Fetch the export package path for a model").action(async (modelId) => {
|
|
@@ -10324,7 +10391,12 @@ program2.command("billing:usage").option("--unit <unit>", "normalized_tflop_seco
|
|
|
10324
10391
|
const runId = normalizeOptionalId(options.run, "run", "Run ID");
|
|
10325
10392
|
const unit = normalizeOptionalBillingUnit(options.unit);
|
|
10326
10393
|
const client = createClient(loadConfig());
|
|
10327
|
-
|
|
10394
|
+
if (runId) {
|
|
10395
|
+
const summary = await client.billing.getRunUsage(runId);
|
|
10396
|
+
printJson(unit ? { ...summary, unit, usage: summary.usage.filter((entry) => entry.unit === unit) } : summary);
|
|
10397
|
+
return;
|
|
10398
|
+
}
|
|
10399
|
+
printJson(await client.billing.getUsage(unit));
|
|
10328
10400
|
});
|
|
10329
10401
|
program2.command("billing:invoices").description("List invoices").action(async () => {
|
|
10330
10402
|
printJson(await createClient(loadConfig()).billing.listInvoices());
|