sandcovery 0.3.0 → 0.5.0
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/README.md +14 -5
- package/dist/{Schema-DiSfJzMf.mjs → Schema-fLas6rbA.mjs} +8069 -930
- package/dist/cli/index.mjs +2 -1707
- package/dist/cli/sandcovery-docker.d.mts +1 -0
- package/dist/cli/sandcovery-docker.mjs +8 -0
- package/dist/handlers-qYjkPftS.mjs +18077 -0
- package/dist/index.d.mts +23 -1
- package/dist/index.mjs +1 -1
- package/dist/{origin-CIA-1Jia.mjs → origin-5maEGWRg.mjs} +105 -74
- package/dist/{spec-DfgmzDj-.mjs → spec-cGDeWJ3v.mjs} +951 -122
- package/dist/{src-YrynO3hz.mjs → src-zWk1RjrB.mjs} +241 -23
- package/dist/start-B8ruSPVb.mjs +1992 -0
- package/dist/{telemetry-delivery-zinKRHRc.mjs → telemetry-delivery-8t5RXWli.mjs} +3 -3
- package/dist/{types-DMB8KnA3.d.mts → types-ZqbGCXKy.d.mts} +153 -12
- package/dist/types.d.mts +2 -2
- package/dist/types.mjs +18 -18
- package/package.json +17 -13
- package/dist/handlers-rkx0CsMY.mjs +0 -2459
|
@@ -1,5 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Bn as toMillis, Bt as retry, Cn as ClockRef, En as currentTimeMillis$1, Kt as suspend, Ln as TaggedError, Mr as hasProperty, Rn as millis, St as flatMap, Yt as tapError, bt as fail, ht as catchTag, nn as void_, on as spaced, ot as acquireUseRelease, pt as catchDefect, qt as sync, sn as upTo, vt as die, zn as seconds } from "./Schema-fLas6rbA.mjs";
|
|
2
|
+
import { D as CARD_FEE_TERMS, M as NO_MARKUP_TERMS, O as CREDIT_PURCHASE_MAX_MICRO_USD, _ as SandboxStatus, c as SpendLimit, j as MICRO_USD_PER_DOLLAR, k as CREDIT_PURCHASE_MIN_MICRO_USD, o as KeyKind, x as ProviderSort, y as DEFAULT_SLUG } from "./origin-5maEGWRg.mjs";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import crypto from "node:crypto";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
// ../../node_modules/.pnpm/effect@4.1.1/node_modules/effect/dist/Clock.js
|
|
8
|
+
/**
|
|
9
|
+
* Context reference for the active time service in the environment.
|
|
10
|
+
*
|
|
11
|
+
* **When to use**
|
|
12
|
+
*
|
|
13
|
+
* Use when you need to access or provide the full time service, including sleep
|
|
14
|
+
* operations, rather than a single timestamp accessor.
|
|
15
|
+
*
|
|
16
|
+
* **Example** (Accessing the Clock service)
|
|
17
|
+
*
|
|
18
|
+
* ```ts import.meta.vitest
|
|
19
|
+
* import { Clock, Effect } from "effect"
|
|
20
|
+
*
|
|
21
|
+
* const testClock: Clock.Clock = {
|
|
22
|
+
* currentTimeMillisUnsafe: () => 1_000,
|
|
23
|
+
* currentTimeMillis: Effect.succeed(1_000),
|
|
24
|
+
* monotonicTimeNanosUnsafe: () => 1_000_000_000n,
|
|
25
|
+
* monotonicTimeNanos: Effect.succeed(1_000_000_000n),
|
|
26
|
+
* currentTimeNanosUnsafe: () => 1_000_000_000n,
|
|
27
|
+
* currentTimeNanos: Effect.succeed(1_000_000_000n),
|
|
28
|
+
* sleep: () => Effect.void
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* const program = Effect.gen(function*() {
|
|
32
|
+
* const clock = yield* Clock.Clock
|
|
33
|
+
* return clock.currentTimeMillisUnsafe()
|
|
34
|
+
* })
|
|
35
|
+
*
|
|
36
|
+
* await Effect.runPromise(Effect.provideService(program, Clock.Clock, testClock)) // => 1_000
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @see {@link clockWith} for using the current Clock service inside an effect
|
|
40
|
+
* @see {@link currentTimeMillis} for reading the current time in milliseconds
|
|
41
|
+
* @see {@link currentTimeNanos} for reading the current time in nanoseconds
|
|
42
|
+
*
|
|
43
|
+
* @stability stable
|
|
44
|
+
* @category services
|
|
45
|
+
* @since 2.0.0
|
|
46
|
+
*/
|
|
47
|
+
const Clock = ClockRef;
|
|
48
|
+
/**
|
|
49
|
+
* Returns an Effect that succeeds with the current Unix time in milliseconds.
|
|
50
|
+
*
|
|
51
|
+
* **When to use**
|
|
52
|
+
*
|
|
53
|
+
* Use to create wall-clock timestamps from the active `Clock` service with
|
|
54
|
+
* millisecond precision.
|
|
55
|
+
*
|
|
56
|
+
* **Gotchas**
|
|
57
|
+
*
|
|
58
|
+
* The value can move backward or forward when the system wall clock is
|
|
59
|
+
* corrected, so it is not suitable for measuring elapsed time.
|
|
60
|
+
*
|
|
61
|
+
* **Example** (Reading milliseconds)
|
|
62
|
+
*
|
|
63
|
+
* ```ts import.meta.vitest
|
|
64
|
+
* import { Clock, Effect } from "effect"
|
|
65
|
+
*
|
|
66
|
+
* const testClock: Clock.Clock = {
|
|
67
|
+
* currentTimeMillisUnsafe: () => 1_000,
|
|
68
|
+
* currentTimeMillis: Effect.succeed(1_000),
|
|
69
|
+
* monotonicTimeNanosUnsafe: () => 1_000_000_000n,
|
|
70
|
+
* monotonicTimeNanos: Effect.succeed(1_000_000_000n),
|
|
71
|
+
* currentTimeNanosUnsafe: () => 1_000_000_000n,
|
|
72
|
+
* currentTimeNanos: Effect.succeed(1_000_000_000n),
|
|
73
|
+
* sleep: () => Effect.void
|
|
74
|
+
* }
|
|
75
|
+
*
|
|
76
|
+
* await Effect.runPromise(Effect.provideService(Clock.currentTimeMillis, Clock.Clock, testClock)) // => 1_000
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @see {@link currentTimeNanos} for nanosecond precision
|
|
80
|
+
* @see {@link monotonicTimeNanos} for measuring elapsed time
|
|
81
|
+
* @see {@link clockWith} for accessing the full Clock service
|
|
82
|
+
*
|
|
83
|
+
* @stability stable
|
|
84
|
+
* @category accessors
|
|
85
|
+
* @since 2.0.0
|
|
86
|
+
*/
|
|
87
|
+
const currentTimeMillis = currentTimeMillis$1;
|
|
3
88
|
// ../cli-core/src/canceled.ts
|
|
4
89
|
var Canceled = class extends TaggedError("Canceled") {};
|
|
5
90
|
// ../cli-core/src/failure.ts
|
|
@@ -46,6 +131,8 @@ const reasons = {
|
|
|
46
131
|
login_required: "authentication",
|
|
47
132
|
market_information_locked: "conflict",
|
|
48
133
|
missing_command: "usage",
|
|
134
|
+
missing_installation: "missing_input",
|
|
135
|
+
missing_job: "missing_input",
|
|
49
136
|
missing_key: "missing_input",
|
|
50
137
|
missing_path: "missing_input",
|
|
51
138
|
missing_port: "missing_input",
|
|
@@ -103,6 +190,17 @@ const isWordCharacter = (character) => isDigit(character) || isUpper(character)
|
|
|
103
190
|
const consistsOf = (text, allowed) => text !== "" && text.split("").every(allowed);
|
|
104
191
|
const isDigits = (text) => consistsOf(text, isDigit);
|
|
105
192
|
const codePoints = (text) => Array.from(text, (point) => point);
|
|
193
|
+
// ../../node_modules/.pnpm/es-toolkit@1.53.1/node_modules/es-toolkit/dist/function/noop.mjs
|
|
194
|
+
/**
|
|
195
|
+
* A no-operation function that does nothing.
|
|
196
|
+
* This can be used as a placeholder or default function.
|
|
197
|
+
*
|
|
198
|
+
* @example
|
|
199
|
+
* noop(); // Does nothing
|
|
200
|
+
*
|
|
201
|
+
* @returns This function does not return anything.
|
|
202
|
+
*/
|
|
203
|
+
function noop() {}
|
|
106
204
|
// ../cli-core/src/sanitize.ts
|
|
107
205
|
const ESC = 27;
|
|
108
206
|
const BEL = 7;
|
|
@@ -549,11 +647,169 @@ const parseFailure = ({ bin, issues, path }) => {
|
|
|
549
647
|
reason: first?.reason ?? "invalid_arguments"
|
|
550
648
|
});
|
|
551
649
|
};
|
|
650
|
+
// ../cli-core/src/mode.ts
|
|
651
|
+
const DEFAULT_WIDTH = 80;
|
|
652
|
+
const terminalOf = (stream) => ({
|
|
653
|
+
columns: stream.columns,
|
|
654
|
+
tty: stream.isTTY === true
|
|
655
|
+
});
|
|
656
|
+
const falsy = /* @__PURE__ */ new Set([
|
|
657
|
+
"",
|
|
658
|
+
"0",
|
|
659
|
+
"false"
|
|
660
|
+
]);
|
|
661
|
+
const enabledVariable = (value) => value !== void 0 && !falsy.has(value.trim().toLowerCase());
|
|
662
|
+
const nonempty = (value) => value !== void 0 && value !== "";
|
|
663
|
+
const colorPreference = ({ env, noColor }) => {
|
|
664
|
+
if (noColor || nonempty(env.NO_COLOR)) return false;
|
|
665
|
+
const forced = env.FORCE_COLOR;
|
|
666
|
+
if (forced === void 0) return;
|
|
667
|
+
return forced !== "0" && forced.toLowerCase() !== "false";
|
|
668
|
+
};
|
|
669
|
+
const streamStyle = ({ accessible, color, env, terminal }) => {
|
|
670
|
+
const rich = terminal.tty && env.TERM !== "dumb" && !accessible;
|
|
671
|
+
return {
|
|
672
|
+
color: color ?? rich,
|
|
673
|
+
rich,
|
|
674
|
+
tty: terminal.tty,
|
|
675
|
+
width: terminal.columns !== void 0 && terminal.columns > 0 ? terminal.columns : DEFAULT_WIDTH
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
const interactionAllowed = (input, ci) => {
|
|
679
|
+
if (!(input.stdin.tty && input.stderr.tty && !input.payloadStdin) || input.json || ci || input.nonInteractive === true) return false;
|
|
680
|
+
return input.agent === void 0 || input.nonInteractive === false;
|
|
681
|
+
};
|
|
682
|
+
const resolveMode = (input) => {
|
|
683
|
+
const { accessible } = input;
|
|
684
|
+
const ci = enabledVariable(input.env.CI);
|
|
685
|
+
const color = colorPreference(input);
|
|
686
|
+
return {
|
|
687
|
+
accessible,
|
|
688
|
+
agent: input.agent,
|
|
689
|
+
ci,
|
|
690
|
+
format: input.json ? "json" : "human",
|
|
691
|
+
githubActions: input.env.GITHUB_ACTIONS === "true",
|
|
692
|
+
interactive: interactionAllowed(input, ci),
|
|
693
|
+
stderr: streamStyle({
|
|
694
|
+
accessible,
|
|
695
|
+
color,
|
|
696
|
+
env: input.env,
|
|
697
|
+
terminal: input.stderr
|
|
698
|
+
}),
|
|
699
|
+
stdin: { tty: input.stdin.tty },
|
|
700
|
+
stdout: streamStyle({
|
|
701
|
+
accessible,
|
|
702
|
+
color,
|
|
703
|
+
env: input.env,
|
|
704
|
+
terminal: input.stdout
|
|
705
|
+
})
|
|
706
|
+
};
|
|
707
|
+
};
|
|
708
|
+
const AGENT_VARIABLES = [
|
|
709
|
+
"AGENT",
|
|
710
|
+
"AI_AGENT",
|
|
711
|
+
"AUGMENT_AGENT",
|
|
712
|
+
"CLAUDECODE",
|
|
713
|
+
"CLAUDE_CODE",
|
|
714
|
+
"CODEX_SANDBOX",
|
|
715
|
+
"CURSOR_AGENT",
|
|
716
|
+
"GEMINI_CLI",
|
|
717
|
+
"OPENCODE"
|
|
718
|
+
];
|
|
719
|
+
const productVariable = ({ bin, name }) => `${bin.toUpperCase()}_${name}`;
|
|
720
|
+
const guidanceOn = ({ bin, env = process.env }) => !enabledVariable(env[productVariable({
|
|
721
|
+
bin,
|
|
722
|
+
name: "GUIDANCE_DISABLED"
|
|
723
|
+
})]);
|
|
724
|
+
const accessibleOn = ({ bin, env = process.env }) => enabledVariable(env[productVariable({
|
|
725
|
+
bin,
|
|
726
|
+
name: "ACCESSIBLE"
|
|
727
|
+
})]);
|
|
728
|
+
const modeOf = ({ bin, env = process.env, io, json, noColor, nonInteractive, payloadStdin }) => resolveMode({
|
|
729
|
+
accessible: accessibleOn({
|
|
730
|
+
bin,
|
|
731
|
+
env
|
|
732
|
+
}),
|
|
733
|
+
agent: AGENT_VARIABLES.find((name) => enabledVariable(env[name])),
|
|
734
|
+
env,
|
|
735
|
+
json,
|
|
736
|
+
noColor,
|
|
737
|
+
nonInteractive: nonInteractive ?? null,
|
|
738
|
+
payloadStdin,
|
|
739
|
+
stderr: terminalOf(io.stderr),
|
|
740
|
+
stdin: terminalOf(io.stdin),
|
|
741
|
+
stdout: terminalOf(io.stdout)
|
|
742
|
+
});
|
|
743
|
+
// ../cli-core/src/config.ts
|
|
744
|
+
const LOCK_POLL = millis(50);
|
|
745
|
+
const LOCK_STALE_MS = toMillis(seconds(90));
|
|
746
|
+
const LOCK_WAIT = seconds(20);
|
|
747
|
+
var LockHeld = class extends TaggedError("LockHeld") {};
|
|
748
|
+
const configDirectory = ({ bin, cwd, override }) => override === void 0 ? path.join(os.homedir(), ".config", bin) : path.resolve(cwd ?? process.cwd(), override);
|
|
749
|
+
const writePrivateFile = ({ file, text }) => {
|
|
750
|
+
const directory = path.dirname(file);
|
|
751
|
+
fs.mkdirSync(directory, {
|
|
752
|
+
mode: 448,
|
|
753
|
+
recursive: true
|
|
754
|
+
});
|
|
755
|
+
const pending = path.join(directory, `.${path.basename(file)}.${crypto.randomBytes(8).toString("hex")}.tmp`);
|
|
756
|
+
fs.writeFileSync(pending, text, {
|
|
757
|
+
flag: "wx",
|
|
758
|
+
mode: 384
|
|
759
|
+
});
|
|
760
|
+
fs.renameSync(pending, file);
|
|
761
|
+
};
|
|
762
|
+
const createNew = (file) => sync(() => {
|
|
763
|
+
fs.mkdirSync(path.dirname(file), {
|
|
764
|
+
mode: 448,
|
|
765
|
+
recursive: true
|
|
766
|
+
});
|
|
767
|
+
const fd = fs.openSync(file, "wx", 384);
|
|
768
|
+
const created = fs.fstatSync(fd);
|
|
769
|
+
fs.closeSync(fd);
|
|
770
|
+
return created;
|
|
771
|
+
}).pipe(catchDefect((defect) => hasProperty(defect, "code") && defect.code === "EEXIST" ? fail(new LockHeld()) : die(defect)));
|
|
772
|
+
const fileMatches = (file, matches) => {
|
|
773
|
+
const held = fs.statSync(file, { throwIfNoEntry: false });
|
|
774
|
+
return held !== void 0 && matches(held);
|
|
775
|
+
};
|
|
776
|
+
const removeIf = (file, matches) => sync(() => {
|
|
777
|
+
if (fileMatches(file, matches)) fs.rmSync(file, { force: true });
|
|
778
|
+
});
|
|
779
|
+
const staleAt = (now) => (held) => now - held.mtimeMs > LOCK_STALE_MS;
|
|
780
|
+
const sameAs = (own) => (held) => held.ino === own.ino && held.mtimeMs === own.mtimeMs;
|
|
781
|
+
const removeStaleLock = ({ lock, now }) => {
|
|
782
|
+
const takeover = `${lock}.takeover`;
|
|
783
|
+
return acquireUseRelease(createNew(takeover), () => removeIf(lock, staleAt(now)), (own) => removeIf(takeover, sameAs(own))).pipe(catchTag("LockHeld", () => removeIf(takeover, staleAt(now))));
|
|
784
|
+
};
|
|
785
|
+
const takeLock = ({ bin, lock }) => suspend(() => createNew(lock)).pipe(tapError(() => currentTimeMillis.pipe(flatMap((now) => fileMatches(lock, staleAt(now)) ? removeStaleLock({
|
|
786
|
+
lock,
|
|
787
|
+
now
|
|
788
|
+
}) : void_))), retry(spaced(LOCK_POLL).pipe(upTo({ duration: LOCK_WAIT }))), catchTag("LockHeld", () => fail(new CliFailure({
|
|
789
|
+
blocked: true,
|
|
790
|
+
context: [{
|
|
791
|
+
label: "Lock",
|
|
792
|
+
value: lock
|
|
793
|
+
}],
|
|
794
|
+
message: `Can't update the saved login. Another ${bin} command is updating it.`,
|
|
795
|
+
notes: [`Run the command again once the other ${bin} command finishes.`],
|
|
796
|
+
reason: "login_locked",
|
|
797
|
+
retryable: true
|
|
798
|
+
}))));
|
|
799
|
+
const withFileLock = ({ bin, file, work }) => {
|
|
800
|
+
const lock = `${file}.lock`;
|
|
801
|
+
return acquireUseRelease(takeLock({
|
|
802
|
+
bin,
|
|
803
|
+
lock
|
|
804
|
+
}), () => work, (own) => removeIf(lock, sameAs(own)));
|
|
805
|
+
};
|
|
552
806
|
// package.json
|
|
553
|
-
var version = "0.
|
|
807
|
+
var version = "0.5.0";
|
|
554
808
|
// src/cli/spec.ts
|
|
555
809
|
const BIN = "sandcovery";
|
|
810
|
+
const SETUP_MARK = "# added by sandcovery setup";
|
|
556
811
|
const NULLABLE_TEXT = "string | null";
|
|
812
|
+
const NULLABLE_NUMBER = "number | null";
|
|
557
813
|
const SANDBOX = "<SANDBOX>";
|
|
558
814
|
const SPEND_LIMIT = "spend-limit";
|
|
559
815
|
const NEEDS_MANAGEMENT = "Needs a management key.";
|
|
@@ -581,6 +837,12 @@ const baseUrl = {
|
|
|
581
837
|
name: "base-url",
|
|
582
838
|
summary: "Sandcovery origin to send requests to"
|
|
583
839
|
};
|
|
840
|
+
const usageKey = {
|
|
841
|
+
hint: "<KEY>",
|
|
842
|
+
kind: "value",
|
|
843
|
+
name: "key",
|
|
844
|
+
summary: "Show only this API key, by its ID"
|
|
845
|
+
};
|
|
584
846
|
const yes = flag({
|
|
585
847
|
name: "yes",
|
|
586
848
|
short: "y",
|
|
@@ -771,18 +1033,20 @@ const sandboxSpecOptions = [
|
|
|
771
1033
|
summary: "Region to run in, such as us, eu, or asia"
|
|
772
1034
|
},
|
|
773
1035
|
{
|
|
774
|
-
defaultText:
|
|
775
|
-
hint: "<
|
|
1036
|
+
defaultText: DEFAULT_SLUG,
|
|
1037
|
+
hint: "<SLUG>",
|
|
776
1038
|
kind: "value",
|
|
777
|
-
name: "
|
|
1039
|
+
name: "slug",
|
|
1040
|
+
repeat: "append",
|
|
778
1041
|
short: "s",
|
|
779
|
-
summary: "
|
|
1042
|
+
summary: "Provider and size as <provider>/<vcpu>x<memory_gib>, such as sandcovery/2x4, boat/2x4, or sandcovery/nx16:fastest, routed as :cheapest unless it ends in :fastest or :most-reliable; repeat to try each slug in order"
|
|
780
1043
|
},
|
|
781
1044
|
{
|
|
1045
|
+
defaultText: "price",
|
|
782
1046
|
hint: "<SORT>",
|
|
783
1047
|
kind: "value",
|
|
784
1048
|
name: "sort",
|
|
785
|
-
summary: "How to rank
|
|
1049
|
+
summary: "How to rank each slug's candidates; a slug's routing suffix must agree with it",
|
|
786
1050
|
values: ProviderSort.literals
|
|
787
1051
|
},
|
|
788
1052
|
{
|
|
@@ -850,20 +1114,31 @@ const sandboxesCreate = {
|
|
|
850
1114
|
examples: [
|
|
851
1115
|
{
|
|
852
1116
|
argv: ["sandboxes", "create"],
|
|
853
|
-
summary:
|
|
1117
|
+
summary: `Create a ${DEFAULT_SLUG} sandbox on the best provider`
|
|
854
1118
|
},
|
|
855
1119
|
{
|
|
856
1120
|
argv: [
|
|
857
1121
|
"sandboxes",
|
|
858
1122
|
"create",
|
|
859
|
-
"--
|
|
860
|
-
"4x8:cheapest",
|
|
1123
|
+
"--slug",
|
|
1124
|
+
"sandcovery/4x8:cheapest",
|
|
861
1125
|
"--ttl",
|
|
862
1126
|
"600",
|
|
863
1127
|
"--json"
|
|
864
1128
|
],
|
|
865
1129
|
summary: "Create the cheapest 4x8 sandbox for 10 minutes in a script"
|
|
866
1130
|
},
|
|
1131
|
+
{
|
|
1132
|
+
argv: [
|
|
1133
|
+
"sandboxes",
|
|
1134
|
+
"create",
|
|
1135
|
+
"--slug",
|
|
1136
|
+
"boat/2x4",
|
|
1137
|
+
"--slug",
|
|
1138
|
+
"sandcovery/nx4:cheapest"
|
|
1139
|
+
],
|
|
1140
|
+
summary: "Try boat at 2x4 first, then the cheapest provider with 4 GiB at any vCPU count"
|
|
1141
|
+
},
|
|
867
1142
|
{
|
|
868
1143
|
argv: [
|
|
869
1144
|
"sandboxes",
|
|
@@ -879,7 +1154,7 @@ const sandboxesCreate = {
|
|
|
879
1154
|
kind: "leaf",
|
|
880
1155
|
name: "create",
|
|
881
1156
|
notes: [
|
|
882
|
-
"
|
|
1157
|
+
"A slug pins a provider, or routes across every candidate provider when it starts with sandcovery/. Each slug falls back across its candidates on capacity, quota, timeout, and server errors, unless --no-fallbacks is given, and then the create moves to the next --slug.",
|
|
883
1158
|
"Each create sends an idempotency key, so the CLI retries a create that got no answer without making a second sandbox.",
|
|
884
1159
|
"When stdout is not a terminal, the command prints the sandbox ID there."
|
|
885
1160
|
],
|
|
@@ -1174,10 +1449,167 @@ const filesWrite = {
|
|
|
1174
1449
|
type: "string"
|
|
1175
1450
|
}, {
|
|
1176
1451
|
name: "file.size_bytes",
|
|
1177
|
-
type:
|
|
1452
|
+
type: NULLABLE_NUMBER
|
|
1178
1453
|
}],
|
|
1179
1454
|
summary: "Write a file into a sandbox"
|
|
1180
1455
|
};
|
|
1456
|
+
const docker = {
|
|
1457
|
+
arguments: [{
|
|
1458
|
+
name: "args",
|
|
1459
|
+
optional: true,
|
|
1460
|
+
summary: "Arguments for docker, every word passed on unchanged, so sandcovery options such as --base-url go before docker",
|
|
1461
|
+
variadic: true
|
|
1462
|
+
}],
|
|
1463
|
+
examples: [
|
|
1464
|
+
{
|
|
1465
|
+
argv: [
|
|
1466
|
+
"docker",
|
|
1467
|
+
"build",
|
|
1468
|
+
"--tag",
|
|
1469
|
+
"app",
|
|
1470
|
+
"."
|
|
1471
|
+
],
|
|
1472
|
+
summary: "Build an image from the working directory in a sandbox"
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
argv: [
|
|
1476
|
+
"docker",
|
|
1477
|
+
"run",
|
|
1478
|
+
"--rm",
|
|
1479
|
+
"app"
|
|
1480
|
+
],
|
|
1481
|
+
summary: "Run a container from it in the same sandbox"
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
argv: [
|
|
1485
|
+
"docker",
|
|
1486
|
+
"compose",
|
|
1487
|
+
"up",
|
|
1488
|
+
"--build",
|
|
1489
|
+
"--detach"
|
|
1490
|
+
],
|
|
1491
|
+
summary: "Start the Compose project in the working directory"
|
|
1492
|
+
}
|
|
1493
|
+
],
|
|
1494
|
+
kind: "leaf",
|
|
1495
|
+
name: "docker",
|
|
1496
|
+
notes: [
|
|
1497
|
+
"Runs the Docker CLI in a sandbox with every word after docker, streams its stdout and stderr to this terminal's, and exits with its exit code.",
|
|
1498
|
+
"The first command starts a sandbox on a provider that runs Docker, as Sandcovery CI runners do, and later commands reuse it until it ends at its TTL, so images, containers, and volumes carry over between commands. sandcovery sandboxes destroy ends it sooner.",
|
|
1499
|
+
"build, buildx, builder, and image build first copy the working directory into the sandbox, up to 100 MiB packed, so their relative paths resolve as they do here. Every other path names a file in the sandbox, as with a remote Docker daemon.",
|
|
1500
|
+
"compose first copies the Compose project into the sandbox, up to 100 MiB packed: its Compose files and env files, each build context without what .dockerignore leaves out, and each bind-mounted file or directory, under the directory that holds them all. ps, logs, down, and other commands that only read the project copy only the Compose files and env files. The copy keeps what containers wrote there, and a file deleted here stays there. Variables in Compose files come only from .env and --env-file, and absolute and ~ paths name files in the sandbox.",
|
|
1501
|
+
"When stdin is not a terminal and docker reads it, as with -i on run or exec without -d, start -i, login --password-stdin, load, import -, build -, or cp -, the command reads stdin to its end and hands it to docker.",
|
|
1502
|
+
"When stdout is not a terminal and docker writes an archive there, as with save or export without -o, cp to -, or build -o -, the archive arrives byte for byte. save and export without -o refuse a terminal, as docker does.",
|
|
1503
|
+
"The command gets no terminal and stops after an hour, so docker run -it does not work.",
|
|
1504
|
+
"sandcovery-docker takes docker arguments alone, runs them in the same sandbox, and adds nothing to docker output, so alias docker=sandcovery-docker runs docker here."
|
|
1505
|
+
],
|
|
1506
|
+
options: [baseUrl],
|
|
1507
|
+
passthrough: true,
|
|
1508
|
+
result: [],
|
|
1509
|
+
summary: "Run a docker command in a sandbox"
|
|
1510
|
+
};
|
|
1511
|
+
const setup = {
|
|
1512
|
+
arguments: [],
|
|
1513
|
+
examples: [{
|
|
1514
|
+
argv: ["setup"],
|
|
1515
|
+
summary: "Run docker, kubectl, and the other drop-ins on sandboxes"
|
|
1516
|
+
}, {
|
|
1517
|
+
argv: ["setup", "--undo"],
|
|
1518
|
+
summary: "Remove every shim and every line setup added"
|
|
1519
|
+
}],
|
|
1520
|
+
kind: "leaf",
|
|
1521
|
+
name: "setup",
|
|
1522
|
+
notes: [
|
|
1523
|
+
"Writes a shim for each Sandcovery drop-in on PATH, such as docker for sandcovery-docker and kubectl for sandcovery-kubectl, into the bin folder beside the CLI settings, and adds a line that puts that folder first on PATH to the startup files of bash, zsh, and fish.",
|
|
1524
|
+
"Lists every change and asks first, and without a terminal it needs --yes. Run it again after installing a new drop-in; with nothing to change, it changes nothing.",
|
|
1525
|
+
`Each shim and line it adds is marked "${SETUP_MARK}", and --undo removes only those. Your own docker or kubectl stays where it is and runs by its full path.`
|
|
1526
|
+
],
|
|
1527
|
+
options: [
|
|
1528
|
+
json,
|
|
1529
|
+
flag({
|
|
1530
|
+
name: "undo",
|
|
1531
|
+
summary: "Remove every shim and every line setup added"
|
|
1532
|
+
}),
|
|
1533
|
+
yes
|
|
1534
|
+
],
|
|
1535
|
+
result: [
|
|
1536
|
+
{
|
|
1537
|
+
name: "changes[].action",
|
|
1538
|
+
type: "\"append\" | \"delete\" | \"remove\" | \"write\""
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
name: "changes[].file",
|
|
1542
|
+
type: "string"
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
name: "changes[].line",
|
|
1546
|
+
type: NULLABLE_NUMBER
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
name: "changes[].text",
|
|
1550
|
+
type: NULLABLE_TEXT
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
name: "drop_ins[].binary",
|
|
1554
|
+
type: "string"
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
name: "drop_ins[].installed",
|
|
1558
|
+
type: "boolean"
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
name: "drop_ins[].real_path",
|
|
1562
|
+
type: NULLABLE_TEXT
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
name: "drop_ins[].tool",
|
|
1566
|
+
type: "string"
|
|
1567
|
+
}
|
|
1568
|
+
],
|
|
1569
|
+
summary: "Run docker, kubectl, and other drop-ins on sandboxes"
|
|
1570
|
+
};
|
|
1571
|
+
const login = {
|
|
1572
|
+
arguments: [],
|
|
1573
|
+
examples: [{
|
|
1574
|
+
argv: ["login"],
|
|
1575
|
+
summary: "Log in with a browser"
|
|
1576
|
+
}, {
|
|
1577
|
+
argv: ["login", "--no-open"],
|
|
1578
|
+
summary: "Print the login URL instead of opening a browser"
|
|
1579
|
+
}],
|
|
1580
|
+
kind: "leaf",
|
|
1581
|
+
name: "login",
|
|
1582
|
+
notes: ["Shows a login URL and a code, then waits while a person signed in to Sandcovery approves that code in a browser. The login is saved, readable only by you, beside the CLI settings, and renews itself until you log out.", "Commands send --token or SANDCOVERY_API_KEY when either is set, and the saved login otherwise. Without a terminal, set SANDCOVERY_API_KEY instead."],
|
|
1583
|
+
options: [
|
|
1584
|
+
baseUrl,
|
|
1585
|
+
flag({
|
|
1586
|
+
name: "open",
|
|
1587
|
+
summary: "Open the login URL in a browser; the default where one can open, and --no-open only prints it"
|
|
1588
|
+
}),
|
|
1589
|
+
json
|
|
1590
|
+
],
|
|
1591
|
+
result: [],
|
|
1592
|
+
summary: "Log in with a browser, so commands need no key"
|
|
1593
|
+
};
|
|
1594
|
+
const logout = {
|
|
1595
|
+
arguments: [],
|
|
1596
|
+
examples: [{
|
|
1597
|
+
argv: ["logout"],
|
|
1598
|
+
summary: "Log out on this computer"
|
|
1599
|
+
}],
|
|
1600
|
+
kind: "leaf",
|
|
1601
|
+
name: "logout",
|
|
1602
|
+
notes: ["Revokes the saved login at Sandcovery and deletes it. Keys in --token or SANDCOVERY_API_KEY stay as they are."],
|
|
1603
|
+
options: [json],
|
|
1604
|
+
result: [{
|
|
1605
|
+
name: "logout.origin",
|
|
1606
|
+
type: NULLABLE_TEXT
|
|
1607
|
+
}, {
|
|
1608
|
+
name: "logout.revoked",
|
|
1609
|
+
type: "boolean"
|
|
1610
|
+
}],
|
|
1611
|
+
summary: "Log out and delete the saved login"
|
|
1612
|
+
};
|
|
1181
1613
|
const sandboxes = {
|
|
1182
1614
|
children: [
|
|
1183
1615
|
sandboxesList,
|
|
@@ -1437,6 +1869,38 @@ const keys = {
|
|
|
1437
1869
|
shortcuts: ["key"],
|
|
1438
1870
|
summary: "Manage API keys and management keys"
|
|
1439
1871
|
};
|
|
1872
|
+
const credentialField = {
|
|
1873
|
+
hint: "<NAME=VALUE>",
|
|
1874
|
+
kind: "value",
|
|
1875
|
+
name: "field",
|
|
1876
|
+
repeat: "append",
|
|
1877
|
+
summary: "Credential field to set; repeat for each one"
|
|
1878
|
+
};
|
|
1879
|
+
const credentialSource = {
|
|
1880
|
+
hint: "<FILE|->",
|
|
1881
|
+
kind: "value",
|
|
1882
|
+
name: "from",
|
|
1883
|
+
stdin: true,
|
|
1884
|
+
summary: "JSON object of the fields, from a file or - for stdin"
|
|
1885
|
+
};
|
|
1886
|
+
const storedCredential = [
|
|
1887
|
+
{
|
|
1888
|
+
name: "credential.id",
|
|
1889
|
+
type: "string"
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
name: "credential.provider",
|
|
1893
|
+
type: "string"
|
|
1894
|
+
},
|
|
1895
|
+
{
|
|
1896
|
+
name: "credential.hint",
|
|
1897
|
+
type: "string"
|
|
1898
|
+
},
|
|
1899
|
+
{
|
|
1900
|
+
name: "credential.paused",
|
|
1901
|
+
type: "boolean"
|
|
1902
|
+
}
|
|
1903
|
+
];
|
|
1440
1904
|
const credentials = {
|
|
1441
1905
|
children: [
|
|
1442
1906
|
{
|
|
@@ -1447,13 +1911,17 @@ const credentials = {
|
|
|
1447
1911
|
}],
|
|
1448
1912
|
kind: "leaf",
|
|
1449
1913
|
name: "list",
|
|
1450
|
-
notes: ["Shows a hint of each credential, never the credential. Needs a management key."],
|
|
1914
|
+
notes: ["Shows a hint of each credential, never the credential. Needs a management key.", "A provider's credentials are listed in the order a create tries them. A Free organization routes only its oldest credential, and Paused marks each other one."],
|
|
1451
1915
|
options: [baseUrl, json],
|
|
1452
1916
|
result: [
|
|
1453
1917
|
{
|
|
1454
1918
|
name: "credentials",
|
|
1455
1919
|
type: "array"
|
|
1456
1920
|
},
|
|
1921
|
+
{
|
|
1922
|
+
name: "credentials[].id",
|
|
1923
|
+
type: "string"
|
|
1924
|
+
},
|
|
1457
1925
|
{
|
|
1458
1926
|
name: "credentials[].provider",
|
|
1459
1927
|
type: "string"
|
|
@@ -1461,6 +1929,10 @@ const credentials = {
|
|
|
1461
1929
|
{
|
|
1462
1930
|
name: "credentials[].hint",
|
|
1463
1931
|
type: "string"
|
|
1932
|
+
},
|
|
1933
|
+
{
|
|
1934
|
+
name: "credentials[].paused",
|
|
1935
|
+
type: "boolean"
|
|
1464
1936
|
}
|
|
1465
1937
|
],
|
|
1466
1938
|
shortcuts: ["ls"],
|
|
@@ -1489,33 +1961,52 @@ const credentials = {
|
|
|
1489
1961
|
}],
|
|
1490
1962
|
kind: "leaf",
|
|
1491
1963
|
name: "set",
|
|
1492
|
-
notes: [
|
|
1964
|
+
notes: [
|
|
1965
|
+
"Each provider names its fields in sandcovery providers inspect. Sandboxes on that provider then run on your account.",
|
|
1966
|
+
"It replaces the credential when you hold exactly one for the provider, and fails when you hold more; then add the new one and delete the old one.",
|
|
1967
|
+
"Prefer --from -, since options show in process lists. Sandcovery seals the values and never returns them. Needs a management key."
|
|
1968
|
+
],
|
|
1493
1969
|
options: [
|
|
1494
1970
|
baseUrl,
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
kind: "value",
|
|
1498
|
-
name: "field",
|
|
1499
|
-
repeat: "append",
|
|
1500
|
-
summary: "Credential field to set; repeat for each one"
|
|
1501
|
-
},
|
|
1502
|
-
{
|
|
1503
|
-
hint: "<FILE|->",
|
|
1504
|
-
kind: "value",
|
|
1505
|
-
name: "from",
|
|
1506
|
-
stdin: true,
|
|
1507
|
-
summary: "JSON object of the fields, from a file or - for stdin"
|
|
1508
|
-
},
|
|
1971
|
+
credentialField,
|
|
1972
|
+
credentialSource,
|
|
1509
1973
|
json
|
|
1510
1974
|
],
|
|
1511
|
-
result:
|
|
1512
|
-
|
|
1513
|
-
|
|
1975
|
+
result: storedCredential,
|
|
1976
|
+
summary: "Set or replace a provider credential"
|
|
1977
|
+
},
|
|
1978
|
+
{
|
|
1979
|
+
arguments: [providerArgument("add a credential")],
|
|
1980
|
+
examples: [{
|
|
1981
|
+
argv: [
|
|
1982
|
+
"credentials",
|
|
1983
|
+
"add",
|
|
1984
|
+
"e2b",
|
|
1985
|
+
"--from",
|
|
1986
|
+
"-"
|
|
1987
|
+
],
|
|
1988
|
+
summary: "Add another E2B credential from a JSON object on stdin"
|
|
1514
1989
|
}, {
|
|
1515
|
-
|
|
1516
|
-
|
|
1990
|
+
argv: [
|
|
1991
|
+
"credentials",
|
|
1992
|
+
"add",
|
|
1993
|
+
"e2b",
|
|
1994
|
+
"--field",
|
|
1995
|
+
"api_key=<KEY>"
|
|
1996
|
+
],
|
|
1997
|
+
summary: "Add it from an option"
|
|
1517
1998
|
}],
|
|
1518
|
-
|
|
1999
|
+
kind: "leaf",
|
|
2000
|
+
name: "add",
|
|
2001
|
+
notes: ["A create tries your credentials for a provider in the order you added them, and falls back to the next one on capacity, quota, a provider error, or a timeout.", "A Free organization routes only its oldest credential, so another stays paused until it has Pro. Prefer --from -, since options show in process lists. Needs a management key."],
|
|
2002
|
+
options: [
|
|
2003
|
+
baseUrl,
|
|
2004
|
+
credentialField,
|
|
2005
|
+
credentialSource,
|
|
2006
|
+
json
|
|
2007
|
+
],
|
|
2008
|
+
result: storedCredential,
|
|
2009
|
+
summary: "Add another provider credential"
|
|
1519
2010
|
},
|
|
1520
2011
|
{
|
|
1521
2012
|
arguments: [providerArgument("delete a credential")],
|
|
@@ -1525,13 +2016,28 @@ const credentials = {
|
|
|
1525
2016
|
"delete",
|
|
1526
2017
|
"e2b"
|
|
1527
2018
|
],
|
|
1528
|
-
summary: "Delete
|
|
2019
|
+
summary: "Delete every E2B credential after a prompt"
|
|
2020
|
+
}, {
|
|
2021
|
+
argv: [
|
|
2022
|
+
"credentials",
|
|
2023
|
+
"delete",
|
|
2024
|
+
"e2b",
|
|
2025
|
+
"--id",
|
|
2026
|
+
"<CREDENTIAL>"
|
|
2027
|
+
],
|
|
2028
|
+
summary: "Delete one E2B credential by its ID"
|
|
1529
2029
|
}],
|
|
1530
2030
|
kind: "leaf",
|
|
1531
2031
|
name: "delete",
|
|
1532
|
-
notes: ["
|
|
2032
|
+
notes: ["Without --id, it deletes every credential of the provider, and new sandboxes on that provider then run on Sandcovery's account. A credential that live sandboxes use cannot be deleted.", "It asks first, and needs --yes without a terminal. Needs a management key."],
|
|
1533
2033
|
options: [
|
|
1534
2034
|
baseUrl,
|
|
2035
|
+
{
|
|
2036
|
+
hint: "<CREDENTIAL>",
|
|
2037
|
+
kind: "value",
|
|
2038
|
+
name: "id",
|
|
2039
|
+
summary: "Delete only the credential with this ID"
|
|
2040
|
+
},
|
|
1535
2041
|
json,
|
|
1536
2042
|
yes
|
|
1537
2043
|
],
|
|
@@ -1543,7 +2049,7 @@ const credentials = {
|
|
|
1543
2049
|
type: "\"deleted\""
|
|
1544
2050
|
}],
|
|
1545
2051
|
shortcuts: ["rm"],
|
|
1546
|
-
summary: "Delete
|
|
2052
|
+
summary: "Delete provider credentials"
|
|
1547
2053
|
},
|
|
1548
2054
|
{
|
|
1549
2055
|
arguments: [],
|
|
@@ -1596,8 +2102,8 @@ const providers = {
|
|
|
1596
2102
|
name: "list",
|
|
1597
2103
|
notes: [
|
|
1598
2104
|
"Lists each provider with its status, 2x4 price per hour, and median create latency.",
|
|
1599
|
-
"A provider Sandcovery does not route to yet shows as
|
|
1600
|
-
"
|
|
2105
|
+
"A provider Sandcovery does not route to yet shows as Coming Soon.",
|
|
2106
|
+
"Coming Soon also marks each figure or fact Sandcovery does not publish, and --json adds every fact with the page it was read from.",
|
|
1601
2107
|
"With --routed, it lists only the providers on the provider board, and --json prints their board entries."
|
|
1602
2108
|
],
|
|
1603
2109
|
options: [
|
|
@@ -1665,106 +2171,215 @@ const providers = {
|
|
|
1665
2171
|
summary: "Compare the sandbox providers"
|
|
1666
2172
|
};
|
|
1667
2173
|
const usage = {
|
|
2174
|
+
children: [
|
|
2175
|
+
{
|
|
2176
|
+
arguments: [],
|
|
2177
|
+
examples: [{
|
|
2178
|
+
argv: ["usage", "inspect"],
|
|
2179
|
+
summary: "Show this month's usage"
|
|
2180
|
+
}, {
|
|
2181
|
+
argv: [
|
|
2182
|
+
"usage",
|
|
2183
|
+
"inspect",
|
|
2184
|
+
"--from",
|
|
2185
|
+
"2026-10-01",
|
|
2186
|
+
"--to",
|
|
2187
|
+
"2026-10-31",
|
|
2188
|
+
"--json"
|
|
2189
|
+
],
|
|
2190
|
+
summary: "Read October's usage in a script"
|
|
2191
|
+
}],
|
|
2192
|
+
kind: "leaf",
|
|
2193
|
+
name: "inspect",
|
|
2194
|
+
notes: ["Shows sandboxes, sandbox time, vCPU and memory time, and estimated cost per UTC day, key, and provider, at most 92 days at once, plus GPU time once any sandbox ran a GPU. Needs a management key."],
|
|
2195
|
+
options: [
|
|
2196
|
+
baseUrl,
|
|
2197
|
+
{
|
|
2198
|
+
defaultText: "the first day of this UTC month",
|
|
2199
|
+
hint: "<DAY>",
|
|
2200
|
+
kind: "value",
|
|
2201
|
+
name: "from",
|
|
2202
|
+
summary: "First UTC day, such as 2026-11-01"
|
|
2203
|
+
},
|
|
2204
|
+
json,
|
|
2205
|
+
usageKey,
|
|
2206
|
+
{
|
|
2207
|
+
defaultText: "today, in UTC",
|
|
2208
|
+
hint: "<DAY>",
|
|
2209
|
+
kind: "value",
|
|
2210
|
+
name: "to",
|
|
2211
|
+
summary: "Last UTC day, such as 2026-11-30"
|
|
2212
|
+
}
|
|
2213
|
+
],
|
|
2214
|
+
result: [
|
|
2215
|
+
{
|
|
2216
|
+
name: "usage",
|
|
2217
|
+
type: "array"
|
|
2218
|
+
},
|
|
2219
|
+
{
|
|
2220
|
+
name: "usage[].date",
|
|
2221
|
+
type: "string"
|
|
2222
|
+
},
|
|
2223
|
+
{
|
|
2224
|
+
name: "usage[].estimated_micro_usd",
|
|
2225
|
+
type: "number"
|
|
2226
|
+
}
|
|
2227
|
+
],
|
|
2228
|
+
summary: "Show usage and cost per day"
|
|
2229
|
+
},
|
|
2230
|
+
{
|
|
2231
|
+
arguments: [],
|
|
2232
|
+
examples: [{
|
|
2233
|
+
argv: ["usage", "live"],
|
|
2234
|
+
summary: "Show the sandboxes live now and their cost per hour"
|
|
2235
|
+
}],
|
|
2236
|
+
kind: "leaf",
|
|
2237
|
+
name: "live",
|
|
2238
|
+
notes: ["Shows the sandboxes live at this moment per key, provider, and status, with their vCPUs, memory, GPUs, cost per hour, and cost so far. Needs a management key."],
|
|
2239
|
+
options: [
|
|
2240
|
+
baseUrl,
|
|
2241
|
+
json,
|
|
2242
|
+
usageKey
|
|
2243
|
+
],
|
|
2244
|
+
result: [
|
|
2245
|
+
{
|
|
2246
|
+
name: "at",
|
|
2247
|
+
type: "string"
|
|
2248
|
+
},
|
|
2249
|
+
{
|
|
2250
|
+
name: "live",
|
|
2251
|
+
type: "array"
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
name: "live[].hourly_micro_usd",
|
|
2255
|
+
type: "number"
|
|
2256
|
+
},
|
|
2257
|
+
{
|
|
2258
|
+
name: "live[].sandbox_count",
|
|
2259
|
+
type: "number"
|
|
2260
|
+
}
|
|
2261
|
+
],
|
|
2262
|
+
summary: "Show the sandboxes live now"
|
|
2263
|
+
},
|
|
2264
|
+
{
|
|
2265
|
+
arguments: [],
|
|
2266
|
+
examples: [{
|
|
2267
|
+
argv: ["usage", "totals"],
|
|
2268
|
+
summary: "Show today's, this week's, this month's, and all usage"
|
|
2269
|
+
}],
|
|
2270
|
+
kind: "leaf",
|
|
2271
|
+
name: "totals",
|
|
2272
|
+
notes: ["Shows sandboxes, sandbox time, vCPU and memory time, and estimated cost from the start of the UTC day, ISO week, and UTC month to now, and in total, plus GPU time once any sandbox ran a GPU. Needs a management key."],
|
|
2273
|
+
options: [
|
|
2274
|
+
baseUrl,
|
|
2275
|
+
json,
|
|
2276
|
+
usageKey
|
|
2277
|
+
],
|
|
2278
|
+
result: [
|
|
2279
|
+
{
|
|
2280
|
+
name: "at",
|
|
2281
|
+
type: "string"
|
|
2282
|
+
},
|
|
2283
|
+
{
|
|
2284
|
+
name: "totals",
|
|
2285
|
+
type: "array"
|
|
2286
|
+
},
|
|
2287
|
+
{
|
|
2288
|
+
name: "totals[].period",
|
|
2289
|
+
type: "string"
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
name: "totals[].estimated_micro_usd",
|
|
2293
|
+
type: "number"
|
|
2294
|
+
}
|
|
2295
|
+
],
|
|
2296
|
+
summary: "Show usage totals by day, week, month, and in total"
|
|
2297
|
+
},
|
|
2298
|
+
{
|
|
2299
|
+
arguments: [],
|
|
2300
|
+
examples: [{
|
|
2301
|
+
argv: [
|
|
2302
|
+
"usage",
|
|
2303
|
+
"estimate",
|
|
2304
|
+
"--slug",
|
|
2305
|
+
"sandcovery/4x8",
|
|
2306
|
+
"--ttl",
|
|
2307
|
+
"3600"
|
|
2308
|
+
],
|
|
2309
|
+
summary: "Price a 4x8 sandbox for an hour"
|
|
2310
|
+
}],
|
|
2311
|
+
kind: "leaf",
|
|
2312
|
+
name: "estimate",
|
|
2313
|
+
notes: ["Prices the spec on each provider that can run it, in routing order, at the size each slug runs there, without creating anything.", NO_MARKUP_TERMS],
|
|
2314
|
+
options: [
|
|
2315
|
+
baseUrl,
|
|
2316
|
+
json,
|
|
2317
|
+
...sandboxSpecOptions
|
|
2318
|
+
],
|
|
2319
|
+
result: [
|
|
2320
|
+
{
|
|
2321
|
+
name: "estimates",
|
|
2322
|
+
type: "array"
|
|
2323
|
+
},
|
|
2324
|
+
{
|
|
2325
|
+
name: "estimates[].provider",
|
|
2326
|
+
type: "string"
|
|
2327
|
+
},
|
|
2328
|
+
{
|
|
2329
|
+
name: "estimates[].slug",
|
|
2330
|
+
type: "string"
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
name: "estimates[].ttl_micro_usd",
|
|
2334
|
+
type: "number"
|
|
2335
|
+
}
|
|
2336
|
+
],
|
|
2337
|
+
summary: "Price a sandbox before creating it"
|
|
2338
|
+
}
|
|
2339
|
+
],
|
|
2340
|
+
defaultChild: "inspect",
|
|
2341
|
+
kind: "group",
|
|
2342
|
+
name: "usage",
|
|
2343
|
+
summary: "Show usage and price sandboxes"
|
|
2344
|
+
};
|
|
2345
|
+
const stats = {
|
|
1668
2346
|
children: [{
|
|
1669
2347
|
arguments: [],
|
|
1670
2348
|
examples: [{
|
|
1671
|
-
argv: ["
|
|
1672
|
-
summary: "Show
|
|
2349
|
+
argv: ["stats", "inspect"],
|
|
2350
|
+
summary: "Show your organization's level, streak, and badges"
|
|
1673
2351
|
}, {
|
|
1674
2352
|
argv: [
|
|
1675
|
-
"
|
|
2353
|
+
"stats",
|
|
1676
2354
|
"inspect",
|
|
1677
|
-
"--from",
|
|
1678
|
-
"2026-10-01",
|
|
1679
|
-
"--to",
|
|
1680
|
-
"2026-10-31",
|
|
1681
2355
|
"--json"
|
|
1682
2356
|
],
|
|
1683
|
-
summary: "Read
|
|
2357
|
+
summary: "Read the badges in a script"
|
|
1684
2358
|
}],
|
|
1685
2359
|
kind: "leaf",
|
|
1686
2360
|
name: "inspect",
|
|
1687
|
-
notes: ["
|
|
1688
|
-
options: [
|
|
1689
|
-
baseUrl,
|
|
1690
|
-
{
|
|
1691
|
-
defaultText: "the first day of this UTC month",
|
|
1692
|
-
hint: "<DAY>",
|
|
1693
|
-
kind: "value",
|
|
1694
|
-
name: "from",
|
|
1695
|
-
summary: "First UTC day, such as 2026-11-01"
|
|
1696
|
-
},
|
|
1697
|
-
json,
|
|
1698
|
-
{
|
|
1699
|
-
hint: "<KEY>",
|
|
1700
|
-
kind: "value",
|
|
1701
|
-
name: "key",
|
|
1702
|
-
summary: "Show only this API key, by its ID"
|
|
1703
|
-
},
|
|
1704
|
-
{
|
|
1705
|
-
defaultText: "today, in UTC",
|
|
1706
|
-
hint: "<DAY>",
|
|
1707
|
-
kind: "value",
|
|
1708
|
-
name: "to",
|
|
1709
|
-
summary: "Last UTC day, such as 2026-11-30"
|
|
1710
|
-
}
|
|
1711
|
-
],
|
|
2361
|
+
notes: ["Reads every sandbox the organization started. Level 1 starts at 1 vCPU-hour, and each level after it takes ten times as many. Takes an API key or a management key."],
|
|
2362
|
+
options: [baseUrl, json],
|
|
1712
2363
|
result: [
|
|
1713
2364
|
{
|
|
1714
|
-
name: "
|
|
1715
|
-
type: "
|
|
1716
|
-
},
|
|
1717
|
-
{
|
|
1718
|
-
name: "usage[].date",
|
|
1719
|
-
type: "string"
|
|
2365
|
+
name: "stats",
|
|
2366
|
+
type: "object"
|
|
1720
2367
|
},
|
|
1721
2368
|
{
|
|
1722
|
-
name: "
|
|
2369
|
+
name: "stats.level",
|
|
1723
2370
|
type: "number"
|
|
1724
|
-
}
|
|
1725
|
-
],
|
|
1726
|
-
summary: "Show usage and cost per day"
|
|
1727
|
-
}, {
|
|
1728
|
-
arguments: [],
|
|
1729
|
-
examples: [{
|
|
1730
|
-
argv: [
|
|
1731
|
-
"usage",
|
|
1732
|
-
"estimate",
|
|
1733
|
-
"--size",
|
|
1734
|
-
"4x8",
|
|
1735
|
-
"--ttl",
|
|
1736
|
-
"3600"
|
|
1737
|
-
],
|
|
1738
|
-
summary: "Price a 4x8 sandbox for an hour"
|
|
1739
|
-
}],
|
|
1740
|
-
kind: "leaf",
|
|
1741
|
-
name: "estimate",
|
|
1742
|
-
notes: ["Prices the spec on each provider that can run it, in routing order, without creating anything."],
|
|
1743
|
-
options: [
|
|
1744
|
-
baseUrl,
|
|
1745
|
-
json,
|
|
1746
|
-
...sandboxSpecOptions
|
|
1747
|
-
],
|
|
1748
|
-
result: [
|
|
1749
|
-
{
|
|
1750
|
-
name: "estimates",
|
|
1751
|
-
type: "array"
|
|
1752
|
-
},
|
|
1753
|
-
{
|
|
1754
|
-
name: "estimates[].provider",
|
|
1755
|
-
type: "string"
|
|
1756
2371
|
},
|
|
1757
2372
|
{
|
|
1758
|
-
name: "
|
|
1759
|
-
type: "
|
|
2373
|
+
name: "stats.badges",
|
|
2374
|
+
type: "array"
|
|
1760
2375
|
}
|
|
1761
2376
|
],
|
|
1762
|
-
summary: "
|
|
2377
|
+
summary: "Show level, streak, records, and badges"
|
|
1763
2378
|
}],
|
|
1764
2379
|
defaultChild: "inspect",
|
|
1765
2380
|
kind: "group",
|
|
1766
|
-
name: "
|
|
1767
|
-
summary: "Show
|
|
2381
|
+
name: "stats",
|
|
2382
|
+
summary: "Show your organization's level, streak, and badges"
|
|
1768
2383
|
};
|
|
1769
2384
|
const activity = {
|
|
1770
2385
|
children: [{
|
|
@@ -1813,7 +2428,7 @@ const billing = {
|
|
|
1813
2428
|
}],
|
|
1814
2429
|
kind: "leaf",
|
|
1815
2430
|
name: "inspect",
|
|
1816
|
-
notes: [`Shows the plan, the credit balance, and the Pro price. It fails as not found while billing is not
|
|
2431
|
+
notes: [`Shows the plan, the credit balance, and the Pro price. It fails as not found while billing is not set up. ${NEEDS_MANAGEMENT}`],
|
|
1817
2432
|
options: [baseUrl, json],
|
|
1818
2433
|
result: [
|
|
1819
2434
|
{
|
|
@@ -1824,6 +2439,10 @@ const billing = {
|
|
|
1824
2439
|
name: "billing.credit_balance_micro_usd",
|
|
1825
2440
|
type: "number"
|
|
1826
2441
|
},
|
|
2442
|
+
{
|
|
2443
|
+
name: "billing.credits_on_sale",
|
|
2444
|
+
type: "boolean"
|
|
2445
|
+
},
|
|
1827
2446
|
{
|
|
1828
2447
|
name: "billing.pro_price",
|
|
1829
2448
|
type: "object | null"
|
|
@@ -1866,6 +2485,201 @@ const billing = {
|
|
|
1866
2485
|
name: "billing",
|
|
1867
2486
|
summary: "Show the plan and buy credits"
|
|
1868
2487
|
};
|
|
2488
|
+
const pricing = {
|
|
2489
|
+
children: [{
|
|
2490
|
+
arguments: [],
|
|
2491
|
+
examples: [{
|
|
2492
|
+
argv: ["pricing", "inspect"],
|
|
2493
|
+
summary: "Show the Pro price and the credit terms"
|
|
2494
|
+
}],
|
|
2495
|
+
kind: "leaf",
|
|
2496
|
+
name: "inspect",
|
|
2497
|
+
notes: ["Shows the Pro price, the smallest and largest credit purchase, and the processing fee that comes out of each purchase. It needs no key, and the Pro price reads Not on sale while Pro is not on sale.", NO_MARKUP_TERMS],
|
|
2498
|
+
options: [baseUrl, json],
|
|
2499
|
+
result: [{
|
|
2500
|
+
name: "pricing.pro_price",
|
|
2501
|
+
type: "object | null"
|
|
2502
|
+
}, {
|
|
2503
|
+
name: "pricing.credits",
|
|
2504
|
+
type: "object"
|
|
2505
|
+
}],
|
|
2506
|
+
summary: "Show the Pro price and credit terms"
|
|
2507
|
+
}],
|
|
2508
|
+
defaultChild: "inspect",
|
|
2509
|
+
kind: "group",
|
|
2510
|
+
name: "pricing",
|
|
2511
|
+
summary: "Show the Pro price and the credit terms"
|
|
2512
|
+
};
|
|
2513
|
+
const ci = {
|
|
2514
|
+
children: [{
|
|
2515
|
+
children: [{
|
|
2516
|
+
arguments: [],
|
|
2517
|
+
examples: [{
|
|
2518
|
+
argv: [
|
|
2519
|
+
"ci",
|
|
2520
|
+
"jobs",
|
|
2521
|
+
"list"
|
|
2522
|
+
],
|
|
2523
|
+
summary: "List the newest CI jobs"
|
|
2524
|
+
}],
|
|
2525
|
+
kind: "leaf",
|
|
2526
|
+
name: "list",
|
|
2527
|
+
notes: ["Lists each GitHub Actions job that asked for a Sandcovery runner label, newest first, one page per run."],
|
|
2528
|
+
options: [
|
|
2529
|
+
baseUrl,
|
|
2530
|
+
json,
|
|
2531
|
+
limit("jobs"),
|
|
2532
|
+
next
|
|
2533
|
+
],
|
|
2534
|
+
result: [
|
|
2535
|
+
{
|
|
2536
|
+
name: "jobs",
|
|
2537
|
+
type: "array"
|
|
2538
|
+
},
|
|
2539
|
+
{
|
|
2540
|
+
name: "jobs[].id",
|
|
2541
|
+
type: "string"
|
|
2542
|
+
},
|
|
2543
|
+
{
|
|
2544
|
+
name: "jobs[].status",
|
|
2545
|
+
type: "\"queued\" | \"in_progress\" | \"completed\""
|
|
2546
|
+
},
|
|
2547
|
+
{
|
|
2548
|
+
name: "jobs[].cost_micro_usd",
|
|
2549
|
+
type: NULLABLE_NUMBER
|
|
2550
|
+
},
|
|
2551
|
+
{
|
|
2552
|
+
name: "next_cursor",
|
|
2553
|
+
type: NULLABLE_TEXT
|
|
2554
|
+
}
|
|
2555
|
+
],
|
|
2556
|
+
shortcuts: ["ls"],
|
|
2557
|
+
summary: "List CI jobs, newest first"
|
|
2558
|
+
}, {
|
|
2559
|
+
arguments: [required({
|
|
2560
|
+
message: "Can't show a CI job without its ID.",
|
|
2561
|
+
name: "job",
|
|
2562
|
+
reason: "missing_job",
|
|
2563
|
+
summary: "CI job ID, such as cij_ and a UUID, as sandcovery ci jobs list prints it"
|
|
2564
|
+
})],
|
|
2565
|
+
examples: [{
|
|
2566
|
+
argv: [
|
|
2567
|
+
"ci",
|
|
2568
|
+
"jobs",
|
|
2569
|
+
"inspect",
|
|
2570
|
+
"<JOB>"
|
|
2571
|
+
],
|
|
2572
|
+
summary: "Show a job's provider, wait, and cost"
|
|
2573
|
+
}],
|
|
2574
|
+
kind: "leaf",
|
|
2575
|
+
name: "inspect",
|
|
2576
|
+
notes: ["Shows the provider, wait, duration, and list-price cost of a job, beside what it costs on a GitHub-hosted runner."],
|
|
2577
|
+
options: [baseUrl, json],
|
|
2578
|
+
result: [
|
|
2579
|
+
{
|
|
2580
|
+
name: "job.id",
|
|
2581
|
+
type: "string"
|
|
2582
|
+
},
|
|
2583
|
+
{
|
|
2584
|
+
name: "job.provider",
|
|
2585
|
+
type: NULLABLE_TEXT
|
|
2586
|
+
},
|
|
2587
|
+
{
|
|
2588
|
+
name: "job.github_hosted_cost_micro_usd",
|
|
2589
|
+
type: NULLABLE_NUMBER
|
|
2590
|
+
}
|
|
2591
|
+
],
|
|
2592
|
+
summary: "Show one CI job"
|
|
2593
|
+
}],
|
|
2594
|
+
defaultChild: "list",
|
|
2595
|
+
kind: "group",
|
|
2596
|
+
name: "jobs",
|
|
2597
|
+
shortcuts: ["job"],
|
|
2598
|
+
summary: "Read GitHub Actions jobs that ran on Sandcovery CI"
|
|
2599
|
+
}, {
|
|
2600
|
+
children: [{
|
|
2601
|
+
arguments: [],
|
|
2602
|
+
examples: [{
|
|
2603
|
+
argv: [
|
|
2604
|
+
"ci",
|
|
2605
|
+
"installations",
|
|
2606
|
+
"list"
|
|
2607
|
+
],
|
|
2608
|
+
summary: "List the linked GitHub installations"
|
|
2609
|
+
}],
|
|
2610
|
+
kind: "leaf",
|
|
2611
|
+
name: "list",
|
|
2612
|
+
notes: [`Lists each linked installation with the API key that creates its runners. An organization owner or admin links one from the dashboard. ${NEEDS_MANAGEMENT}`],
|
|
2613
|
+
options: [baseUrl, json],
|
|
2614
|
+
result: [
|
|
2615
|
+
{
|
|
2616
|
+
name: "installations",
|
|
2617
|
+
type: "array"
|
|
2618
|
+
},
|
|
2619
|
+
{
|
|
2620
|
+
name: "installations[].installation_id",
|
|
2621
|
+
type: "number"
|
|
2622
|
+
},
|
|
2623
|
+
{
|
|
2624
|
+
name: "installations[].api_key_id",
|
|
2625
|
+
type: "string"
|
|
2626
|
+
}
|
|
2627
|
+
],
|
|
2628
|
+
shortcuts: ["ls"],
|
|
2629
|
+
summary: "List linked GitHub installations"
|
|
2630
|
+
}, {
|
|
2631
|
+
arguments: [required({
|
|
2632
|
+
message: "Can't unlink an installation without its ID.",
|
|
2633
|
+
name: "installation",
|
|
2634
|
+
reason: "missing_installation",
|
|
2635
|
+
summary: "GitHub installation ID, as sandcovery ci installations list prints it"
|
|
2636
|
+
})],
|
|
2637
|
+
examples: [{
|
|
2638
|
+
argv: [
|
|
2639
|
+
"ci",
|
|
2640
|
+
"installations",
|
|
2641
|
+
"unlink",
|
|
2642
|
+
"<INSTALLATION>"
|
|
2643
|
+
],
|
|
2644
|
+
summary: "Unlink an installation after a prompt"
|
|
2645
|
+
}, {
|
|
2646
|
+
argv: [
|
|
2647
|
+
"ci",
|
|
2648
|
+
"installations",
|
|
2649
|
+
"unlink",
|
|
2650
|
+
"<INSTALLATION>",
|
|
2651
|
+
"--yes"
|
|
2652
|
+
],
|
|
2653
|
+
summary: "Unlink it in a script, after a person approved"
|
|
2654
|
+
}],
|
|
2655
|
+
kind: "leaf",
|
|
2656
|
+
name: "unlink",
|
|
2657
|
+
notes: ["Its jobs start no more runners, and a runner already started ends when its job completes or at its TTL. The GitHub App stays installed until you uninstall it on GitHub.", `It asks first, and needs --yes without a terminal. ${NEEDS_MANAGEMENT}`],
|
|
2658
|
+
options: [
|
|
2659
|
+
baseUrl,
|
|
2660
|
+
json,
|
|
2661
|
+
yes
|
|
2662
|
+
],
|
|
2663
|
+
result: [{
|
|
2664
|
+
name: "installation.installation_id",
|
|
2665
|
+
type: "number"
|
|
2666
|
+
}, {
|
|
2667
|
+
name: "outcome",
|
|
2668
|
+
type: "\"unlinked\""
|
|
2669
|
+
}],
|
|
2670
|
+
shortcuts: ["delete", "rm"],
|
|
2671
|
+
summary: "Unlink a GitHub installation"
|
|
2672
|
+
}],
|
|
2673
|
+
defaultChild: "list",
|
|
2674
|
+
kind: "group",
|
|
2675
|
+
name: "installations",
|
|
2676
|
+
shortcuts: ["installation"],
|
|
2677
|
+
summary: "Manage GitHub installations linked to Sandcovery CI"
|
|
2678
|
+
}],
|
|
2679
|
+
kind: "group",
|
|
2680
|
+
name: "ci",
|
|
2681
|
+
summary: "Run GitHub Actions jobs on sandboxes"
|
|
2682
|
+
};
|
|
1869
2683
|
const telemetryLeaf = ({ name, summary }) => ({
|
|
1870
2684
|
arguments: [],
|
|
1871
2685
|
examples: [{
|
|
@@ -1975,12 +2789,19 @@ const CLI = {
|
|
|
1975
2789
|
root: {
|
|
1976
2790
|
children: [
|
|
1977
2791
|
sandboxes,
|
|
2792
|
+
docker,
|
|
2793
|
+
setup,
|
|
1978
2794
|
keys,
|
|
1979
2795
|
credentials,
|
|
1980
2796
|
providers,
|
|
1981
2797
|
usage,
|
|
2798
|
+
stats,
|
|
1982
2799
|
activity,
|
|
1983
2800
|
billing,
|
|
2801
|
+
pricing,
|
|
2802
|
+
ci,
|
|
2803
|
+
login,
|
|
2804
|
+
logout,
|
|
1984
2805
|
help,
|
|
1985
2806
|
{
|
|
1986
2807
|
children: [{
|
|
@@ -2010,7 +2831,7 @@ const CLI = {
|
|
|
2010
2831
|
kind: "group",
|
|
2011
2832
|
name: BIN,
|
|
2012
2833
|
notes: [
|
|
2013
|
-
"SANDCOVERY_API_KEY holds an API key or management key from the dashboard; --token wins over it, an empty value counts as unset, and the CLI never saves it.",
|
|
2834
|
+
"SANDCOVERY_API_KEY holds an API key or management key from the dashboard; --token wins over it, an empty value counts as unset, and the CLI never saves it. With neither set, commands send the login that sandcovery login saved.",
|
|
2014
2835
|
"SANDCOVERY_BASE_URL sets the origin; --base-url wins over it. SANDCOVERY_TELEMETRY_DISABLED=1 turns telemetry off. SANDCOVERY_GUIDANCE_DISABLED=1 hides optional next steps. SANDCOVERY_ACCESSIBLE=1 prints words instead of status glyphs.",
|
|
2015
2836
|
"NO_COLOR or --no-color turns color off, FORCE_COLOR turns it on, and CI makes every command non-interactive."
|
|
2016
2837
|
],
|
|
@@ -2023,20 +2844,28 @@ const CLI = {
|
|
|
2023
2844
|
["sandboxes", "exec"],
|
|
2024
2845
|
["sandboxes", "list"],
|
|
2025
2846
|
["sandboxes", "destroy"],
|
|
2026
|
-
["sandboxes", "files"]
|
|
2847
|
+
["sandboxes", "files"],
|
|
2848
|
+
["docker"],
|
|
2849
|
+
["setup"]
|
|
2027
2850
|
],
|
|
2028
2851
|
title: "Sandboxes"
|
|
2029
2852
|
},
|
|
2030
2853
|
{
|
|
2031
2854
|
paths: [
|
|
2032
2855
|
["providers", "list"],
|
|
2856
|
+
["pricing", "inspect"],
|
|
2033
2857
|
["usage", "estimate"],
|
|
2034
|
-
["usage", "inspect"]
|
|
2858
|
+
["usage", "inspect"],
|
|
2859
|
+
["usage", "live"],
|
|
2860
|
+
["usage", "totals"],
|
|
2861
|
+
["stats", "inspect"]
|
|
2035
2862
|
],
|
|
2036
2863
|
title: "Providers and Cost"
|
|
2037
2864
|
},
|
|
2038
2865
|
{
|
|
2039
2866
|
paths: [
|
|
2867
|
+
["login"],
|
|
2868
|
+
["logout"],
|
|
2040
2869
|
["keys"],
|
|
2041
2870
|
["credentials"],
|
|
2042
2871
|
["activity", "list"],
|
|
@@ -2054,4 +2883,4 @@ const CLI = {
|
|
|
2054
2883
|
}
|
|
2055
2884
|
]
|
|
2056
2885
|
};
|
|
2057
|
-
export {
|
|
2886
|
+
export { remoteCell as A, exitCodeOf as B, clearLine as C, spinnerFrame as D, plainPrefix as E, isDigit as F, usageFailure as H, isDigits as I, isUpper as L, remoteText as M, noop as N, theme as O, consistsOf as P, isWordCharacter as R, valuesOf as S, glyph as T, Canceled as U, statusOf as V, Clock as W, lastValue as _, version as a, readOptionToken as b, writePrivateFile as c, modeOf as d, productVariable as f, isOptionValue as g, isOptionToken as h, SETUP_MARK as i, remoteLine as j, escapeUnprintable as k, enabledVariable as l, flagOf as m, CLEARABLE as n, configDirectory as o, closest as p, CLI as r, withFileLock as s, BIN as t, guidanceOn as u, parseFailure as v, ellipsis as w, rerunArgv as x, parseLeaf as y, CliFailure as z };
|