- このガイドについて
- スタート アップ ガイド
- インストールしています。
- アップグレード
- Connecting and licensing
- 構成する
- Running workloads
- RPA processes and tests
- Agents, functions, and API workflows
- 上限量
- Securing and governing
- 監視
- トラブルシューティング
- 参照
- ロボットのコマンド ライン インターフェイス
- 環境変数
- ログ フィールド
- スタック トレースの詳細
ロボットのコマンド ライン インターフェイス
Robot Command Line Interface (UiRobot.exe) for starting automations, connecting to Orchestrator, and managing the Robot from a terminal.
The UiPath Robot Command Line Interface is a tool that allows you to interact with the Robot from a command line terminal. It uses the UiRobot.exe file to start automations, install processes, connect and disconnect the Robot from Orchestrator, and manage logs, tracing, the Robot session (PiP), proxy credentials, and the NuGet cache directly from the command line.
動作のしくみ
CLI を使用するには、次の点を確認します。
- Robot サービスが実行されていない
- Robot がインストールされているディレクトリで作業している。
Then enter instructions or commands that refer to the UiRobot.exe program along with the necessary parameters, depending on what you want your automation to achieve.
UiRobot.exe is in the Robot installation folder: %ProgramFiles%\UiPathPlatform\Robot\<version> for a per-machine installation, or %LocalAppData%\Programs\UiPathPlatform\Robot\<version> for a per-user installation.
Command and option names aren't case-sensitive.
When the Robot runs in service mode, the connect, disconnect, and flushlogs commands require an elevated command prompt (run as administrator).
たとえば、コマンド ラインからプロセスを開始するには、次のコマンドを使用します。
UiRobot.exe execute --file "C:\UiPath\Projects\YourProject\project.1.0.0.nupkg"
UiRobot.exe execute --file "C:\UiPath\Projects\YourProject\project.1.0.0.nupkg"
UiRobot.exe の一般的なコマンド
実行
このコマンドは、次の種類のプロジェクト ファイルの実行を開始する場合に使用します。
- NUPKG
- JSON (legacy projects only)
- XAML (legacy projects only)
Robot v2023.4 以降では、プロセスの実行と同時にプロセス リストが更新されます。ジョブの開始時にプロセスの更新が利用可能である場合、ジョブは古いバージョンのプロセスを使用します。それ以降の実行では、更新されたプロセスが適用されます。
execute コマンドでは、次の引数を使用します。
UiRobot.exe execute (--package-id <Package_ID> | --process-name <Process_Name> | --file <File_Path>) [--input <Input_Parameters>] [--folder <Orchestrator_Folder_Path>] [--entry <Entry_Point_Path>]
UiRobot.exe execute (--package-id <Package_ID> | --process-name <Process_Name> | --file <File_Path>) [--input <Input_Parameters>] [--folder <Orchestrator_Folder_Path>] [--entry <Entry_Point_Path>]
Use exactly one of --package-id, --process-name, and --file.
-
-p,--package-id <Package_ID>- Starts the process with this package ID, from the Orchestrator feed or the local feed. The Robot uses the available version of the package.例:
UiRobot.exe execute --package-id UiPathDemoUiRobot.exe execute --package-id UiPathDemoUiRobot.exe execute -p UiPathDemoUiRobot.exe execute -p UiPathDemo -
-r,--process-name <Process_Name>- Starts the process with this name, as defined in Orchestrator.例:
UiRobot.exe execute --process-name UiPathDemoProcessUiRobot.exe execute --process-name UiPathDemoProcess -
-f,--file <File_Path>- Starts the execution of a local project file. The target file can be NUPKG, or JSON or XAML for legacy projects only.例:
UiRobot.exe execute --file "C:\UiPath\Automation\project.1.0.0.nupkg"UiRobot.exe execute --file "C:\UiPath\Automation\project.1.0.0.nupkg" -
--folder <Orchestrator_Folder_Path>(optional) - The path of the Orchestrator folder from which to install and execute the target process, such asProduct/Development/QA. Required when the process is deployed in more than one folder.例:
UiRobot.exe execute --package-id UiPathDemo --folder "Product/Development/QA"UiRobot.exe execute --package-id UiPathDemo --folder "Product/Development/QA" -
-i,--input <Input_Parameters>(optional) - Input arguments for the execution, in JSON format.例:
UiRobot.exe execute --package-id UiPathDemo --input "{\"intArg\" : 3, \"strArg\" : \"hello\"}"UiRobot.exe execute --package-id UiPathDemo --input "{\"intArg\" : 3, \"strArg\" : \"hello\"}"UiRobot.exe execute --file "C:\UiPath\Automation\project.1.0.0.nupkg" --input "{\"intArg\" : 3, \"strArg\" : \"hello\"}"UiRobot.exe execute --file "C:\UiPath\Automation\project.1.0.0.nupkg" --input "{\"intArg\" : 3, \"strArg\" : \"hello\"}"In PowerShell, enclose the JSON in single quotes:
--input '{\"intArg\" : 3, \"strArg\" : \"hello\"}'. -
--entry <Entry_Point_Path>(optional) - Selects the entry point of the process. It applies to.nupkgfiles and--package-id. It is ignored when--filepoints to a.xamlor.jsonfile, and you can't use it with--process-name.例:
UiRobot.exe execute --file "C:\UiPath\Project\project.1.0.3.nupkg" --entry "OtherEntryPoint.xaml"UiRobot.exe execute --file "C:\UiPath\Project\project.1.0.3.nupkg" --entry "OtherEntryPoint.xaml"重要:- 以下のコマンドは、Windows プロジェクトまたはクロスプラットフォーム プロジェクトではサポートされていません。
UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml"UiRobot.exe execute --file "C:\UiPath\Automation\Main.xaml"UiRobot.exe execute --file "C:\UiPath\Automation\Project.json"UiRobot.exe execute --file "C:\UiPath\Automation\Project.json" - The
--processargument of earlier versions still works as an alias of--package-id.
- 以下のコマンドは、Windows プロジェクトまたはクロスプラットフォーム プロジェクトではサポートされていません。
プロセスをインストールする
このコマンドは、プロセスをインストールする場合に使用します。Robot が Orchestrator に接続されている場合、Robot は Orchestrator フィード内でプロセスを検索します。Orchestrator に接続されていない場合は、ローカル フィードを使用します。
installprocess コマンドでは、次の引数を使用します。
UiRobot.exe installprocess --process-name <process_name> [--folder <orchestrator_folder_path>]
UiRobot.exe installprocess --process-name <process_name> [--folder <orchestrator_folder_path>]
-
-p,--process-name <process_name>(mandatory) - The name of the process you want to install. The-pshort form means process name here, but package ID in theexecutecommand.例:
UiRobot.exe installprocess --process-name MyProcessUiRobot.exe installprocess --process-name MyProcess -
--folder <orchestrator_folder_path>(optional) - The full path of the Orchestrator folder containing the process you want to install, such asProduct/Development/QA. This argument applies only when the connection to Orchestrator is active. If only one folder contains the process for installation, skip this parameter.例:
UiRobot.exe installprocess --process-name MyProcess --folder "Product/Development/QA"UiRobot.exe installprocess --process-name MyProcess --folder "Product/Development/QA"
Connect
Use this command to connect your Robot to an Orchestrator instance. If your Robot is already connected to a different Orchestrator instance or with different credentials, the command returns the "Orchestrator already connected" message. Run disconnect first to switch. Running it again with the same URL and credentials succeeds and changes nothing.
connect コマンドでは、次の引数を使用します。
UiRobot.exe connect --url <Orchestrator_Server_URL> --clientId <Client_ID> --clientSecret <Client_Secret>
UiRobot.exe connect --url <Orchestrator_Server_URL> --clientId <Client_ID> --clientSecret <Client_Secret>
-
connect- Establishes the connection to Orchestrator. Must be used together with the--url,--clientId, and--clientSecretarguments.例:
UiRobot.exe connect --url https://cloud.uipath.com/<Organization_Name>/<Tenant_Name>/orchestrator_ --clientId <Client_ID> --clientSecret <your-client-secret>UiRobot.exe connect --url https://cloud.uipath.com/<Organization_Name>/<Tenant_Name>/orchestrator_ --clientId <Client_ID> --clientSecret <your-client-secret>The command also accepts
--urlwith--key <Machine_Key>for a machine key connection. Robots connected with a machine key don't run agents, functions, or API workflows by default, and the command prints a message that calls machine key connections deprecated. For the differences, refer to Connecting the Robot to Orchestrator.
切断
このコマンドを使用すると、Robot を現在の Orchestrator インスタンスから切断できます。
disconnect コマンドでは、次の引数を使用します。
UiRobot.exe disconnect [--force | --wait]
UiRobot.exe disconnect [--force | --wait]
-
disconnect- ロボット端末で実行中のジョブがない場合にのみ、Robot を Orchestrator から切断します。例:
UiRobot.exe disconnectUiRobot.exe disconnect -
--force- マシン上で実行中のすべてのジョブを強制終了し、Robot を Orchestrator から切断します。例:
UiRobot.exe disconnect --forceUiRobot.exe disconnect --force -
--wait- 実行中のジョブが完了するまで待機してから、Robot を Orchestrator から切断します。例:
UiRobot.exe disconnect --waitUiRobot.exe disconnect --wait
You can't use --force and --wait together. The disconnectandsignout command takes the same arguments, and also signs out the current user.
Trace (トレース)
Use this command to enable or disable low-level tracing of the UiPath drivers and the browser extension. Tracing of the Robot Executor and Service is always on, and the command prints a warning about it.
trace コマンドでは、次の引数を使用します。
UiRobot.exe trace --enableLowLevel | --disableLowLevel
UiRobot.exe trace --enableLowLevel | --disableLowLevel
-
--enableLowLevel- Starts low-level tracing of the UiPath drivers and the browser extension. Requires administrator rights.例:
UiRobot.exe trace --enableLowLevelUiRobot.exe trace --enableLowLevel -
--disableLowLevel- Stops it and saves the trace asUiPathTrace-<id>.etlon the Desktop of the user who runs the command. Requires administrator rights. Without them, the command shows an error but still returns exit code0.例:
UiRobot.exe trace --disableLowLevelUiRobot.exe trace --disableLowLevel
PiP
このコマンドは、マシンのロボット セッションまたはピクチャ イン ピクチャ機能を有効化または無効化する場合に使用します。この設定は既存のインストールを変更します。また、ローカル マシン上のすべてのユーザーに適用されます。管理者権限が必要です。
PiP コマンドでは、次の引数を使用します。
UiRobot.exe pip --enable | --disable
UiRobot.exe pip --enable | --disable
-
--enable- Enables the Robot session (PiP functionality) of the machine.例:
UiRobot.exe pip --enableUiRobot.exe pip --enable -
--disable- Disables the Robot session (PiP functionality) of the machine.例:
UiRobot.exe pip --disableUiRobot.exe pip --disable
NuGet のキャッシュをクリーンアップする
このコマンドは、NuGet キャッシュをクリーンアップする場合に使用します。対象となるのは、グローバル パッケージ キャッシュ (復元された .nupkg コンテンツが存在する場所) と HTTP キャッシュ (NuGet フィードの応答キャッシュ) です。この操作中はジョブを実行しないでください。
NuGet キャッシュのクリーンアップ コマンドでは、次の引数を使用します。
UiRobot.exe cleannugetcache [--period <period_in_days>] [--timeout <timeout_in_minutes>] [--allow-unsafe]
UiRobot.exe cleannugetcache [--period <period_in_days>] [--timeout <timeout_in_minutes>] [--allow-unsafe]
-
-p,--period <period_in_days>(optional, default30) - Deletes global-packages entries whose.nupkg.metadatafile has not been accessed in the last X days. Stale or corrupt package folders (missing.nupkg.metadata) are removed regardless of this value, unless they are listed innugetclean.ignore. The HTTP cache is wiped in full regardless of this value. Must be greater than0.例:
UiRobot.exe cleannugetcache --period 60UiRobot.exe cleannugetcache --period 60 -
-t,--timeout <timeout_in_minutes>(optional, default10) - Maximum time, in minutes, to wait for the cleanup. Press Ctrl+C to cancel the cleanup; the command then prints a partial summary.例:
UiRobot.exe cleannugetcache --timeout 20UiRobot.exe cleannugetcache --timeout 20 -
--allow-unsafe(optional, defaultfalse) - By default, the command refuses to run if the Robot packages folder (PackagesInstallationFolderinUiPath.config) differs from the default NuGet global-packages folder (a folder that may be shared with other users). Use this flag to force cleanup of the Robot packages folder.重要:Cleaning a shared packages folder may break running jobs or apps belonging to other users sharing the folder.
例:
UiRobot.exe cleannugetcache --period 30 --allow-unsafeUiRobot.exe cleannugetcache --period 30 --allow-unsafe
このコマンドは、クリーンアップの概要を global-packages および http-cache 別に分類して出力します。一致した総数のうち、削除されたエントリの数が含まれます。
To protect package folders from the cleanup, list them in a nugetclean.ignore file in the global-packages folder. Write one package folder per line, as an absolute path or a path relative to the global-packages folder. A line with only a package ID keeps every version of that package. Blank lines and lines that start with # are ignored.
プロキシ基本認証の資格情報を設定する
このコマンドは、現在のユーザーにプロキシ基本認証の資格情報を設定する場合に使用します。資格情報はローカルに保持され、基本認証が必要なプロキシ経由で通信する際にロボットによって使用されます。
set proxy コマンドでは、次の引数を使用します。
UiRobot.exe setproxy --username <user> --password <password> [--domain <domain>]
UiRobot.exe setproxy --username <user> --password <password> [--domain <domain>]
-
--username <user>(必須) - プロキシ基本認証用のユーザー名です。 -
--password <password>(必須) - プロキシ基本認証のパスワードです。例:
UiRobot.exe setproxy --username myuser --password <your-password>UiRobot.exe setproxy --username myuser --password <your-password> -
--domain <domain>(任意) - プロキシ基本認証用のドメインです。プロキシでドメイン修飾資格情報が必要な場合に使用します。例:
UiRobot.exe setproxy --username myuser --password <your-password> --domain MYDOMAINUiRobot.exe setproxy --username myuser --password <your-password> --domain MYDOMAIN
このコマンドを実行すると、以前に保存したプロキシ資格情報はすべて上書きされます。
その他の引数
次の引数は純粋に情報を提供するものであり、オートメーション プロジェクトには影響しません。
version- Displays information about the Robot version. The--versionform also works.--help- サポートされているコマンドのリスト、および対応する情報と例を表示します。flushlogs [--timeout <timeout_in_seconds>]- Sends all pending logs to Orchestrator. The default timeout is 30 seconds.
終了コード
UiRobot.exe returns the following exit codes:
| 終了コード | 意味 |
|---|---|
0 | The command succeeded. For execute, the job completed successfully. |
1 | For execute, the job failed. For cleannugetcache, the cleanup didn't complete successfully. |
2 | For execute, the job suspended. The command prints the resumeId of the suspended job. |
-1 | The command was used incorrectly (invalid or missing arguments), or it failed with an error. |