Team 操作
team 命令是对云沙箱 Team 操作的命令:主要包括 Team 的创建、查看、列举、更新、删除等功能。
命令解析
当执行命令team -h/team --help时,可以获取帮助文档。
所有子命令都支持以下两种寻址方式:
--team-id:直接指定服务端生成的 Team ID;--team-name(缩写-n):指定 Team 名称,组件会先查询线上资源做精确匹配再拿到 ID。未显式传入时回落到 s.yaml 的props.teamName。
两者都没有时报错 Team not specified, please specify --team-id or --team-name。
team create 命令
team create 命令,是创建 Team 的命令。
当执行命令team create -h/team create --help时,可以获取帮助文档。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 地域名称,取值参见支持的地域 |
| team-name | - | 选填 | 必填 | Team 名称 |
| description | - | 选填 | 选填 | Team 描述 |
| plan | - | 选填 | 选填 | Team 套餐,如 base |
| resource-group-id | - | 选填 | 选填 | 资源组 ID |
当前命令还支持部分全局参数(例如
-a/--access,--debug等),详情可参考 Serverless Devs 全局参数文档
操作案例
- 有资源描述文件(Yaml)时,可以直接执行
s cli fc-sandbox team create --description "dev team",Team 名称与地域取自 s.yaml; - 纯命令行形式(在没有资源描述 Yaml 文件时),需要指定地域与 Team 名称,例如
s cli fc-sandbox team create --team-name dev --plan base --region cn-hangzhou -a default;
上述命令的执行结果示例:
teamID: t-5lycxxxxxxxx
teamName: dev
description: dev team
plan: base
status: active
createdTime: 2026-08-16T03:24:28Z
声明式管理请用
s deploy,它会自动判断创建还是更新。
team get 命令
team get 命令,是获取指定 Team 详情的命令。
当执行命令team get -h/team get --help时,可以获取帮助文档。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 地域名称,取值参见支持的地域 |
| team-id | - | 选填 | 选填 | Team ID,与 --team-name 二选一 |
| team-name | n | 选填 | 选填 | Team 名称,--team-id 缺省时使用 |
当前命令还支持部分全局参数(例如
-a/--access,--debug等),详情可参考 Serverless Devs 全局参数文档
操作案例
s cli fc-sandbox team get --team-name dev --region cn-hangzhou -a default
s cli fc-sandbox team get --team-id t-5lycxxxxxxxx --region cn-hangzhou -a default
上述命令的执行结果示例:
teamID: t-5lycxxxxxxxx
teamName: dev
description: dev team
plan: base
status: active
resourceGroupID: rg-acfmxxxxxxxx
createdTime: 2026-08-16T03:24:28Z
Team 不存在时报错 Team "t-5lycxxxxxxxx" not found in region cn-hangzhou。
team list 命令
team list 命令,是列举 Team 列表的命令。
当执行命令team list -h/team list --help时,可以获取帮助文档。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 地域名称,取值参见支持的地域 |
| team-name | - | 选填 | 选填 | 按 Team 名称过滤 |
| plan | - | 选填 | 选填 | 按套餐过滤 |
| resource-group-id | - | 选填 | 选填 | 按资源组 ID 过滤 |
| table | - | 选填 | 选填 | 是否以表格形式输出,--table 表示以表格形式输出 |
当前命令还支持部分全局参数(例如
-a/--access,--debug等),详情可参考 Serverless Devs 全局参数文档
操作案例
s cli fc-sandbox team list --table --region cn-hangzhou -a default
s cli fc-sandbox team list --plan base --region cn-hangzhou -a default
上述命令的执行结果示例:
-
teamID: t-5lycxxxxxxxx
teamName: dev
description: dev team
plan: base
status: active
createdTime: 2026-08-16T03:24:28Z
-
teamID: t-9fquxxxxxxxx
teamName: prod
plan: base
status: active
createdTime: 2026-08-16T04:11:02Z
如果指定了--table参数,输出示例:
| teamID | teamName | plan | status | description | createdTime |
|---|---|---|---|---|---|
| t-5lycxxxxxxxx | dev | base | active | dev team | 2026-08-16T03:24:28Z |
| t-9fquxxxxxxxx | prod | base | active | 2026-08-16T04:11:02Z |
list内部已做全量翻页,无需自行处理pageNumber/pageSize。--team-name走的是服务端的模糊过滤,返回结果可能多于一条。
team update 命令
team update 命令,是更新 Team 配置的命令。
当执行命令team update -h/team update --help时,可以获取帮助文档。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 地域名称,取值参见支持的地域 |
| team-id | - | 选填 | 选填 | Team ID,与 --team-name 二选一 |
| team-name | n | 选填 | 选填 | Team 名称,--team-id 缺省时使用 |
| new-team-name | - | 选填 | 选填 | 把 Team 重命名为指定名称 |
| description | - | 选填 | 选填 | Team 描述 |
| plan | - | 选填 | 选填 | Team 套餐 |
| resource-group-id | - | 选填 | 选填 | 资源组 ID |
当前命令还支持部分全局参数(例如
-a/--access,--debug等),详情可参考 Serverless Devs 全局参数文档
操作案例
s cli fc-sandbox team update --team-name dev --description "new desc" --region cn-hangzhou -a default
s cli fc-sandbox team update --team-id t-5lycxxxxxxxx --new-team-name prod --region cn-hangzhou -a default
注意事项
-
--new-team-name/--description/--plan/--resource-group-id至少要指定一个,否则报错:Nothing to update, please specify at least one of --new-team-name / --description / --plan / --resource-group-id -
重命名需要服务端
allowUpdateTeamName为 true。改名成功后请同步修改 s.yaml 的props.teamName,否则下次s deploy会按旧名字新建一个 Team,详见 身份解析。
team remove 命令
team remove 命令,是删除 Team 的命令。
当执行命令team remove -h/team remove --help时,可以获取帮助文档。
参数解析
| 参数全称 | 参数缩写 | Yaml 模式下必填 | Cli 模式下必填 | 参数含义 |
|---|---|---|---|---|
| region | - | 选填 | 必填 | 地域名称,取值参见支持的地域 |
| team-id | - | 选填 | 选填 | Team ID,与 --team-name 二选一 |
| team-name | n | 选填 | 选填 | Team 名称,--team-id 缺省时使用 |
| assume-yes | y | 选填 | 选填 | 在交互时,默认选择y |
当前命令还支持部分全局参数(例如
-a/--access,--debug等),详情可参考 Serverless Devs 全局参数文档
操作案例
s cli fc-sandbox team remove --team-name dev --region cn-hangzhou -a default -y
上述命令的执行结果示例:
? Are you sure you want to delete the team t-5lycxxxxxxxx? Volumes and api keys under it may be removed together. yes
Team t-5lycxxxxxxxx removed
⚠️ 注意:Team 上还挂着 volume / apiKey 时删除会失败,请先删除内嵌资源,或直接使用
s remove(它会按apiKeys → volumes → team的逆序处理)。
权限与策略说明
create/update/remove:AliyunFCFullAccessget/list:AliyunFCReadOnlyAccess