@tangle-network/sandbox-cli 0.8.3-develop.20260623200213.63e05e9 → 0.8.3
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 +101 -16
- package/SKILL.md +108 -29
- package/dist/index.mjs +22 -12
- package/hub-reference.md +46 -40
- package/package.json +8 -5
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`)
|
|
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
|
|
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
|
|
65
|
-
3. `
|
|
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
|
|
|
@@ -86,10 +87,12 @@ Top-level command groups:
|
|
|
86
87
|
- `exec`
|
|
87
88
|
- `ssh`
|
|
88
89
|
- `agent`
|
|
90
|
+
- `fleet`
|
|
89
91
|
- `snapshot`
|
|
90
92
|
- `usage`
|
|
91
93
|
- `permissions`
|
|
92
94
|
- `backend`
|
|
95
|
+
- `batch`
|
|
93
96
|
- `process`
|
|
94
97
|
- `fs`
|
|
95
98
|
|
|
@@ -100,7 +103,7 @@ Examples:
|
|
|
100
103
|
tangle auth login --api-key sk_...
|
|
101
104
|
|
|
102
105
|
# sandbox lifecycle
|
|
103
|
-
tangle sandbox create --name my-box --
|
|
106
|
+
tangle sandbox create --name my-box --environment node:20 --ssh
|
|
104
107
|
tangle sandbox list
|
|
105
108
|
tangle sandbox get sbx_123
|
|
106
109
|
tangle sandbox stop sbx_123
|
|
@@ -111,13 +114,23 @@ tangle sandbox delete sbx_123
|
|
|
111
114
|
tangle exec sbx_123 "npm test"
|
|
112
115
|
tangle ssh sbx_123
|
|
113
116
|
tangle agent prompt sbx_123 "Summarize this repo"
|
|
114
|
-
tangle agent
|
|
117
|
+
tangle agent prompt sbx_123 "Fix the failing tests"
|
|
118
|
+
tangle fleet create --count 4 --coordinator
|
|
115
119
|
|
|
116
120
|
# grant hub connections to the agent (see hub-reference.md for the 3 modes).
|
|
117
121
|
# the connection is an id or a provider name (resolved via `tangle hub connections`).
|
|
118
|
-
tangle agent
|
|
119
|
-
--connection github:github.issues.
|
|
120
|
-
tangle agent
|
|
122
|
+
tangle agent prompt sbx_123 "triage issues" \
|
|
123
|
+
--connection github:github.issues.search,github.issues.create
|
|
124
|
+
tangle agent prompt sbx_123 "file the report" --connection github:* --allow-writes
|
|
125
|
+
|
|
126
|
+
# temporary GPU for an eval; omitted provider picks the cheapest configured cloud
|
|
127
|
+
tangle sandbox gpu run sbx_123 \
|
|
128
|
+
--accelerator-kind nvidia-3090 \
|
|
129
|
+
--accelerator-memory 24000 \
|
|
130
|
+
--max-spend-usd 1 \
|
|
131
|
+
--max-lifetime 900 \
|
|
132
|
+
--idle-timeout 120 \
|
|
133
|
+
-- python eval.py
|
|
121
134
|
|
|
122
135
|
# state and operations
|
|
123
136
|
tangle secret list
|
|
@@ -127,18 +140,90 @@ tangle fs ls sbx_123 /workspace
|
|
|
127
140
|
```
|
|
128
141
|
|
|
129
142
|
Hub commands (`tangle hub …`) and `tangle agent --connection` auto-mint a
|
|
130
|
-
short-lived platform Hub key from your `tangle auth login` session
|
|
143
|
+
short-lived platform Hub key from your `tangle auth login` session, with no separate
|
|
131
144
|
key needed. See [`hub-reference.md`](./hub-reference.md) for the `--connection`
|
|
132
145
|
grant modes, `--allow-writes`, and `permissions revert-writes`.
|
|
133
146
|
|
|
147
|
+
## Temporary GPUs
|
|
148
|
+
|
|
149
|
+
Keep the base sandbox cheap and attach a GPU only while the accelerated command runs.
|
|
150
|
+
Omit `--provider` to let Tangle choose the cheapest configured GPU cloud.
|
|
151
|
+
Always set a spend cap and lifetime.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Attach, run one command, and destroy the lease.
|
|
155
|
+
tangle sandbox gpu run sbx_123 \
|
|
156
|
+
--accelerator-kind nvidia-3090 \
|
|
157
|
+
--accelerator-memory 24000 \
|
|
158
|
+
--max-spend-usd 1 \
|
|
159
|
+
--max-lifetime 900 \
|
|
160
|
+
--idle-timeout 120 \
|
|
161
|
+
-- python eval.py
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
For multiple GPU commands, use the manual lifecycle:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
tangle sandbox gpu attach sbx_123 \
|
|
168
|
+
--accelerator-kind nvidia-3090 \
|
|
169
|
+
--accelerator-memory 24000 \
|
|
170
|
+
--max-spend-usd 1 \
|
|
171
|
+
--max-lifetime 900 \
|
|
172
|
+
--idle-timeout 120
|
|
173
|
+
|
|
174
|
+
tangle sandbox gpu list sbx_123
|
|
175
|
+
tangle sandbox gpu exec sbx_123 gpu_abc -- python eval.py
|
|
176
|
+
tangle sandbox gpu detach sbx_123 gpu_abc
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Create-time GPU flags are a shortcut over the same lease lifecycle:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
tangle sandbox create --name gpu-eval \
|
|
183
|
+
--accelerator-kind nvidia-3090 \
|
|
184
|
+
--accelerator-memory 24000 \
|
|
185
|
+
--gpu-max-spend-usd 1 \
|
|
186
|
+
--gpu-max-lifetime 900 \
|
|
187
|
+
--gpu-idle-timeout 120
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The final detach output includes billed seconds and customer cost.
|
|
191
|
+
Use `tangle usage` to inspect account-level GPU seconds and GPU spend.
|
|
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
|
+
|
|
134
221
|
## Provisioning Coverage
|
|
135
222
|
|
|
136
|
-
`tangle sandbox create`
|
|
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.
|
|
137
226
|
|
|
138
227
|
## Limitations
|
|
139
228
|
|
|
140
229
|
- `snapshot restore` creates a new sandbox from a snapshot; the command signature suggests in-place restore.
|
|
141
|
-
|
|
142
|
-
## Design Follow-Up
|
|
143
|
-
|
|
144
|
-
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
|
|
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
|
|
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`
|
|
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`
|
|
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.
|
|
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
|
|
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
|
|
|
@@ -67,7 +69,45 @@ tangle sandbox expose <id> --port 3000
|
|
|
67
69
|
tangle sandbox urls <id>
|
|
68
70
|
```
|
|
69
71
|
|
|
70
|
-
##
|
|
72
|
+
## Temporary GPUs
|
|
73
|
+
|
|
74
|
+
Use a normal sandbox first, then attach a GPU only for the work that needs it.
|
|
75
|
+
Omit `--provider` to use the cheapest configured GPU cloud.
|
|
76
|
+
Always set a spend cap and lifetime.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# One-shot eval: attach GPU, run command, always destroy the lease.
|
|
80
|
+
tangle sandbox gpu run <sandbox-id> \
|
|
81
|
+
--accelerator-kind nvidia-3090 \
|
|
82
|
+
--accelerator-memory 24000 \
|
|
83
|
+
--max-spend-usd 1 \
|
|
84
|
+
--max-lifetime 900 \
|
|
85
|
+
--idle-timeout 120 \
|
|
86
|
+
-- python eval.py
|
|
87
|
+
|
|
88
|
+
# Manual lifecycle when the agent needs multiple GPU commands.
|
|
89
|
+
tangle sandbox gpu attach <sandbox-id> \
|
|
90
|
+
--accelerator-kind nvidia-3090 \
|
|
91
|
+
--accelerator-memory 24000 \
|
|
92
|
+
--max-spend-usd 1 \
|
|
93
|
+
--max-lifetime 900 \
|
|
94
|
+
--idle-timeout 120
|
|
95
|
+
tangle sandbox gpu exec <sandbox-id> <gpu-lease-id> -- python eval.py
|
|
96
|
+
tangle sandbox gpu detach <sandbox-id> <gpu-lease-id>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
For fleets, put the same GPU lease cap on every worker:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
tangle fleet create --count 4 \
|
|
103
|
+
--accelerator-kind nvidia-3090 \
|
|
104
|
+
--accelerator-memory 24000 \
|
|
105
|
+
--gpu-max-spend-usd 1 \
|
|
106
|
+
--gpu-max-lifetime 900 \
|
|
107
|
+
--gpu-idle-timeout 120
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Full Hub Workflow
|
|
71
111
|
|
|
72
112
|
Hub lets agents use connected provider tools (GitHub, etc.) through Tangle without seeing provider OAuth tokens.
|
|
73
113
|
|
|
@@ -98,17 +138,17 @@ tangle hub tools sources --json
|
|
|
98
138
|
tangle hub tools search "github issues" --provider github --json
|
|
99
139
|
|
|
100
140
|
# Describe a tool to see input/output schemas
|
|
101
|
-
tangle hub tools describe github.issues.
|
|
141
|
+
tangle hub tools describe github.issues.search --json
|
|
102
142
|
```
|
|
103
143
|
|
|
104
144
|
### Tool Execution
|
|
105
145
|
|
|
106
|
-
Two equivalent commands
|
|
146
|
+
Two equivalent commands are available: `call` and `exec`.
|
|
107
147
|
|
|
108
148
|
```bash
|
|
109
149
|
# Basic call: <path tokens...> <json-input>
|
|
110
|
-
tangle hub call github issues
|
|
111
|
-
tangle hub exec github.issues.
|
|
150
|
+
tangle hub call github issues search '{"q":"repo:tangle-network/agent-dev-container is:issue"}'
|
|
151
|
+
tangle hub exec github.issues.search '{"q":"repo:tangle-network/agent-dev-container is:issue"}'
|
|
112
152
|
|
|
113
153
|
# With explicit connection
|
|
114
154
|
tangle hub call github issues createIssue '{"owner":"foo","repo":"bar","title":"Fix bug"}' --connection conn_xxx
|
|
@@ -116,7 +156,8 @@ tangle hub call github issues createIssue '{"owner":"foo","repo":"bar","title":"
|
|
|
116
156
|
|
|
117
157
|
### Policy & Approvals
|
|
118
158
|
|
|
119
|
-
Tools default to `ask` policy
|
|
159
|
+
Tools default to the `ask` policy.
|
|
160
|
+
They pause and require approval on first use.
|
|
120
161
|
|
|
121
162
|
```bash
|
|
122
163
|
# List pending approvals
|
|
@@ -125,7 +166,7 @@ tangle hub approvals approve <approval-id>
|
|
|
125
166
|
tangle hub approvals deny <approval-id>
|
|
126
167
|
|
|
127
168
|
# Set policy to always allow (skip future approvals)
|
|
128
|
-
tangle hub permissions set --connection conn_xxx --action github.issues.
|
|
169
|
+
tangle hub permissions set --connection conn_xxx --action github.issues.search --decision allow
|
|
129
170
|
|
|
130
171
|
# Set policy to always deny (block tool)
|
|
131
172
|
tangle hub permissions set --connection conn_xxx --action github.issues.deleteIssue --decision deny
|
|
@@ -172,20 +213,14 @@ tangle secret update DATABASE_URL "new-value"
|
|
|
172
213
|
tangle secret delete DATABASE_URL
|
|
173
214
|
```
|
|
174
215
|
|
|
175
|
-
## Snapshots
|
|
216
|
+
## Snapshots
|
|
176
217
|
|
|
177
218
|
```bash
|
|
178
|
-
# Snapshots (point-in-time for cloning/restoring)
|
|
179
219
|
tangle snapshot create <sandbox-id>
|
|
180
220
|
tangle snapshot list <sandbox-id>
|
|
181
221
|
tangle snapshot restore <sandbox-id> <snapshot-id> # creates new sandbox
|
|
182
222
|
tangle snapshot revert <sandbox-id> <snapshot-id> # reverts in-place
|
|
183
223
|
tangle snapshot delete <sandbox-id> <snapshot-id>
|
|
184
|
-
|
|
185
|
-
# Checkpoints (lightweight, local)
|
|
186
|
-
tangle checkpoint create <id>
|
|
187
|
-
tangle checkpoint list|ls <id>
|
|
188
|
-
tangle checkpoint delete|rm <id> <checkpoint-id>
|
|
189
224
|
```
|
|
190
225
|
|
|
191
226
|
## Templates
|
|
@@ -221,6 +256,12 @@ tangle team invitations [team] # List pending/historical invitations
|
|
|
221
256
|
|
|
222
257
|
## Workflows
|
|
223
258
|
|
|
259
|
+
Authenticate with the `sk-tan-*` API key (`TANGLE_API_KEY`), same as the other
|
|
260
|
+
platform commands, not a hub capability token.
|
|
261
|
+
|
|
262
|
+
Authoring a workflow (graph topology, guards, joins, KV state, decisions):
|
|
263
|
+
https://sandbox.tangle.tools/docs/workflows
|
|
264
|
+
|
|
224
265
|
```bash
|
|
225
266
|
tangle workflows validate workflow.yml
|
|
226
267
|
tangle workflows schema # print JSON Schema
|
|
@@ -228,7 +269,43 @@ tangle workflows create workflow.yml
|
|
|
228
269
|
tangle workflows list
|
|
229
270
|
tangle workflows get <id>
|
|
230
271
|
tangle workflows update <id> workflow.yml
|
|
272
|
+
tangle workflows enable <id>
|
|
273
|
+
tangle workflows disable <id>
|
|
231
274
|
tangle workflows delete <id>
|
|
275
|
+
|
|
276
|
+
# Templates
|
|
277
|
+
tangle workflows templates # starter gallery
|
|
278
|
+
tangle workflows init <template-id> # instantiate, print YAML
|
|
279
|
+
tangle workflows init <template-id> --param repo=o/r --file workflow.yml
|
|
280
|
+
|
|
281
|
+
# Revisions
|
|
282
|
+
tangle workflows revisions <id> # definition history
|
|
283
|
+
tangle workflows revision <id> <rev> # one revision's YAML
|
|
284
|
+
tangle workflows rollback <id> <rev> # restore a rev as the new head
|
|
285
|
+
|
|
286
|
+
# Runs
|
|
287
|
+
tangle workflows run <id> # trigger a run
|
|
288
|
+
tangle workflows run <id> --input pull_request.number=123 # with trigger inputs
|
|
289
|
+
tangle workflows run <id> --wait # wait + print result
|
|
290
|
+
tangle workflows runs <id> # run history
|
|
291
|
+
tangle workflows run-detail <id> <runId> # single-run detail
|
|
292
|
+
tangle workflows events <id> <runId> # tail live progress
|
|
293
|
+
tangle workflows cancel <id> <runId> # cancel a queued/running run
|
|
294
|
+
|
|
295
|
+
# Cross-run KV state
|
|
296
|
+
tangle workflows kv list <id>
|
|
297
|
+
tangle workflows kv get <id> <key>
|
|
298
|
+
tangle workflows kv set <id> <key> '{"cursor":123}'
|
|
299
|
+
tangle workflows kv set <id> <key> '{"cursor":123}' --cas 4 # compare-and-swap
|
|
300
|
+
tangle workflows kv delete <id> <key>
|
|
301
|
+
|
|
302
|
+
# Run artifacts
|
|
303
|
+
tangle workflows artifacts <id> <runId>
|
|
304
|
+
tangle workflows artifact-download <id> <runId> <artifactId> --out report.json
|
|
305
|
+
|
|
306
|
+
# Human decisions
|
|
307
|
+
tangle workflows decisions <id> # pending approvals
|
|
308
|
+
tangle workflows decision-resolve <id> <runId> --choice deploy
|
|
232
309
|
```
|
|
233
310
|
|
|
234
311
|
## Other Commands
|
|
@@ -257,6 +334,7 @@ tangle tools install <id> python 3.12
|
|
|
257
334
|
|
|
258
335
|
# Batch tasks across sandboxes
|
|
259
336
|
tangle batch run --tasks tasks.json
|
|
337
|
+
tangle batch run --tasks tasks.json --backend writer=opencode --backend reviewer=claude-code --stream
|
|
260
338
|
|
|
261
339
|
# Intelligence reports
|
|
262
340
|
tangle intelligence sandbox <id>
|
|
@@ -286,22 +364,23 @@ tangle permissions add <sandboxId> --userId <userId> --role editor
|
|
|
286
364
|
|
|
287
365
|
| Goal | Commands |
|
|
288
366
|
|------|----------|
|
|
289
|
-
| Spin up sandbox, run agent | `tangle sandbox create --name X` → `tangle agent
|
|
290
|
-
| Connect GitHub, read issues | `tangle hub connect github` → `tangle hub tools search "issues" --provider github` → `tangle hub call github issues
|
|
367
|
+
| Spin up sandbox, run agent | `tangle sandbox create --name X` → `tangle agent prompt <id> "..."` |
|
|
368
|
+
| 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"}'` |
|
|
291
369
|
| 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>` |
|
|
292
370
|
| Save and restore state | `tangle snapshot create <id>` → ...work... → `tangle snapshot revert <id> <snap-id>` |
|
|
293
371
|
| Set secret for agent use | `tangle secret create GITHUB_TOKEN "..."` → agent reads via `process.env.GITHUB_TOKEN` |
|
|
294
372
|
| Set hub permissions | `tangle hub permissions set --connection conn_xxx --action github.issues.createIssue --decision allow` |
|
|
295
|
-
| Batch parallel agent
|
|
373
|
+
| Batch parallel agent prompts | `tangle batch run --tasks tasks.json --backend primary=opencode` (array of `{id, message}`) |
|
|
374
|
+
| Compare backends on the same tasks | `tangle batch run --tasks tasks.json --backend writer=opencode --backend reviewer=claude-code --stream` |
|
|
296
375
|
|
|
297
376
|
## Common Mistakes
|
|
298
377
|
|
|
299
|
-
- **Forgetting `--reveal` on `secret show
|
|
300
|
-
- **Using API-key env and `TANGLE_HUB_CAPABILITY_TOKEN` together for hub
|
|
301
|
-
- **Calling hub tools without `--approve` on first use
|
|
302
|
-
- **Missing `--json`
|
|
303
|
-
- **`tangle hub exec` vs `tangle exec
|
|
304
|
-
- **`hub resume`
|
|
378
|
+
- **Forgetting `--reveal` on `secret show`:** values are hidden by default for safety.
|
|
379
|
+
- **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.
|
|
380
|
+
- **Calling hub tools without `--approve` on first use:** use `--approve` or set policy to `allow` first.
|
|
381
|
+
- **Missing `--json` when piping output:** many commands need explicit `--json` for machine-readable output.
|
|
382
|
+
- **`tangle hub exec` vs `tangle exec`:** `hub exec` runs hub tools; `exec` runs shell commands in a sandbox.
|
|
383
|
+
- **`hub resume` does not replay:** after `hub resume --accept`, rerun the original `hub exec` with `--approve`.
|
|
305
384
|
|
|
306
385
|
## Token Safety
|
|
307
386
|
|