opensandbox-cli 0.1.0.dev1__tar.gz → 0.1.1__tar.gz
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.
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/.gitignore +2 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/PKG-INFO +233 -230
- opensandbox_cli-0.1.1/README.md +383 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/pyproject.toml +3 -3
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/client.py +25 -70
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/command.py +92 -36
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/config_cmd.py +73 -35
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/devops.py +34 -8
- opensandbox_cli-0.1.1/src/opensandbox_cli/commands/diagnostics.py +129 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/egress.py +12 -3
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/file.py +109 -27
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/sandbox.py +277 -38
- opensandbox_cli-0.1.1/src/opensandbox_cli/commands/skills.py +775 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/config.py +1 -8
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/main.py +39 -21
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/output.py +24 -0
- opensandbox_cli-0.1.1/src/opensandbox_cli/skill_registry.py +184 -0
- opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-command-execution.md +215 -0
- opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-file-operations.md +244 -0
- opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-network-egress.md +179 -0
- opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-sandbox-lifecycle.md +305 -0
- opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-sandbox-troubleshooting.md +202 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/utils.py +68 -1
- opensandbox_cli-0.1.0.dev1/README.md +0 -380
- opensandbox_cli-0.1.0.dev1/src/opensandbox_cli/commands/skills.py +0 -248
- opensandbox_cli-0.1.0.dev1/src/opensandbox_cli/skills/opensandbox-troubleshoot.md +0 -112
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/LICENSE +0 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/__init__.py +0 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/__main__.py +0 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/__init__.py +0 -0
- {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: opensandbox-cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: OpenSandbox CLI - Command-line interface for managing sandboxes
|
|
5
5
|
Project-URL: Homepage, https://open-sandbox.ai
|
|
6
6
|
Project-URL: Repository, https://github.com/alibaba/OpenSandbox
|
|
@@ -224,7 +224,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
224
224
|
Classifier: Typing :: Typed
|
|
225
225
|
Requires-Python: >=3.10
|
|
226
226
|
Requires-Dist: click<9.0,>=8.1.0
|
|
227
|
-
Requires-Dist: opensandbox<0.2.0,>=0.1.
|
|
227
|
+
Requires-Dist: opensandbox<0.2.0,>=0.1.9
|
|
228
228
|
Requires-Dist: pyyaml<7.0,>=6.0
|
|
229
229
|
Requires-Dist: rich<14.0,>=13.0.0
|
|
230
230
|
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
|
|
@@ -232,335 +232,358 @@ Description-Content-Type: text/markdown
|
|
|
232
232
|
|
|
233
233
|
# OpenSandbox CLI
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
`osb` is the command-line interface for OpenSandbox. It is built for the common day-to-day flows:
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
- create and manage sandboxes
|
|
238
|
+
- run commands inside a sandbox
|
|
239
|
+
- read and modify sandbox files
|
|
240
|
+
- inspect runtime egress policy
|
|
241
|
+
- collect low-level diagnostics
|
|
242
|
+
- install OpenSandbox-specific skills for coding agents
|
|
238
243
|
|
|
239
|
-
|
|
244
|
+
It uses the OpenSandbox Python SDK under the hood and is intended to be the shortest path from a terminal to a working sandbox workflow.
|
|
245
|
+
|
|
246
|
+
## Install
|
|
247
|
+
|
|
248
|
+
Choose one:
|
|
240
249
|
|
|
241
250
|
```bash
|
|
242
251
|
pip install opensandbox-cli
|
|
243
252
|
```
|
|
244
253
|
|
|
245
|
-
### uv
|
|
246
|
-
|
|
247
254
|
```bash
|
|
248
255
|
uv tool install opensandbox-cli
|
|
249
256
|
```
|
|
250
257
|
|
|
251
|
-
### pipx (recommended for global CLI usage)
|
|
252
|
-
|
|
253
258
|
```bash
|
|
254
259
|
pipx install opensandbox-cli
|
|
255
260
|
```
|
|
256
261
|
|
|
257
|
-
|
|
262
|
+
Confirm the install:
|
|
258
263
|
|
|
259
264
|
```bash
|
|
260
265
|
osb --help
|
|
266
|
+
osb --version
|
|
261
267
|
```
|
|
262
268
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
## Quick Start
|
|
266
|
-
|
|
267
|
-
### Step 0: Start the OpenSandbox Server
|
|
269
|
+
## Before You Start
|
|
268
270
|
|
|
269
|
-
|
|
271
|
+
Make sure an OpenSandbox server is reachable. If you are running locally, start the server first and then point the CLI at it.
|
|
270
272
|
|
|
271
273
|
```bash
|
|
272
274
|
opensandbox-server
|
|
273
275
|
```
|
|
274
276
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
### Step 1: Install the CLI
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
cd cli
|
|
281
|
-
uv sync
|
|
282
|
-
uv run osb --help
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-

|
|
277
|
+
## Quick Start
|
|
286
278
|
|
|
287
|
-
###
|
|
279
|
+
### 1. Initialize config
|
|
288
280
|
|
|
289
281
|
```bash
|
|
290
282
|
osb config init
|
|
291
283
|
osb config set connection.domain localhost:8080
|
|
292
284
|
osb config set connection.protocol http
|
|
285
|
+
osb config show -o json
|
|
293
286
|
```
|
|
294
287
|
|
|
295
|
-
|
|
288
|
+
If you want a non-default config file, choose it at the root command level for the whole invocation:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
osb --config /tmp/dev.toml config init
|
|
292
|
+
osb --config /tmp/dev.toml config set connection.domain localhost:8080
|
|
293
|
+
osb --config /tmp/dev.toml config show -o json
|
|
294
|
+
```
|
|
296
295
|
|
|
297
|
-
###
|
|
296
|
+
### 2. Create a sandbox
|
|
298
297
|
|
|
299
298
|
```bash
|
|
300
|
-
osb sandbox create --image python:3.12
|
|
299
|
+
osb sandbox create --image python:3.12 --timeout 30m -o json
|
|
301
300
|
```
|
|
302
301
|
|
|
303
|
-
|
|
302
|
+
If you set defaults first, later create commands can be shorter:
|
|
304
303
|
|
|
305
304
|
```bash
|
|
306
305
|
osb config set defaults.image python:3.12
|
|
307
|
-
osb config set defaults.timeout
|
|
308
|
-
osb sandbox create
|
|
306
|
+
osb config set defaults.timeout 30m
|
|
307
|
+
osb sandbox create -o json
|
|
309
308
|
```
|
|
310
309
|
|
|
311
|
-
|
|
310
|
+
### 3. Verify it is usable
|
|
312
311
|
|
|
313
312
|
```bash
|
|
314
|
-
osb sandbox
|
|
315
|
-
|
|
316
|
-
--network-policy-file network-policy.json \
|
|
317
|
-
--volumes-file volumes.json
|
|
313
|
+
osb sandbox get <sandbox-id> -o json
|
|
314
|
+
osb sandbox health <sandbox-id> -o json
|
|
318
315
|
```
|
|
319
316
|
|
|
320
|
-
|
|
317
|
+
### 4. Run a command inside the sandbox
|
|
321
318
|
|
|
322
|
-
|
|
319
|
+
Use `--` before the sandbox command payload.
|
|
323
320
|
|
|
324
321
|
```bash
|
|
325
|
-
|
|
326
|
-
osb sandbox list
|
|
327
|
-
|
|
328
|
-
# JSON output for scripting
|
|
329
|
-
osb -o json sandbox list
|
|
322
|
+
osb command run <sandbox-id> -o raw -- python -c "print(1 + 1)"
|
|
330
323
|
```
|
|
331
324
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-

|
|
325
|
+
### 5. Read or write a file
|
|
335
326
|
|
|
336
|
-
|
|
327
|
+
```bash
|
|
328
|
+
osb file write <sandbox-id> /workspace/hello.txt -c "hello" -o json
|
|
329
|
+
osb file cat <sandbox-id> /workspace/hello.txt -o raw
|
|
330
|
+
```
|
|
337
331
|
|
|
338
|
-
|
|
332
|
+
### 6. Clean up
|
|
339
333
|
|
|
340
334
|
```bash
|
|
341
|
-
|
|
342
|
-
osb sandbox get db027570-4f86-45f8-b1a8-c31a2dd90da8
|
|
343
|
-
|
|
344
|
-
# Short prefix — as long as it's unambiguous
|
|
345
|
-
osb sandbox get db02
|
|
346
|
-
osb exec db02 -- echo "hello"
|
|
335
|
+
osb sandbox kill <sandbox-id> -o json
|
|
347
336
|
```
|
|
348
337
|
|
|
349
|
-
|
|
338
|
+
## Common Tasks
|
|
350
339
|
|
|
351
|
-
|
|
340
|
+
### Create sandboxes
|
|
352
341
|
|
|
353
|
-
|
|
342
|
+
Basic:
|
|
354
343
|
|
|
355
344
|
```bash
|
|
356
|
-
osb
|
|
357
|
-
osb exec <sandbox-id> -- python -c "print(1+1)"
|
|
345
|
+
osb sandbox create --image python:3.12
|
|
358
346
|
```
|
|
359
347
|
|
|
360
|
-
|
|
348
|
+
Private image:
|
|
361
349
|
|
|
362
|
-
|
|
350
|
+
```bash
|
|
351
|
+
osb sandbox create \
|
|
352
|
+
--image my-registry.example.com/team/app:latest \
|
|
353
|
+
--image-auth-username alice \
|
|
354
|
+
--image-auth-password <token>
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
Manual cleanup mode:
|
|
363
358
|
|
|
364
359
|
```bash
|
|
365
|
-
|
|
366
|
-
|
|
360
|
+
osb sandbox create --image python:3.12 --timeout none
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
Explicit entrypoint argv:
|
|
367
364
|
|
|
368
|
-
|
|
369
|
-
osb
|
|
365
|
+
```bash
|
|
366
|
+
osb sandbox create \
|
|
367
|
+
--image python:3.12 \
|
|
368
|
+
--entrypoint python \
|
|
369
|
+
--entrypoint -m \
|
|
370
|
+
--entrypoint http.server
|
|
370
371
|
```
|
|
371
372
|
|
|
372
|
-
|
|
373
|
+
Create with network policy and volumes:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
osb sandbox create \
|
|
377
|
+
--image python:3.12 \
|
|
378
|
+
--network-policy-file network-policy.json \
|
|
379
|
+
--volumes-file volumes.json
|
|
380
|
+
```
|
|
373
381
|
|
|
374
|
-
###
|
|
382
|
+
### List and inspect sandboxes
|
|
375
383
|
|
|
376
384
|
```bash
|
|
377
|
-
osb sandbox kill <sandbox-id>
|
|
378
385
|
osb sandbox list
|
|
386
|
+
osb sandbox list -o json
|
|
387
|
+
osb sandbox list --state running --state paused
|
|
388
|
+
osb sandbox get <sandbox-id> -o json
|
|
389
|
+
osb sandbox metrics <sandbox-id>
|
|
390
|
+
osb sandbox metrics <sandbox-id> --watch -o raw
|
|
379
391
|
```
|
|
380
392
|
|
|
381
|
-
|
|
393
|
+
### Expose a service
|
|
382
394
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
395
|
+
```bash
|
|
396
|
+
osb sandbox endpoint <sandbox-id> --port 8080 -o json
|
|
397
|
+
```
|
|
386
398
|
|
|
387
|
-
|
|
388
|
-
| ---------- | ------------------------------------------- |
|
|
389
|
-
| `create` | Create a new sandbox |
|
|
390
|
-
| `list` | List sandboxes (with optional filters) |
|
|
391
|
-
| `get` | Get sandbox details by ID |
|
|
392
|
-
| `kill` | Terminate one or more sandboxes |
|
|
393
|
-
| `pause` | Pause a running sandbox |
|
|
394
|
-
| `resume` | Resume a paused sandbox |
|
|
395
|
-
| `renew` | Renew sandbox expiration |
|
|
396
|
-
| `endpoint` | Get public endpoint for a sandbox port |
|
|
397
|
-
| `health` | Check sandbox health |
|
|
398
|
-
| `metrics` | Get sandbox resource metrics (CPU, memory) |
|
|
399
|
+
### Run commands
|
|
399
400
|
|
|
400
|
-
|
|
401
|
+
Foreground streaming:
|
|
401
402
|
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
| `status` | Get command execution status |
|
|
406
|
-
| `logs` | Get background command logs |
|
|
407
|
-
| `interrupt` | Interrupt a running command |
|
|
408
|
-
| `session` | Manage persistent bash sessions |
|
|
403
|
+
```bash
|
|
404
|
+
osb command run <sandbox-id> -o raw -- sh -lc 'echo ready'
|
|
405
|
+
```
|
|
409
406
|
|
|
410
|
-
|
|
407
|
+
Tracked background execution:
|
|
411
408
|
|
|
412
409
|
```bash
|
|
413
|
-
osb
|
|
410
|
+
osb command run <sandbox-id> --background -o json -- sh -c "sleep 10; echo done"
|
|
411
|
+
osb command status <sandbox-id> <execution-id> -o json
|
|
412
|
+
osb command logs <sandbox-id> <execution-id> -o json
|
|
414
413
|
```
|
|
415
414
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
Persistent shell sessions:
|
|
415
|
+
Persistent shell session:
|
|
419
416
|
|
|
420
417
|
```bash
|
|
421
|
-
|
|
422
|
-
osb command session
|
|
418
|
+
osb command session create <sandbox-id> --workdir /workspace -o json
|
|
419
|
+
osb command session run <sandbox-id> <session-id> -o raw -- pwd
|
|
420
|
+
osb command session run <sandbox-id> <session-id> -o raw -- export FOO=bar
|
|
421
|
+
osb command session run <sandbox-id> <session-id> -o raw -- sh -c 'echo $FOO'
|
|
422
|
+
osb command session delete <sandbox-id> <session-id> -o json
|
|
423
|
+
```
|
|
423
424
|
|
|
424
|
-
|
|
425
|
-
osb command session run <sandbox-id> <session-id> -- pwd
|
|
426
|
-
osb command session run <sandbox-id> <session-id> -- export FOO=bar
|
|
427
|
-
osb command session run <sandbox-id> <session-id> -- sh -c 'echo $FOO'
|
|
425
|
+
### Work with files
|
|
428
426
|
|
|
429
|
-
|
|
430
|
-
osb
|
|
427
|
+
```bash
|
|
428
|
+
osb file upload <sandbox-id> ./local.txt /workspace/local.txt -o json
|
|
429
|
+
osb file download <sandbox-id> /workspace/result.json ./result.json -o json
|
|
430
|
+
osb file search <sandbox-id> /workspace --pattern "*.py" -o json
|
|
431
|
+
osb file info <sandbox-id> /workspace/main.py -o json
|
|
432
|
+
osb file replace <sandbox-id> /workspace/app.py --old old --new new -o json
|
|
433
|
+
osb file chmod <sandbox-id> /workspace/script.sh --mode 755 -o json
|
|
431
434
|
```
|
|
432
435
|
|
|
433
|
-
###
|
|
436
|
+
### Manage runtime egress policy
|
|
434
437
|
|
|
435
|
-
|
|
436
|
-
| ---------- | ------------------------------------------ |
|
|
437
|
-
| `cat` | Read file contents |
|
|
438
|
-
| `write` | Write content to a file |
|
|
439
|
-
| `upload` | Upload a local file to the sandbox |
|
|
440
|
-
| `download` | Download a file from the sandbox |
|
|
441
|
-
| `rm` | Delete files |
|
|
442
|
-
| `mv` | Move or rename a file |
|
|
443
|
-
| `mkdir` | Create directories |
|
|
444
|
-
| `rmdir` | Remove directories |
|
|
445
|
-
| `search` | Search for files by pattern |
|
|
446
|
-
| `info` | Get file/directory metadata |
|
|
447
|
-
| `chmod` | Set file permissions |
|
|
448
|
-
| `replace` | Find and replace content in a file |
|
|
438
|
+
Inspect current policy:
|
|
449
439
|
|
|
450
|
-
|
|
440
|
+
```bash
|
|
441
|
+
osb egress get <sandbox-id> -o json
|
|
442
|
+
```
|
|
451
443
|
|
|
452
|
-
|
|
453
|
-
| ------- | ---------------------------------------- |
|
|
454
|
-
| `get` | Get the current runtime egress policy |
|
|
455
|
-
| `patch` | Patch runtime egress rules with merge semantics |
|
|
444
|
+
Patch specific rules:
|
|
456
445
|
|
|
457
446
|
```bash
|
|
458
|
-
|
|
459
|
-
|
|
447
|
+
osb egress patch <sandbox-id> --rule allow=pypi.org --rule deny=internal.example.com -o json
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
If you are debugging connectivity, verify behavior with an actual command:
|
|
460
451
|
|
|
461
|
-
|
|
462
|
-
osb
|
|
452
|
+
```bash
|
|
453
|
+
osb command run <sandbox-id> -o raw -- curl -I https://pypi.org
|
|
463
454
|
```
|
|
464
455
|
|
|
465
|
-
###
|
|
456
|
+
### Collect diagnostics
|
|
466
457
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
458
|
+
Use the stable diagnostics commands for API-backed log and event descriptors.
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
osb diagnostics events <sandbox-id> --scope lifecycle -o raw
|
|
462
|
+
osb diagnostics events <sandbox-id> --scope runtime -o raw
|
|
463
|
+
osb diagnostics logs <sandbox-id> --scope container -o raw
|
|
464
|
+
osb diagnostics logs <sandbox-id> --scope lifecycle -o json
|
|
465
|
+
osb diagnostics events <sandbox-id> --scope runtime -o json
|
|
466
|
+
osb diagnostics logs <sandbox-id> --scope container -o yaml
|
|
467
|
+
```
|
|
473
468
|
|
|
474
|
-
|
|
469
|
+
`--scope` is required for stable diagnostics. Common scopes are `lifecycle` and
|
|
470
|
+
`container` for logs, and `lifecycle` and `runtime` for events. Raw output
|
|
471
|
+
prints inline diagnostic text, or the content URL when diagnostics are
|
|
472
|
+
delivered as a temporary URL. Structured CLI output follows the SDK/Python field
|
|
473
|
+
style, for example `content_url`, `content_length`, and `expires_at`.
|
|
474
|
+
Some server builds may return `DIAGNOSTICS_NOT_IMPLEMENTED` for scoped
|
|
475
|
+
diagnostics until the stable backend implementation is enabled.
|
|
476
|
+
|
|
477
|
+
Legacy DevOps diagnostics remain experimental. Prefer `osb diagnostics logs/events`
|
|
478
|
+
for stable API-backed log and event collection.
|
|
475
479
|
|
|
476
480
|
```bash
|
|
477
|
-
|
|
478
|
-
osb devops summary <sandbox-id>
|
|
481
|
+
osb devops inspect <sandbox-id> -o raw
|
|
482
|
+
osb devops summary <sandbox-id> -o raw
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
## Output Formats
|
|
479
486
|
|
|
480
|
-
|
|
481
|
-
osb devops logs <sandbox-id> --tail 500
|
|
487
|
+
Output selection is command-scoped, not global.
|
|
482
488
|
|
|
483
|
-
|
|
484
|
-
|
|
489
|
+
- `table`: human-readable tables and panels
|
|
490
|
+
- `json`: machine-readable JSON
|
|
491
|
+
- `yaml`: machine-readable YAML
|
|
492
|
+
- `raw`: unformatted text or streaming output
|
|
485
493
|
|
|
486
|
-
|
|
487
|
-
osb devops inspect <sandbox-id>
|
|
494
|
+
Examples:
|
|
488
495
|
|
|
489
|
-
|
|
490
|
-
osb
|
|
496
|
+
```bash
|
|
497
|
+
osb sandbox list -o json
|
|
498
|
+
osb sandbox list -o yaml
|
|
499
|
+
osb file cat <sandbox-id> /workspace/hello.txt -o raw
|
|
491
500
|
```
|
|
492
501
|
|
|
493
|
-
|
|
502
|
+
Not every command supports every format. Use `--help` on the specific command when in doubt.
|
|
503
|
+
|
|
504
|
+
## Command Groups
|
|
494
505
|
|
|
495
|
-
|
|
506
|
+
The main command groups are:
|
|
496
507
|
|
|
497
|
-
|
|
508
|
+
- `osb sandbox`: lifecycle management
|
|
509
|
+
- `osb command`: command execution and persistent sessions
|
|
510
|
+
- `osb file`: file and directory operations
|
|
511
|
+
- `osb egress`: runtime egress policy
|
|
512
|
+
- `osb diagnostics`: stable diagnostics logs and events
|
|
513
|
+
- `osb devops`: experimental legacy diagnostics
|
|
514
|
+
- `osb config`: local CLI configuration
|
|
515
|
+
- `osb skills`: bundled skills for AI tools
|
|
498
516
|
|
|
499
|
-
|
|
517
|
+
Explore them directly:
|
|
500
518
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
519
|
+
```bash
|
|
520
|
+
osb sandbox --help
|
|
521
|
+
osb command --help
|
|
522
|
+
osb file --help
|
|
523
|
+
osb skills --help
|
|
524
|
+
```
|
|
506
525
|
|
|
507
|
-
|
|
526
|
+
## Agent Skills
|
|
508
527
|
|
|
509
|
-
|
|
510
|
-
| --------- | ---------------- | ---------------- |
|
|
511
|
-
| `claude` | Claude Code | `~/.claude/skills/` |
|
|
512
|
-
| `cursor` | Cursor | `~/.cursor/rules/` |
|
|
513
|
-
| `codex` | Codex | `~/.codex/instructions.md` |
|
|
514
|
-
| `copilot` | GitHub Copilot | `~/.github/copilot-instructions.md` |
|
|
515
|
-
| `windsurf`| Windsurf | `~/.windsurfrules` |
|
|
516
|
-
| `cline` | Cline | `~/.clinerules` |
|
|
528
|
+
The CLI ships with built-in OpenSandbox skills for coding agents and agent-oriented tools.
|
|
517
529
|
|
|
518
|
-
|
|
519
|
-
# Install for Claude Code (default)
|
|
520
|
-
osb skills install
|
|
530
|
+
Bundled skills:
|
|
521
531
|
|
|
522
|
-
|
|
523
|
-
|
|
532
|
+
- `sandbox-lifecycle`
|
|
533
|
+
- `command-execution`
|
|
534
|
+
- `file-operations`
|
|
535
|
+
- `network-egress`
|
|
536
|
+
- `sandbox-troubleshooting`
|
|
524
537
|
|
|
525
|
-
|
|
526
|
-
osb skills install --target all
|
|
538
|
+
Supported targets:
|
|
527
539
|
|
|
528
|
-
|
|
529
|
-
|
|
540
|
+
| Target | Install location |
|
|
541
|
+
| --- | --- |
|
|
542
|
+
| `claude` | `./.claude/skills/` or `~/.claude/skills/` |
|
|
543
|
+
| `cursor` | `./.cursor/rules/` or `~/.cursor/rules/` |
|
|
544
|
+
| `codex` | `./.codex/skills/<name>/SKILL.md` or `~/.codex/skills/<name>/SKILL.md` |
|
|
545
|
+
| `copilot` | `./.github/copilot-instructions.md` or `~/.github/copilot-instructions.md` |
|
|
546
|
+
| `windsurf` | `./.windsurfrules` or `~/.windsurfrules` |
|
|
547
|
+
| `cline` | `./.clinerules` or `~/.clinerules` |
|
|
548
|
+
| `opencode` | `./.agents/skills/<name>/SKILL.md` or `~/.agents/skills/<name>/SKILL.md` |
|
|
530
549
|
|
|
531
|
-
|
|
532
|
-
osb skills uninstall --target claude
|
|
533
|
-
```
|
|
550
|
+
Common flows:
|
|
534
551
|
|
|
535
|
-
|
|
552
|
+
```bash
|
|
553
|
+
osb skills list
|
|
554
|
+
osb skills show sandbox-lifecycle
|
|
555
|
+
osb skills install sandbox-lifecycle --target codex --scope project
|
|
556
|
+
osb skills install --all-builtins --target codex --scope global
|
|
557
|
+
osb skills uninstall sandbox-troubleshooting --target claude --scope global
|
|
558
|
+
```
|
|
536
559
|
|
|
537
|
-
|
|
538
|
-
| ------- | ------------------------------------------ |
|
|
539
|
-
| `init` | Create a default config file |
|
|
540
|
-
| `show` | Show resolved configuration |
|
|
560
|
+
For scripts or agents, use structured output:
|
|
541
561
|
|
|
542
|
-
|
|
562
|
+
```bash
|
|
563
|
+
osb skills install sandbox-lifecycle --target codex --scope project -o json
|
|
564
|
+
```
|
|
543
565
|
|
|
544
|
-
|
|
566
|
+
## Configuration Model
|
|
545
567
|
|
|
546
|
-
|
|
547
|
-
2. **Environment variables** — `OPEN_SANDBOX_API_KEY`, `OPEN_SANDBOX_DOMAIN`, `OPEN_SANDBOX_PROTOCOL`, `OPEN_SANDBOX_REQUEST_TIMEOUT`, `OPEN_SANDBOX_OUTPUT`
|
|
548
|
-
3. **Config file** — `~/.opensandbox/config.toml` (or path specified via `--config`)
|
|
549
|
-
4. **SDK defaults**
|
|
568
|
+
The CLI resolves configuration in this order:
|
|
550
569
|
|
|
551
|
-
|
|
570
|
+
1. root CLI flags such as `--api-key`, `--domain`, `--protocol`, `--request-timeout`, `--config`
|
|
571
|
+
2. environment variables such as `OPEN_SANDBOX_API_KEY` and `OPEN_SANDBOX_DOMAIN`
|
|
572
|
+
3. config file, defaulting to `~/.opensandbox/config.toml`
|
|
573
|
+
4. SDK defaults
|
|
552
574
|
|
|
553
|
-
|
|
575
|
+
Config commands:
|
|
554
576
|
|
|
555
577
|
```bash
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
578
|
+
osb config init
|
|
579
|
+
osb config show
|
|
580
|
+
osb config set connection.domain localhost:8080
|
|
581
|
+
osb config set connection.protocol http
|
|
582
|
+
osb config set defaults.image python:3.12
|
|
583
|
+
osb config set defaults.timeout 30m
|
|
559
584
|
```
|
|
560
585
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
### Config File Format
|
|
586
|
+
Example config file:
|
|
564
587
|
|
|
565
588
|
```toml
|
|
566
589
|
[connection]
|
|
@@ -568,45 +591,25 @@ api_key = "your-api-key"
|
|
|
568
591
|
domain = "localhost:8080"
|
|
569
592
|
protocol = "http"
|
|
570
593
|
request_timeout = 30
|
|
594
|
+
use_server_proxy = false
|
|
571
595
|
|
|
572
596
|
[output]
|
|
573
|
-
format = "table" # table | json | yaml
|
|
574
597
|
color = true
|
|
575
598
|
|
|
576
599
|
[defaults]
|
|
577
|
-
image = "python:3.
|
|
578
|
-
timeout = "
|
|
600
|
+
image = "python:3.12"
|
|
601
|
+
timeout = "30m"
|
|
579
602
|
```
|
|
580
603
|
|
|
581
|
-
##
|
|
582
|
-
|
|
583
|
-
| Option | Description |
|
|
584
|
-
| ----------------------------- | -------------------------------- |
|
|
585
|
-
| `--api-key TEXT` | API key for authentication |
|
|
586
|
-
| `--domain TEXT` | API server domain |
|
|
587
|
-
| `--protocol [http\|https]` | Protocol |
|
|
588
|
-
| `--timeout INTEGER` | Request timeout in seconds |
|
|
589
|
-
| `-o, --output [table\|json\|yaml]` | Output format |
|
|
590
|
-
| `--config PATH` | Config file path |
|
|
591
|
-
| `-v, --verbose` | Enable debug output |
|
|
592
|
-
| `--no-color` | Disable colored output |
|
|
593
|
-
| `--version` | Show version |
|
|
594
|
-
|
|
595
|
-
## Output Formats
|
|
596
|
-
|
|
597
|
-
The CLI supports three output formats via the `-o` / `--output` flag:
|
|
604
|
+
## Development
|
|
598
605
|
|
|
599
|
-
|
|
600
|
-
- **`json`** — Machine-readable JSON
|
|
601
|
-
- **`yaml`** — YAML output
|
|
606
|
+
For local development in this monorepo:
|
|
602
607
|
|
|
603
608
|
```bash
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
osb -o json sandbox list
|
|
609
|
-
|
|
610
|
-
# YAML
|
|
611
|
-
osb -o yaml sandbox list
|
|
609
|
+
cd cli
|
|
610
|
+
uv sync
|
|
611
|
+
uv run osb --help
|
|
612
|
+
uv run pytest
|
|
612
613
|
```
|
|
614
|
+
|
|
615
|
+
This repository uses a local `uv` source override for the OpenSandbox Python SDK, so running from `cli/` will resolve against the checked-out SDK in the monorepo.
|