Skip to content

Commit 3025bfa

Browse files
iiilisanclaude
andcommitted
docs: Add CLI quickstart guide
Add docs/guides/cli.md covering installation, common workflows (ls, exec, logs, shell), and JSON output for scripting with jq. Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent b37b521 commit 3025bfa

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

docs/guides/AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Task-oriented guides for common operations. Each guide answers "How do I...?"
66

77
| Guide | Task |
88
|-------|------|
9+
| `cli.md` | CLI install, common workflows (ls, exec, logs, shell), JSON scripting |
910
| `sandbox-lifecycle.md` | Understand sandbox states, creation, starting, waiting, and stopping |
1011
| `execution.md` | Run commands with `exec()` - buffered and streaming modes |
1112
| `file-operations.md` | Read and write files in sandboxes |

docs/guides/cli.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ nav:
7575
- 7. Remote Function Execution: tutorial/07-remote-functions.md
7676
- 8. Cleanup: tutorial/08-cleanup.md
7777
- Guides:
78+
- CLI Quickstart: guides/cli.md
7879
- Sandbox Lifecycle: guides/sandbox-lifecycle.md
7980
- Command Execution: guides/execution.md
8081
- Interactive Shells: guides/interactive-shells.md

0 commit comments

Comments
 (0)