UiPath Documentation
uipath-cli
latest
false
Guia do usuário da UiPath CLI
Importante :
Este conteúdo foi traduzido com auxílio de tradução automática. A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.

uip function

Syntax and options for `uip function`, which builds, serves, and publishes UiPath JS/TS and Python Functions — setup, new, init, serve, run, pack, push, publish, runtime-install.

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) still works as a back-compat alias.

Conceitos

  • 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. uip function <verb> --help for any forwarded verb therefore shows the underlying CLI's own help, not a uip-authored one — the options tables below are extracted from the forwarding wrapper's own flag hints and examples, which is the most this repo's tooling exposes before the downstream CLI takes over.
  • Language resolution matters for init and new. init is Python-only — for JS/TS, scaffold instead with new --empty. new auto-detects; when detection is inconclusive, it defaults to TypeScript with a logged warning, unless you pass --language js|ts|py/python.
  • setup runs automatically. It's a hidden command (not in --help) that verifies Node.js ≥20 before new forwards to the JS/TS CLI — you don't normally call it yourself, but uip function setup --force re-runs the check if the cached verification goes stale (e.g. after a Node reinstall).
  • 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).
  • Solution auto-registration. A successful Python 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 Python CLI's own init output.

Resumo

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> [--port <port>] [--input <json>]
uip function pack [--nolock]
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 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> [--port <port>] [--input <json>]
uip function pack [--nolock]
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 new

Scaffold a new Functions project, including a hello-world function by default.

Argumentos

NameRequiredFinalidade
[name]nãoProject name / directory. Default my-functions. May also be passed as --name.

Opções

LongValorDescription
--name <name>StringAlternative to the positional argument.
-l, --language <lang>ts (default) | js | py/pythonProject language.
--emptyBandeiraSkip the hello-world function — empty project. JS/TS only.

Exemplos

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

Formato dos dados (--output json)

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

uip function init

Python-only: discover entrypoints and (re)generate entry-points.json/bindings.json/project.uiproj. Must run before pack/push for a Python project. For JS/TS, use new --empty instead — init fails with an explicit "Python-only" error against a JS/TS project or an undetected language.

Opções

LongValorDescription
--language pyflag/valueForce Python language resolution when detection would otherwise be ambiguous.
--skip-solution-registrationBandeiraDo not auto-register the project in a parent .uipx solution.

Exemplo

uip function init
uip function init

Formato dos dados (--output json)

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

Followed by a second success envelope reporting solution registration:

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

SolutionRegistration.Status is "NotInSolution" when no parent solution exists, or "OptedOut" when --skip-solution-registration was passed — always present, never omitted.

uip function serve

Start the local function server with hot reload. JS/TS only.

Opções

LongValorDescription
--port <port>Número inteiroPort to listen on. Default 7070.
--runtime <runtime>node (Padrão) | denoRuntime to serve under.

Exemplo

uip function serve
uip function serve

Formato dos dados (--output json)

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

uip function run

Invoke a function against the local serve endpoint. JS/TS only.

Argumentos

NameRequiredFinalidade
<name>simFunction name to invoke.

Opções

LongValorDescription
--port <port>Número inteiroPort the local server is on. Default 7070.
--input <json>JSONInput payload. Default {}.

Exemplo

uip function run hello --input '{"x":1}'
uip function run hello --input '{"x":1}'

Formato dos dados (--output json)

{ "Code": "RunComplete", "Data": { "result": 2 } }
{ "Code": "RunComplete", "Data": { "result": 2 } }

Data is the function's own return value, shape determined entirely by the function you wrote — not normalized by the CLI.

uip function pack

Pack the project into a .nupkg for deployment.

Opções

LongValorDescription
--nolockBandeiraExclude the lock file from the package. JS/TS only.

Exemplo

uip function pack
uip function pack

Formato dos dados (--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 function push

Sync the project to Studio Web — generates entry points and uploads changed files.

Opções

LongValorRequiredDescription
--url <url>urlnãoUiPath platform URL. Falls back to UIPATH_URL.
--project-id <id>GUIDconditionallyStudio Web project ID. Mandatory, but may come from UIPATH_PROJECT_ID instead of the flag.
--org <org>StringnãoOrganization name. Falls back to UIPATH_ORGANIZATION_NAME.
--token <token>StringnãoAccess token. Falls back to UIPATH_ACCESS_TOKEN.

Exemplo

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

Formato dos dados (--output json)

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

uip function publish

Upload the latest .nupkg to an Orchestrator folder. Without --feed-id, prompts interactively for a feed (ESC to cancel) — pass --feed-id for CI use to skip the picker.

Opções

LongValorDescription
--url <url>urlUiPath platform URL. Falls back to UIPATH_URL.
--org <org>StringOrganization name. Falls back to UIPATH_ORGANIZATION_NAME.
--token <token>StringAccess token. Falls back to UIPATH_ACCESS_TOKEN.
--feed-id <id>GUIDFeed to publish to — skips the interactive picker.

Exemplos

# 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

Formato dos dados (--output json)

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

uip function runtime-install

Create a runner folder with its own package.json and install runtime dependencies into it. JS/TS only.

Opções

LongValorDescription
--path <folder>PathTarget folder to create and install runtime dependencies into.

Exemplo

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

Formato dos dados (--output json)

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

Comportamento de erro

  • init against a JS/TS project or an undetected language: Failure, Message: "'init' is not applicable to JS/TS projects." (or "'init' is Python-only."), with Instructions naming new --empty/--language.
  • new with no detectable language and no --language: defaults to TypeScript with a logged warning rather than failing.
  • No Functions project detected for any other verb: Failure, Message: "No Functions project detected in this directory.", with Instructions to run from a directory containing uipath.json/package.json/pyproject.toml, or pass --language explicitly.
  • Node.js missing or below v20 (JS/TS path): ConfigError naming the required version and a link to install it — this check runs automatically before new forwards to the JS/TS CLI.

Veja também

Esta página foi útil?

Conectar

Precisa de ajuda? Suporte

Quer aprender? Academia UiPath

Tem perguntas? Fórum do UiPath

Fique por dentro das novidades