|
| 1 | +<!-- |
| 2 | +SPDX-FileCopyrightText: 2025 CoreWeave, Inc. |
| 3 | +SPDX-License-Identifier: Apache-2.0 |
| 4 | +SPDX-PackageName: aviato-client |
| 5 | +--> |
| 6 | + |
| 7 | +# CLI Quickstart |
| 8 | + |
| 9 | +The `aviato` CLI provides terminal access to sandbox management. All commands wrap the Python SDK. |
| 10 | + |
| 11 | +## Installation |
| 12 | + |
| 13 | +```bash |
| 14 | +pip install aviato[cli] |
| 15 | +``` |
| 16 | + |
| 17 | +Or with uv in a development checkout: |
| 18 | + |
| 19 | +```bash |
| 20 | +uv sync --extra cli |
| 21 | +``` |
| 22 | + |
| 23 | +Verify the installation: |
| 24 | + |
| 25 | +```bash |
| 26 | +aviato --version |
| 27 | +aviato --help |
| 28 | +``` |
| 29 | + |
| 30 | +## Common workflows |
| 31 | + |
| 32 | +### List and inspect sandboxes |
| 33 | + |
| 34 | +```bash |
| 35 | +aviato ls # All sandboxes |
| 36 | +aviato ls --status running # Filter by status |
| 37 | +aviato ls --tag my-project # Filter by tag |
| 38 | +aviato ls --runway-id default --tower-id t1 # Filter by infrastructure |
| 39 | +``` |
| 40 | + |
| 41 | +### Run a command |
| 42 | + |
| 43 | +```bash |
| 44 | +aviato exec <sandbox-id> echo hello |
| 45 | +aviato exec <sandbox-id> --cwd /app python main.py |
| 46 | +aviato exec <sandbox-id> --timeout 30 make test |
| 47 | +``` |
| 48 | + |
| 49 | +The exit code matches the remote command's exit code. |
| 50 | + |
| 51 | +### Stream logs |
| 52 | + |
| 53 | +```bash |
| 54 | +aviato logs <sandbox-id> # Recent logs |
| 55 | +aviato logs <sandbox-id> --follow # Continuous (like tail -f) |
| 56 | +aviato logs <sandbox-id> --tail 50 --timestamps |
| 57 | +``` |
| 58 | + |
| 59 | +### Interactive shell |
| 60 | + |
| 61 | +```bash |
| 62 | +aviato shell <sandbox-id> # Bash shell |
| 63 | +aviato shell <sandbox-id> --cmd /bin/zsh # Custom shell |
| 64 | +aviato shell <sandbox-id> --cmd "python main.py" |
| 65 | +``` |
| 66 | + |
| 67 | +Exit with Ctrl-D or `exit`. Unix only. |
| 68 | + |
| 69 | +## JSON output for scripting |
| 70 | + |
| 71 | +`aviato ls -o json` returns a JSON array for use with `jq`: |
| 72 | + |
| 73 | +```bash |
| 74 | +# List as JSON |
| 75 | +aviato ls -o json |
| 76 | + |
| 77 | +# Get sandbox IDs |
| 78 | +aviato ls -o json | jq -r '.[].sandbox_id' |
| 79 | + |
| 80 | +# Exec into each running sandbox |
| 81 | +aviato ls -o json | jq -r '.[].sandbox_id' | xargs -I{} aviato exec {} echo hello |
| 82 | + |
| 83 | +# Filter by field |
| 84 | +aviato ls -o json | jq '.[] | select(.tower_id == "my-tower")' |
| 85 | +``` |
| 86 | + |
| 87 | +Each object contains: `sandbox_id`, `status`, `tower_id`, `runway_id`, `tower_group_id`, `started_at` (ISO 8601 or null). |
| 88 | + |
| 89 | +## See also |
| 90 | + |
| 91 | +- [Command Execution](execution.md) — `exec()` SDK method details |
| 92 | +- [Sandbox Logging](logging.md) — `stream_logs()` SDK method details |
| 93 | +- [Interactive Shells](interactive-shells.md) — `shell()` SDK method details |
0 commit comments