mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 23:01:37 +00:00
140 lines
3.1 KiB
Text
140 lines
3.1 KiB
Text
---
|
|
title: "CLI"
|
|
description: "CLI reference and server flags."
|
|
---
|
|
|
|
The `sandbox-agent api` subcommand mirrors the HTTP API so you can script everything without writing client code.
|
|
|
|
## Server flags
|
|
|
|
```bash
|
|
sandbox-agent server --token "$SANDBOX_TOKEN" --host 127.0.0.1 --port 2468
|
|
```
|
|
|
|
- `--token`: global token for all requests.
|
|
- `--no-token`: disable auth (local dev only).
|
|
- `--host`, `--port`: bind address.
|
|
- `--cors-allow-origin`, `--cors-allow-method`, `--cors-allow-header`, `--cors-allow-credentials`: configure CORS.
|
|
- `--no-telemetry`: disable anonymous telemetry.
|
|
|
|
## Install agent (no server required)
|
|
|
|
<details>
|
|
<summary><strong>install-agent</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent install-agent claude --reinstall
|
|
```
|
|
</details>
|
|
|
|
## API agent commands
|
|
|
|
<details>
|
|
<summary><strong>api agents list</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api agents list --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api agents install</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api agents install claude --reinstall --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api agents modes</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api agents modes claude --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
## API session commands
|
|
|
|
<details>
|
|
<summary><strong>api sessions list</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions list --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions create</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions create my-session \
|
|
--agent claude \
|
|
--agent-mode build \
|
|
--permission-mode default \
|
|
--endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions send-message</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions send-message my-session \
|
|
--message "Summarize the repository" \
|
|
--endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions send-message-stream</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions send-message-stream my-session \
|
|
--message "Summarize the repository" \
|
|
--endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions events</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions events my-session --offset 0 --limit 50 --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions events-sse</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions events-sse my-session --offset 0 --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions reply-question</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions reply-question my-session QUESTION_ID \
|
|
--answers "yes" \
|
|
--endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions reject-question</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions reject-question my-session QUESTION_ID --endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>api sessions reply-permission</strong></summary>
|
|
|
|
```bash
|
|
sandbox-agent api sessions reply-permission my-session PERMISSION_ID \
|
|
--reply once \
|
|
--endpoint http://127.0.0.1:2468
|
|
```
|
|
</details>
|