@tangle-network/sandbox-cli 0.9.4-develop.20260712234415.c6da6eb → 0.9.4

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 CHANGED
@@ -30,7 +30,9 @@ npx @tangle-network/sandbox-cli sandbox list
30
30
  npx tangle-sandbox --help
31
31
  ```
32
32
 
33
- Never run bare `npx tangle` (or `npx tangle-cli`) — those npm names belong to unrelated third-party packages and would execute someone else's code. The official names are `@tangle-network/sandbox-cli` and its forwarding alias `tangle-sandbox`.
33
+ Never run bare `npx tangle` (or `npx tangle-cli`).
34
+ Those npm names belong to unrelated third-party packages and would execute someone else's code.
35
+ The official names are `@tangle-network/sandbox-cli` and its forwarding alias `tangle-sandbox`.
34
36
 
35
37
  Install globally to expose the short `tangle` binary on PATH:
36
38
 
@@ -56,14 +58,13 @@ Three flows are supported:
56
58
 
57
59
  - **Browser login** (default): `tangle auth login` opens a browser to complete OAuth with `github`, `google`, or `microsoft` identity providers.
58
60
  - **Device code**: `tangle auth login --no-browser` for headless environments.
59
- - **API key**: `tangle auth login --api-key sk-tan-...` (or set `TANGLE_API_KEY`; `SANDBOX_API_KEY` accepted as deprecated alias).
61
+ - **API key**: `tangle auth login --api-key sk-tan-...` (or set `TANGLE_API_KEY`).
60
62
 
61
63
  Credential lookup precedence:
62
64
 
63
65
  1. `--api-key` flag
64
- 2. `TANGLE_API_KEY` environment variable (preferred)
65
- 3. `SANDBOX_API_KEY` environment variable (deprecated alias, accepted for backwards compatibility)
66
- 4. `~/.tangle/credentials` (populated by `tangle auth login`)
66
+ 2. `TANGLE_API_KEY` environment variable
67
+ 3. `~/.tangle/credentials` (populated by `tangle auth login`)
67
68
 
68
69
  Common commands:
69
70
 
@@ -91,6 +92,7 @@ Top-level command groups:
91
92
  - `usage`
92
93
  - `permissions`
93
94
  - `backend`
95
+ - `batch`
94
96
  - `process`
95
97
  - `fs`
96
98
 
@@ -101,7 +103,7 @@ Examples:
101
103
  tangle auth login --api-key sk_...
102
104
 
103
105
  # sandbox lifecycle
104
- tangle sandbox create --name my-box --image node:20 --ssh
106
+ tangle sandbox create --name my-box --environment node:20 --ssh
105
107
  tangle sandbox list
106
108
  tangle sandbox get sbx_123
107
109
  tangle sandbox stop sbx_123
@@ -112,14 +114,14 @@ tangle sandbox delete sbx_123
112
114
  tangle exec sbx_123 "npm test"
113
115
  tangle ssh sbx_123
114
116
  tangle agent prompt sbx_123 "Summarize this repo"
115
- tangle agent task sbx_123 "Fix the failing tests"
117
+ tangle agent prompt sbx_123 "Fix the failing tests"
116
118
  tangle fleet create --count 4 --coordinator
117
119
 
118
120
  # grant hub connections to the agent (see hub-reference.md for the 3 modes).
119
121
  # the connection is an id or a provider name (resolved via `tangle hub connections`).
120
- tangle agent task sbx_123 "triage issues" \
122
+ tangle agent prompt sbx_123 "triage issues" \
121
123
  --connection github:github.issues.search,github.issues.create
122
- tangle agent task sbx_123 "file the report" --connection github:* --allow-writes
124
+ tangle agent prompt sbx_123 "file the report" --connection github:* --allow-writes
123
125
 
124
126
  # temporary GPU for an eval; omitted provider picks the cheapest configured cloud
125
127
  tangle sandbox gpu run sbx_123 \
@@ -138,7 +140,7 @@ tangle fs ls sbx_123 /workspace
138
140
  ```
139
141
 
140
142
  Hub commands (`tangle hub …`) and `tangle agent --connection` auto-mint a
141
- short-lived platform Hub key from your `tangle auth login` session no separate
143
+ short-lived platform Hub key from your `tangle auth login` session, with no separate
142
144
  key needed. See [`hub-reference.md`](./hub-reference.md) for the `--connection`
143
145
  grant modes, `--allow-writes`, and `permissions revert-writes`.
144
146
 
@@ -188,14 +190,40 @@ tangle sandbox create --name gpu-eval \
188
190
  The final detach output includes billed seconds and customer cost.
189
191
  Use `tangle usage` to inspect account-level GPU seconds and GPU spend.
190
192
 
193
+ ## Batch Runs
194
+
195
+ Run each task against one explicitly named backend:
196
+
197
+ ```bash
198
+ tangle batch run --tasks tasks.json --backend primary=opencode
199
+ ```
200
+
201
+ `tasks.json` is an array of `{ "id": "...", "message": "..." }` objects or an object with a `tasks` array.
202
+ At least one `--backend <id=type>` is required with `--tasks` or `--task`.
203
+
204
+ Repeat `--backend <id=type>` to run every task against multiple backends:
205
+
206
+ ```bash
207
+ tangle batch run --tasks tasks.json \
208
+ --backend writer=opencode \
209
+ --backend reviewer=claude-code \
210
+ --stream
211
+ ```
212
+
213
+ Backend IDs must be unique and use 1 to 128 letters, numbers, dots, underscores, or hyphens.
214
+ Use `--model provider/model` only when one backend is selected.
215
+ Each result is identified by both `taskId` and `backendId`.
216
+ JSON output reports `totalTasks`, `totalBackends`, `totalExecutions`, `totalSuccess`, `totalFailure`, `totalRetries`, and `successRate`.
217
+
218
+ Use `--request <file.json>` when each backend needs its own model, profile, server, or lifecycle configuration.
219
+ The file uses the same complete request shape as the TypeScript SDK and cannot be combined with inline task or backend flags.
220
+
191
221
  ## Provisioning Coverage
192
222
 
193
- `tangle sandbox create` exposes the full SDK provisioning surface, including image/environment, resources (CPU, memory, disk), temporary GPU leases, lifetime and idle timeout, driver and backend selection (`opencode`, `claude-code`, `codex`, `cursor`, `amp`, and other registry backends), SSH and web terminal, env and secret injection, metadata, initial permissions, git clone, tool pre-install, BYOS3 storage, snapshot restore, and outbound network controls. Run `tangle sandbox create --help` for the canonical flag list.
223
+ `tangle sandbox create` supports environments or container images, resources, temporary GPU leases, lifecycle limits, driver and backend selection, SSH and web terminal, environment variables, secrets, metadata, git clone, BYOS3 storage, and snapshot restore.
224
+ Use the `tools`, `permissions`, `network`, and `expose` commands after creation.
225
+ Run `tangle sandbox create --help` for the current flag list.
194
226
 
195
227
  ## Limitations
196
228
 
197
229
  - `snapshot restore` creates a new sandbox from a snapshot; the command signature suggests in-place restore.
198
-
199
- ## Design Follow-Up
200
-
201
- For the architecture review, parity checklist, and auth flow spec, see [CHECKLIST.md](./CHECKLIST.md).
package/SKILL.md CHANGED
@@ -1,13 +1,14 @@
1
1
  ---
2
2
  name: tangle-cli
3
- description: Use when interacting with Tangle sandboxes, executing hub tools, managing agent tasks, operating on sandbox filesystems, building workflows, connecting to external providers, or setting up integrations and automations from a terminal. Triggers include tangle, tangle sandbox, tangle hub, tangle agent, tangle exec, tangle fs, tangle snapshot, tangle secret, tangle workflows, tangle hub connect, github, slack, google, microsoft, external connections, provider integrations, hub tools, or any tangle command.
3
+ description: Use Tangle Sandbox CLI for lifecycle, prompts, files, fleets, Hub tools, and integrations.
4
4
  ---
5
5
 
6
6
  # Tangle CLI
7
7
 
8
8
  ## Overview
9
9
 
10
- `tangle` is the CLI for Tangle Sandbox operations create sandboxes, run agents, execute hub tools, manage files, secrets, snapshots, git, and more. All commands support `--help` for inline reference.
10
+ `tangle` is the CLI for Tangle Sandbox operations: create sandboxes, run agents, execute hub tools, and manage files, secrets, snapshots, and git.
11
+ All commands support `--help` for inline reference.
11
12
 
12
13
  ## Auth
13
14
 
@@ -16,7 +17,7 @@ Generic command auth modes, resolved in order:
16
17
  | Priority | Source | Set via |
17
18
  |----------|--------|--------|
18
19
  | 1 | CLI flag | `--api-key <key>` |
19
- | 2 | Env var | `TANGLE_API_KEY` or `SANDBOX_API_KEY` |
20
+ | 2 | Env var | `TANGLE_API_KEY` |
20
21
  | 3 | Profile store | `tangle auth login` (keychain or file) |
21
22
 
22
23
  Hub commands resolve auth in this order:
@@ -25,10 +26,11 @@ Hub commands resolve auth in this order:
25
26
  |----------|--------|--------|
26
27
  | 1 | CLI flag | `--api-key <key>` |
27
28
  | 2 | Hub capability | `TANGLE_HUB_CAPABILITY_TOKEN` |
28
- | 3 | Env var | `TANGLE_API_KEY` or `SANDBOX_API_KEY` |
29
+ | 3 | Env var | `TANGLE_API_KEY` |
29
30
  | 4 | Profile store | `tangle auth login` (keychain or file) |
30
31
 
31
- **Inside a sandbox:** `tangle` is automatically authenticated. No extra auth needed — commands work out of the box.
32
+ **Inside a sandbox:** `tangle` is automatically authenticated.
33
+ No extra authentication is needed.
32
34
 
33
35
  ```bash
34
36
  # Browser login (preferred)
@@ -48,7 +50,7 @@ tangle auth login --profile work
48
50
  tangle auth profiles use work
49
51
  ```
50
52
 
51
- For hub env auth, set **exactly one** of `TANGLE_API_KEY`/`SANDBOX_API_KEY` or `TANGLE_HUB_CAPABILITY_TOKEN`.
53
+ For hub env auth, set **exactly one** of `TANGLE_API_KEY` or `TANGLE_HUB_CAPABILITY_TOKEN`.
52
54
 
53
55
  ## Sandbox Lifecycle
54
56
 
@@ -105,7 +107,7 @@ tangle fleet create --count 4 \
105
107
  --gpu-idle-timeout 120
106
108
  ```
107
109
 
108
- ## Hub — Full Workflow
110
+ ## Full Hub Workflow
109
111
 
110
112
  Hub lets agents use connected provider tools (GitHub, etc.) through Tangle without seeing provider OAuth tokens.
111
113
 
@@ -141,7 +143,7 @@ tangle hub tools describe github.issues.search --json
141
143
 
142
144
  ### Tool Execution
143
145
 
144
- Two equivalent commands `call` and `exec`:
146
+ Two equivalent commands are available: `call` and `exec`.
145
147
 
146
148
  ```bash
147
149
  # Basic call: <path tokens...> <json-input>
@@ -154,7 +156,8 @@ tangle hub call github issues createIssue '{"owner":"foo","repo":"bar","title":"
154
156
 
155
157
  ### Policy & Approvals
156
158
 
157
- Tools default to `ask` policy — they pause and require approval on first use.
159
+ Tools default to the `ask` policy.
160
+ They pause and require approval on first use.
158
161
 
159
162
  ```bash
160
163
  # List pending approvals
@@ -210,20 +213,14 @@ tangle secret update DATABASE_URL "new-value"
210
213
  tangle secret delete DATABASE_URL
211
214
  ```
212
215
 
213
- ## Snapshots & Checkpoints
216
+ ## Snapshots
214
217
 
215
218
  ```bash
216
- # Snapshots (point-in-time for cloning/restoring)
217
219
  tangle snapshot create <sandbox-id>
218
220
  tangle snapshot list <sandbox-id>
219
221
  tangle snapshot restore <sandbox-id> <snapshot-id> # creates new sandbox
220
222
  tangle snapshot revert <sandbox-id> <snapshot-id> # reverts in-place
221
223
  tangle snapshot delete <sandbox-id> <snapshot-id>
222
-
223
- # Checkpoints (lightweight, local)
224
- tangle checkpoint create <id>
225
- tangle checkpoint list|ls <id>
226
- tangle checkpoint delete|rm <id> <checkpoint-id>
227
224
  ```
228
225
 
229
226
  ## Templates
@@ -260,19 +257,40 @@ tangle team invitations [team] # List pending/historical invitations
260
257
  ## Workflows
261
258
 
262
259
  Authenticate with the `sk-tan-*` API key (`TANGLE_API_KEY`), same as the other
263
- platform commands not a hub capability token.
260
+ platform commands, not a hub capability token. These commands address the
261
+ platform control plane, not the sandbox API. The host resolves from
262
+ `--base-url`, then `TANGLE_HUB_URL` (which a spawned sandbox injects to name
263
+ its own hub, so it wins over an ambient value), then `TANGLE_PLATFORM_URL`,
264
+ then `https://id.tangle.tools`. On `workflows`,
265
+ `--base-url` names the PLATFORM host — unlike `tangle keys`, where `--base-url`
266
+ is the sandbox API and `--platform-url` is the platform.
267
+
268
+ Authoring a workflow (graph topology, guards, joins, KV state, decisions):
269
+ https://sandbox.tangle.tools/docs/workflows
264
270
 
265
271
  ```bash
266
272
  tangle workflows validate workflow.yml
267
273
  tangle workflows schema # print JSON Schema
268
274
  tangle workflows create workflow.yml
275
+ tangle workflows apply workflow.yml # create or update, matched by the definition's name
269
276
  tangle workflows list
277
+ tangle workflows fleet # run tallies over a trailing window, failing first
270
278
  tangle workflows get <id>
271
279
  tangle workflows update <id> workflow.yml
272
280
  tangle workflows enable <id>
273
281
  tangle workflows disable <id>
274
282
  tangle workflows delete <id>
275
283
 
284
+ # Templates
285
+ tangle workflows templates # starter gallery
286
+ tangle workflows init <template-id> # instantiate, print YAML
287
+ tangle workflows init <template-id> --param repo=o/r --file workflow.yml
288
+
289
+ # Revisions
290
+ tangle workflows revisions <id> # definition history
291
+ tangle workflows revision <id> <rev> # one revision's YAML
292
+ tangle workflows rollback <id> <rev> # restore a rev as the new head
293
+
276
294
  # Runs
277
295
  tangle workflows run <id> # trigger a run
278
296
  tangle workflows run <id> --input pull_request.number=123 # with trigger inputs
@@ -280,6 +298,23 @@ tangle workflows run <id> --wait # wait + print resul
280
298
  tangle workflows runs <id> # run history
281
299
  tangle workflows run-detail <id> <runId> # single-run detail
282
300
  tangle workflows events <id> <runId> # tail live progress
301
+ tangle workflows cancel <id> <runId> # cancel a queued/running run
302
+ tangle workflows retry <id> <runId> # re-run a failed run with the same trigger context
303
+
304
+ # Cross-run KV state
305
+ tangle workflows kv list <id>
306
+ tangle workflows kv get <id> <key>
307
+ tangle workflows kv set <id> <key> '{"cursor":123}'
308
+ tangle workflows kv set <id> <key> '{"cursor":123}' --cas 4 # compare-and-swap
309
+ tangle workflows kv delete <id> <key>
310
+
311
+ # Run artifacts
312
+ tangle workflows artifacts <id> <runId>
313
+ tangle workflows artifact-download <id> <runId> <artifactId> --out report.json
314
+
315
+ # Human decisions
316
+ tangle workflows decisions <id> # pending approvals
317
+ tangle workflows decision-resolve <id> <runId> --choice deploy
283
318
  ```
284
319
 
285
320
  ## Other Commands
@@ -308,6 +343,7 @@ tangle tools install <id> python 3.12
308
343
 
309
344
  # Batch tasks across sandboxes
310
345
  tangle batch run --tasks tasks.json
346
+ tangle batch run --tasks tasks.json --backend writer=opencode --backend reviewer=claude-code --stream
311
347
 
312
348
  # Intelligence reports
313
349
  tangle intelligence sandbox <id>
@@ -337,22 +373,23 @@ tangle permissions add <sandboxId> --userId <userId> --role editor
337
373
 
338
374
  | Goal | Commands |
339
375
  |------|----------|
340
- | Spin up sandbox, run agent | `tangle sandbox create --name X` → `tangle agent task <id> "..."` |
376
+ | Spin up sandbox, run agent | `tangle sandbox create --name X` → `tangle agent prompt <id> "..."` |
341
377
  | Connect GitHub, read issues | `tangle hub connect github` → `tangle hub tools search "issues" --provider github` → `tangle hub call github issues search '{"q":"repo:X/Y is:issue"}'` |
342
378
  | Push code from sandbox to GitHub | `tangle hub connect github` → `tangle git add <id> files` → `tangle git commit <id> -m "msg"` → `tangle git push <id>` |
343
379
  | Save and restore state | `tangle snapshot create <id>` → ...work... → `tangle snapshot revert <id> <snap-id>` |
344
380
  | Set secret for agent use | `tangle secret create GITHUB_TOKEN "..."` → agent reads via `process.env.GITHUB_TOKEN` |
345
381
  | Set hub permissions | `tangle hub permissions set --connection conn_xxx --action github.issues.createIssue --decision allow` |
346
- | Batch parallel agent tasks | `tangle batch run --tasks tasks.json` (array of `{sandboxId, message}`) |
382
+ | Batch parallel agent prompts | `tangle batch run --tasks tasks.json --backend primary=opencode` (array of `{id, message}`) |
383
+ | Compare backends on the same tasks | `tangle batch run --tasks tasks.json --backend writer=opencode --backend reviewer=claude-code --stream` |
347
384
 
348
385
  ## Common Mistakes
349
386
 
350
- - **Forgetting `--reveal` on `secret show`** values are hidden by default for safety.
351
- - **Using API-key env and `TANGLE_HUB_CAPABILITY_TOKEN` together for hub** set exactly one env auth source, or use `--api-key` to override both.
352
- - **Calling hub tools without `--approve` on first use** use `--approve` or set policy to `allow` first.
353
- - **Missing `--json` flag when piping output** many commands need explicit `--json` for machine-readable output.
354
- - **`tangle hub exec` vs `tangle exec`** `hub exec` runs hub tools; `exec` runs shell commands in a sandbox.
355
- - **`hub resume` doesn't replay** after `hub resume --accept`, rerun original `hub exec` with `--approve`.
387
+ - **Forgetting `--reveal` on `secret show`:** values are hidden by default for safety.
388
+ - **Using API-key env and `TANGLE_HUB_CAPABILITY_TOKEN` together for hub:** set exactly one env auth source, or use `--api-key` to override both.
389
+ - **Calling hub tools without `--approve` on first use:** use `--approve` or set policy to `allow` first.
390
+ - **Missing `--json` when piping output:** many commands need explicit `--json` for machine-readable output.
391
+ - **`tangle hub exec` vs `tangle exec`:** `hub exec` runs hub tools; `exec` runs shell commands in a sandbox.
392
+ - **`hub resume` does not replay:** after `hub resume --accept`, rerun the original `hub exec` with `--approve`.
356
393
 
357
394
  ## Token Safety
358
395