pac copilot

用于 copilot 管理的工具和实用工具。

Commands

Command Description
pac copilot clone 将Copilot Studio代理克隆到本地工作区目录。
pac copilot create 使用现有模板文件作为引用创建新的 copilot。
pac copilot delete 删除自定义Copilot。
pac copilot extract-template 从环境中的现有 copilot 中提取模板文件。
pac copilot extract-translation 提取包含一个或多个机器人的本地化内容的文件。
pac copilot init 从模板创建新的Copilot Studio代理工作区。
pac copilot init-skills 将 Copilot 技能定义文件提取到当前目录。
pac copilot list 当前或目标 Dataverse 环境中的 copilot 列表。
pac copilot mcp 有关本地 MCP(模型上下文协议)服务器的信息。
pac copilot merge-translation 合并包含一个或多个机器人的本地化内容的文件。
pac copilot model list 当前环境中的 AI Builder 模型。
pac copilot model predict 向 AI 模型发送文本或提示
pac copilot model prepare-fetch 从 AI 大型语言模型(LLM)获取 FetchXML 文件,并准备针对当前环境执行该文件。
pac copilot pack 将Copilot Studio代理工作区打包到解决方案 zip 文件中。
pac copilot publish 发布自定义 Copilot
pac copilot pull 从Copilot Studio拉取远程更改,并与本地工作区合并。
pac copilot push 将本地工作区更改推送到Copilot Studio。
pac copilot quarantine 副驾驶特工处于隔离状态。
pac copilot status 在当前或目标 Dataverse 环境中轮询指定 copilot 的部署状态。

pac copilot clone

将Copilot Studio代理克隆到本地工作区目录。

所需的参数 copilot clone

--bot -id

Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。

可选参数 copilot clone

--component-collection -cc

要克隆的组件集合 ID。 对多个重复。

--display-name -dn

代理的显示名称(用于文件夹命名)。

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

--output-dir -od

克隆输出的根文件夹。 默认为当前目录。

pac copilot create

使用现有模板文件作为引用创建新的 copilot。

所需的参数 copilot create

--displayName

新 copilot 的显示名称

--schemaName

新 copilot 的架构名称(唯一名称)。

--solution -s

解决方案的名称。

--templateFileName

包含使用 extract-template 命令提取的 copilot 模板的源 yaml 文件。

可选参数 copilot create

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

pac copilot delete

删除自定义Copilot。

所需的参数 copilot delete

--bot -id

Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。

可选参数 copilot delete

--confirm -y

需要确认删除 copilot。

此参数不需要任何值。 这是一个开关。

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

pac copilot extract-template

从环境中的现有 copilot 中提取模板文件。

Example

此命令从环境中的现有 copilot 中提取模板文件。

pac copilot extract-template `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --bot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e `
   --templateFileName NewTestCopilot.yaml

该命令使用英语和德语返回类似以下内容的输出:

Connected as user@contoso.org

Loaded 34 components for bot 'New Test Copilot ' with id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e. Primary language: English, supported languages: German

New Test Copilot -> C:\Users\user\NewTestCopilot.yaml

所需的参数 copilot extract-template

--bot -id

Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。

--templateFileName

要向其写入 copil 模板的 yaml 文件的位置。

可选参数 copilot extract-template

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

--overwrite -o

如果输出数据文件已存在,则允许覆盖输出数据文件。

此参数不需要任何值。 这是一个开关。

--templateName

如果未指定名称,则模板名称或“kickStartTemplate”。

--templateVersion

如果未指定版本,则为 X.X.X 格式的模板版本或 1.0.0。

pac copilot extract-translation

提取包含一个或多个机器人的本地化内容的文件。

Example

此命令提取一个文件,其中包含一个或多个 copilot 的本地化内容。

pac copilot extract-translation `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --bot 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e `
   --all `
   --outdir . `
   --format json

该命令返回如下所示的输出:

Connected as user@contoso.org

Loaded 32 components for bot 'New Test Copilot' with id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e. Primary language: English, supported languages: German

可选参数 copilot extract-translation

--all -a

为所有支持的语言编写本地化文件。 默认情况下,仅编写主要语言。

此参数不需要任何值。 这是一个开关。

--bot -id

Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

--format

要在其中写入本地化文件的文件格式,即“resx”或“json”。 默认值为“resx”。

--outdir

要写入的输出目录。

--overwrite -o

如果输出数据文件已存在,则允许覆盖输出数据文件。

此参数不需要任何值。 这是一个开关。

--sourcedir -src

源解决方案目录。 指定后,将在查找机器人时忽略连接的环境,而是在解决方案文件夹中查找内容。

pac copilot init

从模板创建新的Copilot Studio代理工作区。

所需的参数 copilot init

--name -n

代理显示名称。

--publisher-prefix -pp

Publisher解决方案的自定义前缀。

可选参数 copilot init

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

--instructions -ins

代理系统说明。

--project-dir -pd

代理工作区的目标目录。 默认为当前目录。

--schema-name -sn

完整代理架构名称。 重写默认派生({publisher-prefix}_{sanitized-name})。 在不使用修改的情况下使用 as-is。

--template -t

模板配置文件名称(默认,最小)。 默认值为“default”。

pac copilot init-skills

将 Copilot 技能定义文件提取到当前目录。

可选参数 copilot init-skills

--output -o

技能文件的输出文件夹。 默认值:.github/skills

--skills -s

要复制的技能名称(顶级名词名称)的逗号分隔列表,例如管理员、身份验证。默认值:所有技能。

pac copilot list

当前或目标 Dataverse 环境中的 copilot 列表。

Example

此命令列出当前或目标 Dataverse 环境中的所有 copilot。

pac copilot list --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118

该命令返回如下所示的输出:

Name                           Bot ID                               Component State Is Managed Solution ID                          Status Code State Code
Ask Me Anything Copilot       584e012c-dc95-46d6-af5a-1263b6a44342 Published       Unmanaged  285af946-6383-49a0-8615-4e2afafeaf38 Active      Provisioned
New Test Copilot               9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e Published       Unmanaged  285af946-6383-49a0-8615-4e2afafeaf38 Active      Provisioned

可选参数 copilot list

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

pac copilot mcp

有关本地 MCP(模型上下文协议)服务器的信息。

Example

pac copilot mcp --run

可选参数 copilot mcp

--run -r

运行本地 MCP(模型上下文协议)服务器。

此参数不需要任何值。 这是一个开关。

Remarks

了解如何将 Power Platform CLI 与内置 MCP 服务器配合使用

pac copilot merge-translation

合并包含一个或多个机器人的本地化内容的文件。

Example

此命令合并包含一个或多个 copilot 的本地化内容的文件。

pac copilot merge-translation `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --file ms_store_newTestCopilot.de-DE.json `
   --solution SolutionName

更新德语时,此命令将返回如下所示的输出:

Connected as user@contoso.org

Loading language German into bot 'ms_store_newTestCopilot' (New Test Copilot) from file 'C:\Users\user\ms_store_newTestCopilot'. 0 key(s) were missing, 0 value(s) were not used. Use the --verbose switch to get more details.

Updated 16 out of 16 components.

了解如何从合并转换命令管理错误

可选参数 copilot merge-translation

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

--file -f

包含翻译的文件列表。 支持 Glob 模式。

--solution -s

解决方案的名称。

--sourcedir -src

源解决方案目录。 指定后,将在查找机器人时忽略连接的环境,而是在解决方案文件夹中查找内容。

--verbose

在数据导入/导出过程中输出更多诊断信息

此参数不需要任何值。 这是一个开关。

--whatif

不执行命令,但输出所发生情况的详细信息。

此参数不需要任何值。 这是一个开关。

合并转换错误

根据上面的示例,如果在用于更新 copilot 的文件中存在一个错误,则输出如下所示:

Connected as user@contoso.org

Loading language German into bot 'ms_store_newTestCopilot' (New Test Copilot) from file 'C:\Users\user\ms_store_newTestCopilot'. 1 key(s) were missing, 1 value(s) were not used. Use the --verbose switch to get more details.

Updated 16 out of 16 components.

--verbose 标志将添加有关错误的详细信息:

Connected as user@contoso.org

Missing translation key: 'dialog(ms_store_newTestCopilot.topic.Lesson2)'.'trigger(main)'.'action(LbWwpD)'.Entity.Definition.'closedListItem(Redmond)'.DisplayName.

Unused translation: 'dialog(ms_store_newTestCopilot.topic.Lesson2)'.'trigger(main)'.'action(LbWwpD)'.Entity.Definition.'closedListItem(Redmont)'.DisplayName, value: Redmond

Loading language German into bot 'ms_store_newTestCopilot' (New Test Copilot) from file 'C:\Users\user\ms_store_newTestCopilot'. 1 key(s) were missing, 1 value(s) were not used. Use the --verbose switch to get more details.

Updated 16 out of 16 components.

pac copilot model list

当前环境中的 AI Builder 模型。

Example

此命令列出所有 AI Builder 模型。

pac copilot model list --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118

该命令返回如下所示的输出:

Id                                   State    Name
32a9e265-1149-4155-af54-d2856d2b83f5 Active   Document Processing 2023/09/20, 12:21:40
2bcd7b94-50bc-4767-af4a-367c63fb5487 Inactive AI Classify
4e72b59a-17d6-451e-8657-89fbdec56d7a Inactive AI Extract
572f57a7-7a8f-49fc-adb4-331e02c509a6 Inactive AI Reply
b9b636cf-9748-47a7-b617-6df5f00f5151 Inactive AI Sentiment
c076eac8-f218-4feb-8ad1-7ee4fb039419 Inactive AI Summarize
a0440df3-2656-e911-8194-000d3a6cd5a5 Inactive BusinessCard model
62d1e848-5ca7-490a-94bf-79baabe85ef4 Inactive CategoryClassification model
4da7ec17-5c26-4fd2-9ddb-be4f7eda21a9 Inactive DataGenieEmailAddressValidation
51f4da11-5702-401d-b53a-9638744e8ac9 Inactive Document Layout Analysis Model
d1bb8d57-24ab-3b36-9592-bd792e153b79 Inactive DVCopilotQueryModel
3fbd4e5c-32bc-40fc-acce-59c2821cf113 Inactive Empty Dynamic Prompt
8c281981-c5d6-484f-bac7-4924ddd0b8ae Inactive EntityExtraction model
a1afa5d4-7a44-4c31-9cd2-e852a78431fa Inactive GptPromptEngineering model
2c444168-f8b1-4c6a-9313-2d9c03be6fea Inactive Id Scanning Model
77365cfa-7021-4cb7-a9b2-dc9823cde772 Inactive ImageDescription model
aef1bdd2-2a74-4f74-b4eb-9dfa22e35ded Inactive Invoice Model
5ed4d0fd-e9d4-4026-b09b-71f83ea90c60 Inactive Invoice Processing Model
c8425db7-c5a7-4226-b38e-c93a044c0fe1 Inactive KeyPhraseExtraction model
17a6f893-5b0b-4867-8fac-fb2eda9080b2 Inactive LanguageDetection model
046ab801-2756-e911-8194-000d3a6cd5a5 Inactive ObjectDetectionProposal model
892d3698-ba03-3d15-8e9e-843ca4ac5e7d Inactive PowerAppsAppCopilotModel
baa44529-bebe-49e6-837a-80bee63b0d2c Inactive Receipt Scanning Model
f1c549c2-a97e-47a5-b612-c5c2bab0f163 Inactive SentimentAnalysis model
7f8a7856-003a-3662-9871-0000d7674433 Inactive SimsModel
86419a67-205a-454f-b6fc-601394f2786d Inactive TextRecognition model
6225038a-8b5a-4913-bfd2-d8236f4102ba Inactive TextTranslation model
02e1fca3-232a-4f58-8c93-bdd8c9cd6de9 Inactive TextTranslationInternal model

可选参数 copilot model list

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

pac copilot model predict

向 AI 模型发送文本或提示

可选参数 copilot model predict

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

--model-id -id

AI Builder 模型 ID

--model-name -n

完整或部分 AI 模型名称

--prompt -p

提示发送到 AI 模型

--text -t

要发送到 AI 模型的文本

pac copilot model prepare-fetch

从 AI 大型语言模型(LLM)获取 FetchXML 文件,并准备针对当前环境执行该文件。

所需的参数 copilot model prepare-fetch

--inputFile -i

通常来自 AI LLM 的输入 FetchXML 文件。

--outputFile -o

输出准备针对当前环境执行的 FetchXML 文件。

可选参数 copilot model prepare-fetch

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

pac copilot pack

将Copilot Studio代理工作区打包到解决方案 zip 文件中。

所需的参数 copilot pack

--publisher-prefix -pp

Publisher解决方案的自定义前缀。

可选参数 copilot pack

--output-path -op

解决方案 zip 文件的输出路径。 默认为当前目录。

--project-dir -pd

要打包的代理工作区目录。 默认为当前目录。

--solution-name -sn

解决方案唯一名称。 如果省略,则派生自代理架构名称。

pac copilot publish

发布自定义 Copilot

所需的参数 copilot publish

--bot -id

Copilot ID 或架构名称(在机器人详细信息中找到的唯一名称或解决方案资源管理器中的文件名)。

可选参数 copilot publish

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

pac copilot pull

从Copilot Studio拉取远程更改,并与本地工作区合并。

可选参数 copilot pull

--project-dir -pd

项目目录的路径。 默认为当前工作目录。

pac copilot push

将本地工作区更改推送到Copilot Studio。

可选参数 copilot push

--project-dir -pd

项目目录的路径。 默认为当前工作目录。

pac copilot quarantine

副驾驶特工处于隔离状态。

所需的参数 copilot quarantine

--bot-id -id

副驾驶的身份证,用于隔离/解除隔离。

可选参数 copilot quarantine

--environment -env

环境(ID、组织 ID、URL、唯一名称或部分名称)。

--status -s

隔离状态值。 true = 隔离,false = 解除隔离。 默认值为 true。

此参数不需要任何值。 这是一个开关。

pac copilot status

在当前或目标 Dataverse 环境中轮询指定 copilot 的部署状态。

Example

此命令轮询当前或目标 Dataverse 环境中的指定 copilot 的部署状态。

pac copilot status `
   --environment 2e250e7a-5607-4fea-aa4e-1aeb7bf79118 `
   --bot-id 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e

该命令返回如下所示的输出:

Connected as user@contoso.org
Connected to... Contoso Organization
Virtual Agent New Bot German with ID 9ee3f7aa-ab79-4cf6-a726-d85c8c18cc3e has been provisioned.

所需的参数 copilot status

--bot-id -id

copilot (Chatbot) 的 ID。

可选参数 copilot status

--environment -env

指定目标 Dataverse。 该值可以是 Guid 或绝对 https URL。 如果未指定,将使用为当前身份验证配置文件选择的活动组织。

另见

Microsoft Power Platform CLI 命令组
Microsoft Power Platform CLI 概述