@computesdk/cli 2.6.9 → 2.6.10
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/cli-manifest.json +1 -1
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/cli-manifest.json
CHANGED
package/dist/index.js
CHANGED
|
@@ -136,7 +136,7 @@ function conclusionLabel(conclusion) {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
// src/settings.ts
|
|
139
|
-
var PLATFORM_SIZES = ["small", "medium", "large", "xlarge"];
|
|
139
|
+
var PLATFORM_SIZES = ["small", "medium", "large", "xlarge", "2xlarge", "3xlarge"];
|
|
140
140
|
function parseMaxPrice(value, per) {
|
|
141
141
|
if (value === void 0) {
|
|
142
142
|
if (per !== void 0) throw new Error("--max-price-per requires --max-price.");
|
|
@@ -3717,7 +3717,7 @@ function resolveTwoArgTarget(argId, resourceId, opts, label) {
|
|
|
3717
3717
|
return { resolved: resolveSandbox(argId, opts), resource: resourceId };
|
|
3718
3718
|
}
|
|
3719
3719
|
function addCreateFlags(c) {
|
|
3720
|
-
return c.option("--provider <names>", "place only on these providers, through your router (its BYOK mode and order), e.g. daytona or daytona,e2b").option("--byok", "use only your own keys for this create").option("--managed", "use only ComputeSDK managed accounts for this create").addOption(new Option3("--order <providers>").hideHelp()).option("--size <size>", "platform size: small (1 vCPU/2
|
|
3720
|
+
return c.option("--provider <names>", "place only on these providers, through your router (its BYOK mode and order), e.g. daytona or daytona,e2b").option("--byok", "use only your own keys for this create").option("--managed", "use only ComputeSDK managed accounts for this create").addOption(new Option3("--order <providers>").hideHelp()).option("--size <size>", "platform size: small (1 vCPU/2 GiB), medium, large, xlarge, 2xlarge (16/32 GiB), 3xlarge (32/128 GiB); default medium").option("--label <label>", "label for the sandbox").option("--image <image>", "container image to boot").option("--snapshot-id <id>", "provider snapshot to resume").option("--cpus <n>", "CPU cores (raw resources \u2014 mutually exclusive with --size)").option("--memory-mb <n>", "memory in MB (raw resources)").option("--disk-mb <n>", "ephemeral disk in MB (raw resources)").addOption(new Option3("--max-price <usd/unit>").hideHelp()).addOption(new Option3("--max-price-per <unit>").hideHelp()).addOption(new Option3("--market").hideHelp()).addOption(new Option3("--order-type <type>").hideHelp()).option("--timeout-ms <ms>", "sandbox timeout in ms (provider minimums apply, e.g. blaxel \u22655m)").option("--secret <name>", "vault secret name to inject (repeatable)", (v, a) => a.concat(v), []);
|
|
3721
3721
|
}
|
|
3722
3722
|
function providerNames(value) {
|
|
3723
3723
|
const names = value.split(",").map((name) => name.trim()).filter(Boolean);
|
|
@@ -3858,6 +3858,7 @@ function registerCreate(command2, { providerShorthand = false } = {}) {
|
|
|
3858
3858
|
}
|
|
3859
3859
|
}
|
|
3860
3860
|
emitResult(opts, res.sandbox, (s) => s.id, (s) => printSandbox(s, opts.verbose));
|
|
3861
|
+
if (!opts.json && !opts.quiet) printNextSteps(res.sandbox.id, opts);
|
|
3861
3862
|
} catch (e) {
|
|
3862
3863
|
fail(e, opts);
|
|
3863
3864
|
}
|
|
@@ -3891,6 +3892,20 @@ async function previewPlacement(c, opts) {
|
|
|
3891
3892
|
pc11.dim(`\u2192 placing on ${provider} \xB7 ${placementLane(p2.source)} \xB7 ${p2.size ?? p2.box?.sizeName ?? "custom size"} (${billedBy(p2.source, provider)}) \u2026`)
|
|
3892
3893
|
);
|
|
3893
3894
|
}
|
|
3895
|
+
function printNextSteps(id, opts) {
|
|
3896
|
+
const context = `${opts.org ? ` --org ${opts.org}` : ""}${opts.baseUrl ? ` --base-url ${opts.baseUrl}` : ""}`;
|
|
3897
|
+
const steps = [
|
|
3898
|
+
[`compute sandboxes exec ${id}${context} -- node -v`, "run a command"],
|
|
3899
|
+
[`compute sandboxes spawn ${id}${context} -- npm run dev`, "start a server"],
|
|
3900
|
+
[`compute sandboxes url ${id}${context} --port 3000`, "get its public URL"],
|
|
3901
|
+
[`compute sandboxes destroy ${id}${context}`, "stop billing"]
|
|
3902
|
+
];
|
|
3903
|
+
const width = Math.max(...steps.map(([command2]) => command2.length));
|
|
3904
|
+
console.error("");
|
|
3905
|
+
console.error("Use it:");
|
|
3906
|
+
for (const [command2, does] of steps) console.error(` ${command2.padEnd(width)} ${pc11.dim(does)}`);
|
|
3907
|
+
console.error(pc11.dim("It runs and bills until it times out or is destroyed."));
|
|
3908
|
+
}
|
|
3894
3909
|
function shorthandProviders(operands) {
|
|
3895
3910
|
return operands.map((operand) => {
|
|
3896
3911
|
const name = operand.startsWith("--") ? operand.slice(2) : operand;
|
|
@@ -3917,7 +3932,7 @@ function registerSandboxesCommands(program2) {
|
|
|
3917
3932
|
}
|
|
3918
3933
|
});
|
|
3919
3934
|
for (const name of ["route", "quote"]) {
|
|
3920
|
-
const command2 = cmd.command(name, { hidden: name === "quote" }).description("Show where a sandbox create would land, how it is billed, and the price \u2014 creates nothing").option("--size <size>", "platform size: small, medium (default), large, xlarge").option("--provider <names>", "only these providers, through your router (e.g. daytona)").option("--byok", "only your own keys").option("--managed", "only ComputeSDK managed accounts").option("--cpus <n>", "CPU cores (raw resources instead of --size)").option("--memory-mb <n>", "memory in MB").option("--disk-mb <n>", "ephemeral disk in MB").option("--region <region>", "pin the placement region").option("--timeout-ms <ms>", "sandbox timeout in ms; a managed account holds credit for it").addOption(new Option3("--order-type <type>").hideHelp()).addOption(new Option3("--market").hideHelp()).addOption(new Option3("--max-price <usd/unit>").hideHelp()).addOption(new Option3("--max-price-per <unit>").hideHelp()).option("--api-key <key>").option("--base-url <url>").option("--allow-untrusted-host").option("--json", "print the raw response");
|
|
3935
|
+
const command2 = cmd.command(name, { hidden: name === "quote" }).description("Show where a sandbox create would land, how it is billed, and the price \u2014 creates nothing").option("--size <size>", "platform size: small, medium (default), large, xlarge, 2xlarge (16/32 GiB), 3xlarge (32/128 GiB)").option("--provider <names>", "only these providers, through your router (e.g. daytona)").option("--byok", "only your own keys").option("--managed", "only ComputeSDK managed accounts").option("--cpus <n>", "CPU cores (raw resources instead of --size)").option("--memory-mb <n>", "memory in MB").option("--disk-mb <n>", "ephemeral disk in MB").option("--region <region>", "pin the placement region").option("--timeout-ms <ms>", "sandbox timeout in ms; a managed account holds credit for it").addOption(new Option3("--order-type <type>").hideHelp()).addOption(new Option3("--market").hideHelp()).addOption(new Option3("--max-price <usd/unit>").hideHelp()).addOption(new Option3("--max-price-per <unit>").hideHelp()).option("--api-key <key>").option("--base-url <url>").option("--allow-untrusted-host").option("--json", "print the raw response");
|
|
3921
3936
|
command2.action(async (opts) => {
|
|
3922
3937
|
try {
|
|
3923
3938
|
const c = await client(opts);
|