@computesdk/cli 2.6.4 → 2.6.5
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 +348 -4
- package/cli-manifest.json +3425 -0
- package/dist/index.js +2057 -494
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -24,18 +24,21 @@ tokens renew automatically.
|
|
|
24
24
|
## Commands
|
|
25
25
|
|
|
26
26
|
```
|
|
27
|
-
compute actions … # Actions API — repos, dispatch, runs, schedule, logs, vault
|
|
27
|
+
compute actions … # Actions API — repos, workflows, dispatch, runs, schedule, logs, vault (see below)
|
|
28
28
|
compute market … # buy and sell on the compute market (cap, bids, credits, listings)
|
|
29
29
|
compute sandboxes … # platform sandbox control plane
|
|
30
30
|
compute bench … # benchmarks CLI (run, auth, org, results, …)
|
|
31
|
-
compute providers #
|
|
31
|
+
compute providers # SDK provider credentials in this environment
|
|
32
|
+
compute byok … # the org's BYOK provider keys and custom rates (see below)
|
|
32
33
|
compute org list # your organizations (* = active)
|
|
33
34
|
compute org use <slug> # switch the stored login's active org
|
|
34
|
-
compute org current / whoami # current user + active org
|
|
35
|
+
compute org current / whoami # current user + active org (an API key: its org)
|
|
36
|
+
compute org members|invitations|invite|member|leave # members and invitations (see below)
|
|
37
|
+
compute invitations … # your own invitations: show, accept, decline
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
All platform commands accept `--api-key` / `COMPUTE_API_KEY` and fall back to
|
|
38
|
-
the stored OAuth credentials.
|
|
41
|
+
the stored OAuth credentials. `COMPUTE_PLATFORM_URL` sets the platform URL.
|
|
39
42
|
|
|
40
43
|
The active org comes from the stored login (`compute org use` changes it —
|
|
41
44
|
it's per user, so every CLI on every machine sees the switch). For a one-off
|
|
@@ -55,6 +58,106 @@ compute sandboxes exec sb1 uname -a
|
|
|
55
58
|
compute sandboxes spawn sb1 --cwd /app -e NODE_ENV=production -- npm run dev
|
|
56
59
|
```
|
|
57
60
|
|
|
61
|
+
## compute actions runs
|
|
62
|
+
|
|
63
|
+
`compute actions runs` lists the newest 100 runs across every repo, or one
|
|
64
|
+
repo with `compute actions runs <owner/repo>`. Archived and reliability runs
|
|
65
|
+
are hidden unless asked for. The filters map onto the
|
|
66
|
+
`/api/v1/actions/runs` query and work on every view below:
|
|
67
|
+
|
|
68
|
+
| Flag | Query |
|
|
69
|
+
|---|---|
|
|
70
|
+
| `--status <s...>` | `status` (passed, failed, running, cancelled, none) |
|
|
71
|
+
| `--branch <b...>` | `branch` |
|
|
72
|
+
| `--event <e...>` | `event` (push, pull_request, schedule, workflow_dispatch) |
|
|
73
|
+
| `--workflow <path\|name...>` | `workflow`; names and file names (`ci.yml`) resolve to paths through the workflow catalog |
|
|
74
|
+
| `--search <text>` | `q` (title, ref, SHA prefix, workflow, `#run` or `#PR` number) |
|
|
75
|
+
| `--archived` | `archived=only` |
|
|
76
|
+
| `--reliability` | `reliability=1` |
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
compute actions runs --event pull_request --archived --json
|
|
80
|
+
compute actions runs days --status failed # 2026-09-21 3 runs, newest day first
|
|
81
|
+
compute actions runs --day 2026-09-21 --time-zone UTC # one page; prints the --cursor for the next
|
|
82
|
+
compute actions runs --day 2026-09-21 --all --json # every page: {runs, nextCursor: null}
|
|
83
|
+
compute actions runs archive <run-id> <run-id> -y # owner/admin; all or nothing
|
|
84
|
+
compute actions runs unarchive <run-id> -y
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`--json` prints the run array, `{runs, nextCursor}` with `--day`, `{days}`
|
|
88
|
+
for `runs days`, and `{archived, archivedAt}` for archive and unarchive.
|
|
89
|
+
Archive and unarchive ask for confirmation on a terminal; elsewhere they need
|
|
90
|
+
`-y` and exit 1 without it. When an id is unknown or another org's, nothing
|
|
91
|
+
changes and the command prints the ids it could not find and exits 1.
|
|
92
|
+
|
|
93
|
+
## compute actions workflows
|
|
94
|
+
|
|
95
|
+
`compute actions workflows` lists the workflows that can run now, across every
|
|
96
|
+
repo or one (`compute actions workflows <owner/repo>`), with each one's
|
|
97
|
+
controls and latest run:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
● enabled acme/widgets .github/workflows/ci.yml (CI) order: inherits snapshots: dynamic last: passed 3h ago
|
|
101
|
+
○ disabled (user) acme/widgets .github/workflows/nightly.yml (Nightly) order: vercel snapshots: 3 last: never
|
|
102
|
+
○ repo disabled acme/legacy .github/workflows/build.yml (Build) order: inherits snapshots: dynamic last: never
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`--all` adds the workflows that cannot run now (user-disabled, or on a
|
|
106
|
+
disabled repo). `--ref <ref>` (with a repo) also lists the workflow files only
|
|
107
|
+
that branch or tag has, with their inputs (`target* (required)`,
|
|
108
|
+
`suite default=dax`); `compute actions dispatch <repo> --workflow <path> --ref <ref>`
|
|
109
|
+
dispatches one of those by path when the catalog has no match.
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
compute actions workflows acme/widgets --all --json # {workflows}
|
|
113
|
+
compute actions workflows local/fixture --ref feature-ref --json # {workflows, refOnly}
|
|
114
|
+
compute actions workflows disable acme/widgets ci.yml -y # owner/admin
|
|
115
|
+
compute actions workflows enable acme/widgets "Nightly" -y
|
|
116
|
+
compute actions workflows set acme/widgets ci.yml --order market,vercel --snapshot-cap 3 -y
|
|
117
|
+
compute actions workflows set acme/widgets ci.yml --inherit-order --dynamic-snapshots -y
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`<workflow>` is a path, name, file name or id, matched against every
|
|
121
|
+
workflow of the repo (disabled ones included). `--inherit-order` makes the
|
|
122
|
+
workflow follow the org order and `--dynamic-snapshots` puts it back on the
|
|
123
|
+
dynamic snapshot pool; `--snapshot-cap 0` turns snapshots off. `--json` prints
|
|
124
|
+
the `PATCH /api/v1/actions/workflows` result (`repoFullName, path, enabled,
|
|
125
|
+
userDisabledAt, providerOrder, snapshotCap`). Enable, disable and set ask for
|
|
126
|
+
confirmation on a terminal; elsewhere they need `-y` and exit 1 without it.
|
|
127
|
+
|
|
128
|
+
## compute actions repos
|
|
129
|
+
|
|
130
|
+
`compute actions repos` lists the org's repositories with their run counts,
|
|
131
|
+
latest run and poll state (from `GET /api/v1/actions/repos`):
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
enabled computesdk/computesdk github-app · main · 3 workflows · 12 runs · last passed 3h ago · next poll in 2m
|
|
135
|
+
enabled local/fixture token · main · 1 workflow · 0 runs · not polled yet · fork PRs on
|
|
136
|
+
disabled acme/legacy github-app · main · no workflows yet · 4 runs · last failed 9d ago
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
compute actions repos --json # {repos}, the v1 body
|
|
141
|
+
compute actions branches computesdk/computesdk --search 482 # refs containing "482"
|
|
142
|
+
compute actions branches computesdk/computesdk --archived --json # {repo, defaultBranch, branches}; counts archived runs
|
|
143
|
+
compute actions repos poll local/fixture -y # owner/admin; at most every 30 s
|
|
144
|
+
compute actions repos set computesdk/ref-heavy --fork-prs refuse -y # or allow; owner/admin
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
`compute actions branches <repo>` lists the watched branches and open pull
|
|
148
|
+
requests, then the refs that only have run history, each with its run count
|
|
149
|
+
and latest run. `repos poll` fetches the repo's refs now and starts the runs
|
|
150
|
+
new commits call for; the platform allows one poll every 30 seconds per repo
|
|
151
|
+
(shared with the dashboard's "Poll now"), so a second poll inside that window
|
|
152
|
+
exits 1 with `retry after <time>`. A poll that ran but failed against the
|
|
153
|
+
remote prints the error and exits 1. `repos set --fork-prs allow|refuse`
|
|
154
|
+
decides whether pull requests from forks run CI (isolated: no org secrets, no
|
|
155
|
+
GitHub token); private repositories refuse them. `--repo-id` picks one row when
|
|
156
|
+
two installations grant the same name. `--json` prints the v1 body: the poll
|
|
157
|
+
result `{fullName, repoId, polled, error, createdRunIds, repo}` and the
|
|
158
|
+
`PATCH /api/v1/actions/repos` result for `set`. Poll and set ask for
|
|
159
|
+
confirmation on a terminal; elsewhere they need `-y` and exit 1 without it.
|
|
160
|
+
|
|
58
161
|
## Actions schedule
|
|
59
162
|
|
|
60
163
|
```bash
|
|
@@ -107,6 +210,247 @@ Only one session per agent can be active at a time. Legacy sessions without
|
|
|
107
210
|
persistent state cannot be recovered retroactively. Requires the platform's
|
|
108
211
|
managed-volume/resume API; no account storage credentials are needed in the CLI.
|
|
109
212
|
|
|
213
|
+
## compute instances list
|
|
214
|
+
|
|
215
|
+
`compute instances list` (`GET /api/v1/sandboxes`) takes the filters and the
|
|
216
|
+
sort of the dashboard's sandboxes table:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
compute instances list --customer-only --status active # what the dashboard lists as running
|
|
220
|
+
compute instances list --search e2b # label, id, provider, provider sandbox id or product
|
|
221
|
+
compute instances list --sort cost --direction desc --limit 20
|
|
222
|
+
compute instances list --sort name --cursor <nextCursor> # next page: repeat --sort/--direction
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
`--status` is `active` (every status but `destroyed`), `creating`, `running`
|
|
226
|
+
or `destroyed`. `--customer-only` leaves out idle platform sandboxes (warm
|
|
227
|
+
pool, CI sync, snapshot builds); sandboxes running an Actions job stay.
|
|
228
|
+
`--sort` is `created` (default, newest first), `name`, `cost` or `runtime`;
|
|
229
|
+
`--direction` defaults to `asc` for `name` and `desc` for the others. A page
|
|
230
|
+
ends with `nextCursor`; pass it to `--cursor` with the same `--sort` and
|
|
231
|
+
`--direction` (the server refuses a cursor from another sort).
|
|
232
|
+
|
|
233
|
+
## compute instances costs and settings
|
|
234
|
+
|
|
235
|
+
`compute instances` (aliases `sandboxes`, `sbx`) also reads and sets the org's
|
|
236
|
+
sandbox spend and routing policy. Each command takes `--org`, `--api-key`,
|
|
237
|
+
`--base-url`, `--allow-untrusted-host` and `--json` (the v1 body).
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
compute instances costs # spend: running, settled, per provider
|
|
241
|
+
compute instances costs --customer-only # without idle platform sandboxes (warm pool, CI sync, snapshot builds)
|
|
242
|
+
compute instances settings set --resources blaxel=large --warm-pool blaxel=1
|
|
243
|
+
compute instances settings set --resources blaxel=none --warm-pool blaxel=0
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
`costs` calls `GET /api/v1/sandboxes/costs` (`?customerOnly=true` with
|
|
247
|
+
`--customer-only`); `--json` prints `{currency, running, settled, totalUsd,
|
|
248
|
+
byProvider}`. The `all` row and each provider row split running and settled;
|
|
249
|
+
against older servers without the per-provider split, provider rows show `—`
|
|
250
|
+
in those columns.
|
|
251
|
+
|
|
252
|
+
`settings set` (`PATCH /api/v1/sandboxes/settings`, owner/admin) takes
|
|
253
|
+
`--resources <provider>=<preset>` (the provider's size preset, such as
|
|
254
|
+
`small`, `medium`, `large` or `xlarge`; `none` clears it) and
|
|
255
|
+
`--warm-pool <provider>[:<region>]=<n>` (`n` from 0 to 16; 0 clears the
|
|
256
|
+
entry). Both repeat, and the CLI checks only their syntax; the platform checks
|
|
257
|
+
provider and preset names. `compute instances settings` prints the resulting
|
|
258
|
+
`resources` and `warm pool` rows.
|
|
259
|
+
|
|
260
|
+
## compute byok
|
|
261
|
+
|
|
262
|
+
The org's BYOK providers (`/api/v1/providers`): the providers it brings its
|
|
263
|
+
own key for, each key's state, and the rate sandbox costs are reported at.
|
|
264
|
+
Keys and custom rates serve every product that places sandboxes — Actions
|
|
265
|
+
jobs and sandbox creates alike. Reads are open to members; writes need an
|
|
266
|
+
owner/admin.
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
compute byok # every BYOK provider: key state, rate
|
|
270
|
+
compute byok show blaxel # one provider's key, platform and custom rate
|
|
271
|
+
compute byok configure blaxel --field apiKey=… workspace=… --verify
|
|
272
|
+
compute byok verify blaxel # test the stored key with a real sandbox
|
|
273
|
+
compute byok remove blaxel -y # delete the key
|
|
274
|
+
compute byok rate set blaxel 0.09 --per hour
|
|
275
|
+
compute byok rate clear blaxel
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
A custom rate is for your own cost reporting (typically what you pay the
|
|
279
|
+
provider): sandbox costs on that provider are reported at it instead of the
|
|
280
|
+
platform rate. It doesn't change what you're billed, and it applies to
|
|
281
|
+
sandboxes created after you set it.
|
|
282
|
+
|
|
283
|
+
With a user login, run `compute login` again once to pick up the `providers`
|
|
284
|
+
scopes these commands need. `compute actions providers configure|verify|remove`
|
|
285
|
+
still work but are deprecated in favour of `compute byok`;
|
|
286
|
+
`compute actions providers` itself stays the Actions placement inventory
|
|
287
|
+
(order, act capability).
|
|
288
|
+
|
|
289
|
+
## compute org members and invitations
|
|
290
|
+
|
|
291
|
+
`compute org` also manages who is in the organization, and `compute
|
|
292
|
+
invitations` answers your own invitations. Every command takes `--api-key`,
|
|
293
|
+
`--base-url`, `--org`, `--allow-untrusted-host` and `--json` (the v1 body on
|
|
294
|
+
stdout; on failure the `{ok:false, error:{code, message, httpStatus, hint}}`
|
|
295
|
+
envelope on stderr).
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
compute org members # email, role, name, member id (any member)
|
|
299
|
+
compute org invitations # pending invitations with their links (owner/admin)
|
|
300
|
+
compute org invite bob@example.com --role admin # member (default) or admin; prints the link
|
|
301
|
+
compute org invitations cancel <invitationId> -y
|
|
302
|
+
compute org member set-role bob@example.com admin -y # <member id|email> <member|admin>
|
|
303
|
+
compute org member remove bob@example.com -y
|
|
304
|
+
compute org leave -y # needs a user login
|
|
305
|
+
compute invitations # your pending invitations (org slug, role)
|
|
306
|
+
compute invitations show <invitationId>
|
|
307
|
+
compute invitations accept <invitationId> # no confirmation
|
|
308
|
+
compute invitations decline <invitationId> -y
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The org commands call `/api/v1/organizations/current/…`: the server resolves
|
|
312
|
+
`current` to the credential's org. An org API key always acts on its own org;
|
|
313
|
+
for a user login `--org <slug>` (or `COMPUTE_ORG`) picks the org through
|
|
314
|
+
`X-Org-Slug`, and without it the login's active org is used.
|
|
315
|
+
|
|
316
|
+
| Command | Route |
|
|
317
|
+
|---|---|
|
|
318
|
+
| `org members` | `GET /api/v1/organizations/current/members` |
|
|
319
|
+
| `org invitations` | `GET /api/v1/organizations/current/invitations` |
|
|
320
|
+
| `org invite <email> [--role member\|admin]` | `POST /api/v1/organizations/current/invitations` `{email, role}` |
|
|
321
|
+
| `org invitations cancel <invitationId>` | `DELETE /api/v1/organizations/current/invitations/{invitationId}` |
|
|
322
|
+
| `org member set-role <member> <member\|admin>` | `GET …/members` to resolve the member, then `PATCH …/members/{memberId}` `{role}` |
|
|
323
|
+
| `org member remove <member>` | `GET …/members`, then `DELETE …/members/{memberId}` |
|
|
324
|
+
| `org leave` | `POST /api/v1/organizations/current/leave` |
|
|
325
|
+
| `invitations` | `GET /api/v1/me/invitations` |
|
|
326
|
+
| `invitations show <invitationId>` | `GET /api/v1/invitations/{invitationId}` |
|
|
327
|
+
| `invitations accept <invitationId>` | `POST /api/v1/invitations/{invitationId}/accept` |
|
|
328
|
+
| `invitations decline <invitationId>` | `POST /api/v1/invitations/{invitationId}/decline` |
|
|
329
|
+
|
|
330
|
+
**Confirmation.** `invite`, `invitations cancel`, `member set-role`, `member
|
|
331
|
+
remove`, `leave` and `invitations decline` ask for confirmation on a terminal
|
|
332
|
+
(the prompt names the email, role or org); elsewhere they need `-y`/`--yes`
|
|
333
|
+
and exit 1 with a "Pass -y to confirm" hint, changing nothing. `invitations
|
|
334
|
+
accept` never asks (it is your own answer); it takes `-y` so scripts can pass
|
|
335
|
+
the same flags as `decline`.
|
|
336
|
+
|
|
337
|
+
**Owners stay in the web app.** `invite --role owner` and `set-role … owner`
|
|
338
|
+
are refused locally ("Owner invitations require the web app" / "Owner role
|
|
339
|
+
changes require the web app"), and the platform refuses any role change or
|
|
340
|
+
removal that targets an owner with 403, which the CLI prints. Members are
|
|
341
|
+
named by member id or email; an unknown one exits 1 ("No member …").
|
|
342
|
+
|
|
343
|
+
**User login.** `org leave`, `invitations`, `invitations show|accept|decline`
|
|
344
|
+
need a user login (`compute login`). With an org API key (`bp_…`/`csdk_…`) the
|
|
345
|
+
CLI refuses before sending anything; for any other credential without a user
|
|
346
|
+
the platform's 403 `user_credential_required` is printed with a `compute
|
|
347
|
+
login` hint. Leaving an org also revokes your login's grant for it: if you
|
|
348
|
+
logged in for that org, run `compute login` again.
|
|
349
|
+
|
|
350
|
+
`invite` prints the invitation link and whether the email went out; when the
|
|
351
|
+
platform has no email configured (`emailSent: false`), share the link
|
|
352
|
+
yourself.
|
|
353
|
+
|
|
354
|
+
## compute bench
|
|
355
|
+
|
|
356
|
+
`compute bench …` runs the benchmarks CLI (`bench`) in-process: the same
|
|
357
|
+
commands, flags and output as `bench …`; `compute bench --version` prints the
|
|
358
|
+
version of the bench CLI it runs. The last release bundles `@benchsdk/runner`
|
|
359
|
+
0.8.3 with `@benchsdk/cli` 0.9.3, which adds `bench fork`, `bench runs run-again`
|
|
360
|
+
and the result filters `--participant`, `--since`, `--until`, `--day`, `--tz`
|
|
361
|
+
and `--source-org`.
|
|
362
|
+
|
|
363
|
+
This branch also links the benchmarks branch build (see "Developing against a
|
|
364
|
+
bench branch build" below), so `compute bench` has the newer bench commands:
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
compute bench benchmarks archive|restore|describe|mute|unmute|pause|resume <slug>
|
|
368
|
+
compute bench benchmarks list --status active|archived|all
|
|
369
|
+
compute bench runs archive|unarchive <runId...> -y
|
|
370
|
+
compute bench runs feed | runs days | runs day <YYYY-MM-DD> [--all]
|
|
371
|
+
compute bench reliability <slug> | reliability cards
|
|
372
|
+
compute bench activity [--days N]
|
|
373
|
+
compute bench run-again <slug> [--wait] | run-again status <slug> # daily Run again; needs a user login
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
compute's settings are forwarded to bench:
|
|
377
|
+
|
|
378
|
+
| compute | bench | |
|
|
379
|
+
|---|---|---|
|
|
380
|
+
| `COMPUTE_PLATFORM_URL` | `BENCHMARKS_PLATFORM_URL` | only when `BENCHMARKS_PLATFORM_URL` is unset |
|
|
381
|
+
| `COMPUTE_API_KEY` | `BENCHMARKS_PLATFORM_API_KEY` | only when `BENCHMARKS_PLATFORM_API_KEY` is unset, and only to a computesdk.com or localhost host over HTTPS (bench's `--base-url`, else its URL env, else `COMPUTE_PLATFORM_URL`); anything else is refused |
|
|
382
|
+
| `compute --org <slug> bench …`, else `COMPUTE_ORG` | `--org <slug>` | only when the bench command has no `--org` of its own; not added to `run` / `check` |
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
COMPUTE_API_KEY=bp_… compute bench runs list my-benchmark --json
|
|
386
|
+
COMPUTE_ORG=acme compute bench auth status --json # same as: compute bench --org acme auth status
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
`compute whoami` and `compute org current` also read `COMPUTE_API_KEY`, under the same host rule. To use a key with a self-hosted platform, set `BENCHMARKS_PLATFORM_API_KEY` for it yourself. An
|
|
390
|
+
org API key has no user, so they print the key's organization and
|
|
391
|
+
`API key (no user identity)` (with `--json`: `"user": null`,
|
|
392
|
+
`"credential": "api_key"`).
|
|
393
|
+
|
|
394
|
+
## Command manifest
|
|
395
|
+
|
|
396
|
+
`cli-manifest.json` (shipped in the package) lists every `compute` command:
|
|
397
|
+
its canonical path, alias spellings, arguments and flags, plus the global
|
|
398
|
+
flags and the `@benchsdk/runner` / `@benchsdk/cli` versions behind
|
|
399
|
+
`compute bench …`. The bench commands themselves are described by the bench
|
|
400
|
+
manifest in `@benchsdk/runner`. The benchmarks platform vendors both files
|
|
401
|
+
to check that the commands its API surface map names exist.
|
|
402
|
+
|
|
403
|
+
The hidden `compute __manifest` command prints the manifest (`--released`
|
|
404
|
+
marks it as describing a published version; `--check <file>` exits 1 when
|
|
405
|
+
`<file>` is out of date, ignoring a vendored `source.ref`). After adding,
|
|
406
|
+
renaming or removing commands or flags, regenerate the committed file:
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
pnpm --filter @computesdk/cli run manifest # builds, then writes cli-manifest.json
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
`src/__tests__/manifest.test.ts` fails when the committed file differs from
|
|
413
|
+
the built CLI's output.
|
|
414
|
+
|
|
415
|
+
### Developing against a bench branch build
|
|
416
|
+
|
|
417
|
+
`@benchsdk/cli` and `@benchsdk/runner` can be pointed at a local checkout of
|
|
418
|
+
[computesdk/benchmarks](https://github.com/computesdk/benchmarks) with a pnpm
|
|
419
|
+
`link:` override in the root `package.json`, so `compute bench` runs bench
|
|
420
|
+
commands that are not published yet:
|
|
421
|
+
|
|
422
|
+
```json
|
|
423
|
+
"pnpm": {
|
|
424
|
+
"overrides": {
|
|
425
|
+
"@benchsdk/cli": "link:../benchmarks-surface-parity/packages/benchsdk-cli",
|
|
426
|
+
"@benchsdk/runner": "link:../benchmarks-surface-parity/packages/benchsdk-runner"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
The paths are relative to the repository root, so the benchmarks checkout must
|
|
432
|
+
sit next to it (`../benchmarks-surface-parity`, branch `droid/surface-parity`)
|
|
433
|
+
and be installed and built first (`pnpm install && pnpm build` there; the
|
|
434
|
+
linked packages use that checkout's own `node_modules` and `dist/`). Then run
|
|
435
|
+
`pnpm install` here; the override is recorded in `pnpm-lock.yaml`, and
|
|
436
|
+
`pnpm install --frozen-lockfile` accepts it. Without the sibling checkout pnpm
|
|
437
|
+
still installs, with a "non-existent directory" warning and a dangling
|
|
438
|
+
symlink, but typecheck and the CLI tests fail because `@benchsdk/cli` cannot
|
|
439
|
+
be resolved. The override also covers `@computesdk/platform`'s optional
|
|
440
|
+
`@benchsdk/cli` peer, so the workspace has one bench CLI.
|
|
441
|
+
|
|
442
|
+
While the bench packages resolve to a checkout rather than to an npm install,
|
|
443
|
+
`cli-manifest.json` marks them `"linked": true, "released": false` under
|
|
444
|
+
`passthrough.bench.runner` and `passthrough.bench.cli`: the checkout's version
|
|
445
|
+
number (`0.9.4` / `0.8.4`, the last bench release, until the branch is
|
|
446
|
+
released as `@benchsdk/cli` 0.9.5) does not tell which commands it has, so consumers of the manifest should treat every bench
|
|
447
|
+
command as present but unreleased.
|
|
448
|
+
|
|
449
|
+
Before a release, publish the bench packages, remove the `pnpm.overrides`
|
|
450
|
+
block, set `@benchsdk/cli` / `@benchsdk/runner` in `packages/cli/package.json`
|
|
451
|
+
to the published caret ranges, run `pnpm install`, and regenerate the
|
|
452
|
+
manifest (the `linked` / `released` fields disappear).
|
|
453
|
+
|
|
110
454
|
## Migrating from @computesdk/cli 1.x
|
|
111
455
|
|
|
112
456
|
v2 removes the legacy console authentication and its commands:
|