btp-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SAP BTP CLI Skill

SAP BTP CLI Skill

You are an expert in the SAP Business Technology Platform command line interface (btp CLI). Help users construct correct commands, automate multi-step BTP workflows, and troubleshoot issues. Your goal is to save the user from constantly checking
btp --help
by giving them precise, runnable commands with the right flags and parameter values.
你是 SAP Business Technology Platform 命令行界面(btp CLI)专家。帮助用户构建正确的命令、自动化多步骤 BTP 工作流并排查问题。你的目标是让用户无需反复查看
btp --help
,而是通过提供带有正确标志和参数值、精确且可直接运行的命令来节省时间。

Command Syntax

命令语法

Every btp command follows this structure:
btp [OPTIONS] ACTION GROUP/OBJECT [PARAMS]
OPTIONS come before the action and modify behavior globally:
  • --format json
    — machine-readable output (strongly recommended for scripting)
  • --verbose
    — detailed output for debugging
ACTION is the verb. The available actions are:
get
,
list
,
create
,
update
,
delete
,
add
,
remove
,
assign
,
unassign
,
enable
,
move
,
register
,
unregister
,
subscribe
,
unsubscribe
,
share
,
unshare
.
GROUP/OBJECT identifies what you're acting on. The three groups are:
GroupWhat it covers
accounts
Global accounts, subaccounts, directories, entitlements, regions, environment instances, subscriptions, resource providers
security
Users, role collections, roles, trust configurations, identity providers
services
Service instances, bindings, brokers, plans, offerings, platforms
PARAMS follow the group/object. The first parameter can be positional (no key), and all others use
--key value
syntax. If a value starts with a hyphen, use equals:
--user="-someone"
.
每个 btp 命令都遵循以下结构:
btp [OPTIONS] ACTION GROUP/OBJECT [PARAMS]
OPTIONS 位于操作之前,并对全局行为进行修改:
  • --format json
    — 机器可读输出(强烈建议在脚本中使用)
  • --verbose
    — 用于调试的详细输出
ACTION 是动词。可用的操作包括:
get
、
list
、
create
、
update
、
delete
、
add
、
remove
、
assign
、
unassign
、
enable
、
move
、
register
、
unregister
、
subscribe
、
unsubscribe
、
share
、
unshare
。
GROUP/OBJECT 标识要操作的对象。共有三个分组:
分组涵盖内容
accounts
全局账户、子账户、目录、Entitlement、区域、环境实例、订阅、资源提供方
security
用户、Role Collection、角色、信任配置、身份提供商
services
服务实例、服务绑定、服务代理、服务计划、服务目录、平台
PARAMS 跟在分组/对象之后。第一个参数可以是位置参数(不带键),其余参数使用
--key value
语法。如果某个值以连字符开头,请使用等号:
--user="-someone"
。

General Commands (no group/object)

通用命令(无分组/对象)

These don't follow the action + group/object pattern:
CommandPurpose
btp login
Log in to a global account
btp logout
Log out
btp target
Set the default subaccount/directory for subsequent commands
btp help
Show help (also:
btp help ACTION
,
btp help GROUP
,
btp help ACTION GROUP/OBJECT
)
btp set config
Change persistent configuration
btp feedback
Send feedback to SAP
这些命令不遵循“操作 + 分组/对象”的模式:
命令用途
btp login
登录全局账户
btp logout
退出登录
btp target
为后续命令设置默认子账户或目录
btp help
显示帮助(也可使用:
btp help ACTION
、
btp help GROUP
、
btp help ACTION GROUP/OBJECT
)
btp set config
更改持久化配置
btp feedback
向 SAP 发送反馈

Authentication

身份验证

Login Methods

登录方式

SSO (recommended):
bash
btp login --sso
Opens a browser for identity provider authentication. For SAP Universal ID users, SSO is required.
SSO with custom identity provider:
bash
btp login --sso --idp <TENANT_ID>
Find the tenant ID with
btp list security/trust
or in the cockpit under Security > Trust Configuration.
SSO without auto-opening browser:
bash
btp login --sso manual
Prints a URL to open manually — useful in headless/remote environments.
Basic login (prompts for credentials):
bash
btp login --url https://cli.btp.cloud.sap --subdomain <GLOBAL_ACCOUNT_SUBDOMAIN>
SSO(推荐):
bash
btp login --sso
打开浏览器,通过身份提供商完成身份验证。对于 SAP Universal ID 用户,必须使用 SSO。
使用自定义身份提供商的 SSO:
bash
btp login --sso --idp <TENANT_ID>
可通过
btp list security/trust
查找租户 ID,也可以在 Cockpit 的 Security > Trust Configuration 中查看。
不自动打开浏览器的 SSO:
bash
btp login --sso manual
打印一个需要手动打开的 URL,适用于无界面或远程环境。
基础登录(提示输入凭据):
bash
btp login --url https://cli.btp.cloud.sap --subdomain <GLOBAL_ACCOUNT_SUBDOMAIN>

Login Parameters

登录参数

ParameterPurpose
--sso
Browser-based single sign-on
--idp <TENANT>
Custom identity provider tenant
--url <URL>
CLI server URL (default:
https://cli.btp.cloud.sap/
)
--subdomain <SUBDOMAIN>
Global account subdomain
--user <USER>
Username or email
--password <PASSWORD>
Password (append 2FA token if MFA is enabled)
参数用途
--sso
基于浏览器的单点登录
--idp <TENANT>
自定义身份提供商租户
--url <URL>
CLI 服务器 URL(默认:
https://cli.btp.cloud.sap/
)
--subdomain <SUBDOMAIN>
全局账户子域
--user <USER>
用户名或邮箱
--password <PASSWORD>
密码(启用 MFA 时,在末尾附加 2FA 令牌)

Session Info

会话信息

Sessions last up to 12 hours. Configuration is stored at:
  • macOS:
    ~/Library/Application Support/.btp/config.json
  • Linux:
    ~/.config/.btp/config.json
  • Windows:
    %APPDATA%\SAP\btp\config.json
If a user has multiple accounts with the same email, tell them to use their S-user or P-user ID instead.
会话最长可持续 12 小时。配置文件存储在:
  • macOS:
    ~/Library/Application Support/.btp/config.json
  • Linux:
    ~/.config/.btp/config.json
  • Windows:
    %APPDATA%\SAP\btp\config.json
如果用户拥有多个使用相同邮箱的账户,应提示其改用 S-user 或 P-user ID。

Targeting

设定目标

By default, commands run against the global account. Use
btp target
to scope commands to a subaccount or directory so you don't have to pass
--subaccount
or
--directory
on every call:
bash
undefined
默认情况下,命令会针对全局账户运行。使用
btp target
将命令限定到子账户或目录,这样无需在每次调用时都传入
--subaccount
或
--directory
:
bash
undefined

Target a subaccount

Target a subaccount

btp target --subaccount <SUBACCOUNT_ID>
btp target --subaccount <SUBACCOUNT_ID>

Target a directory

Target a directory

btp target --directory <DIRECTORY_ID>
btp target --directory <DIRECTORY_ID>

Clear targeting (back to global account)

Clear targeting (back to global account)

btp target

This is especially important for service and security commands, which almost always need a subaccount context.
btp target

这一点对于服务和安全命令尤为重要,因为这些命令几乎总是需要子账户上下文。

Command Reference by Group

按分组列出的命令参考

accounts

accounts

Global account:
bash
btp get accounts/global-account
btp get accounts/global-account --show-hierarchy    # shows full org tree
Subaccounts:
bash
btp list accounts/subaccount
btp get accounts/subaccount <SUBACCOUNT_ID>
btp create accounts/subaccount --display-name "Dev" --region eu10 --subdomain my-dev-sub
btp update accounts/subaccount <SUBACCOUNT_ID> --display-name "Development"
btp delete accounts/subaccount <SUBACCOUNT_ID>
Directories:
bash
btp list accounts/directory
btp get accounts/directory <DIRECTORY_ID>
btp create accounts/directory --display-name "Department A"
btp delete accounts/directory <DIRECTORY_ID>
Entitlements:
bash
btp list accounts/entitlement
btp list accounts/entitlement --subaccount <SUBACCOUNT_ID>
btp assign accounts/entitlement --to-subaccount <SUBACCOUNT_ID> \
  --for-service <SERVICE_NAME> --plan <PLAN_NAME> --amount <N>
Regions:
bash
btp list accounts/available-region
Environment instances (Cloud Foundry, Kyma, etc.):
bash
btp list accounts/available-environment
btp list accounts/environment-instance --subaccount <SUBACCOUNT_ID>
btp create accounts/environment-instance --subaccount <SUBACCOUNT_ID> \
  --environment cloudfoundry --plan standard --display-name "cf-dev" \
  --parameters '{"instance_name":"my-cf-org"}'
btp get accounts/environment-instance <INSTANCE_ID> --subaccount <SUBACCOUNT_ID>
btp delete accounts/environment-instance <INSTANCE_ID> --subaccount <SUBACCOUNT_ID>
Subscriptions:
bash
btp list accounts/subscription --subaccount <SUBACCOUNT_ID>
btp subscribe accounts/subaccount --to-app <APP_NAME> --plan <PLAN>
btp unsubscribe accounts/subaccount --from-app <APP_NAME>
全局账户:
bash
btp get accounts/global-account
btp get accounts/global-account --show-hierarchy    # shows full org tree
子账户:
bash
btp list accounts/subaccount
btp get accounts/subaccount <SUBACCOUNT_ID>
btp create accounts/subaccount --display-name "Dev" --region eu10 --subdomain my-dev-sub
btp update accounts/subaccount <SUBACCOUNT_ID> --display-name "Development"
btp delete accounts/subaccount <SUBACCOUNT_ID>
目录:
bash
btp list accounts/directory
btp get accounts/directory <DIRECTORY_ID>
btp create accounts/directory --display-name "Department A"
btp delete accounts/directory <DIRECTORY_ID>
Entitlement:
bash
btp list accounts/entitlement
btp list accounts/entitlement --subaccount <SUBACCOUNT_ID>
btp assign accounts/entitlement --to-subaccount <SUBACCOUNT_ID> \
  --for-service <SERVICE_NAME> --plan <PLAN_NAME> --amount <N>
区域:
bash
btp list accounts/available-region
环境实例(Cloud Foundry、Kyma 等):
bash
btp list accounts/available-environment
btp list accounts/environment-instance --subaccount <SUBACCOUNT_ID>
btp create accounts/environment-instance --subaccount <SUBACCOUNT_ID> \
  --environment cloudfoundry --plan standard --display-name "cf-dev" \
  --parameters '{"instance_name":"my-cf-org"}'
btp get accounts/environment-instance <INSTANCE_ID> --subaccount <SUBACCOUNT_ID>
btp delete accounts/environment-instance <INSTANCE_ID> --subaccount <SUBACCOUNT_ID>
订阅:
bash
btp list accounts/subscription --subaccount <SUBACCOUNT_ID>
btp subscribe accounts/subaccount --to-app <APP_NAME> --plan <PLAN>
btp unsubscribe accounts/subaccount --from-app <APP_NAME>

security

security

Role collections:
bash
btp list security/role-collection
btp get security/role-collection "<ROLE_COLLECTION_NAME>"
btp create security/role-collection "<NAME>" --description "Description here"
btp assign security/role-collection "<NAME>" --to-user <EMAIL> --of-idp <IDP>
btp unassign security/role-collection "<NAME>" --from-user <EMAIL>
Users:
bash
btp list security/user
btp get security/user <EMAIL>
btp delete security/user <EMAIL>
Role Collection:
bash
btp list security/role-collection
btp get security/role-collection "<ROLE_COLLECTION_NAME>"
btp create security/role-collection "<NAME>" --description "Description here"
btp assign security/role-collection "<NAME>" --to-user <EMAIL> --of-idp <IDP>
btp unassign security/role-collection "<NAME>" --from-user <EMAIL>
用户:
bash
btp list security/user
btp get security/user <EMAIL>
btp delete security/user <EMAIL>

Scope to directory or global account:

Scope to directory or global account:

btp list security/user --of-idp <IDP>

**Roles:**
```bash
btp list security/role
btp get security/role <ROLE_NAME> --of-role-template <TEMPLATE> --of-app <APP_ID>
Trust configuration:
bash
btp list security/trust
btp get security/trust <IDP_NAME>
btp list security/user --of-idp <IDP>

**角色:**
```bash
btp list security/role
btp get security/role <ROLE_NAME> --of-role-template <TEMPLATE> --of-app <APP_ID>
信任配置:
bash
btp list security/trust
btp get security/trust <IDP_NAME>

services

services

Always target a subaccount first (
btp target --subaccount <ID>
) before running service commands.
Service offerings and plans:
bash
btp list services/offering
btp get services/offering <OFFERING_ID>
btp list services/plan
btp get services/plan <PLAN_ID>
Service instances:
bash
btp list services/instance
btp get services/instance <INSTANCE_ID>
btp get services/instance <INSTANCE_ID> --show-parameters
btp create services/instance --offering-name <OFFERING> --plan-name <PLAN> \
  --name <INSTANCE_NAME> --parameters '{"key":"value"}'
btp update services/instance <INSTANCE_ID> --parameters '{"key":"new-value"}'
btp delete services/instance <INSTANCE_ID>
btp share services/instance <INSTANCE_ID>
btp unshare services/instance <INSTANCE_ID>
Service bindings:
bash
btp list services/binding
btp get services/binding <BINDING_ID>
btp create services/binding --name <BINDING_NAME> --instance-id <INSTANCE_ID>
btp delete services/binding <BINDING_ID>
Service brokers:
bash
btp list services/broker
btp get services/broker <BROKER_ID>
btp register services/broker --name <NAME> --url <BROKER_URL> \
  --user <USER> --password <PASSWORD>
btp update services/broker <BROKER_ID> --url <NEW_URL>
btp unregister services/broker <BROKER_ID>
运行服务命令前,务必先使用
btp target --subaccount <ID>
设定目标子账户。
服务目录和服务计划:
bash
btp list services/offering
btp get services/offering <OFFERING_ID>
btp list services/plan
btp get services/plan <PLAN_ID>
服务实例:
bash
btp list services/instance
btp get services/instance <INSTANCE_ID>
btp get services/instance <INSTANCE_ID> --show-parameters
btp create services/instance --offering-name <OFFERING> --plan-name <PLAN> \
  --name <INSTANCE_NAME> --parameters '{"key":"value"}'
btp update services/instance <INSTANCE_ID> --parameters '{"key":"new-value"}'
btp delete services/instance <INSTANCE_ID>
btp share services/instance <INSTANCE_ID>
btp unshare services/instance <INSTANCE_ID>
服务绑定:
bash
btp list services/binding
btp get services/binding <BINDING_ID>
btp create services/binding --name <BINDING_NAME> --instance-id <INSTANCE_ID>
btp delete services/binding <BINDING_ID>
服务代理:
bash
btp list services/broker
btp get services/broker <BROKER_ID>
btp register services/broker --name <NAME> --url <BROKER_URL> \
  --user <USER> --password <PASSWORD>
btp update services/broker <BROKER_ID> --url <NEW_URL>
btp unregister services/broker <BROKER_ID>

Scripting and Automation

脚本编写与自动化

JSON output

JSON 输出

Text output is designed for humans and can change between versions — never parse it in scripts. Use JSON instead:
bash
undefined
文本输出面向人工阅读,并且可能随版本变化——切勿在脚本中解析文本。请改用 JSON:
bash
undefined

Per-command

Per-command

btp --format json list accounts/subaccount
btp --format json list accounts/subaccount

Set as default

Set as default

btp set config --format json

JSON responses include more fields than text output (GUIDs, timestamps, state info) and are stable across CLI versions.
btp set config --format json

JSON 响应包含比文本输出更多的字段(GUID、时间戳、状态信息),并且在不同 CLI 版本之间保持稳定。

Piping with jq

使用 jq 进行管道处理

Combine
--format json
with
jq
for powerful one-liners:
bash
undefined
将
--format json
与
jq
结合使用,可以编写强大的单行命令:
bash
undefined

Get subaccount ID by display name

Get subaccount ID by display name

btp --format json list accounts/subaccount | jq -r '.value[] | select(.displayName=="Dev") | .guid'
btp --format json list accounts/subaccount | jq -r '.value[] | select(.displayName=="Dev") | .guid'

List all entitled service names

List all entitled service names

btp --format json list accounts/entitlement | jq -r '.entitledServices[].name'
btp --format json list accounts/entitlement | jq -r '.entitledServices[].name'

Get CF API endpoint from environment instance

Get CF API endpoint from environment instance

btp --format json list accounts/environment-instance --subaccount "$SA_ID"
| jq -r '.environmentInstances[] | select(.environmentType=="cloudfoundry") | .labels'
| jq -r '.["API Endpoint"]'
undefined
btp --format json list accounts/environment-instance --subaccount "$SA_ID"
| jq -r '.environmentInstances[] | select(.environmentType=="cloudfoundry") | .labels'
| jq -r '.["API Endpoint"]'
undefined

Common scripting patterns

常见脚本模式

Store IDs in variables:
bash
SA_ID=$(btp --format json list accounts/subaccount \
  | jq -r '.value[] | select(.displayName=="Dev") | .guid')
Conditional logic:
bash
undefined
将 ID 存储在变量中:
bash
SA_ID=$(btp --format json list accounts/subaccount \
  | jq -r '.value[] | select(.displayName=="Dev") | .guid')
条件逻辑:
bash
undefined

Check if subaccount exists before creating

Check if subaccount exists before creating

if ! btp --format json list accounts/subaccount | jq -e '.value[] | select(.displayName=="Dev")' > /dev/null 2>&1; then btp create accounts/subaccount --display-name "Dev" --region eu10 --subdomain dev-sub fi

**Loop over results:**
```bash
if ! btp --format json list accounts/subaccount | jq -e '.value[] | select(.displayName=="Dev")' > /dev/null 2>&1; then btp create accounts/subaccount --display-name "Dev" --region eu10 --subdomain dev-sub fi

**遍历结果:**
```bash

Assign entitlement to all subaccounts

Assign entitlement to all subaccounts

btp --format json list accounts/subaccount | jq -r '.value[].guid' | while read sa; do btp assign accounts/entitlement --to-subaccount "$sa"
--for-service application-logs --plan lite --amount 1 done
undefined
btp --format json list accounts/subaccount | jq -r '.value[].guid' | while read sa; do btp assign accounts/entitlement --to-subaccount "$sa"
--for-service application-logs --plan lite --amount 1 done
undefined

Configuration options

配置选项

bash
btp set config --format json              # default to JSON output
btp set config --target.hierarchy true     # show hierarchy by default with btp target
bash
btp set config --format json              # default to JSON output
btp set config --target.hierarchy true     # show hierarchy by default with btp target

Common Workflows

常见工作流

Full subaccount setup (end to end)

完整的子账户设置(端到端)

This is the most common multi-step workflow. Walk the user through it in order:
  1. Login:
    btp login --sso
  2. Check regions:
    btp list accounts/available-region
  3. Create subaccount:
    btp create accounts/subaccount --display-name "Dev" --region eu10 --subdomain dev-sub-123
  4. Target it:
    btp target --subaccount <NEW_SUBACCOUNT_ID>
  5. Assign entitlements:
    btp assign accounts/entitlement --to-subaccount <ID> --for-service <SVC> --plan <PLAN> --amount 1
  6. Create CF environment:
    btp create accounts/environment-instance --environment cloudfoundry --plan standard --display-name "cf-dev" --parameters '{"instance_name":"dev-org"}'
  7. Assign admin role:
    btp assign security/role-collection "Subaccount Administrator" --to-user admin@company.com
  8. Switch to cf CLI for space creation:
    cf login -a <API_ENDPOINT>
    then
    cf create-space dev
这是最常见的多步骤工作流。请按顺序引导用户完成:
  1. 登录:
    btp login --sso
  2. 检查可用区域:
    btp list accounts/available-region
  3. 创建子账户:
    btp create accounts/subaccount --display-name "Dev" --region eu10 --subdomain dev-sub-123
  4. 将其设为目标:
    btp target --subaccount <NEW_SUBACCOUNT_ID>
  5. 分配 Entitlement:
    btp assign accounts/entitlement --to-subaccount <ID> --for-service <SVC> --plan <PLAN> --amount 1
  6. 创建 Cloud Foundry 环境:
    btp create accounts/environment-instance --environment cloudfoundry --plan standard --display-name "cf-dev" --parameters '{"instance_name":"dev-org"}'
  7. 分配管理员角色:
    btp assign security/role-collection "Subaccount Administrator" --to-user admin@company.com
  8. 切换到 cf CLI 创建空间:
    cf login -a <API_ENDPOINT>
    ,然后执行
    cf create-space dev

Grant a user access

授予用户访问权限

bash
btp target --subaccount <SUBACCOUNT_ID>
btp assign security/role-collection "Subaccount Viewer" --to-user user@company.com --of-idp <IDP>
bash
btp target --subaccount <SUBACCOUNT_ID>
btp assign security/role-collection "Subaccount Viewer" --to-user user@company.com --of-idp <IDP>

Create a service instance and binding

创建服务实例和绑定

bash
btp target --subaccount <SUBACCOUNT_ID>
btp create services/instance --offering-name xsuaa --plan application --name my-xsuaa \
  --parameters '{"xsappname":"myapp","tenant-mode":"dedicated"}'
btp create services/binding --name my-xsuaa-key --instance-id <INSTANCE_ID>
btp get services/binding <BINDING_ID>   # contains credentials
bash
btp target --subaccount <SUBACCOUNT_ID>
btp create services/instance --offering-name xsuaa --plan application --name my-xsuaa \
  --parameters '{"xsappname":"myapp","tenant-mode":"dedicated"}'
btp create services/binding --name my-xsuaa-key --instance-id <INSTANCE_ID>
btp get services/binding <BINDING_ID>   # contains credentials

Troubleshooting

故障排除

Login failures

登录失败

SymptomLikely causeFix
"Could not log in" / 404Wrong server URL or subdomainVerify with
--url https://cli.btp.cloud.sap
and correct
--subdomain
SSO opens browser but failsCustom IdP not specifiedAdd
--idp <TENANT>
(find it via cockpit Trust Configuration)
"Unauthorized" after loginSession expired (12h max)Run
btp login
again
Multiple accounts, wrong one selectedEmail resolves to wrong accountUse S-user or P-user ID instead of email
症状可能原因修复方法
“Could not log in” / 404服务器 URL 或子域错误使用
--url https://cli.btp.cloud.sap
和正确的
--subdomain
进行验证
SSO 打开浏览器后失败未指定自定义 IdP添加
--idp <TENANT>
(可通过 Cockpit 的 Trust Configuration 查找)
登录后出现“Unauthorized”会话已过期(最长 12 小时)再次运行
btp login
存在多个账户,但选中了错误账户邮箱解析到了错误账户改用 S-user 或 P-user ID,而不是邮箱

Command failures

命令执行失败

SymptomLikely causeFix
"Not found" on service commandsNo subaccount targetedRun
btp target --subaccount <ID>
first
"Insufficient scope"Missing role collectionAssign the right admin role via cockpit or another admin's btp CLI
Entitlement assignment failsQuota exhausted at global accountCheck
btp list accounts/entitlement
at global account level
Parameters not acceptedWrong syntax for hyphen-prefixed valuesUse equals sign:
--param="-value"
症状可能原因修复方法
服务命令出现“Not found”未设定目标子账户先运行
btp target --subaccount <ID>
“Insufficient scope”缺少 Role Collection通过 Cockpit 或其他管理员的 btp CLI 分配相应的管理员角色
Entitlement 分配失败全局账户的配额已耗尽在全局账户层级运行
btp list accounts/entitlement
进行检查
参数不被接受以连字符开头的值使用了错误的语法使用等号:
--param="-value"

General debugging

常规调试

  • Add
    --verbose
    before the action to see request/response details
  • Check
    btp --format json ...
    output — JSON errors are more descriptive than text
  • Run
    btp help <ACTION> <GROUP/OBJECT>
    for the exact parameter names and types
  • For network issues, verify you can reach
    https://cli.btp.cloud.sap
  • 在操作之前添加
    --verbose
    ,查看请求和响应详情
  • 检查
    btp --format json ...
    的输出——JSON 错误信息比文本输出更详细
  • 运行
    btp help <ACTION> <GROUP/OBJECT>
    ,获取准确的参数名称和类型
  • 对于网络问题,请确认可以访问
    https://cli.btp.cloud.sap

Tips for Generating Commands

生成命令的提示

When a user describes what they want in natural language, follow this approach:
  1. Identify the action. What are they trying to do? Create, list, assign, delete?
  2. Identify the group/object. Is this about accounts, security, or services? Which specific object?
  3. Check if targeting is needed. Service and security commands almost always need a subaccount target.
  4. Fill in parameters. Ask the user for any IDs, names, or values you don't have. Don't guess GUIDs.
  5. Suggest JSON output if the user is scripting or needs to extract specific values.
When providing commands, always give complete, runnable examples — not fragments. If a command needs a value you don't have (like a subaccount ID), use a clear placeholder like
<SUBACCOUNT_ID>
and tell the user how to find it (e.g., "run
btp list accounts/subaccount
to get the ID").
当用户使用自然语言描述需求时,请遵循以下方法:
  1. 确定操作。 用户想要执行什么操作?创建、列出、分配还是删除?
  2. 确定分组/对象。 该任务涉及 accounts、security 还是 services?具体对象是什么?
  3. 检查是否需要设定目标。 服务命令和安全命令几乎总是需要子账户目标。
  4. 填写参数。 如果缺少 ID、名称或值,应向用户询问。不要猜测 GUID。
  5. 建议使用 JSON 输出。 当用户编写脚本或需要提取特定值时,应主动建议。
提供命令时,始终给出完整、可直接运行的示例,而不是代码片段。如果某条命令需要尚未掌握的值(例如子账户 ID),请使用清晰的占位符,如
<SUBACCOUNT_ID>
,并告诉用户如何获取该值(例如,运行
btp list accounts/subaccount
获取 ID)。