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

uip context-grounding

Syntax and options for `uip context-grounding`, a bridge to the Python UiPath CLI for context grounding operations.

uip context-grounding is a thin bridge to the Python-based UiPath SDK's context grounding operations. It detects a suitable Python interpreter, confirms the uipath Python package is installed, and forwards everything else to the Python CLI as uipath context-grounding <args> — this tool defines no native subcommands of its own beyond setup.

Unlike uip codedagent, which only forwards a fixed whitelist of subcommand names, context-grounding-tool forwards any unrecognized command — there is no allowlist to consult before a new Python-side verb works here.

有关精简包装器与完整工具的不同,请参阅工具(插件)

大纲

uip context-grounding setup [--force]
uip context-grounding <any-command> [args...]
uip context-grounding help
uip context-grounding
uip context-grounding setup [--force]
uip context-grounding <any-command> [args...]
uip context-grounding help
uip context-grounding

setup and any forwarded command honor the global options (--output, --output-filter, --log-level, --log-file). Exit codes follow the standard contract.

uip context-grounding setup

检测 Python 并验证是否已安装uipath包。结果缓存在基于用户的文件中,因此后续context-grounding命令可以立即解析 Python 二进制文件。

参数

无。

选项

  • --force — 即使存在缓存结果,也会重新运行检测。

示例

uip context-grounding setup
uip context-grounding setup --force
uip context-grounding setup
uip context-grounding setup --force

数据形状 ( --output json )

{
  "Code": "ContextGroundingSetup",
  "Data": {
    "PythonPath": "/usr/bin/python3.11",
    "Package": "uipath",
    "PackageInstalled": "Yes",
    "PackageVersion": "1.0.0"
  }
}
{
  "Code": "ContextGroundingSetup",
  "Data": {
    "PythonPath": "/usr/bin/python3.11",
    "Package": "uipath",
    "PackageInstalled": "Yes",
    "PackageVersion": "1.0.0"
  }
}

环境检查

  • 允许的 Python 版本通过环境变量PYTHON_TOOL_PYTHON_VERSIONS配置。空列表会在设置时引发Failure
  • 如果当前工作目录中存在.venv目录,但未激活虚拟环境,安装程序将拒绝运行,并建议首先激活虚拟环境(在 Windows 上为.venv\Scripts\activate ,在其他地方为source .venv/bin/activate )。

已转发的命令

Any subcommand that isn't setup or help is forwarded to the Python uipath CLI as uipath context-grounding <args> — there is no fixed whitelist to check against; a brand-new verb the Python package adds tomorrow works here today, with one exception:

备注:

auth is blocked. Calling uip context-grounding auth ... fails immediately with Result: ValidationError (exit code 3) and the message "Use 'uip login' for authentication."unless you pass --force, which bypasses this one filter and lets the auth call through to Python. This is the opposite of --force's effect on uip codedagent, where --force is always silently stripped and never reaches Python — here it's a real, if narrow, escape hatch.

示例

# Hand off to the Python CLI's index command
uip context-grounding index ./my-index

# Search a context grounding index
uip context-grounding search "invoice total" --index my-index

# Blocked without --force
uip context-grounding auth login
# Result: ValidationError — "Use 'uip login' for authentication."

# Bypasses the auth filter
uip context-grounding auth login --force
# Hand off to the Python CLI's index command
uip context-grounding index ./my-index

# Search a context grounding index
uip context-grounding search "invoice total" --index my-index

# Blocked without --force
uip context-grounding auth login
# Result: ValidationError — "Use 'uip login' for authentication."

# Bypasses the auth filter
uip context-grounding auth login --force
备注:

Because forwarded commands are defined by the uipath Python package, their flags and output shape are whatever that package emits — not the CLI's standard Code/Data envelope. Treat the CLI here as a transport. For the argument surface, run uip context-grounding <command> --help.

Output-format relay: when the global --output is json, the CLI appends --format json to the forwarded command automatically (skipped for --help calls, or when the forwarded args already contain --format) — the Python CLI must support --format json for this to have any effect; no other output format is relayed this way.

Bare invocation and help both forward — unlike uip codedagent (where bare help shows Commander's own help), uip context-grounding with no arguments forwards to exec --help, and uip context-grounding help explicitly forwards to the same exec --help call. Both surface the Python package's own help text, not this tool's.

Auth relay: before forwarding, the CLI reads the session created by uip login and injects it into the Python subprocess's environment, the same mechanism uip codedagent uses. If you are not logged in, forwarding still works; the Python CLI runs without those variables.

退出代码

Standard exit codes apply, plus 3 specifically for the blocked auth command described above. The forwarded subprocess's exit code is otherwise relayed directly to the parent shell.

  • 工具(插件) —Thin-Wapper 工具模型。
  • uip codedagent — the same Python-bridge pattern, with a fixed forwarding whitelist instead of forwarding everything.
  • uip login — 创建中继到 Python 运行时的会话。
  • uip tools — 安装、更新、卸载context-grounding-tool包本身。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新