pnp / pnp/cli-microsoft365

New command: m365 pp copilot component list

Open
#7,543 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request needs peer review
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Usage

m365 pp copilot component list

Description

Lists the components of a Copilot Studio agent, such as topics, knowledge sources, triggers and test cases.

m365 pp copilot list and get return the agents in an environment, but there is currently no way to see what an agent is actually made of. The components live in the botcomponent table, which is queryable through the same Dataverse Web API the existing pp copilot commands already use.

This is useful for governance and ALM review: which agents carry knowledge sources, which have an External Trigger (and are therefore autonomous), which have test cases, and which have unmanaged components in a managed solution.

Options
Option Description
-e, --environmentName <environmentName> The name of the environment
-i, --copilotId [copilotId] The ID of the copilot. Specify either copilotId or copilotName but not both.
-n, --copilotName [copilotName] The name of the copilot. Specify either copilotId or copilotName but not both.
-t, --type [type] Filter by component type. Allowed values below.
--asAdmin Set, to list the components as admin for environments you are not a member of

--copilotName follows the same duplicate-name handling as pp copilot get.

Component types

The complete botcomponent_componenttype choice set. V1 and V2 are kept distinct, since they map to different API values and the distinction matters for ALM and governance.

Value Label --type value
0 Topic topic
1 Skill skill
2 Bot variable variable
3 Bot entity entity
4 Dialog dialog
5 Trigger trigger
6 Language understanding languageUnderstanding
7 Language generation languageGeneration
8 Dialog schema dialogSchema
9 Topic (V2) topicV2
10 Bot translations (V2) translationsV2
11 Bot entity (V2) entityV2
12 Bot variable (V2) variableV2
13 Skill (V2) skillV2
14 Bot File Attachment fileAttachment
15 Custom GPT customGpt
16 Knowledge Source knowledgeSource
17 External Trigger externalTrigger
18 Copilot Settings settings
19 Test Case testCase
Default output

botcomponentid, name, componenttype, schemaname, ismanaged, statecode.

content and data are not returned by default. Each can hold up to 1 MB, which would make the default JSON output very heavy. The full component payload belongs on a future pp copilot component get.

Examples

List all components of a copilot in the given environment

m365 pp copilot component list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --copilotId "9be05428-a279-4aa3-ae54-8449c2cc2722"

List only the knowledge sources of a copilot, by name

m365 pp copilot component list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --copilotName "HR Assistant" --type knowledgeSource

List the components of a copilot as administrator

m365 pp copilot component list --environmentName "Default-2ca3eaa5-140f-4175-8261-3272edf9f339" --copilotId "9be05428-a279-4aa3-ae54-8449c2cc2722" --asAdmin
Additional Info

Same mechanism as the existing pp copilot commands: resolve the environment with powerPlatform.getDynamicsInstanceApiUrl, then query the Dataverse Web API.

GET {dynamicsApiUrl}/api/data/v9.1/botcomponents?$filter=_parentbotid_value eq {copilotId}

botcomponent reference: https://learn.microsoft.com/power-apps/developer/data-platform/reference/entities/botcomponent

  • EntitySetName is botcomponents, RetrieveMultiple is a plain GET /botcomponents
  • parentbotid is a lookup to bot, so the copilot filter is a standard lookup filter
Follow-up

m365 pp copilot component get - same table, single record, with content and data included.


Spec updated following @Jwaegebaert's review: option names aligned to copilot, full component type set with V1/V2 kept distinct, content and data excluded from the default output, component ID and ismanaged added, and duplicate-name handling aligned with pp copilot get.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing pp copilot commands and powerPlatform.getDynamicsInstanceApiUrl, then trace their Dataverse Web API request and duplicate-name handling. Done means the new command resolves a copilot by ID or name, queries botcomponents with the documented filters and options, and returns the specified fields without content or data by default.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.