Extract an agent template
cs_extract_agent_templateExtract an existing Copilot Studio agent into a reusable YAML template, preserving topics, settings, and components, to replicate it in another environment or solution.
Instructions
Write a reusable YAML template from an existing agent (its topics, settings and components), for cs_create_agent_from_template in another environment or solution. Runs 'pac copilot extract-template' with the active pac auth profile.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bot | Yes | Agent id or schema name | |
| cwd | No | Working directory for pac (for project commands: the solution project folder) | |
| profile | No | pac auth profile to run as: the admin account for tenant commands. Defaults to CPS_ADMIN_PROFILE for admin commands and CPS_PAC_PROFILE otherwise, then the active profile. cs_init lists the profiles. | |
| overwrite | No | Overwrite the file if it exists | |
| background | No | Run in the background and return a jobId immediately, for a command that takes longer than the client will wait. Poll cs_job_status. | |
| environment | No | Environment id or URL; default: the environment of the active pac auth profile | |
| templateFile | Yes | Path of the YAML template to write | |
| templateName | No | Template name (default kickStartTemplate) | |
| timeoutSeconds | No | Default 600 | |
| templateVersion | No | Template version X.Y.Z (default 1.0.0) |