@lizard-build/cli 4.0.115 → 4.0.117
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/billing.js +5 -1
- package/dist/commands/billing.js.map +1 -1
- package/dist/commands/gha.d.ts +5 -0
- package/dist/commands/gha.js +9 -1
- package/dist/commands/gha.js.map +1 -1
- package/dist/commands/sandbox.js +1 -1
- package/dist/commands/sandbox.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/skills-data.generated.js +3 -3
- package/dist/lib/skills-data.generated.js.map +1 -1
- package/dist/lib/updater.d.ts +1 -1
- package/dist/lib/updater.js +1 -1
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +4 -2
- package/skill-data/core/references/sandboxes.md +2 -2
- package/skill-data/core/references/sdk.md +1 -1
- package/src/commands/billing.ts +4 -1
- package/src/commands/gha.ts +12 -2
- package/src/commands/sandbox.ts +1 -1
- package/src/index.ts +2 -0
- package/src/lib/updater.ts +1 -1
- package/test/unit/billing.test.ts +13 -0
- package/test/unit/gha.test.ts +12 -1
|
@@ -47,7 +47,7 @@ Options for `create()` (TypeScript / Python):
|
|
|
47
47
|
|
|
48
48
|
Templates: `base` (default), `interpreter` (Python with data libraries, plus Node 22), `codex`, `claude`, `opencode`, `pi`, `prime` (one coding agent each), `desktop`. The SDK and CLI give a sandbox 5 minutes by default; the raw API and the dashboard give none. Commands do not reset the deadline. Pricing is flat by size, billed per second while the sandbox runs; a sandbox restored from a snapshot runs at the source's size and is billed at that size; volumes bill separately.
|
|
49
49
|
|
|
50
|
-
An account's limit counts vCPU of running sandboxes (Mini 1, Small 2, Medium 4, Large 8):
|
|
50
|
+
An account's limit counts vCPU of running sandboxes (Mini 1, Small 2, Medium 4, Large 8): 40 vCPU on Pro, 220 on Pro 5x and 1,200 on Pro 20x. The trial runs 1 Small and 2 Mini at a time, US regions only (no size = small); Medium and Large unlock after the first payment (403 `TRIAL_SANDBOX_SIZE` / `TRIAL_SANDBOX_REGION`, and 403 `TRIAL_SIZE_RUNNING` for a second Small or a third Mini). Starts are limited only on the trial (6 a minute, 30 an hour, 100 a day); Pro, Pro 5x and Pro 20x have unlimited starts. Over a limit, a `LimitExceededError` (status 429) with `code` `SANDBOX_LIMIT_REACHED` (`unit` `vcpu`, `limit`, `running`, `needed`) or `SANDBOX_RATE_LIMITED` (`retryAfterS`). More than 32 commands at once in one sandbox gives `EXEC_LIMIT_REACHED`.
|
|
51
51
|
|
|
52
52
|
## Quickstart
|
|
53
53
|
|
package/src/commands/billing.ts
CHANGED
|
@@ -272,7 +272,10 @@ export function describeSubscription(sub: Subscription, now = Date.now()): strin
|
|
|
272
272
|
if (sub.limits) {
|
|
273
273
|
const n = sub.limits.replicasPerApp;
|
|
274
274
|
lines.push(label("Replicas: ") + `up to ${n} per service`);
|
|
275
|
-
if (sub.limits.
|
|
275
|
+
if (sub.limits.tier === "trial") {
|
|
276
|
+
// The trial is limited by size, not vCPU: 1 Small and 2 Mini at a time, US regions only.
|
|
277
|
+
lines.push(label("Sandboxes: ") + "1 Small and 2 Mini at a time (US regions only); Medium and Large unlock after the first payment");
|
|
278
|
+
} else if (sub.limits.sandboxVcpu) {
|
|
276
279
|
lines.push(label("Sandboxes: ") + `up to ${sub.limits.sandboxVcpu.toLocaleString("en-US")} vCPU at once`);
|
|
277
280
|
}
|
|
278
281
|
}
|
package/src/commands/gha.ts
CHANGED
|
@@ -27,7 +27,8 @@ interface Status {
|
|
|
27
27
|
repo: string;
|
|
28
28
|
lizardAccount: string | null;
|
|
29
29
|
installationId: number | null;
|
|
30
|
-
|
|
30
|
+
/** Never paid: `jobs` medium and large runner jobs in all, then small only (jobs/jobsLeft absent on older servers). */
|
|
31
|
+
trial: { maxSize: string; jobs?: Record<string, number>; jobsLeft?: Record<string, number> } | null;
|
|
31
32
|
sizes: Size[];
|
|
32
33
|
recentJobs: { id: string; workflow: string | null; job: string; status: string; conclusion: string | null; url: string | null; createdAt: number }[];
|
|
33
34
|
}
|
|
@@ -280,11 +281,20 @@ function printReport(r: Report) {
|
|
|
280
281
|
if (r.verdict === "READY" && r.sizes?.length && (r.state === "NEEDS_MIGRATION")) {
|
|
281
282
|
lines.push("");
|
|
282
283
|
lines.push(chalk.dim("Runner sizes (billed per second while a job runs): " + r.sizes.map((s) => `${s.name} ${s.vcpus} vCPU/${s.memoryGb} GB ${money(s.pricePerHour)}`).join(" · ")));
|
|
283
|
-
if (r.trial) lines.push(chalk.dim(
|
|
284
|
+
if (r.trial) lines.push(chalk.dim(trialLine(r.trial)));
|
|
284
285
|
}
|
|
285
286
|
console.log(lines.join("\n"));
|
|
286
287
|
}
|
|
287
288
|
|
|
289
|
+
/** The trial's runner jobs: medium and large jobs left of each when the server says, the rule otherwise. */
|
|
290
|
+
export function trialLine(t: { jobs?: Record<string, number>; jobsLeft?: Record<string, number> }): string {
|
|
291
|
+
const left = t.jobsLeft, jobs = t.jobs;
|
|
292
|
+
if (left && left.medium != null && left.large != null) {
|
|
293
|
+
return `Trial: ${left.medium} of ${jobs?.medium ?? 20} medium and ${left.large} of ${jobs?.large ?? 10} large runner jobs left, then small runners only. Start Pro (or add credit) for unlimited.`;
|
|
294
|
+
}
|
|
295
|
+
return "Trial: 20 medium and 10 large runner jobs, then small runners only. Start Pro (or add credit) for unlimited.";
|
|
296
|
+
}
|
|
297
|
+
|
|
288
298
|
/** For agents: one line saying how to act on `next`. */
|
|
289
299
|
function howToUse(n: Next): string {
|
|
290
300
|
if (n.confirm) return "Ask the user first: show them next.say. Run next.command only if they agree.";
|
package/src/commands/sandbox.ts
CHANGED
|
@@ -174,7 +174,7 @@ export function registerSandbox(program: Command) {
|
|
|
174
174
|
sb.command("create")
|
|
175
175
|
.description("Create a sandbox")
|
|
176
176
|
.option("-t, --template <name>", `Template (${TEMPLATE_HINT}; server validates)`, "base")
|
|
177
|
-
.addOption(new Option("-s, --size <size>", `Machine size (${SIZE_HINT}); default medium, small on the Pro trial (US regions only). Mini works only with the ${MINI_TEMPLATES} templates`).choices(SANDBOX_SIZES))
|
|
177
|
+
.addOption(new Option("-s, --size <size>", `Machine size (${SIZE_HINT}); default medium, small on the Pro trial (1 Small and 2 Mini at a time, US regions only; Medium and Large unlock after the first payment). Mini works only with the ${MINI_TEMPLATES} templates`).choices(SANDBOX_SIZES))
|
|
178
178
|
.option("--timeout <ms>", "Lifetime in milliseconds; 0 disables expiration", parseTimeoutOption, 300_000)
|
|
179
179
|
.option("--region <code>", `Region to create the sandbox in (default ${DEFAULT_REGION}; with --volume or --snapshot, theirs)`)
|
|
180
180
|
.option("--snapshot <id>", "Create from a private saved snapshot, at the size it was taken at")
|
package/src/index.ts
CHANGED
|
@@ -484,6 +484,8 @@ async function main() {
|
|
|
484
484
|
? `${baseMsg}\n Your key is limited to specific workspaces or projects. Run this with an unscoped key, or see per-workspace spend with \`lizard metrics\`.`
|
|
485
485
|
: limitCode === "WORKSPACE_SANDBOX_LIMIT"
|
|
486
486
|
? `${baseMsg}\n \`lizard sandbox list\` shows them; \`lizard sandbox pause <id>\` or \`lizard sandbox rm <id>\` frees one. Limits: \`lizard workspace limits <workspace>\`.`
|
|
487
|
+
: limitCode === "TRIAL_SIZE_RUNNING" || limitCode === "TRIAL_MEDIUM_RUNNING"
|
|
488
|
+
? `${baseMsg}\n \`lizard sandbox list --all\` shows them; \`lizard sandbox pause <id>\` or \`lizard sandbox rm <id>\` frees one.`
|
|
487
489
|
: limitCode === "WORKSPACE_USAGE_LIMIT"
|
|
488
490
|
? `${baseMsg}\n \`lizard workspace limits <workspace>\` shows use against the limits; \`lizard metrics\` shows each service. Free CPU/memory by stopping or scaling down a service, SSD by deleting data or a volume; the workspace owner can raise them.`
|
|
489
491
|
: causeDetail && !baseMsg.includes(causeDetail)
|
package/src/lib/updater.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { join, dirname } from "node:path";
|
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
|
|
8
|
-
export const CURRENT_VERSION = "4.0.
|
|
8
|
+
export const CURRENT_VERSION = "4.0.117";
|
|
9
9
|
const RELEASES_API = "https://api.github.com/repos/lizard-build/lizard-cli/releases/latest";
|
|
10
10
|
const RELEASE_BASE = "https://github.com/lizard-build/lizard-cli/releases/latest/download";
|
|
11
11
|
|
|
@@ -174,6 +174,19 @@ describe("lizard billing (status)", () => {
|
|
|
174
174
|
expect(text).toContain("Sandboxes: up to 1,200 vCPU at once");
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
+
test("the trial shows its sandbox sizes instead of a vCPU limit", async () => {
|
|
178
|
+
routes({
|
|
179
|
+
"GET /api/billing/subscription": () => reply(200, {
|
|
180
|
+
...paid, tiers,
|
|
181
|
+
limits: { tier: "trial", replicasPerApp: 1, sandboxVcpu: 8, maxSandboxCpus: 4 },
|
|
182
|
+
}),
|
|
183
|
+
});
|
|
184
|
+
await run(["billing"]);
|
|
185
|
+
const text = out();
|
|
186
|
+
expect(text).toContain("Sandboxes: 1 Small and 2 Mini at a time (US regions only)");
|
|
187
|
+
expect(text).not.toContain("vCPU at once");
|
|
188
|
+
});
|
|
189
|
+
|
|
177
190
|
test("no plan offers the trial", async () => {
|
|
178
191
|
routes({ "GET /api/billing/subscription": () => reply(200, { ...none, trial: { ...none.trial, promoCode: "ROST", days: 31, creditCents: 10000 } }) });
|
|
179
192
|
await run(["billing"]);
|
package/test/unit/gha.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { repoFromRemote } from "../../src/commands/gha.js";
|
|
2
|
+
import { repoFromRemote, trialLine } from "../../src/commands/gha.js";
|
|
3
3
|
|
|
4
4
|
describe("repoFromRemote", () => {
|
|
5
5
|
it.each([
|
|
@@ -15,3 +15,14 @@ describe("repoFromRemote", () => {
|
|
|
15
15
|
expect(repoFromRemote("https://lizard.build/git/acme/api.git")).toBeNull();
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
|
+
|
|
19
|
+
describe("trialLine", () => {
|
|
20
|
+
it("shows the jobs left", () => {
|
|
21
|
+
expect(trialLine({ jobs: { medium: 20, large: 10 }, jobsLeft: { medium: 18, large: 0 } }))
|
|
22
|
+
.toBe("Trial: 18 of 20 medium and 0 of 10 large runner jobs left, then small runners only. Start Pro (or add credit) for unlimited.");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("states the rule without counts (older server)", () => {
|
|
26
|
+
expect(trialLine({})).toMatch(/^Trial: 20 medium and 10 large runner jobs, then small runners only/);
|
|
27
|
+
});
|
|
28
|
+
});
|