UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

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>]

所有uip config动词都遵循全局选项( --output 、 --output-filter 、 --log-level 、 --log-file )。退出代码遵循标准合同。

配置键​

密钥有效值可写描述
outputtable、json、yaml、plain、markdown是CLI 命令的默认输出格式。
logLevelerror、warn、info、debug是默认日志级别。
interactivenever, auto, always是当 CLI 可能显示交互式提示词时。默认为 auto。
updateChannelstable、preview(接受 dev,但不公布)。是用于解决工具更新的发布频道。
versionmajor.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处于只读状态是有原因的。

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新