UiPath Documentation
uipath-cli
latest
false
UiPath CLI ユーザー ガイド
重要 :
このコンテンツは機械翻訳によって処理されています。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

uip codedagent

「uip codedagent」の構文とオプション- コード化されたエージェントを構築および実行するための Python UiPath CLI へのブリッジです。

uip codedagent は、Python ベースの UiPath コード化されたエージェント ワークフローへの細いブリッジです。適切な Python インタプリタを検出し、 uipath Python パッケージがインストールされていることを確認し、サブコマンドの固定ホワイトリストを Python CLI に転送します。review 1 つの例外は、このツールに直接実装されるネイティブ コマンドであり、転送されるものではありません。

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

概要​

uip codedagent setup [--force]
uip codedagent review [path] [--checks <categories>]
uip codedagent <whitelisted-command> [args...]
uip codedagent setup [--force]
uip codedagent review [path] [--checks <categories>]
uip codedagent <whitelisted-command> [args...]

setup、 review、および転送されたコマンドには、 グローバル オプション (--output、 --output-filter、 --log-level、 --log-file) が適用されます。終了コードは 標準契約に従います。

UIP CodedAgent レビュー​

コード化されたエージェント プロジェクトを決定論的なルール セットに照らして確認する — Python インタープリターは不要で、CLI でネイティブに実行されます。評定 (PASS/FAIL)、スコア (0 から 100)、文字の成績 (A+...F)、および課題のリストを返します。

引数​

名前Required目的
[path]×エージェント プロジェクト ディレクトリ。既定値は .です。

オプション​

  • --checks <categories> — 実行するルールのカテゴリをコンマ区切りで指定します。すべてのルールを実行する場合は省略します。既知のカテゴリには、 evals、 schema、 tools、 guardrails、 code、 general (ライブ リストの場合は実行 uip codedagent review --help ) などがあります。
uip codedagent review ./my-coded-agent
uip codedagent review --checks code
uip codedagent review ./my-coded-agent
uip codedagent review --checks code

データシェイプ (--output json)​

{
  "Code": "CodedAgentReview",
  "Data": {
    "ProjectDir": "./my-coded-agent",
    "Verdict": "PASS",
    "Score": 100,
    "Grade": "A+",
    "Issues": [],
    "Strengths": [],
    "Stats": {
      "errors": 0,
      "warnings": 0,
      "infos": 0,
      "byCategory": { "evals": 0, "schema": 0, "tools": 0, "guardrails": 0, "code": 0, "general": 0 }
    }
  }
}
{
  "Code": "CodedAgentReview",
  "Data": {
    "ProjectDir": "./my-coded-agent",
    "Verdict": "PASS",
    "Score": 100,
    "Grade": "A+",
    "Issues": [],
    "Strengths": [],
    "Stats": {
      "errors": 0,
      "warnings": 0,
      "infos": 0,
      "byCategory": { "evals": 0, "schema": 0, "tools": 0, "guardrails": 0, "code": 0, "general": 0 }
    }
  }
}

認識されない --checks 値は失敗し、既知のカテゴリが一覧表示される Code: "CodedAgentReviewInvalidChecks"が表示されます。

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. The cache is shared with uip function setup, so running either command configures Python for both.

When a virtual environment is active (VIRTUAL_ENV is set), setup binds the Python interpreter and the uipath executable from that environment. A cached result whose uipath executable is outside the active virtual environment is detected again.

引数​

設定はありません。

オプション​

  • --force — キャッシュされた結果が存在する場合でも、検出を再実行します。
uip codedagent setup
uip codedagent setup --force
uip codedagent setup
uip codedagent setup --force

データシェイプ (--output json)​

{
  "Code": "CodedAgentsSetup",
  "Data": {
    "PythonPath": "/usr/bin/python3.11",
    "Package": "uipath",
    "PackageInstalled": "Yes",
    "PackageVersion": "1.0.0",
    "UipathPath": "/home/me/my-agent/.venv/bin/uipath",
    "Source": "venv"
  }
}
{
  "Code": "CodedAgentsSetup",
  "Data": {
    "PythonPath": "/usr/bin/python3.11",
    "Package": "uipath",
    "PackageInstalled": "Yes",
    "PackageVersion": "1.0.0",
    "UipathPath": "/home/me/my-agent/.venv/bin/uipath",
    "Source": "venv"
  }
}
フィールド説明
PythonPathPython interpreter that setup bound.
PackagePython package that setup checked.
PackageInstalledYes または No。
PackageVersionInstalled package version, or N/A.
UipathPathPath to the uipath executable that forwarded commands run.
SourceWhere the interpreter came from: venv (the virtual environment active through VIRTUAL_ENV during setup) or path (an interpreter found by name on PATH).

環境チェック​

  • 許可される Python のバージョンは、環境変数 ( PYTHON_TOOL_PYTHON_VERSIONS) を使用して構成されます。リストが空の場合、セットアップ時に Failure が発生します。
  • When a virtual environment is active but the uipath package is not installed in it, setup fails and asks you to install the package inside that environment, then re-run uip codedagent setup --force.
  • If a .venv directory exists in the current working directory but no virtual environment is activated (VIRTUAL_ENV is not set), setup refuses to run and suggests activating it first (.venv\Scripts\activate on Windows, source .venv/bin/activate elsewhere).

転送されるコマンド​

A fixed whitelist of subcommand names is forwarded to the uipath Python CLI as codedagent exec <subcommand> ...: add, debug, deploy, dev, eval, init, invoke, list-models, new, pack, publish, pull, push, register, run. Anything outside this list — including a typo — is rejected by Commander as an unknown command before any forwarding is attempted; it is not passed through to Python.

# 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
注:

これらのコマンドは uipath Python パッケージによって定義されているため、そのフラグと出力形状は、CLI の標準の Code/Data エンベロープではなく、そのパッケージが出力するものです。ここでは、CLI をトランスポートとして扱います。引数サーフェスについては、 uip codedagent <command> --helpを実行します。このコマンドは Python に転送されます。ベア uip codedagent help は転送 されません — codedagent-tool は help コマンドを登録しないため、代わりに Commander 自身が生成したこのツールのヘルプを表示します。

認証リレー:転送する前に、CLI は uip login によって作成されたセッションを読み取り、次の環境変数を Python サブプロセスに挿入して、SDK が自動的に取得するようにします。

  • UIPATH_ACCESS_TOKEN
  • UIPATH_URL ( <baseUrl>/<org>/<tenant>として構成)
  • UIPATH_ORGANIZATION_ID、UIPATH_ORGANIZATION_NAME
  • UIPATH_TENANT_ID、UIPATH_TENANT_NAME

ログインしていない場合でも、転送は機能します。Python CLI は、これらの変数なしで実行されます。

--forceは常に取り除かれます: このツールは --forceのコマンド固有のルールを定義していないため、転送されたすべてのコマンドの引数が Python CLI に到達する前に無条件かつサイレントに取り除かれます。それは決してPythonに到達せず、エラーも出されません — 転送されたサブコマンドに --force 渡すことは単にno-opです。

pushには UIPATH_PROJECT_IDが必要です — 必須の環境変数であり、Python CLI が単独で強制するものではありません。プロジェクトごとに 1 回設定します。

echo "UIPATH_PROJECT_ID=<id>" >> .env
uip codedagent push
echo "UIPATH_PROJECT_ID=<id>" >> .env
uip codedagent push

Studio Web の既存のコード化されたエージェント プロジェクトから <id> を取得します。uip codedagent push --helpでは、このチェックはスキップされます。

deploy/publish --my-workspace (or -w) requires a personal-workspace-capable login scope — another native, pre-forwarding check. It reads your current uip login access token and requires the umbrella OrchestratorApiUserAccess scope or the granular OR.Users or OR.Users.Read scope (any one satisfies it); a token missing all of them fails before anything reaches Python:

{
  "Result": "Failure",
  "Message": "Current login token is missing the OrchestratorApiUserAccess (or granular OR.Users.Read) scope required for --my-workspace.",
  "Instructions": "The personal workspace publish path calls Orchestrator GetCurrentUserExtended and requires either the umbrella OrchestratorApiUserAccess scope or the granular OR.Users.Read scope. If you are using the default client, run `uip login` again — IdentityServer attaches OrchestratorApiUserAccess to issued tokens automatically. ..."
}
{
  "Result": "Failure",
  "Message": "Current login token is missing the OrchestratorApiUserAccess (or granular OR.Users.Read) scope required for --my-workspace.",
  "Instructions": "The personal workspace publish path calls Orchestrator GetCurrentUserExtended and requires either the umbrella OrchestratorApiUserAccess scope or the granular OR.Users.Read scope. If you are using the default client, run `uip login` again — IdentityServer attaches OrchestratorApiUserAccess to issued tokens automatically. ..."
}

既定の uip login クライアントは自動的に OrchestratorApiUserAccess を取得するため、カスタム クライアントまたは制限付きスコープ リストのみが対象となります。代わりにテナント フィードにデプロイすることで、確認を完全にスキップできます ( uip codedagent deploy --tenant)。このチェックは、--my-workspace/-wが合格した場合にのみdeploy/publishに適用されます。プレーンなdeploy/publishやその他のホワイトリストにリストされたコマンドに対しては実行されません。

終了コード​

標準の 終了コード が適用されます。転送されたサブプロセスの終了コードは親シェルに直接中継されるため、Python側の障害は同じゼロ以外のステータスで uip codedagent 終了します。

  • ツール (プラグイン) — シンラッパーツールモデル。
  • uip login — Python ランタイムにリレーされるセッションを作成します。
  • uip tools — codedagent-toolパッケージ自体をインストール、更新、アンインストールします。

このページは役に立ちましたか?

接続

ヘルプ リソース サポート(opens in new window)

学習する UiPath アカデミー(opens in new window)

質問する UiPath フォーラム(opens in new window)

最新情報を取得