UiPath Documentation
uipath-cli
latest
false
Guide de l'utilisateur de UiPath CLI
Important :
Ce contenu a été traduit à l'aide d'une traduction automatique. La localisation du contenu nouvellement publié peut prendre 1 à 2 semaines avant d’être disponible.

Fonction UiP

Syntax and options for `uip function`, which builds, serves, runs, and publishes UiPath JS/TS and Python Functions.

uip function builds, serves, and publishes UiPath Functions — small JS/TS or Python handlers packaged and run on the UiPath platform. uip function is the canonical group name; uip functions (plural) is accepted as an alias.

Concepts​

  • This is a language dispatcher, not a native tool. Every verb except setup is a thin forwarder: the CLI detects your project's language (from uipath.json, package.json, or pyproject.toml in the current directory, or --language/-l on new) and routes the raw arguments to either an in-process JS/TS CLI (@uipath/coded-functions-js-cli) or a spawned Python CLI. Flags the wrapper does not declare are forwarded unchanged to the underlying CLI.
  • La résolution linguistique est importante pour init et new. init est Python uniquement — pour JS/TS, élaboration à la place avec new --empty. new détections automatiques; lorsque la détection est incertaine, elle utilise par défaut TypeScript avec un avertissement consigné, sauf si vous réussissez --language js|ts|py/python.
  • setup vérifie les chaînes d'outils. Il vérifie Node.js ≥ 20 pour les projets JS/TS et Python avec le package uipath pour les projets Python. La vérification Node.js s'exécute également automatiquement avant que new ne soit transmis à la CLI JS/TS. Les commandes des fonctions Python échouent avec une ConfigError qui pointe vers uip function setup jusqu'à ce que Python soit configuré.
  • publish vs. push cibles: publish télécharge le fichier .nupkg compressé dans un flux Orchestrator; push synchronise le projet directement dans un projet Studio Web. Les deux acceptent --url/--org/--token (ou les variables d’environnement UIPATH_URL/UIPATH_ORGANIZATION_NAME/UIPATH_ACCESS_TOKEN correspondantes).
  • Enregistrement automatique de la solution. Un Python init réussit à enregistrer automatiquement le projet dans une solution .uipx parente lorsqu’il en existe une (même modèle que pour l’initialisation de agent/case/flow) — transmettre --skip-solution-registration pour se désinscrire. Cela assure le rapport via une enveloppe de réussite FunctionsInitSolutionRegistration distincte après la sortie d’initialisation de la CLI Python sous-jacente.

Synthèse​

uip function setup [--force]
uip function new [name] [--name <name>] [-l, --language ts|js|py] [--empty]
uip function init [--language 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]
uip function init [--language 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​

Verify the toolchains a Functions project needs: Node.js v20 or later for JS/TS, and Python with the uipath package for Python. A missing or outdated Node.js fails the command with a ConfigError. A missing Python configuration is reported but does not fail the command, so JS/TS-only machines are not blocked. The result is cached and shared with uip codedagent setup, so running either command configures Python for both.

Options​

LongValeur (Value)Description
--forceDrapeauRe-run the verification even when a cached result exists. Default: false.

Exemple​

uip function setup --force
uip function setup --force

Fonction UIP nouvelle​

Élaborez un nouveau projet Fonctions, y compris une fonction bonjour-monde par défaut.

Arguments​

NomRequisObjectif
[name]nonNom/répertoire du projet. Par défaut my-functions. Peut également être transmis sous la forme --name.

Options​

LongValeur (Value)Description
--name <name>stringAlternative à l’argument de position.
-l, --language <lang>ts (par défaut) | js | py/pythonLangage du projet.
--emptyDrapeauIgnorez la fonction bonjour-monde — projet vide. JS/TS uniquement.

Exemples​

uip function new my-fn --language ts
uip function new my-fn --language py
uip function new my-fn --language ts
uip function new my-fn --language py

Format des données (--sortie json)​

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

Initialisation de la fonction UIP​

Python uniquement: découvrez les points d'entrée et (régénérez) entry-points.json/bindings.json/project.uiproj. Doit s’exécuter avant pack/push pour un projet Python. Pour JS/TS, utilisez new --empty à la place — init échoue avec un explicite et quota;Python uniquement comme erreur dans un projet JS/TS ou dans un langage non détecté.

Options​

LongValeur (Value)Description
--language pyindicateur/valeurForcer la résolution du langage Python lors de la détection serait autrement ambiguë.
--skip-solution-registrationDrapeauNe pas enregistrer automatiquement le projet dans une solution .uipx parente.

Exemple​

uip function init
uip function init

Format des données (--sortie json)​

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

Suivi d’un deuxième enregistrement de solution de rapport par enveloppe réussie:

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

SolutionRegistration.Status est "NotInSolution" lorsqu'aucune solution parente n'existe, ou "OptedOut" lorsque --skip-solution-registration a été transmis - toujours présent, jamais omis.

fonction uip service​

Démarrez le serveur de fonctions local avec le rechargement rapide. JS/TS uniquement.

Options​

LongValeur (Value)Description
--port <port>IntegerPort sur lequel écouter. Par défaut 7070.
--runtime <runtime>node (par défaut) | denoRuntime sous lequel servir.

Exemple​

uip function serve
uip function serve

Format des données (--sortie json)​

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

Exécution de la fonction UIP​

Run one function once and print its result. The function name comes from your project's function list.

Arguments​

NomRequisObjectif
[name]nonName of the function to run.

Options​

LongValeur (Value)Description
--input <json>JSONCharge utile d'entrée. Par défaut {}.
--input-file <path>Chemin d'accèsPath to a JSON input file. On JS/TS projects, takes precedence over --input.

Exemples​

# 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

Format des données (--sortie json)​

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

The structured result applies to Python projects when you pass --output json or --output yaml explicitly:

  • Data is the function's own output, with its field names kept exactly as the function declares them.
  • When the function returns a scalar, an array, or nothing, the value is placed under a single Output key.
  • Progress and the run's own logs go to stderr, so stdout carries only the envelope.
  • A failed run returns Result: "Failure" with ErrorCode: "unknown_error" and the run's exit code in Message; the run's own error is on stderr.

Sans --output json/yaml explicite, ou avec table ou plain, run imprime la sortie de la CLI sous-jacente. Sur les projets JS/TS, --output n'est pas pris en charge par run: la CLI imprime un avis et la sortie de la fonction reste inchangée.

module de fonctions uip​

Pack the project into a .nupkg for deployment. The project's lock file is always included in the package.

Exemple​

uip function pack
uip function pack

Format des données (--sortie 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" } }

Fonction UIP push​

Synchroniser le projet avec Studio Web: génère des points d'entrée et télécharge les fichiers modifiés.

Options​

LongValeur (Value)RequisDescription
--url <url>urlnonURL de la plate-forme UiPath. Revient à UIPATH_URL.
--project-id <id>GUIDConditionnelID de projet Studio Web. Obligatoire, mais peut provenir de UIPATH_PROJECT_ID au lieu de l'indicateur.
--org <org>stringnonNom de l'organisation. Revient à UIPATH_ORGANIZATION_NAME.
--token <token>stringnonJeton d’accès. Revient à UIPATH_ACCESS_TOKEN.

Exemple​

uip function push --project-id 1f2a3b4c-0000-0000-0000-000000000001
uip function push --project-id 1f2a3b4c-0000-0000-0000-000000000001

Format des données (--sortie json)​

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

publication de la fonction UiP​

Chargez le dernier .nupkg dans un dossier Orchestrator. Sans --feed-id, invite interactive pour un flux (Échap pour annuler) — saisissez --feed-id pour Utilisation CI pour ignorer le sélecteur.

Options​

LongValeur (Value)Description
--url <url>urlURL de la plate-forme UiPath. Revient à UIPATH_URL.
--org <org>stringNom de l'organisation. Revient à UIPATH_ORGANIZATION_NAME.
--token <token>stringJeton d’accès. Revient à UIPATH_ACCESS_TOKEN.
--feed-id <id>GUIDFlux vers lequel publier — ignore le sélecteur interactif.

Exemples​

# 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

Format des données (--sortie json)​

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

Fonction UIP runtime-install​

Créez un dossier de runtime avec son propre package.json et installez-y les dépendances du runtime. JS/TS uniquement.

Options​

LongValeur (Value)Description
--path <folder>Chemin d'accèsDossier cible dans lequel créer et installer les dépendances du runtime.

Exemple​

uip function runtime-install --path .uipath/runner
uip function runtime-install --path .uipath/runner

Format des données (--sortie json)​

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

Comportement des erreurs​

  • init par rapport à un projet JS/TS ou à une langue non détectée: Failure, Message: "'init' is not applicable to JS/TS projects." (ou "'init' is Python-only."), avec Instructions nommant new --empty/--language.
  • new sans langage détectable et sans --language: la valeur par défaut est TypeScript avec un avertissement consigné plutôt que d'échouer.
  • Aucun projet Fonctions détecté pour tout autre verbe: Failure, Message: "No Functions project detected in this directory.", avec Instructions à exécuter à partir d’un répertoire contenant uipath.json/package.json/pyproject.toml, ou transmettre --language explicitement.
  • Node.js manquant ou inférieur à v20 (chemin JS/TS): ConfigError nommant la version requise et un lien pour l'installer. Cette vérification s'exécute dans setup et automatiquement avant que new ne transfère à la CLI JS/TS.
  • Python or the uipath package not configured (Python path): ConfigError with Instructions to run uip function setup.

Voir également​

Cette page vous a-t-elle été utile ?

Connecter

Besoin d'aide ? Assistance(opens in new window)

Vous souhaitez apprendre ? UiPath Academy(opens in new window)

Vous avez des questions ? UiPath Forum(opens in new window)

Rester à jour