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.
Files changed (31) hide show
  1. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/.gitignore +2 -0
  2. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/PKG-INFO +233 -230
  3. opensandbox_cli-0.1.1/README.md +383 -0
  4. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/pyproject.toml +3 -3
  5. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/client.py +25 -70
  6. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/command.py +92 -36
  7. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/config_cmd.py +73 -35
  8. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/devops.py +34 -8
  9. opensandbox_cli-0.1.1/src/opensandbox_cli/commands/diagnostics.py +129 -0
  10. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/egress.py +12 -3
  11. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/file.py +109 -27
  12. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/sandbox.py +277 -38
  13. opensandbox_cli-0.1.1/src/opensandbox_cli/commands/skills.py +775 -0
  14. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/config.py +1 -8
  15. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/main.py +39 -21
  16. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/output.py +24 -0
  17. opensandbox_cli-0.1.1/src/opensandbox_cli/skill_registry.py +184 -0
  18. opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-command-execution.md +215 -0
  19. opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-file-operations.md +244 -0
  20. opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-network-egress.md +179 -0
  21. opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-sandbox-lifecycle.md +305 -0
  22. opensandbox_cli-0.1.1/src/opensandbox_cli/skills/opensandbox-sandbox-troubleshooting.md +202 -0
  23. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/utils.py +68 -1
  24. opensandbox_cli-0.1.0.dev1/README.md +0 -380
  25. opensandbox_cli-0.1.0.dev1/src/opensandbox_cli/commands/skills.py +0 -248
  26. opensandbox_cli-0.1.0.dev1/src/opensandbox_cli/skills/opensandbox-troubleshoot.md +0 -112
  27. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/LICENSE +0 -0
  28. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/__init__.py +0 -0
  29. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/__main__.py +0 -0
  30. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/commands/__init__.py +0 -0
  31. {opensandbox_cli-0.1.0.dev1 → opensandbox_cli-0.1.1}/src/opensandbox_cli/py.typed +0 -0
@@ -274,3 +274,5 @@ kubernetes/test/kind/gvisor/runsc
274
274
  kubernetes/test/kind/gvisor/containerd-shim-runsc-v1
275
275
  bin/
276
276
  obj/
277
+
278
+ .qoder/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: opensandbox-cli
3
- Version: 0.1.0.dev1
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.5
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
- A command-line interface for managing OpenSandbox environments from your terminal. Built on top of the [OpenSandbox Python SDK](../sdks/sandbox/python/README.md), the CLI provides intuitive commands for sandbox lifecycle management, file operations, command execution, and diagnostics.
235
+ `osb` is the command-line interface for OpenSandbox. It is built for the common day-to-day flows:
236
236
 
237
- ## Installation
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
- ### pip
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
- ## Overview
262
+ Confirm the install:
258
263
 
259
264
  ```bash
260
265
  osb --help
266
+ osb --version
261
267
  ```
262
268
 
263
- ![CLI Help](assets/cli_help.png)
264
-
265
- ## Quick Start
266
-
267
- ### Step 0: Start the OpenSandbox Server
269
+ ## Before You Start
268
270
 
269
- Before using the CLI, make sure the OpenSandbox server is running. See the root [README.md](../README.md) for startup instructions.
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
- ![Start OpenSandbox Server](assets/start_opensandbox_server.png)
276
-
277
- ### Step 1: Install the CLI
278
-
279
- ```bash
280
- cd cli
281
- uv sync
282
- uv run osb --help
283
- ```
284
-
285
- ![Install CLI](assets/install_cli.png)
277
+ ## Quick Start
286
278
 
287
- ### Step 2: Initialize Configuration
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
- ![Init CLI](assets/init_cli.png)
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
- ### Step 3: Create a Sandbox
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
- Or configure defaults once and omit repeated flags:
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 15m
308
- osb sandbox create
306
+ osb config set defaults.timeout 30m
307
+ osb sandbox create -o json
309
308
  ```
310
309
 
311
- You can also load network policy and volume mounts from JSON files:
310
+ ### 3. Verify it is usable
312
311
 
313
312
  ```bash
314
- osb sandbox create \
315
- --image python:3.12 \
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
- ![Create Sandbox](assets/cli_create_sandbox.png)
317
+ ### 4. Run a command inside the sandbox
321
318
 
322
- ### Step 4: List Sandboxes
319
+ Use `--` before the sandbox command payload.
323
320
 
324
321
  ```bash
325
- # Table output (default)
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
- ![List Sandboxes](assets/cli_list_sandbox.png)
333
-
334
- ![List Sandboxes JSON](assets/cli_list_sandbox_json.png)
325
+ ### 5. Read or write a file
335
326
 
336
- ### Short ID Matching
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
- Like Docker, you don't need to type the full sandbox ID — just enough characters to uniquely identify the target sandbox:
332
+ ### 6. Clean up
339
333
 
340
334
  ```bash
341
- # Full ID
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
- If the prefix matches multiple sandboxes, the CLI will report an error listing the matches so you can be more specific.
338
+ ## Common Tasks
350
339
 
351
- ![Short ID Matching](assets/cli_sandbox_search.png)
340
+ ### Create sandboxes
352
341
 
353
- ### Step 5: Execute Commands
342
+ Basic:
354
343
 
355
344
  ```bash
356
- osb exec <sandbox-id> -- echo "hello world"
357
- osb exec <sandbox-id> -- python -c "print(1+1)"
345
+ osb sandbox create --image python:3.12
358
346
  ```
359
347
 
360
- ![Execute Commands](assets/cli_sandbox_exec.png)
348
+ Private image:
361
349
 
362
- ### Step 6: File Operations
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
- # Write a file
366
- osb file write <sandbox-id> /tmp/test.txt -c "hello"
360
+ osb sandbox create --image python:3.12 --timeout none
361
+ ```
362
+
363
+ Explicit entrypoint argv:
367
364
 
368
- # Read it back
369
- osb file cat <sandbox-id> /tmp/test.txt
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
- ![File Operations](assets/cli_sandbox_file.png)
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
- ### Step 7: Cleanup
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
- ![Kill Sandbox](assets/cli_kill_sandbox.png)
393
+ ### Expose a service
382
394
 
383
- ## Command Reference
384
-
385
- ### `osb sandbox` — Lifecycle Management
395
+ ```bash
396
+ osb sandbox endpoint <sandbox-id> --port 8080 -o json
397
+ ```
386
398
 
387
- | Command | Description |
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
- ### `osb command` — Command Execution
401
+ Foreground streaming:
401
402
 
402
- | Command | Description |
403
- | ----------- | ----------------------------------------- |
404
- | `run` | Run a shell command in the sandbox |
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
- ### `osb exec` — Quick Command Shortcut
407
+ Tracked background execution:
411
408
 
412
409
  ```bash
413
- osb exec <sandbox-id> -- <command>
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
- Shortcut for `osb command run`. Everything after `--` is passed as the command.
417
-
418
- Persistent shell sessions:
415
+ Persistent shell session:
419
416
 
420
417
  ```bash
421
- # Create a bash session
422
- osb command session create <sandbox-id>
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
- # Reuse that session for multiple commands
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
- # Delete the session when done
430
- osb command session delete <sandbox-id> <session-id>
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
- ### `osb file` File Operations
436
+ ### Manage runtime egress policy
434
437
 
435
- | Command | Description |
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
- ### `osb egress` — Runtime Egress Policy
440
+ ```bash
441
+ osb egress get <sandbox-id> -o json
442
+ ```
451
443
 
452
- | Command | Description |
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
- # Inspect current policy
459
- osb egress get <sandbox-id>
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
- # Allow PyPI and deny an internal domain
462
- osb egress patch <sandbox-id> --rule allow=pypi.org --rule deny=internal.example.com
452
+ ```bash
453
+ osb command run <sandbox-id> -o raw -- curl -I https://pypi.org
463
454
  ```
464
455
 
465
- ### `osb devops` — Experimental DevOps Diagnostics
456
+ ### Collect diagnostics
466
457
 
467
- | Command | Description |
468
- | --------- | ---------------------------------------------------- |
469
- | `logs` | Retrieve container/pod logs |
470
- | `inspect` | Retrieve detailed container/pod inspection info |
471
- | `events` | Retrieve events related to a sandbox |
472
- | `summary` | One-shot diagnostics: inspect + events + logs combined |
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
- These diagnostics commands are currently experimental. They are implemented by the server and exposed by the CLI, but are not yet part of the public `specs/` API contract and may change before being formalized.
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
- # Quick diagnostics summary
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
- # Get last 500 log lines
481
- osb devops logs <sandbox-id> --tail 500
487
+ Output selection is command-scoped, not global.
482
488
 
483
- # Get logs from the last 30 minutes
484
- osb devops logs <sandbox-id> --since 30m
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
- # Detailed container/pod inspection
487
- osb devops inspect <sandbox-id>
494
+ Examples:
488
495
 
489
- # View events (up to 100)
490
- osb devops events <sandbox-id> --limit 100
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
- All devops commands return plain text output, making them ideal for both human reading and AI agent consumption.
502
+ Not every command supports every format. Use `--help` on the specific command when in doubt.
503
+
504
+ ## Command Groups
494
505
 
495
- ![DevOps Summary 1](assets/cli_devops_summary_1.png)
506
+ The main command groups are:
496
507
 
497
- ![DevOps Summary 2](assets/cli_devops_summary_2.png)
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
- ### `osb skills` — AI Coding Skills
517
+ Explore them directly:
500
518
 
501
- | Command | Description |
502
- | ----------- | ---------------------------------------------------- |
503
- | `install` | Install OpenSandbox troubleshooting skill for AI tools |
504
- | `list` | List supported targets and their install status |
505
- | `uninstall` | Remove installed skill from AI tools |
519
+ ```bash
520
+ osb sandbox --help
521
+ osb command --help
522
+ osb file --help
523
+ osb skills --help
524
+ ```
506
525
 
507
- The troubleshooting skill enables AI coding assistants to automatically diagnose sandbox issues (OOM, crashes, image pull errors, etc.). Supported targets:
526
+ ## Agent Skills
508
527
 
509
- | Target | AI Tool | Install Location |
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
- ```bash
519
- # Install for Claude Code (default)
520
- osb skills install
530
+ Bundled skills:
521
531
 
522
- # Install for a specific tool
523
- osb skills install --target cursor
532
+ - `sandbox-lifecycle`
533
+ - `command-execution`
534
+ - `file-operations`
535
+ - `network-egress`
536
+ - `sandbox-troubleshooting`
524
537
 
525
- # Install for all supported tools
526
- osb skills install --target all
538
+ Supported targets:
527
539
 
528
- # Check install status
529
- osb skills list
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
- # Uninstall
532
- osb skills uninstall --target claude
533
- ```
550
+ Common flows:
534
551
 
535
- ### `osb config` — Configuration
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
- | Command | Description |
538
- | ------- | ------------------------------------------ |
539
- | `init` | Create a default config file |
540
- | `show` | Show resolved configuration |
560
+ For scripts or agents, use structured output:
541
561
 
542
- ## Configuration
562
+ ```bash
563
+ osb skills install sandbox-lifecycle --target codex --scope project -o json
564
+ ```
543
565
 
544
- The CLI resolves configuration from multiple sources with the following priority (highest to lowest):
566
+ ## Configuration Model
545
567
 
546
- 1. **CLI flags** `--api-key`, `--domain`, `--protocol`, `--timeout`
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
- ## Development
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
- For local CLI development in this monorepo, prefer `uv sync` from the `cli/` directory. That workflow honors the local `[tool.uv.sources]` override for `opensandbox`, so the CLI resolves against the checked-out SDK instead of the published package.
575
+ Config commands:
554
576
 
555
577
  ```bash
556
- cd cli
557
- uv sync
558
- uv run osb --help
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
- If you specifically need an editable install into another environment, install the SDK dependencies from their local paths first, then install the CLI.
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.11"
578
- timeout = "10m"
600
+ image = "python:3.12"
601
+ timeout = "30m"
579
602
  ```
580
603
 
581
- ## Global Options
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
- - **`table`** (default) Human-friendly tables powered by [Rich](https://github.com/Textualize/rich)
600
- - **`json`** — Machine-readable JSON
601
- - **`yaml`** — YAML output
606
+ For local development in this monorepo:
602
607
 
603
608
  ```bash
604
- # Table (default)
605
- osb sandbox list
606
-
607
- # JSON for scripting
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.