Skip to main content
Agent 基础设施

Sandbox

阿里云百炼 CLI 管理沙箱实例与模版生命周期的命令速查。

在终端管理阿里云百炼沙箱实例与模版:创建、查询、连接、暂停、恢复、释放实例,以及创建、更新、查询、删除模版和查看构建状态。
Sandbox 相关能力目前仅对中国站(aliyun.com)账号开放,要求 cn-beijing 地域并完成 Sandbox SLR 授权。
任意命令追加 --help 可查看完整参数说明,例如 bl sandbox create --help。连接凭据默认脱敏,需要时使用 --show-credentials 获取。

实例管理

能力命令说明
实例列表bl sandbox list列出工作空间内的沙箱实例
实例详情bl sandbox get查看指定实例的配置与连接信息
创建实例bl sandbox create创建沙箱实例
连接实例bl sandbox connect获取实例连接信息(WebShell、CDP、VNC)
暂停实例bl sandbox pause暂停运行中的实例
恢复实例bl sandbox resume恢复已暂停的实例
释放实例bl sandbox delete释放(删除)实例(高危操作)

模版管理

能力命令说明
模版列表bl sandbox template list列出工作空间内的沙箱模版
模版详情bl sandbox template get查看指定模版的配置
创建模版bl sandbox template create创建沙箱模版,支持 --image 选择内置基础镜像
更新模版bl sandbox template update更新模版配置
构建状态bl sandbox template build-status查询模版构建状态(--async 提交后轮询)
删除模版bl sandbox template delete删除模版(高危操作)

内置镜像与文件

能力命令说明
内置镜像bl sandbox official-images查看内置基础镜像预设(Code Interpreter、Browser、All-in-One),无需鉴权
上传挂载文件bl sandbox file upload上传模版挂载文件(source=sandbox_template),返回 File ID 用于 mntConfig

示例

bl sandbox official-images
bl sandbox create --template-id <模版ID> --instance-timeout 3600
bl sandbox get --sandbox-id <实例ID> --show-credentials --output json
bl sandbox template create --image code-interpreter --name my-sandbox-template
能力参考
更新日志