> ## Documentation Index
> Fetch the complete documentation index at: https://ppio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# PPIO Agent 沙箱 Skill

使用 AI Agent 直接操作 PPIO Agent 沙箱平台 — 构建模板、管理沙箱、部署 Agent，无需离开你的对话界面。

***

## 安装

向任意支持 Skill 的 AI Agent 发送以下消息，Agent 会自动完成安装：

```
Read https://raw.githubusercontent.com/PPIO/ppio-skills/main/skills/ppio-sandbox/SKILL.md and follow the instructions to install
```

支持的平台：Claude Code、Gemini CLI、OpenClaw 及其他兼容 SKILL.md 标准的 Agent。

## 功能介绍

ppio-sandbox Skill 封装了 `ppio-sandbox-cli`，让 Agent 能够以自然语言驱动 PPIO Sandbox 平台的全部操作。该 Skill 包含所有 Beta 版 `ppio-sandbox-cli` 的功能。

### 模板管理

从 Dockerfile 构建可复用的沙箱模板。模板是创建沙箱的基础。

* 从 Dockerfile 构建模板
* 查看、发布、删除模板
* 版本管理与回滚

### 沙箱管理

按需启动隔离的沙箱环境，执行任务后销毁。

* 创建、列出、连接沙箱
* 查看实时日志与资源指标
* 上传、下载文件
* 执行命令或代码
* 克隆沙箱（并行创建多个副本）
* 提交沙箱状态为快照模板

### Agent Runtime

将 Python/其他语言的 Agent 打包部署到 PPIO Sandbox，通过 HTTP 调用。

* 配置 Agent 项目（自动生成 Dockerfile）
* 一键构建并部署
* 流式调用已部署的 Agent

## 使用示例

### 创建沙箱

> 用户：帮我从模板 base 创建一个沙箱

Agent 会自动执行：

```bash theme={null}
ppio-sandbox-cli sandbox create base --detach
# 输出：Sandbox xxx created from template base
```

### 查看沙箱日志

> 用户：查看沙箱 abc123 的日志

Agent 执行：

```bash theme={null}
ppio-sandbox-cli sandbox logs abc123 -f
```

### 在沙箱中执行命令

> 用户：在沙箱 abc123 中执行 python run.py

Agent 执行：

```bash theme={null}
ppio-sandbox-cli sandbox connect abc123
# 连接后在沙箱终端中执行命令
```

### 克隆沙箱

> 用户：把沙箱 abc123 克隆 3 份

Agent 执行：

```bash theme={null}
ppio-sandbox-cli sandbox clone abc123 --count 3
# 输出：3 个新沙箱 ID，状态均为 Running
```

### 构建模板

> 用户：帮我用当前目录的 ppio.Dockerfile 构建一个叫 my-app 的模板

Agent 执行：

```bash theme={null}
ppio-sandbox-cli template build -d ppio.Dockerfile -n my-app
```

### 部署 Agent

> 用户：把这个 Python agent 部署到 PPIO Sandbox

Agent 执行：

```bash theme={null}
# Agent 会依次执行：
ppio-sandbox-cli agent configure -n my-agent -e app.py
ppio-sandbox-cli agent launch
```

## 触发词

以下关键词会触发此 Skill：

* 创建沙箱、启动沙箱、列出沙箱
* 构建模板、模板构建、查看模板
* 部署 agent、调用 agent、发布 agent
* 沙箱日志、沙箱指标、克隆沙箱
* ppio-sandbox-cli、ppio sandbox

## 前置要求

* Node.js 18+
* PPIO 账号（用于 `ppio-sandbox-cli auth login`）

## 相关链接

* [PPIO Agent 沙箱](/sandbox/overview)
* [PPIO Agent Runtime](/sandbox/agent-runtime-introduction)
* [PPIO Skills GitHub](https://github.com/PPIO/ppio-skills)
