UIP 配置
“uip config”的语法和选项,可读取、设置和清除 config.json 中存储的 CLI 配置首选项。
uip config 读取和写入 CLI 的本地配置文件 — 默认情况下,例如输出格式、日志级别以及管理 uip update 和 uip tools update 的版本/更新频道策略。通过从当前目录向上遍历到 $HOME 查找 .uipath/config.json 来发现文件,如果未找到,则回退到 ~/.uipath/config.json; --config-file 会覆盖任何动词的发现。
大纲
uip config get [key] [-c <path>]
uip config set <key> <value> [-c <path>]
uip config clear <key> [-c <path>]
uip config get [key] [-c <path>]
uip config set <key> <value> [-c <path>]
uip config clear <key> [-c <path>]
配置键
| 密钥 | 有效值 | 可写 | 描述 |
|---|---|---|---|
output | table、json、yaml、plain、markdown | 是 | CLI 命令的默认输出格式。 |
logLevel | error、warn、info、debug | 是 | 默认日志级别。 |
interactive | never, auto, always | 是 | 当 CLI 可能显示交互式提示词时。默认为 auto。 |
updateChannel | stable、preview(接受 dev,但不公布)。 | 是 | 用于解决工具更新的发布频道。 |
version | major.minor 或 major.minor.patch(例如1.2 或 1.2.3)。 | 是 | 版本策略:确切的 major.minor.patch 会完全冻结自动更新; major.minor 行会跟踪该行; unset 遵循最新版本。 |
clientSecret | — | 否 | 外部应用程序客户端密码已由 uip login 使用。对于 uip config,只读 — 通过 uip login --client-secret env.NAME 进行设置,以便密码保留在环境变量和身份验证文件中,而永远不会保留在 config.json 中。 |
当版本策略折叠为 autoVersionSync + versionSource 时,两个较旧的密钥 version 和 updateChannel 已被删除。运行 uip config set autoVersionSync ... 或 versionSource ... 现在失败并显示 Unknown config key,错误消息会将您引导至 version/updateChannel 等效项。
uip 配置获取
获取一个配置值,如果未提供键,则获取完整配置。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
[key] | 否 | 上述配置键之一。省略以显示整个配置文件。 |
选项
-c, --config-file <path>— 覆盖发现的特定配置文件的路径。
示例
uip config get output
uip config get output
# Show everything
uip config get
# Show everything
uip config get
数据形状(--输出 json)
单键:
{
"Code": "ConfigGet",
"Data": { "Key": "output", "Value": "table" }
}
{
"Code": "ConfigGet",
"Data": { "Key": "output", "Value": "table" }
}
未设置值的键将返回 Value: "-"。clientSecret(以及任何其他包含密码的密钥)始终返回 <redacted>,而非实际值。
无键 — 完整文件,已编辑密码:
{
"Code": "ConfigList",
"Data": {
"Config": {
"core": { "output": "table", "logLevel": "info", "updateChannel": "stable" },
"auth": { "clientId": "client-abc", "clientSecret": "<redacted>" }
}
}
}
{
"Code": "ConfigList",
"Data": {
"Config": {
"core": { "output": "table", "logLevel": "info", "updateChannel": "stable" },
"auth": { "clientId": "client-abc", "clientSecret": "<redacted>" }
}
}
}
ConfigGet 和 ConfigList 是不同的 Code 值,因此 JMESPath 使用者看到的每个 Code 都有一个稳定的形状,而不是根据是否传递 Data 来更改形状的 key 字段。
UIP 配置集
设置配置值。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<key> | 是 | 可写的配置键(上面除 clientSecret 以外的所有键)。 |
<value> | 是 | 新值。请根据该键允许的值(如果有)进行验证。 |
选项
-c, --config-file <path>— 覆盖发现的特定配置文件的路径。如果文件不存在,则系统将创建该文件。
示例
uip config set output table
uip config set output table
uip config set updateChannel preview
uip config set updateChannel preview
# Pin the CLI and tools to the 1.196 line (float — tracks patch releases within it)
uip config set version 1.196
# Freeze on an exact patch (no auto-update at all)
uip config set version 1.196.3
# Pin the CLI and tools to the 1.196 line (float — tracks patch releases within it)
uip config set version 1.196
# Freeze on an exact patch (no auto-update at all)
uip config set version 1.196.3
数据形状(--输出 json)
{
"Code": "ConfigSet",
"Data": { "Key": "output", "Value": "table", "Status": "Updated" }
}
{
"Code": "ConfigSet",
"Data": { "Key": "output", "Value": "table", "Status": "Updated" }
}
尝试设置 clientSecret 失败,ValidationError 会将您指向 uip login --client-secret env.NAME。枚举键的无效值(例如 uip config set output csv)将失败并显示 ValidationError,并列出有效值。
清除 UIP 配置
删除配置值。如果从未设置过键,则无操作(非错误)。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<key> | 是 | 可写的配置键。 |
选项
-c, --config-file <path>— 覆盖发现的特定配置文件的路径。
示例
# Un-pin the version so the CLI follows the latest release again
uip config clear version
# Un-pin the version so the CLI follows the latest release again
uip config clear version
# Clearing a key that was never set is a no-op
uip config clear updateChannel
# Clearing a key that was never set is a no-op
uip config clear updateChannel
数据形状(--输出 json)
{
"Code": "ConfigClear",
"Data": { "Key": "version", "Status": "Cleared" }
}
{
"Code": "ConfigClear",
"Data": { "Key": "version", "Status": "Cleared" }
}
当键没有要删除的值时,Status 为 "Not set",而不是 "Cleared"。
相关内容
- uip 更新—
config get version/config set version管理uip update和uip tools update解析的依据。 - uip 工具— 工具安装/更新读取相同的
version和updateChannel密钥。 - uip Login — 在
config.json之外设置凭据;此处的clientSecret处于只读状态是有原因的。