- 概述
- 开始使用
- 概念
- Using UiPath CLI
- 操作指南
- CI/CD recipes
- 命令参考
- 概述
- 退出代码
- Global options
- uip codedagent
- uip docsai
- add-test-data-entity
- add-test-data-queue
- add-test-data-variation
- analyze
- build
- 创建项目
- diff
- find-activities
- get-analyzer-rules
- get-default-activity-xaml
- get-errors
- get-manual-test-cases
- get-manual-test-steps
- get-versions
- get-workflow-example
- indicate-application
- indicate-element
- inspect-package
- install-data-fabric-entities
- install-or-update-packages
- list-data-fabric-entities
- list-workflow-examples
- pack
- restore
- run-file
- search-templates
- start-studio
- stop-execution
- uia
- uip traces
- 迁移
- Reference & support
UiPath CLI user guide
uip agent validate runs a local static-analysis pass over an agent project and then executes the schema-migration pipeline. It is the command you should run after every hand-edit to agent.json (or entry-points.json, project.uiproj, resources/*/resource.json) — and always before packing, publishing, or pushing.
The pipeline is in-memory first, then write-back: migration is computed against the current files, and nothing is written to disk unless every check passes. When checks pass, migrated file contents are written back, and (standalone mode only) the .agent-builder/ scaffolding is regenerated.
Validate is local-only — no login required.
Synopsis
uip agent validate [path] [--inline-in-flow]
uip agent validate [path] [--inline-in-flow]
All uip agent validate invocations honor the global options (--output, --output-filter, --log-level, --log-file). Exit codes follow the standard contract.
参数
[path](optional, default.) — Agent project directory. Must containagent.json; standalone mode additionally requiresentry-points.jsonandproject.uiproj.
选项
| 标记 | 默认 | 用途 |
|---|---|---|
--inline-in-flow | off | Validate an inline agent inside a flow project. Skips the entry-points.json and project.uiproj checks, and does not generate .agent-builder/. Use this mode whenever the agent was scaffolded with uip agent init --inline-in-flow. |
示例
# Validate the current directory
uip agent validate
# Validate a specific standalone project
uip agent validate ./my-agent
# Validate an inline agent (the flow-project subdirectory)
uip agent validate ./my-flow/<uuid> --inline-in-flow
# Validate the current directory
uip agent validate
# Validate a specific standalone project
uip agent validate ./my-agent
# Validate an inline agent (the flow-project subdirectory)
uip agent validate ./my-flow/<uuid> --inline-in-flow
What is checked
Standalone mode runs, in order:
- Required files —
agent.json,entry-points.json,project.uiproj. agent.jsonstructure —version === "1.1.0",type === "lowCode",projectIdis a UUID,settings.model/settings.engine/settings.modepresent,metadata.storageVersionpresent,messages[]has at least[system, user].messages[].contentTokens— each message'scontentTokensarray is re-derived fromcontent(splitting on{{…}}) and compared to what is on disk. Mismatches in count, type, or raw-string are errors.- I/O schemas —
inputSchemaandoutputSchemamust each be{ type: "object", properties: {…} }, with every entry inrequired[]present inproperties. - Resources — both inline
agent.resourcesand file-basedresources/<Name>/resource.jsonentries.toolresources need a UUIDid,name,type, and — whenlocationis set — one of"solution"/"external", withproperties.folderPath === "solution_folder"when the location is"solution".escalationandmcpresources need a UUID and a name. - Entry-points sync —
entry-points.json → entryPoints[0].input/outputmust matchagent.json'sinputSchema/outputSchema(properties keys for both; required arrays for input only). project.uiproj—ProjectType === "Agent".- Schema-migration pipeline — the validator migrates files as needed (
storageVersionbumps, field additions) and runs schema validation against the Studio Web schemas. .agent-builder/generation — standalone only. Writes scaffolding files and, where possible, patches referenceKeys inresource.jsonfiles.
Inline mode (--inline-in-flow) skips steps 1 (partial — only agent.json required), 6, 7, and 9.
Static errors fail fast with exit code 1 before the migration pipeline runs. Migration errors also fail with exit code 1, with each offending file and path reported.
Data shape (--output json)
Valid, no migration applied (Code: "AgentValidation"):
{
"Code": "AgentValidation",
"Data": {
"Status": "Valid",
"ProjectDir": "/abs/path/my-agent",
"Model": "gpt-4o-2024-11-20",
"StorageVersion": "47.0.0",
"MigrationApplied": false,
"Validated": true
}
}
{
"Code": "AgentValidation",
"Data": {
"Status": "Valid",
"ProjectDir": "/abs/path/my-agent",
"Model": "gpt-4o-2024-11-20",
"StorageVersion": "47.0.0",
"MigrationApplied": false,
"Validated": true
}
}
Valid, migration applied:
{
"Code": "AgentValidation",
"Data": {
"Status": "Valid — migrated to 47.0.0",
"ProjectDir": "/abs/path/my-agent",
"Model": "gpt-4o-2024-11-20",
"StorageVersion": "47.0.0",
"MigrationApplied": true,
"MigratedFiles": 3,
"Validated": true,
"AgentBuilderGenerated": true,
"AgentBuilderFiles": 5,
"ReferenceKeysResolved": 2,
"Warnings": ["…"]
}
}
{
"Code": "AgentValidation",
"Data": {
"Status": "Valid — migrated to 47.0.0",
"ProjectDir": "/abs/path/my-agent",
"Model": "gpt-4o-2024-11-20",
"StorageVersion": "47.0.0",
"MigrationApplied": true,
"MigratedFiles": 3,
"Validated": true,
"AgentBuilderGenerated": true,
"AgentBuilderFiles": 5,
"ReferenceKeysResolved": 2,
"Warnings": ["…"]
}
}
Inline mode adds "InlineInFlow": true to the payload and omits AgentBuilderGenerated / AgentBuilderFiles / ReferenceKeysResolved.
Failure (Code: "AgentValidationFailed"):
{
"Code": "AgentValidationFailed",
"Message": "Validation failed with 2 error(s)",
"Data": {
"Errors": [
"agent.json.settings.model: missing or empty",
"messages[1].contentTokens: contentTokens has 3 entries but content requires 2. Rebuild contentTokens to match content."
]
}
}
{
"Code": "AgentValidationFailed",
"Message": "Validation failed with 2 error(s)",
"Data": {
"Errors": [
"agent.json.settings.model: missing or empty",
"messages[1].contentTokens: contentTokens has 3 entries but content requires 2. Rebuild contentTokens to match content."
]
}
}
Related
uip agent init— scaffolds projects that always validate cleanly by default.- Structured edits that keep the agent project consistent:
uip agent config,uip agent input/output,uip agent tool,uip agent context,uip agent escalation. - Consumers of a validated project:
uip agent pack,uip agent publish,uip agent push.