uipath-coded-apps
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUiPath Coded Apps
UiPath Coded Apps
Build, debug, and deploy UiPath Coded Web Applications and Coded Action Apps using the CLI and SDK.
uip codedapp@uipath/uipath-typescript使用 CLI和 SDK构建、调试和部署UiPath编码Web应用与编码动作应用。
uip codedapp@uipath/uipath-typescriptWhen to Use This Skill
何时使用该技能
- User wants to build, debug, or deploy a UiPath Coded Web App or Coded Action App
- User asks about commands,
uip codedappdirectory,.uipath/, orapp.config.jsonaction-schema.json - User wants to scaffold a new React/Vue frontend for UiPath Cloud or an Action Center form
- User asks for app UI that a prebuilt UiPath widget covers: review/correct Document Understanding extraction results (Validation Station), chat with a conversational agent, browse/edit a Data Fabric entity in a grid, upload files to a storage bucket, display a PDF, or sign in with an external IdP (Google/SAML)
- User wants to push/pull source between local and Studio Web
- User wants to use the SDK from a coded app
@uipath/uipath-typescript - User wants to run the full pipeline (build → pack → publish → deploy)
- User wants to generate an agent-monitoring / analytics dashboard from a natural-language description — e.g. "show agent health, error rates, invocation volume, latency, active agents, KPIs, governance metrics, or consumption trends"
- User says "build/create/generate a dashboard", describes metrics to visualize, or asks for an agent observability, operations, or cost view
- 用户想要构建、调试或部署UiPath编码Web应用或编码动作应用
- 用户询问命令、
uip codedapp目录、.uipath/或app.config.json相关内容action-schema.json - 用户想要为UiPath Cloud或Action Center表单搭建新的React/Vue前端
- 用户询问预构建UiPath组件覆盖的应用UI:审核/修正Document Understanding提取结果(Validation Station)、与对话代理聊天、在表格中浏览/编辑Data Fabric实体、将文件上传至存储桶、显示PDF或使用外部身份提供商(Google/SAML)登录
- 用户想要在本地与Studio Web之间推送/拉取源码
- 用户想要在编码应用中使用SDK
@uipath/uipath-typescript - 用户想要执行完整流程(构建 → 打包 → 发布 → 部署)
- 用户想要根据自然语言描述生成代理监控/分析仪表盘 — 例如“展示代理健康状况、错误率、调用量、延迟、活跃代理、关键绩效指标、治理指标或消耗趋势”
- 用户提及“构建/创建/生成仪表盘”、描述需可视化的指标,或询问代理可观测性、运维或成本视图
App Types
应用类型
| Type | Description | Key Difference |
|---|---|---|
| Coded Web App | React/Vue/other frontend hosted on UiPath CDN | User-facing app accessed via a URL |
| Coded Action App | React form wired to UiPath Action Center | Rendered inside human task reviews in Maestro/Agent workflows |
Two lifecycles, two scaffolding entry points.
- Standalone coded app: scaffold with
(see create-web-app.md / create-action-app.md). Nonpx create-vite@latest/project.uiproj— those are solution-membership artefacts and standalone apps don't need them. Deploy viawebAppManifest.json→uip codedapp pack(uip codedapp publishfor action apps) →-t Action. This is the classic single-app lifecycle covered by the rest of this skill.uip codedapp deploy- In-solution coded app: run
from inside auip codedapp initsolution. Init writes.uipx(project.uiproj) +ProjectType: "AppV2", nests runtime + build artefacts underwebAppManifest.json, auto-registers the project assource/dist/in theType: "AppV2", and emits.uipx. From then on the app is part of the solution —resources/solution_folder/app/{Coded,CodedAction}/bundles itsuip solution packand.nupkgprovisions it in the deployment folder. Do not runuip solution deploy run/uip codedapp pack/publishon a coded app that's already registered indeploy— that bypasses the solution's deploy config (external client ID, routing name, action schema) and double-registers the package..uipx/uip solution projects addregister existing AppV2 folders too, readinguip solution projects importto pick thewebAppManifest.config.isActionApp/CodedsubType. For the solution-side lifecycle see /uipath:uipath-solution.CodedActionis for solutions only. It is not the scaffolding entry point for a standalone coded app — useuip codedapp initfor that.create-vite
| 类型 | 描述 | 核心差异 |
|---|---|---|
| 编码Web应用(Coded Web App) | 托管在UiPath CDN上的React/Vue或其他前端应用 | 用户可通过URL访问的面向用户的应用 |
| 编码动作应用(Coded Action App) | 与UiPath Action Center关联的React表单 | 在Maestro/代理工作流的人工任务审核中渲染 |
两种生命周期,两种搭建入口。
- 独立编码应用:使用
搭建(详见create-web-app.md / create-action-app.md)。无需npx create-vite@latest/project.uiproj— 这些是解决方案成员的产物,独立应用不需要它们。通过webAppManifest.json→uip codedapp pack(动作应用需加uip codedapp publish) →-t Action进行部署。这是本技能涵盖的经典单应用生命周期。uip codedapp deploy- 解决方案内编码应用:在
解决方案内运行.uipx。该命令会生成uip codedapp init(project.uiproj) +ProjectType: "AppV2",将运行时和构建产物嵌套在webAppManifest.json下,自动将项目注册为source/dist/中的.uipx,并生成Type: "AppV2"。此后该应用便成为解决方案的一部分 —resources/solution_folder/app/{Coded,CodedAction}/会打包其uip solution pack,.nupkg会在部署文件夹中配置它。请勿对已在uip solution deploy run中注册的编码应用运行.uipx/uip codedapp pack/publish— 这会绕过解决方案的部署配置(外部客户端ID、路由名称、动作 schema)并导致包重复注册。deploy/uip solution projects add也可注册现有AppV2文件夹,它会读取uip solution projects import来选择webAppManifest.config.isActionApp/Coded子类型。解决方案端生命周期详见/uipath:uipath-solution。CodedAction**仅适用于解决方案。**它不是独立编码应用的搭建入口 — 请使用uip codedapp init进行搭建。create-vite
Critical Rules
关键规则
- Identify the app type before doing anything else. Ask as a structured choice (Rule 18): Coded Web App — custom frontend deployed to UiPath Cloud · Coded Action App — form for Action Center human task reviews. The two paths diverge on scaffolding, redirect URI, and publish flag — do not guess.
- Always check login status first. Run before any cloud command. If not logged in, run
uip login status --output json.uip login - Never skip the build step. Run after scaffolding (to verify the scaffold compiles) and again before
npm run buildorpack(to produce the deployablepush). Verifydist/exists each time.dist/ - Pack → Publish → Deploy order is required. Each step depends on the previous one producing its output.
- Bump the version for re-publish. If the same version already exists in Orchestrator, publish will fail.
- Action apps require on publish. Run
-t Action(not the defaultuip codedapp publish -t Actiontype).Web - Never handle access tokens manually. Do not pass, print, parse, source, or set cached access tokens. Use and supported
uip logincommands; the CLI manages authentication.uip codedapp - Base URL must use the API subdomain. not
https://api.uipath.com. See the table below.https://cloud.uipath.com - must always set
vite.config.ts. The platform handles URL routing — apps must use relative asset paths. Do not use a routing name or a sub-path here. Import static assets through the bundler (base: './') so Vite fingerprints and base-rewrites them. Do NOT place them inimport logo from './assets/logo.png'or reference them by a hardcodedpublic/-rooted path — those bypass base rewriting and 404 after deploy under the non-root mount./ - Use from
getAppBase()for any absolute URL constructed at runtime — router basename, image@uipath/uipath-typescript,srcpaths. Deployed apps mount at a non-root prefix;fetch-rooted paths work locally but 404 after deploy. Vite's/only fixes import-time references.base: './' - must run non-interactively. Pass the folder key as
uip codedapp deploy(or as--folder-key <GUID>env-var prefix — either works). The interactive folder picker fails in non-TTY contexts (CI, agent shells). If the user provides a folder name, resolve it with the server-side filterUIPATH_FOLDER_KEY=<GUID>and pick the row whoseuip or folders list --all --name "<name>" --output jsonexactly equals the target, then read itsName(the plain list is paginated 50/page andKeyis a contains match requiring--name, so never just take the first row). A personal workspace is not in--all— resolve it from the default--allwhereuip or folders list --output json. To deploy into a new folder, create it first withType == "Personal"and readuip or folders create "<NAME>" --output json. TheData.Keycommands require the Orchestrator tool — install once viauip or ...(check first withuip tools install @uipath/orchestrator-tool).uip tools list - Guard against text overflow in every UI. See patterns.md "Preventing Text Overflow".
- Inspect the DF schema before writing analytics, filters, or seeds. Run to inspect fields and types. At runtime, use
uip df entities get <ENTITY_ID> --output jsonfrom the app's authenticated session. DF doesn't behave like a typical RDBMS; see sdk/data-fabric.md "Anti-shapes & gotchas".entities.getById(<id>) - Every list call returns ONE page — even with no options. There is no "give me everything" path. Applies to ,
getAll,getAllRecords,queryRecordsById, etc.getFileMetaDatawith no options does NOT return all rows; the SDK sends nogetAll()and the server applies its own cap, wrapped in a misleadingly-namedpageSize. To list every row from a source that may exceed the cap, you MUST loop the cursor:NonPaginatedResponseand accumulatewhile (page.hasNextPage) { page = await getAll({ cursor: page.nextCursor }) }. Readingitemsafter a single call is almost always a bug. See sdk/pagination.md.result.items.length - Tables of dynamic data must paginate, not dump all rows in one scroll. Page size 25–50 with next/prev/page-number controls and a "Showing X–Y of Z" summary. Top-N + "see all" is acceptable for explicitly summary panels (e.g., "Top 10 oldest"). Infinite-scroll-of-N-rows is unusable for operational dashboards. Applies to any table backed by any service (DF entities, Tasks, Jobs, Conversations, Process Instances, etc.). See patterns.md "Tabular Data".
- When adding any new SDK method call, verify the configured OAuth scope already includes the required scope — both dashboards and web apps read the key from
scope. Write operations, action methods (uipath.json,Jobs.stop,Tasks.complete, etc.), or first use of a new service typically need broader scopes than read-only flows. Mismatched scopes fail silently withProcessInstances.cancel/401on the first call. See oauth-scopes.md for scope bundles and the per-method lookup protocol (the per-method table ships inside the SDK package at403).node_modules/@uipath/uipath-typescript/docs/oauth-scopes.md - Never call in an action app. That is web-app-only — it starts a PKCE OAuth redirect. Action apps run in Action Center's iframe with a host-injected session: construct
sdk.initialize()(no args) and use it directly. See create-action-app.mdnew UiPath().src/uipath.ts - Never make the user type magic phrases. Whenever you ask the user to pick between known options (app type, build/edit/deploy intent, OAuth setup, deploy pinning), present a structured choice via the host coding agent's native question tool (selectable options) when one exists. Mechanics: one option per choice with a short bold label + one-line description of what picking it does; put the recommended option first and suffix its label "(Recommended)"; keep to at most 4 options (reserve one slot for an escape option like Make changes / Cancel when applicable). If there are 5+ candidates, or the host agent has no question tool, render a plain numbered list instead and accept the number or the option label as the answer. A free-text reply must always remain valid (e.g. a plan-change request) and takes precedence over the options. Exception — never put a question in the same response as a long output: plan-approval gates are free-text by design (the plan ends with "confirm or tell me what to change"); structured questions fire only on later, short turns. See .
references/dashboards/plugins/build/impl.md - Never guess SDK method signatures — read the installed types. The authoritative reference for method names, parameters, return types, and usage examples is (full JSDoc; matches the installed SDK version exactly). Before calling a service you have not used in this session, Read its
node_modules/@uipath/uipath-typescript/dist/<subpath>/index.d.ts. If.d.tsis absent, run the install step first — the app cannot build without it. Thenode_modulesfiles deliberately do NOT list signatures; they cover only scopes, calling conventions, and traps the types cannot express. See references/sdk/imports.md for the missing-capability protocol. Boundary: read thereferences/sdk/*.md, never the compiled bundle..d.ts/dist/*.mjsis minified implementation, not API — reading it dead-ends. A grep with no output confirms absence; treat a genuine gap as unsupported (use the documented alternative) rather than escalating the search into the bundle.*.js
- 首先确定应用类型。以结构化选项的方式询问(规则18):编码Web应用 — 部署至UiPath Cloud的自定义前端 · 编码动作应用 — 用于Action Center人工任务审核的表单。这两种路径在搭建、重定向URI和发布标志上有所不同,请勿猜测。
- 始终先检查登录状态。执行任何云命令前,运行。若未登录,运行
uip login status --output json。uip login - 绝不要跳过构建步骤。搭建完成后运行(验证搭建的项目可编译),在
npm run build或pack前再次运行(生成可部署的push目录)。每次都要确认dist/目录存在。dist/ - 必须遵循打包→发布→部署的顺序。每个步骤都依赖前一步生成的输出。
- 重新发布需更新版本号。如果相同版本已存在于Orchestrator中,发布将失败。
- 动作应用发布时必须添加参数。运行
-t Action(而非默认的uip codedapp publish -t Action类型)。Web - 绝不要手动处理访问令牌。请勿传递、打印、解析、获取或设置缓存的访问令牌。使用和受支持的
uip login命令;CLI会管理认证。uip codedapp - 基础URL必须使用API子域名。使用而非
https://api.uipath.com。详见下表。https://cloud.uipath.com - 必须始终设置
vite.config.ts。平台会处理URL路由 — 应用必须使用相对资源路径。此处请勿使用路由名称或子路径。通过打包工具导入静态资源(base: './'),以便Vite为资源添加指纹并重写基础路径。请勿将资源放在import logo from './assets/logo.png'目录或通过硬编码的根路径public/引用 — 这些会绕过基础路径重写,部署后在非根挂载路径下会出现404错误。/ - 运行时构造任何绝对URL都必须使用中的
@uipath/uipath-typescript— 包括路由器基准名称、图片getAppBase()、src路径。部署后的应用挂载在非根前缀下;根路径fetch在本地可正常工作,但部署后会出现404错误。Vite的/仅能修复导入时的引用。base: './' - 必须以非交互模式运行。通过
uip codedapp deploy(或--folder-key <GUID>环境变量前缀,两种方式均可)传递文件夹密钥。交互式文件夹选择器在非TTY环境(CI、代理Shell)中会失败。如果用户提供文件夹名称,通过服务器端过滤器UIPATH_FOLDER_KEY=<GUID>解析,选择uip or folders list --all --name "<name>" --output json与目标完全匹配的行,然后读取其Name(普通列表每页分页50条,Key是包含匹配,需要--name,因此绝不要直接取第一行)。个人工作区不在--all列表中 — 从默认的--all中解析uip or folders list --output json的条目。要部署到新文件夹,请先使用Type == "Personal"创建它,然后读取uip or folders create "<NAME>" --output json。Data.Key命令需要Orchestrator工具 — 可通过uip or ...安装一次(安装前先用uip tools install @uipath/orchestrator-tool检查)。uip tools list - 每个UI都要防止文本溢出。详见patterns.md中的“防止文本溢出”部分。
- 编写分析、过滤器或种子数据前,先检查DF schema。运行检查字段和类型。运行时,使用应用已认证会话中的
uip df entities get <ENTITY_ID> --output json。DF的行为与典型关系型数据库不同;详见sdk/data-fabric.md中的“反模式与注意事项”。entities.getById(<id>) - 所有列表调用仅返回一页结果 — 即使没有选项。没有“获取全部数据”的路径。适用于、
getAll、getAllRecords、queryRecordsById等方法。不带选项的getFileMetaData不会返回所有行;SDK不发送getAll(),服务器会应用自身的限制,并封装在名称易混淆的pageSize中。要从可能超过限制的源获取所有行,必须循环游标:NonPaginatedResponse并累加while (page.hasNextPage) { page = await getAll({ cursor: page.nextCursor }) }。单次调用后读取items几乎总是错误的。详见sdk/pagination.md。result.items.length - 动态数据表格必须分页,不要一次性加载所有行。每页显示25–50条数据,提供下一页/上一页/页码控制,以及“显示第X–Y条,共Z条”的摘要。对于明确的摘要面板(例如“最久的10条”),显示前N条+“查看全部”是可接受的。无限滚动加载N行数据的方式不适用于运维仪表盘。适用于任何由服务(DF实体、任务、作业、对话、流程实例等)支持的表格。详见patterns.md中的“表格数据”部分。
- 添加任何新的SDK方法调用时,验证已配置的OAuth scope是否包含所需权限 — 仪表盘和Web应用都会从读取
uipath.json键。写入操作、动作方法(scope、Jobs.stop、Tasks.complete等)或首次使用新服务通常需要比只读流程更广泛的权限。权限不匹配会在首次调用时静默失败,返回ProcessInstances.cancel/401错误。权限捆绑包和按方法查询协议详见oauth-scopes.md(按方法的表格随SDK包一起发布在403中)。node_modules/@uipath/uipath-typescript/docs/oauth-scopes.md - 绝不要在动作应用中调用。该方法仅适用于Web应用 — 它会启动PKCE OAuth重定向。动作应用在Action Center的iframe中运行,宿主会注入会话:直接构造
sdk.initialize()(无参数)并使用即可。详见create-action-app.md中的new UiPath()。src/uipath.ts - 绝不要让用户输入魔法短语。每当需要用户在已知选项中选择时(应用类型、构建/编辑/部署意图、OAuth设置、部署固定),如果宿主编码代理有原生的问题工具(可选选项),请通过该工具呈现结构化选项。规则:每个选项包含简短的粗体标签+一行描述选择该选项的作用;将推荐选项放在第一位并在标签后添加“(推荐)”后缀;最多保留4个选项(必要时预留一个退出选项,如修改 / 取消)。如果有5个及以上候选选项,或宿主代理没有问题工具,则改为显示普通编号列表,并接受数字或选项标签作为答案。自由文本回复必须始终有效(例如更改计划的请求),且优先级高于选项。例外 — 不要在长输出的同一条回复中提出问题:计划审批门设计为自由文本(计划结尾为“确认或告知我需要修改的内容”);结构化问题仅在后续简短对话中触发。详见。
references/dashboards/plugins/build/impl.md - 绝不要猜测SDK方法签名 — 查看已安装的类型定义。方法名称、参数、返回类型和使用示例的权威参考是(包含完整JSDoc;与已安装的SDK版本完全匹配)。调用本次会话中未使用过的服务前,请查看其
node_modules/@uipath/uipath-typescript/dist/<subpath>/index.d.ts文件。如果.d.ts不存在,请先运行安装步骤 — 没有它应用无法构建。node_modules文件故意不列出签名;它们仅涵盖类型无法表达的权限、调用约定和陷阱。缺失功能的协议详见references/sdk/imports.md。边界:查看references/sdk/*.md,不要查看编译后的包。.d.ts/dist/*.mjs是压缩后的实现,不是API — 查看它没有意义。 grep无输出确认功能不存在;将真正的功能缺口视为不支持(使用文档中提到的替代方案),而不要深入包中搜索。*.js
Disambiguation — Apps vs Dashboards
歧义消除 — 应用 vs 仪表盘
Route directly to Apps workflow (sections below) when you see:
, , , , ,
, , , , , ,
web appaction appcodedappapp.config.jsonaction-schema.jsonscaffold appdeploy apppackpublishpushpulldebug appRoute directly to references/dashboards/CAPABILITY.md when you see:
, , , , , ,
, , , , ,
dashboardanalyticsKPImetricsInsightsobservabilityadmin consolereportcharttrendgovernance reportagent metricsWhen intent is ambiguous — ask "Which fits your goal?" as a structured choice (Rule 18):
| Option | Description |
|---|---|
| Build or modify a Web App / Action App | Scaffold a UI, form, or app that deploys to Automation Cloud |
| Generate a dashboard | Analytics or admin view from a natural-language description |
当看到以下关键词时,直接路由到应用工作流(以下章节):
, , , , ,
, , , , , ,
web appaction appcodedappapp.config.jsonaction-schema.jsonscaffold appdeploy apppackpublishpushpulldebug app当看到以下关键词时,直接路由到references/dashboards/CAPABILITY.md:
, , , , , ,
, , , , ,
dashboardanalyticsKPImetricsInsightsobservabilityadmin consolereportcharttrendgovernance reportagent metrics当意图不明确时 — 以结构化选项的方式询问“哪个更符合你的目标?”(规则18):
| 选项 | 描述 |
|---|---|
| 构建或修改Web应用/动作应用 | 搭建可部署至Automation Cloud的UI、表单或应用 |
| 生成仪表盘 | 根据自然语言描述生成分析或管理视图 |
Task Navigation
任务导航
| I want to... | Read this |
|---|---|
| Create a new Coded Web App | references/create-web-app.md |
| Create a new Coded Action App | references/create-action-app.md |
| Debug auth or config issues | references/debug.md |
| Push/pull code to Studio Web | references/file-sync.md |
| Package and deploy | references/pack-publish-deploy.md |
| Full CLI command reference | references/commands-reference.md |
| Embed the DU Validation Station widget | references/widgets/validation-station.md |
| Embed the Conversational Agent chat widget | references/widgets/conversational-agent-chat.md |
| Embed the Data Fabric DataTable widget | references/widgets/datatable.md |
| Embed the multi-file bucket upload widget | references/widgets/multi-file-upload.md |
| Embed the PDF viewer widget | references/widgets/pdf-viewer.md |
| Add external IdP sign-in buttons (Google/SAML) | references/widgets/external-auth.md |
| OAuth scopes for SDK services | references/oauth-scopes.md |
| SDK: Import paths & subpath exports | references/sdk/imports.md |
| SDK: Assets, Queues, Buckets, Processes, Jobs, Attachments | references/sdk/orchestrator.md |
| SDK: Data Fabric (Entities, ChoiceSets) | references/sdk/data-fabric.md |
| SDK: Maestro (Processes, Cases) | references/sdk/maestro.md |
| SDK: Action Center (Tasks) | references/sdk/action-center.md |
| SDK: Conversational Agent | references/sdk/conversational-agent.md |
| SDK: Agent Feedback | references/sdk/feedback.md |
| SDK: Pagination | references/sdk/pagination.md |
| SDK: Agents & Agent Memory (Insights RTM) | references/sdk/agents.md |
| SDK: Agent Traces (Insights RTM) | references/sdk/traces.md |
| SDK: Governance — policy evaluations (Insights API) | references/sdk/governance.md |
| SDK: Agent Governance Decisions — runtime compliance (Insights RTM) | references/sdk/governance-traces.md |
| UI Patterns (polling, BPMN, HITL, text overflow, table pagination) | references/patterns.md |
| Generate an admin dashboard from NLP | references/dashboards/CAPABILITY.md |
| 我想要... | 查看此文档 |
|---|---|
| 创建新的编码Web应用 | references/create-web-app.md |
| 创建新的编码动作应用 | references/create-action-app.md |
| 调试认证或配置问题 | references/debug.md |
| 向Studio Web推送/拉取代码 | references/file-sync.md |
| 打包与部署 | references/pack-publish-deploy.md |
| 完整CLI命令参考 | references/commands-reference.md |
| 嵌入DU Validation Station组件 | references/widgets/validation-station.md |
| 嵌入对话代理聊天组件 | references/widgets/conversational-agent-chat.md |
| 嵌入Data Fabric DataTable组件 | references/widgets/datatable.md |
| 嵌入多文件桶上传组件 | references/widgets/multi-file-upload.md |
| 嵌入PDF查看器组件 | references/widgets/pdf-viewer.md |
| 添加外部身份提供商登录按钮(Google/SAML) | references/widgets/external-auth.md |
| SDK服务的OAuth权限 | references/oauth-scopes.md |
| SDK:导入路径与子路径导出 | references/sdk/imports.md |
| SDK:资产、队列、存储桶、流程、作业、附件 | references/sdk/orchestrator.md |
| SDK:Data Fabric(实体、选择集) | references/sdk/data-fabric.md |
| SDK:Maestro(流程、案例) | references/sdk/maestro.md |
| SDK:Action Center(任务) | references/sdk/action-center.md |
| SDK:对话代理 | references/sdk/conversational-agent.md |
| SDK:代理反馈 | references/sdk/feedback.md |
| SDK:分页 | references/sdk/pagination.md |
| SDK:代理与代理内存(Insights RTM) | references/sdk/agents.md |
| SDK:代理追踪(Insights RTM) | references/sdk/traces.md |
| SDK:治理 — 策略评估(Insights API) | references/sdk/governance.md |
| SDK:代理治理决策 — 运行时合规性(Insights RTM) | references/sdk/governance-traces.md |
| UI模式(轮询、BPMN、人工在环、文本溢出、表格分页) | references/patterns.md |
| 从自然语言生成管理仪表盘 | references/dashboards/CAPABILITY.md |
CLI Setup
CLI设置
bash
undefinedbash
undefinedInstall the UiPath CLI (run once)
安装UiPath CLI(运行一次)
npm install -g @uipath/cli
npm install -g @uipath/cli
Install the coded apps tool
安装编码应用工具
uip tools install @uipath/codedapp-tool
uip tools install @uipath/codedapp-tool
Install the Orchestrator tool (needed to resolve folder name → key for deploy)
安装Orchestrator工具(部署时需将文件夹名称解析为密钥)
uip tools install @uipath/orchestrator-tool
uip tools install @uipath/orchestrator-tool
Verify both are installed
验证两者均已安装
uip tools list
uip tools list
Resolve uip if not on PATH
如果uip不在PATH中,解析其路径
UIP=$(command -v uip 2>/dev/null || npm root -g 2>/dev/null | sed 's|/node_modules$||')/bin/uip
$UIP --version
Authenticate before any cloud command:
```bash
uip login status --output json # check if logged in
uip login # interactive OAuth (opens browser)
uip login --authority https://alpha.uipath.com # non-production environmentsUIP=$(command -v uip 2>/dev/null || npm root -g 2>/dev/null | sed 's|/node_modules$||')/bin/uip
$UIP --version
执行任何云命令前先认证:
```bash
uip login status --output json # 检查是否已登录
uip login # 交互式OAuth(打开浏览器)
uip login --authority https://alpha.uipath.com # 非生产环境Client-credentials (headless/CI) — scope MUST name one Orchestrator scope AND
客户端凭证(无头/CI环境) — 权限必须包含一个Orchestrator权限和
the two Apps-service scopes. Neither set covers the other:
两个应用服务权限。两组权限互不覆盖:
OR.Default → Orchestrator
OR.Default → Orchestrator
Apps.Read Apps.Write → Apps-service registration in uip codedapp publish
uip codedapp publishApps.Read Apps.Write → uip codedapp publish
中的应用服务注册
uip codedapp publishDo NOT substitute granular Orchestrator scopes (OR.Folders/OR.Execution/
请勿用细粒度的Orchestrator权限(OR.Folders/OR.Execution/
OR.Administration) for OR.Default.
OR.Administration)替代OR.Default。
uip login
--client-id <id>
--client-secret <secret>
--organization <org>
--tenant <tenant>
--scope "OR.Default Apps.Read Apps.Write"
--authority https://alpha.uipath.com # omit --authority for production
--client-id <id>
--client-secret <secret>
--organization <org>
--tenant <tenant>
--scope "OR.Default Apps.Read Apps.Write"
--authority https://alpha.uipath.com # omit --authority for production
> **The `uip login` session scope is separate from the app's runtime OAuth scopes.** The scopes in `uipath.json` are what the *deployed app* requests at runtime (see [oauth-scopes.md](references/oauth-scopes.md)). The `--scope` on `uip login` above is what the *CLI session* needs to call the Apps registration API during `uip codedapp publish`. `uip codedapp publish` does two things: uploads the package (needs `OR.Default`) **and** registers the coded app (needs `Apps.Read Apps.Write`). For what each failure looks like, see [debug.md](references/debug.md#publish--deploy-fails-under-a-client-credentials-login).uip login
--client-id <id>
--client-secret <secret>
--organization <org>
--tenant <tenant>
--scope "OR.Default Apps.Read Apps.Write"
--authority https://alpha.uipath.com # 生产环境请省略--authority
--client-id <id>
--client-secret <secret>
--organization <org>
--tenant <tenant>
--scope "OR.Default Apps.Read Apps.Write"
--authority https://alpha.uipath.com # 生产环境请省略--authority
> **`uip login`会话权限与应用运行时OAuth权限是分开的。**`uipath.json`中的权限是**已部署应用**在运行时请求的权限(详见[oauth-scopes.md](references/oauth-scopes.md))。上述`uip login`中的`--scope`是**CLI会话**在`uip codedapp publish`期间调用应用注册API所需的权限。`uip codedapp publish`会执行两项操作:上传包(需要`OR.Default`)**以及**注册编码应用(需要`Apps.Read Apps.Write`)。每种失败的表现详见[debug.md](references/debug.md#publish--deploy-fails-under-a-client-credentials-login)。SDK Config (web app)
SDK配置(Web应用)
The web app initializes the SDK with (no config). At runtime the SDK reads , , , , , and from tags. During local dev injects those tags from (committed) — the single config source, holding , , , , , and (the Vite dev URL for local). In production the UiPath platform injects the same tags directly.
new UiPath()clientIdscopeorgNametenantNamebaseUrlredirectUri<meta name="uipath:*">@uipath/coded-apps-devuipath.jsonclientIdscopeorgNametenantNamebaseUrlredirectUriTo change any of these values, edit .
uipath.jsonWeb应用使用(无配置)初始化SDK。运行时,SDK会从标签读取、、、、和。本地开发时,会从(已提交)注入这些标签 — 这是唯一的配置源,包含、、、、和(本地Vite开发URL)。生产环境中,UiPath平台会直接注入相同的标签。
new UiPath()<meta name="uipath:*">clientIdscopeorgNametenantNamebaseUrlredirectUri@uipath/coded-apps-devuipath.jsonclientIdscopeorgNametenantNamebaseUrlredirectUri要更改这些值,请编辑。
uipath.jsonCLI Environment Variables
CLI环境变量
| Variable | Used By | Description |
|---|---|---|
| | Studio Web project ID |
Base URL by environment:
| Environment | Correct Base URL |
|---|---|
| Production (cloud) | |
| Staging | |
| Alpha | |
| 变量 | 使用者 | 描述 |
|---|---|---|
| | Studio Web项目ID |
各环境对应的基础URL:
| 环境 | 正确的基础URL |
|---|---|
| 生产环境(cloud) | |
| 预发布环境 | |
| Alpha环境 | |
Quick Deploy (Full Pipeline)
快速部署(完整流程)
Do NOT pause between steps to ask "should I continue?" — execute the full pipeline. Only stop if you need auth credentials or an app name.
- Auth — . If not logged in, ask the user for their environment and run
uip login status --output json. With client credentials (headless/CI), useuip login— all three names are required:--scope "OR.Default Apps.Read Apps.Write"for Orchestrator,OR.DefaultandApps.Readfor the Apps-service registration inApps.Write. The External Application itself needs onlyuip codedapp publishandApps.Read;Apps.Writeis auto-granted and not portal-selectable, so name it inOR.Default. If publish or deploy then fails, see debug.md.--scope - Build — . Verify
npm run build.ls dist/ - Pack — . Produces
uip codedapp pack dist -n <name> --version <version>. Bump version if previously published..uipath/<name>.<version>.nupkg - Publish — (add
uip codedapp publishfor action apps). Verify-t Action.cat .uipath/app.config.json - Deploy — . Resolve the GUID from the chosen folder: a personal workspace (
uip codedapp deploy -n <name> --folder-key <GUID>), a named existing folder, or a freshlyType == "Personal"d one — viauip or folders create. Dashboards additionally choose a deploy mode (standalone / governance-pinned / governance) that setsuip or folders list --output json; see dashboards deploy impl. Never let the command go interactive. Share the app URL with the user.--tags
步骤间请勿暂停询问“是否继续?” — 执行完整流程。仅在需要认证凭证或应用名称时停止。
- 认证 — 运行。若未登录,询问用户环境并运行
uip login status --output json。使用客户端凭证(无头/CI环境)时,需使用uip login— 三个权限名称均为必填:--scope "OR.Default Apps.Read Apps.Write"用于Orchestrator,OR.Default和Apps.Read用于Apps.Write中的应用服务注册。外部应用本身仅需要uip codedapp publish和Apps.Read;Apps.Write是自动授予的,无法在门户中选择,因此需在OR.Default中指定。如果发布或部署失败,详见debug.md。--scope - 构建 — 运行。验证
npm run build。ls dist/ - 打包 — 运行。生成
uip codedapp pack dist -n <name> --version <version>。如果之前已发布过,需更新版本号。.uipath/<name>.<version>.nupkg - 发布 — 运行(动作应用需添加
uip codedapp publish)。验证-t Action。cat .uipath/app.config.json - 部署 — 运行。从所选文件夹解析GUID:个人工作区(
uip codedapp deploy -n <name> --folder-key <GUID>)、已命名的现有文件夹或新创建的文件夹(通过Type == "Personal"创建) — 使用uip or folders create。仪表盘还需选择部署模式(独立/治理固定/治理)来设置uip or folders list --output json;详见仪表盘部署实现。绝不要让命令进入交互模式。将应用URL分享给用户。--tags
SDK Module Imports
SDK模块导入
See references/sdk/imports.md for the lookup protocol (subpaths and classes are discovered from the installed package — ), type import conventions, and anti-pattern examples. Core rules are listed under Anti-patterns below.
ls node_modules/@uipath/uipath-typescript/dist/导入协议(子路径和类从已安装的包中发现 — )、类型导入约定和反模式示例详见references/sdk/imports.md。核心规则列在下方的反模式部分。
ls node_modules/@uipath/uipath-typescript/dist/Key Concepts
核心概念
App Config (.uipath/app.config.json
)
.uipath/app.config.json应用配置(.uipath/app.config.json
)
.uipath/app.config.jsonCreated by , consumed by . Contains , , , , . Do not delete between publish and deploy.
publishdeployappNamesystemNameappTypedeploymentIdappUrl.uipath/由命令创建,供命令使用。包含、、、、。发布与部署之间请勿删除目录。
publishdeployappNamesystemNameappTypedeploymentIdappUrl.uipath/Action Schema (action-schema.json
)
action-schema.json动作Schema(action-schema.json
)
action-schema.jsonAction apps define a data contract between the form and the Maestro/Agent workflow. It has four sections: (read-only data from automation), (user-filled fields), (pre-populated but editable), and (submission buttons like Approve/Reject).
inputsoutputsinOutsoutcomes动作应用定义了表单与Maestro/代理工作流之间的数据契约。它包含四个部分:(来自自动化的只读数据)、(用户填写的字段)、(预填充但可编辑的字段)、(提交按钮,如批准/拒绝)。
inputsoutputsinOutsoutcomesTroubleshooting
故障排除
See references/debug.md for detailed diagnosis steps.
| Error | Cause | Fix |
|---|---|---|
| No valid session | Run |
| App not built | Run |
| Same name+version already published (registration rejects duplicates) | Bump |
| Missing folder for CLI deploy | Resolve folder name → key via |
| No | Run |
| Login fails / redirect error | OAuth misconfiguration | See debug.md |
| API calls fail with 401/CORS | Wrong base URL | Use |
Folder identifier names differ across CLI and SDK. The CLI uses/UIPATH_FOLDER_KEY(string) and applies only to--folder-key. SDK methods use different parameters: Maestro services (uip codedapp deploy,MaestroProcesses,ProcessInstances) takeCases(string GUID), Orchestrator services (folderKey,Assets,Queues,Buckets) takeProcesses(number). Do not pass the CLI env var into SDK calls. To bridge from a MaestrofolderIdto an OrchestratorfolderKey, see sdk/maestro.md — and neverfolderId, the GUID is not numeric.parseInt(folderKey)
详细诊断步骤详见references/debug.md。
| 错误 | 原因 | 修复方法 |
|---|---|---|
| 无有效会话 | 运行 |
| 应用未构建 | 运行 |
| 相同名称+版本已发布(注册拒绝重复项) | 更新 |
| CLI部署缺少文件夹 | 通过 |
| | 先运行 |
| 登录失败/重定向错误 | OAuth配置错误 | 详见debug.md |
| API调用返回401/CORS错误 | 基础URL错误 | 使用 |
CLI与SDK的文件夹标识符名称不同。CLI使用/UIPATH_FOLDER_KEY(字符串),仅适用于--folder-key。SDK方法使用不同的参数:Maestro服务(uip codedapp deploy、MaestroProcesses、ProcessInstances)接受Cases(字符串GUID),Orchestrator服务(folderKey、Assets、Queues、Buckets)接受Processes(数字)。请勿将CLI环境变量传入SDK调用。要将Maestro的folderId转换为Orchestrator的folderKey,详见sdk/maestro.md — 且绝不要folderId,因为GUID不是数字。parseInt(folderKey)
Completion Output
完成输出
When you finish a task, report only what's applicable to the work actually done:
- What was done — files created, edited, or deleted (list paths); CLI commands run
- Stage reached — one of: scaffolded / built / packed / published / deployed
- Artifacts produced (report only the ones that actually exist):
- — if
dist/was runnpm run build - — if
.uipath/<name>.<version>.nupkgwas runpack - with
.uipath/app.config.json— ifdeploymentIdwas runpublish - Live deployment URL (from
appUrl) — ifapp.config.jsonwas rundeploy - External Application client ID — if one was created this session
- Next steps, depending on where the task stopped:
- Scaffolded only: to run locally
cd <app-name> && npm run dev - Built but not packed: ready to when the user wants to deploy
uip codedapp pack - Published but not deployed: run to go live
uip codedapp deploy - Deployed (Web): open/share the deployment URL; verify sign-in flow
- Deployed (Action): the app will render in Action Center human tasks triggered by Maestro/Agent workflows matching the routing name
- Scaffolded only:
- Open issues — any auth failures, scope mismatches, missing folder key, skipped steps, or errors left unresolved
If a later stage was requested but skipped (e.g., user asked to deploy but only succeeded), call it out explicitly in the next-steps section.
publish完成任务后,仅报告与实际完成工作相关的内容:
- 已完成的工作 — 创建、编辑或删除的文件(列出路径);运行的CLI命令
- 当前阶段 — 以下之一:已搭建 / 已构建 / 已打包 / 已发布 / 已部署
- 生成的产物(仅报告实际存在的产物):
- — 如果运行了
dist/npm run build - — 如果运行了
.uipath/<name>.<version>.nupkgpack - 包含的
deploymentId— 如果运行了.uipath/app.config.jsonpublish - 实时部署URL(来自的
app.config.json) — 如果运行了appUrldeploy - 外部应用客户端ID — 如果本次会话创建了一个
- 下一步操作,取决于任务停止的阶段:
- 仅完成搭建:运行在本地运行
cd <app-name> && npm run dev - 已构建但未打包:准备好后运行进行部署
uip codedapp pack - 已发布但未部署:运行上线
uip codedapp deploy - 已部署(Web应用):打开/分享部署URL;验证登录流程
- 已部署(动作应用):该应用会在Maestro/代理工作流触发的Action Center人工任务中渲染,匹配路由名称
- 仅完成搭建:运行
- 未解决问题 — 任何认证失败、权限不匹配、缺少文件夹密钥、跳过的步骤或未解决的错误
如果用户请求了后续阶段但未完成(例如用户要求部署但仅完成了),请在下一步操作部分明确指出。
publishAnti-patterns
反模式
These pitfalls are not already covered by the Critical Rules. For rules stated as positive requirements, see the Critical Rules section at the top.
- Don't import service classes from the package root — use the subpath (e.g., ).
@uipath/uipath-typescript/assets - Don't use the deprecated dot-chain — use constructor DI:
sdk.entities.getAll().new Entities(sdk) - Don't delete between
.uipath/andpublish—deployreadsdeploywritten byapp.config.json.publish
这些陷阱未在关键规则中涵盖。如需查看正面要求的规则,请参阅顶部的关键规则部分。
- 不要从包根目录导入服务类 — 使用子路径(例如)。
@uipath/uipath-typescript/assets - 不要使用已弃用的链式调用— 使用构造函数依赖注入:
sdk.entities.getAll()。new Entities(sdk) - 不要在与
publish之间删除deploy目录 —.uipath/会读取deploy生成的publish。app.config.json