UiPath Documentation
uipath-cli
latest
false

UiPath CLI user guide

上次更新日期 2026年5月7日

uip codedagent

uip codedagent is a thin bridge to the Python-based UiPath Coded Agents workflow. It detects a suitable Python interpreter, confirms the uipath Python package is installed, and then forwards every other subcommand into the Python CLI — so new, dev, pack, publish, and other lifecycle verbs come from the Python package rather than this tool.

See Tools (plugins) for how thin wrappers differ from full tools.

Synopsis

uip codedagent setup [--force]
uip codedagent <any-command> [args...]
uip codedagent setup [--force]
uip codedagent <any-command> [args...]

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

uip codedagent setup

Detect Python and verify the uipath package is installed. Results are cached in a per-user file so subsequent codedagent commands can resolve the Python binary instantly.

Arguments: none.

Options:

  • --force — Re-run detection even if a cached result is present.

示例:

uip codedagent setup
uip codedagent setup --force
uip codedagent setup
uip codedagent setup --force

Data shape (--output json):

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

Environment checks:

  • Allowed Python versions are configured via the environment variable PYTHON_TOOL_PYTHON_VERSIONS. An empty list raises Failure at setup time.
  • If a .venv directory exists in the current working directory but no virtual environment is activated, setup refuses to run and suggests activating it first (.venv\Scripts\activate on Windows, source .venv/bin/activate elsewhere).

Forwarded commands

Any subcommand other than setup, exec, or help is transparently forwarded to the uipath Python CLI as codedagent exec <subcommand> .... This means the Python package's own command surface — new, dev, run, pack, publish, and anything else it ships — is reachable via uip codedagent.

示例:

# Hand off to the Python CLI's new command
uip codedagent new my-agent

# Run the Python CLI's help for a sub-verb
uip codedagent init --help

# Execute a dev loop defined by the Python package
uip codedagent dev
# Hand off to the Python CLI's new command
uip codedagent new my-agent

# Run the Python CLI's help for a sub-verb
uip codedagent init --help

# Execute a dev loop defined by the Python package
uip codedagent dev
备注:

Because these 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 codedagent help or uip codedagent <command> --help, both of which are forwarded into Python.

Auth relay: before forwarding, the CLI reads the session created by uip login and injects these environment variables into the Python subprocess so the SDK picks them up automatically:

  • UIPATH_ACCESS_TOKEN
  • UIPATH_URL (composed as <baseUrl>/<org>/<tenant>)
  • UIPATH_ORGANIZATION_ID, UIPATH_ORGANIZATION_NAME
  • UIPATH_TENANT_ID, UIPATH_TENANT_NAME

If you are not logged in, forwarding still works; the Python CLI runs without those variables.

Blocked flags: the forwarder refuses to pass --force through to some destructive Python subcommands (the exact list is enforced by the tool's config layer) and emits ValidationError when it sees one. Use the non---force alternative the error message suggests.

退出代码

Standard exit codes apply. The forwarded subprocess's exit code is relayed directly to the parent shell, so a Python-side failure exits uip codedagent with the same non-zero status.

  • Tools (plugins) — thin-wrapper tool model.
  • uip login — creates the session that is relayed to the Python runtime.
  • uip tools — install, update, uninstall the codedagent-tool package itself.
  • Synopsis
  • uip codedagent setup
  • Forwarded commands
  • 退出代码
  • Related

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新