UiPath Documentation
uipath-cli
2026.10
false
Guide de l'utilisateur de UiPath CLI

Fonction UiP

Syntaxe et options pour la fonction `uip`, qui crée, gère, exécute et publie les fonctions UiPath JS/TS et Python.

uip function crée, sert et publie UiPath Functions - petits gestionnaires JS/TS ou Python packagés et exécutés sur la plate-forme UiPath. uip function est le nom canonique du groupe; uip functions (pluir) est accepté comme alias.

Concepts​

  • Un groupe de commandes. uip function couvre les deux langues. Il détecte la langue de votre projet à partir de uipath.json, package.json ou pyproject.toml dans le répertoire actuel, ou de --language/-l sur new, et exécute l'outil JS/TS ou Python correspondant. Les options non répertoriées sur cette page sont transmises à cet outil, par exemple 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 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 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.

Synthèse​

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>]

Configuration de la fonction UIP​

Vérifiez les chaînes d'outils dont un projet Fonctions a besoin: Node.js v20 ou version ultérieure pour JS/TS et Python avec le package uipath pour Python. Un Node.js manquant ou obsolète échoue la commande avec une ConfigError. Une configuration Python manquante est signalée, mais n’échoue pas la commande, de sorte que les machines JS/TS uniquement ne sont pas bloquées. Le résultat est mis en cache et partagé avec uip codedagent setup, donc l'exécution de l'une ou l'autre commande configure Python pour les deux.

Options​

LongValeur (Value)Description
--forceDrapeauRéexécutez la vérification même s’il existe un résultat mis en cache. Par défaut: 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.
--kind <kind>job (par défaut) | httpjob (fonctions de tâche, targetRuntime javascript) ou http (fonctions HTTP, javascript-server). JS/TS uniquement.

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.

Exemples​

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

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​

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.

Options​

LongValeur (Value)Description
--language <lang>ts | js | pyForce the language when detection would otherwise be ambiguous.
--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​

Exécutez une fonction une fois et imprimez son résultat. Le nom de la fonction provient de la liste de fonctions de votre projet.

Arguments​

NomRequisObjectif
[name]nonNom de la fonction à exécuter.

Options​

LongValeur (Value)Description
--input <json>JSONCharge utile d'entrée. Par défaut {}.
--input-file <path>Chemin d'accèsChemin d’accès à un fichier d’entrée JSON. Sur les projets JS/TS, prend le pas sur --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!" } }

Le résultat structuré s’applique aux projets Python lorsque vous transmettez --output json ou --output yaml explicitement:

  • Data est la propre sortie de la fonction, avec ses noms de champ conservés exactement tels que la fonction les déclare.
  • Lorsque la fonction renvoie une mise à l'échelle, un tableau ou rien, la valeur est placée sous une seule clé Output .
  • La progression et les propres journaux de l'exécution vont vers stderr, de sorte que stdout ne comporte que l'enveloppe.
  • Une exécution échouée renvoie Result: "Failure" avec ErrorCode: "unknown_error" et le code de sortie de l'exécution dans Message; l'erreur propre de l'exécution est sur 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​

Compressez le projet dans un .nupkg pour le déploiement. Le fichier de verrouillage du projet est toujours inclus dans le 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 with no detectable language: Failure, Message: "No Functions project detected in this directory.", with Instructions naming --language ts|js|py.
  • new sans langage détectable et sans --language: la valeur par défaut est TypeScript avec un avertissement consigné plutôt que d'échouer.
  • 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.
  • 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.
  • Package Python ou uipath non configuré (chemin Python): ConfigError avec Instructions pour exécuter 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