UiPath Documentation
uipath-cli
2026.10
false
UiPath CLI ユーザー ガイド

uip 関数

「uip 関数」の構文とオプション - UiPath JS/TS 関数と Python 関数を構築、提供、実行、パブリッシュします。

uip function は、 UiPath Functions — UiPath プラットフォーム上でパッケージ化および実行される小型の JS/TS または Python ハンドラーを構築、提供、パブリッシュします。uip function は正規のグループ名です。 uip functions (複数形) はエイリアスとして受け入れられます。

概念​

  • 1 つのコマンド グループ。uip function は両方の言語に対応しています。現在のディレクトリにある uipath.json、package.json、pyproject.toml、あるいは newの --language/-l からプロジェクトの言語を検出し、一致する JS/TS または Python ツールを実行します。このページに記載されていないオプションは、そのツールに渡されます (例: uip function serve --production)。
  • Language resolution matters for init and new. init runs for the language of the project in the current directory, and fails when it detects none. new auto-detects; when detection is inconclusive, it defaults to TypeScript with a logged warning, unless you pass --language js|ts|py/python.
  • setup ツールチェーンを検証します。JS/TS プロジェクトの場合は Node.js ≥20、Python プロジェクトの場合は uipath パッケージを使用した Python をチェックします。また、Node.jsチェックは、 new が JS/TS CLI に転送される前に自動的に実行されます。Python 関数のコマンドは、Python を設定するまで、uip function setup を指すConfigErrorで失敗します。
  • publish vs. push target different destinations: publish uploads the packed .nupkg to an Orchestrator feed; push syncs the project directly into a Studio Web project. Both accept --url/--org/--token (or the matching UIPATH_URL/UIPATH_ORGANIZATION_NAME/UIPATH_ACCESS_TOKEN env vars). On a JS/TS project without --token, both use the session created by uip login.
  • Solution auto-registration. A successful init auto-registers the project into a parent .uipx solution when one exists (same pattern as agent/case/flow init) — pass --skip-solution-registration to opt out. This reports via a separate FunctionsInitSolutionRegistration success envelope after the underlying CLI's own init output. init does not create a solution when none exists.

概要​

uip function setup [--force]
uip function new [name] [--name <name>] [-l, --language ts|js|py] [--empty] [--kind job|http]
uip function init [--language ts|js|py] [--skip-solution-registration]
uip function serve [--port <port>] [--runtime node|deno]
uip function run [name] [--input <json>] [--input-file <path>]
uip function pack
uip function push [--url <url>] [--project-id <id>] [--org <org>] [--token <token>]
uip function publish [--url <url>] [--org <org>] [--token <token>] [--feed-id <id>]
uip function runtime-install [--path <folder>]
uip function setup [--force]
uip function new [name] [--name <name>] [-l, --language ts|js|py] [--empty] [--kind job|http]
uip function init [--language ts|js|py] [--skip-solution-registration]
uip function serve [--port <port>] [--runtime node|deno]
uip function run [name] [--input <json>] [--input-file <path>]
uip function pack
uip function push [--url <url>] [--project-id <id>] [--org <org>] [--token <token>]
uip function publish [--url <url>] [--org <org>] [--token <token>] [--feed-id <id>]
uip function runtime-install [--path <folder>]

UIP 関数の設定​

Functions プロジェクトに必要なツールチェーンを確認します。JS/TS の場合は Node.js v20 以降、Python の場合は Python の場合は uipath パッケージを使用します。Node.jsが見つからないか古い場合、コマンドは失敗し、「」という ConfigErrorが表示されます。Python の設定が見つからないことが報告されますが、コマンドは失敗しないため、JS/TS のみのマシンはブロックされません。結果はキャッシュされ、uip codedagent setupと共有されるため、どちらのコマンドでも両方に対して Python が構成されます。

オプション​

長押し値 (Value)説明
--forceフラグキャッシュされた結果が存在する場合でも、検証を再実行してください。既定値は falseです。
uip function setup --force
uip function setup --force

uip 関数 new​

既定で hello-world 関数を含む新しい Functions プロジェクトをスキャフォールディングします。

引数​

名前Required目的
[name]×プロジェクト名/ディレクトリ。既定 my-functionsです。--nameとして渡すこともあります。

オプション​

長押し値 (Value)説明
--name <name>string位置引数の代替手段。
-l, --language <lang>ts (既定) | js | py/pythonプロジェクトの言語。
--emptyフラグhello-world 関数 — 空のプロジェクトをスキップします。JS/TS のみ。
--kind <kind>job (既定) | httpjob (ジョブ機能、 targetRuntime javascript) または http (HTTP 関数、 javascript-server)。JS/TS のみ。

JS/TS scaffolds into a new ./<name> directory. Python scaffolds into the current directory, with one exception: from a solution root, a directory that holds a .uipx file, it scaffolds into ./<name>, so the project becomes a member folder of the solution. Only the current directory is checked for a .uipx file.

From a solution root, a <name> that already exists is refused with Result: ValidationError and exit code 3, and nothing is written. To choose the directory, pass --dir <path>, which is forwarded to the Python CLI unchanged.

uip function new my-fn --language ts
uip function new my-fn --language py
uip function new my-endpoint --language ts --kind http
uip function new my-fn --language ts
uip function new my-fn --language py
uip function new my-endpoint --language ts --kind http

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

{ "Code": "NewComplete", "Data": { "Message": "Project created at ./my-fn" } }
{ "Code": "NewComplete", "Data": { "Message": "Project created at ./my-fn" } }

uip 関数 init​

Write the project files for the project in the current directory:

  • Python: discover entrypoints and (re)generate entry-points.json/bindings.json/project.uiproj. Must run before pack/push for a Python project.
  • JS/TS: make an existing folder of functions a project. init writes uipath.json, with the functions found under functions/, and project.uiproj, where they are missing.

init fails when it detects no project language in the current directory.

オプション​

長押し値 (Value)説明
--language <lang>ts | js | pyForce the language when detection would otherwise be ambiguous.
--skip-solution-registrationフラグ親 .uipx ソリューションにプロジェクトを自動登録しないでください。
uip function init
uip function init

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

{ "Code": "InitComplete", "Data": { "Message": "Project initialized." } }
{ "Code": "InitComplete", "Data": { "Message": "Project initialized." } }

続いて、2回目の成功エンベロープレポートソリューションの登録を行います。

{
  "Code": "FunctionsInitSolutionRegistration",
  "Data": { "SolutionRegistration": { "Status": "Registered", "...": "..." } }
}
{
  "Code": "FunctionsInitSolutionRegistration",
  "Data": { "SolutionRegistration": { "Status": "Registered", "...": "..." } }
}

SolutionRegistration.Statusは、親ソリューションが存在しない場合、または--skip-solution-registrationが渡されたときに"OptedOut""NotInSolution"されます。常に存在し、省略されることはありません。

uip 関数 serve​

ホット・リロードでローカル・ファンクション・サーバーを起動します。JS/TS のみ。

オプション​

長押し値 (Value)説明
--port <port>integerリッスンするポート。既定 7070です。
--runtime <runtime>node (既定) | deno提供するランタイム。
uip function serve
uip function serve

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

{ "Code": "ServeStarted", "Data": { "Message": "Listening on http://localhost:7070" } }
{ "Code": "ServeStarted", "Data": { "Message": "Listening on http://localhost:7070" } }

UIP 関数の run​

1 つの関数を 1 回実行し、その結果を出力します。関数名は、プロジェクトの関数リストから取得されています。

引数​

名前Required目的
[name]×実行する関数の名前です。

オプション​

長押し値 (Value)説明
--input <json>JSON入力ペイロード。既定 {}です。
--input-file <path>パスJSON 入力ファイルへのパスです。JS/TS プロジェクトでは、 よりも優先 --input。
# Python project: run the 'hello' function once with a JSON payload and read the result as JSON
uip function run hello --input '{"name":"Ada"}' --output json

# Python project: run a function with a payload kept in a file
uip function run hello --input-file ./payload.json --output json
# Python project: run the 'hello' function once with a JSON payload and read the result as JSON
uip function run hello --input '{"name":"Ada"}' --output json

# Python project: run a function with a payload kept in a file
uip function run hello --input-file ./payload.json --output json

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

{ "Code": "RunComplete", "Data": { "message": "Hello, Ada!" } }
{ "Code": "RunComplete", "Data": { "message": "Hello, Ada!" } }

構造化された結果は、明示的に渡すと Python プロジェクトに適用されます --output json または明示的に --output yaml 。

  • Data は関数独自の出力であり、そのフィールド名は関数が宣言したとおりに保持されます。
  • 関数がスカラー、配列、または何も返さない場合、値は単一の Output キーの下に配置されます。
  • 進行状況と実行自体のログは stderr に送られるため、stdout はエンベロープのみを運びます。
  • 実行に失敗すると、ErrorCode: "unknown_error" と実行の終了コード (Message) とともにResult: "Failure"が返されます。実行自体のエラーはstderrにあります。

明示的な --output json/yamlがない場合、または table または plainがある場合、 run は基になる CLI 独自の出力を出力します。JS/TS プロジェクトでは、 --output は runではサポートされていません。CLI は通知を出力し、関数自体の出力は変更されません。

UIP ファンクション パック​

デプロイ用にプロジェクトを .nupkg にパックします。プロジェクトのロック ファイルは常にパッケージに含まれています。

uip function pack
uip function pack

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

{ "Code": "PackComplete", "Data": { "Message": "Package created: my-fn.0.0.1.nupkg" } }
{ "Code": "PackComplete", "Data": { "Message": "Package created: my-fn.0.0.1.nupkg" } }

uip 関数 push​

プロジェクトを Studio Web に同期します — エントリ ポイントを生成し、変更されたファイルをアップロードします。

オプション​

長押し値 (Value)Required説明
--url <url>url×UiPath プラットフォームの URL です。UIPATH_URLにフォールバックします。
--project-id <id>GUID条件付きStudio Web プロジェクト ID です。必須ですが、フラグの代わりに UIPATH_PROJECT_ID から取得される場合があります。
--org <org>string×組織名。UIPATH_ORGANIZATION_NAMEにフォールバックします。
--token <token>string×アクセス トークン。UIPATH_ACCESS_TOKENにフォールバックします。
uip function push --project-id 1f2a3b4c-0000-0000-0000-000000000001
uip function push --project-id 1f2a3b4c-0000-0000-0000-000000000001

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

{ "Code": "PushComplete", "Data": { "Message": "Push complete." } }
{ "Code": "PushComplete", "Data": { "Message": "Push complete." } }

uip 関数: publish​

最新の .nupkg を Orchestrator フォルダーにアップロードします。--feed-idを使用しない場合、フィードの入力を対話的に求めます (キャンセルするには ESC で入力します)。CI が使用できるように --feed-id渡してピッカーをスキップします。

オプション​

長押し値 (Value)説明
--url <url>urlUiPath プラットフォームの URL です。UIPATH_URLにフォールバックします。
--org <org>string組織名。UIPATH_ORGANIZATION_NAMEにフォールバックします。
--token <token>stringアクセス トークン。UIPATH_ACCESS_TOKENにフォールバックします。
--feed-id <id>GUIDパブリッシュ先のフィード — 対話型ピッカーをスキップします。
# Interactive feed picker
uip function publish

# CI use — skip the picker
uip function publish --feed-id 9b2c1d4e-0000-0000-0000-000000000001
# Interactive feed picker
uip function publish

# CI use — skip the picker
uip function publish --feed-id 9b2c1d4e-0000-0000-0000-000000000001

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

{ "Code": "PublishComplete", "Data": { "Message": "Package published." } }
{ "Code": "PublishComplete", "Data": { "Message": "Package published." } }

uip 関数 runtime-install​

独自の package.json を持つランナー フォルダーを作成し、そこにランタイム依存関係をインストールします。JS/TS のみ。

オプション​

長押し値 (Value)説明
--path <folder>パス実行時の依存関係を作成およびインストールするターゲット フォルダーです。
uip function runtime-install --path .uipath/runner
uip function runtime-install --path .uipath/runner

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

{ "Code": "RuntimeInstallComplete", "Data": { "Message": "Runtime installed at .uipath/runner" } }
{ "Code": "RuntimeInstallComplete", "Data": { "Message": "Runtime installed at .uipath/runner" } }

エラー動作​

  • init with no detectable language: Failure, Message: "No Functions project detected in this directory.", with Instructions naming --language ts|js|py.
  • 検出可能な言語と--languageのないnew : 既定で TypeScript が使用され、失敗ではなくログに警告が表示されます。
  • publish or push on a JS/TS project with no login and no --token: Failure, ErrorCode: "authentication_required", exit code 1, with Instructions naming uip login and the --token alternative.
  • 他の動詞 ( Failure、 Message: "No Functions project detected in this directory."、 の 関数プロジェクトが検出されません。uipath.json/package.json/pyproject.tomlを含むディレクトリから実行するInstructionsがあるか、明示的に--language渡します。
  • Node.js が存在しないか v20 未満 (JS/TS パス): 必要なバージョンの名前と、インストールするためのリンクを ConfigError します。このチェックは setup で実行され、 new が JS/TS CLI に転送される前に自動的に実行されます。
  • Python または uipath パッケージが設定されていない (Python パス): uip function setup実行するInstructionsでConfigError。

参照​

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

接続

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

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

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

最新情報を取得