跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.cloudx.io/llms.txt

Use this file to discover all available pages before exploring further.

配置

cloudx config 命令用于检查、验证、编辑和发布 CloudX 中保存的库存配置。 可用命令:
  • cloudx config show:查看实时配置、已发布版本或草稿
  • cloudx config validate:验证本地 YAML 文件或远程配置
  • cloudx config edit create-line-item:向草稿中新增订单项
  • cloudx config edit update-line-item:在草稿中修补订单项
  • cloudx config edit delete-line-item:从草稿中删除订单项
  • cloudx config publish:将草稿发布为实时配置
  • cloudx config history:查看已发布配置历史和发布时的差异统计

cloudx config show

默认以 YAML 显示配置。 当您需要查看 CloudX 为某个账号保存的精确库存配置、对比已发布版本,或在发布前检查草稿时,请使用此命令。

用法

cloudx config show [flags]

寻址方式

默认情况下,config show 返回实时配置。 每次只能使用一种寻址方式:
方式说明
不传寻址标志显示实时配置。
--id <config-id>按稳定 ID 显示指定配置行。可指向已发布版本或草稿。
--version <number>显示账号内的已发布版本号。
--draft显示账号草稿。如存在多个草稿,请改用 --id

标志

标志必需默认值说明
--id稳定配置行 ID。
--version已发布配置版本号。必须大于 0
--draftfalse显示当前账号草稿。
--with-metadatafalse在输出中包含配置行元数据。
--jsonfalse输出结构化 JSON,而不是默认 YAML。
验证规则:
  • --id--version--draft 只能使用一个。
  • --version 必须大于 0

输出格式

默认情况下,命令只打印配置 YAML,不包含行元数据:
cloudx config show
使用 --json 只输出原始配置数据 JSON:
cloudx config show --version 12 --json
当需要 config ID、账号 ID、类型、版本号、创建时间、创建者元数据、YAML 和原始数据等字段时,使用 --with-metadata
cloudx config show --version 12 --with-metadata
cloudx config show --id cfg_123 --with-metadata --json

示例

显示实时配置

cloudx config show

显示已发布版本

cloudx config show --version 12

按 ID 显示配置

cloudx config show --id cfg_123

显示带元数据的草稿

cloudx config show --draft --with-metadata

cloudx config validate

验证本地 YAML 文件或远程配置。 在提交配置评审前、使用 cloudx config edit 创建草稿后,或需要面向自动化流程的 JSON 验证输出时,请使用此命令。

用法

cloudx config validate [file] [flags]

本地与远程验证

传入文件路径时,验证完全在本地运行,不会调用 API:
cloudx config validate config.yaml
省略文件路径时,默认验证远程实时配置:
cloudx config validate
使用 --id 验证指定配置行,包括由 config edit 创建的草稿;使用 --version 验证已发布版本:
cloudx config validate --id draft_123
cloudx config validate --version 12

标志

标志必需默认值说明
file要验证的本地 YAML 文件。省略时验证远程实时配置。
--id要远程验证的稳定配置行 ID。
--version要远程验证的已发布配置版本号。必须大于 0
--strictfalse存在验证警告时也以非零状态退出。
--jsonfalse输出结构化 JSON,而不是人类可读输出。
验证规则:
  • 本地文件验证不支持 --id--version
  • 远程验证只支持 --id--version 之一。
  • --version 必须大于 0
  • 未使用 --strict 时,警告会显示但不会导致命令失败。
  • 使用 --strict 时,错误或警告都会让命令以非零状态退出。

示例

验证本地 YAML 文件

cloudx config validate config.yaml

出现警告时失败

cloudx config validate config.yaml --strict

验证实时配置

cloudx config validate

验证草稿并输出 JSON

cloudx config validate --id draft_123 --json

验证已发布版本

cloudx config validate --version 12

cloudx config edit

在配置草稿中编辑订单项。 编辑命令只保存草稿,不会发布配置。默认情况下,CLI 会基于实时配置创建草稿。使用 --config-id 可原地编辑已有草稿,或将指定配置行复制成新的草稿后编辑。当草稿准备好上线时,请使用 cloudx config publish 每次编辑后,CloudX 都会验证生成的草稿。默认的人类可读输出包含草稿 ID、草稿是新建还是更新、基础配置 ID、变更路径以及验证计数。如果验证发现问题,输出还会显示 cloudx config validate --id <draft-id> 命令,方便查看详情。

命令

命令说明
cloudx config edit create-line-item在配置草稿中创建订单项。
cloudx config edit update-line-item在配置草稿中修补已有订单项。
cloudx config edit delete-line-item从配置草稿中删除订单项。

共享标志

标志必需默认值说明
--config-id要编辑的配置行 ID。草稿会被原地编辑;已发布或实时配置会被复制成新草稿。
--summary根据编辑生成草稿标签或编辑摘要。
--strictfalse存在验证警告时以非零状态退出。验证错误始终以非零状态退出。
--jsonfalse输出结构化 JSON,而不是默认简洁输出。

创建订单项

cloudx config edit create-line-item [flags]
创建订单项时必须提供以下核心字段:
标志说明
--name <name>订单项名称。
--priority <number>订单项优先级。数字越小越先评估。
--bidfloor <usd-cpm>订单项底价,单位为十进制 USD CPM。例如 1.5 表示 $1.50 CPM。
创建订单项还必须指定且只能指定一个目标:
标志说明
--ad-unit-id <id>目标广告单元 ID。
--ad-unit-group-id <id>目标广告单元组 ID。
可选字段:
标志说明
--status <status>订单项状态,例如 draftactivepaused
--bidder <adapter>要为此订单项启用的竞价方适配器。可重复传入多个竞价方。
示例:
cloudx config edit create-line-item \
  --name "US Rewarded" \
  --priority 2 \
  --bidfloor 1.5 \
  --ad-unit-id au_123 \
  --bidder meta \
  --bidder unityAds

更新订单项

cloudx config edit update-line-item --id <line-item-id> [fields]
更新命令是 patch 语义。只有 --id 始终必需;除此之外至少传入一个要修改的字段。未提供的字段保持原值不变。使用 --ad-unit-id--ad-unit-group-id 更改目标时,会清除之前的目标引用。 可修补字段:
标志说明
--id <id>订单项 ID。必需。
--name <name>可选。修补订单项名称。
--priority <number>可选。修补订单项优先级。
--bidfloor <usd-cpm>可选。修补订单项底价,单位为十进制 USD CPM。
--status <status>可选。修补订单项状态。
--ad-unit-id <id>可选。修补目标广告单元 ID,并清除任何广告单元组目标。
--ad-unit-group-id <id>可选。修补目标广告单元组 ID,并清除任何广告单元目标。
--bidder <adapter>可选。用提供的竞价方适配器列表替换现有竞价方。可重复传入多个竞价方。
--clear-bidders可选。清空订单项上的所有竞价方。不能与 --bidder 同时使用。
验证规则:
  • --id 外,至少传入一个要修改的字段。
  • --ad-unit-id--ad-unit-group-id 只能使用一个。
  • --bidder--clear-bidders 只能使用一个。
示例:
cloudx config edit update-line-item --id li_123 --bidfloor 1.5
cloudx config edit update-line-item --id li_123 --priority 3 --status paused
cloudx config edit update-line-item --id li_123 --clear-bidders

删除订单项

cloudx config edit delete-line-item --id <line-item-id>
只有 --id 是必需字段。 示例:
cloudx config edit delete-line-item --id li_123
cloudx config edit delete-line-item --id li_123 --summary "Remove old rewarded line item"

cloudx config publish

将配置草稿发布为实时配置。 编辑并验证草稿后使用此命令。草稿上线前,CloudX 会运行与控制台相同的发布时验证检查。

用法

cloudx config publish --id <draft-id> [flags]

标志

标志必需默认值说明
--id要发布为实时配置的草稿配置行 ID。
--version-label已发布配置版本的可选标签。
--jsonfalse输出结构化 JSON,而不是默认简洁输出。
验证行为:
  • 验证错误会阻止发布,并使命令以非零状态退出。
  • 警告会在成功发布后显示,但不会导致命令失败。
  • 如果仍有警告,输出会显示 cloudx config validate --id <config-id> 命令,方便查看详情。

示例

发布草稿

cloudx config publish --id draft_123

发布并添加版本标签

cloudx config publish --id draft_123 --version-label "May floor update"

以 JSON 输出发布响应

cloudx config publish --id draft_123 --json

调整竞价底价并发布

cloudx config edit update-line-item --id li_123 --bidfloor 1.5 --summary "Raise US rewarded floor"
cloudx config validate --id draft_123
cloudx config publish --id draft_123 --version-label "Raise US rewarded floor"

cloudx config history

默认以表格列出配置历史行。 当您需要查看最近的配置发布、确认创建者,或查看发布时预计算的新增和删除差异数量时,请使用此命令。

用法

cloudx config history [flags]

标志

标志必需默认值说明
--since只包含在此时间之后创建的配置。支持 RFC3339 时间戳或 YYYY-MM-DD 日期。
--author按创建者用户 ID、邮箱或姓名子串过滤。
--include-draftsfalse包含配置草稿。默认只返回已发布版本。
--jsonfalse输出结构化 JSON,而不是默认表格。
验证规则:
  • --since 必须是 RFC3339 时间戳或 YYYY-MM-DD 日期。

输出格式

默认表格包含配置 ID、版本号、类型、创建时间、创建者、差异摘要、版本标签和描述。
cloudx config history
差异值显示为 +新增/-删除,使用配置发布时计算出的 diff_additionsdiff_deletions 值。 脚本需要原始响应字段时,使用 --json
cloudx config history --since 2026-05-01 --json

示例

列出已发布配置历史

cloudx config history

列出最近配置变更

cloudx config history --since 2026-05-01

按创建者过滤

cloudx config history --author alice@example.com

包含草稿

cloudx config history --include-drafts

相关链接