What if you could create, debug and manage Power Automate flows by typing plain English into a terminal? Microsoft now publishes a Power Platform plugin for GitHub Copilot CLI that does exactly that. I set it up end to end and wrote a runbook, so you don't have to hit the same walls I did.
The runbook covers installing everything, the three errors that will almost certainly trip you up, the prompts that actually work, and how to build flows your Copilot Studio agents can call. It was verified on Windows 11 Pro (26200) with PowerShell 7.6.5 and Node v20.2.0.
What you can do with it
- Discover: list environments and flows, find the flows that failed in the last 24 hours, and get an inventory report of every flow and its owner.
- Create: describe a flow in a sentence ("runs weekdays at 9am, reads overdue rows from a SharePoint list and emails a summary"), and the plugin builds it.
- Debug: ask why the last run failed, or run a deep diagnosis of a specific run with the root cause and a proposed fix.
- Manage: publish flows, turn off the ones that haven't run in 90 days, and work with desktop flows and machine groups.
- Build agent actions: create flows with the right trigger and response for Copilot Studio agents.
Under the hood, the power-automate plugin adds 10 skills and a flowagent MCP server to GitHub Copilot CLI. It gets its Power Automate access through Azure CLI.
Before you start
| Requirement | Target | Why it matters |
|---|---|---|
| PowerShell | 7.0+ | Windows PowerShell 5.1 won't run these reliably. Use pwsh, not powershell. |
| Node.js | 20.6+ | Below 20.6 the copilot command breaks. There's a workaround (Gotcha 1). |
| npm | 9.0+ | Ships with Node and installs the CLI package. |
| winget | any | Installs Azure CLI. It's preinstalled on Windows 11. |
You also need a GitHub account with Copilot access and a Microsoft work account with a Power Automate licence. They're two separate sign-ins.
Install in six steps
1. Install Azure CLI
PS C:\> winget install --exact --id Microsoft.AzureCLI --accept-package-agreements --accept-source-agreements
Found Microsoft Azure CLI [Microsoft.AzureCLI] Version 2.90.0
Successfully verified installer hash
Starting package install...
Successfully installed
The plugin gets its token through az. Power Platform CLI (pac) does not work as a substitute, even if you already have it.
2. Refresh your PATH
Open a new terminal tab, or run this in the current one:
PS C:\> $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") PS C:\> az version
3. Install GitHub Copilot CLI
PS C:\> npm install -g @github/copilot PS C:\> copilot --version # If that errors, install the platform package too: PS C:\> npm install -g @github/copilot-win32-x64@1.0.83
npm often skips the platform-specific binary because it's an optional dependency. Installing it yourself is safe either way.
4. Sign in, twice
PS C:\> copilot-win32-x64 login Opening your browser to authenticate... Waiting for authorization... Signed in successfully as octocat. PS C:\> az login --allow-no-subscriptions
Use --allow-no-subscriptions from the start. Plain az login fails on most Power Automate tenants (Gotcha 3).
5. Add the marketplace and the plugin
PS C:\> copilot-win32-x64 plugin marketplace add microsoft/power-platform-skills Marketplace "power-platform-skills" added successfully. PS C:\> copilot-win32-x64 plugin install power-automate@power-platform-skills Plugin "power-automate" installed successfully. Installed 10 skills.
The same marketplace has seven sibling plugins, including power-pages, canvas-apps and model-apps.
6. Check it works
PS C:\> copilot-win32-x64 -p "List my Power Automate environments" --allow-all-tools
● skill(route-environments)
● List Environments (MCP: flowagent) 6s
● Resolve Environment (MCP: flowagent) 6s
Your Power Automate environments:
| Environment | Type | Region | Default |
|-------------------|-----------|--------|---------|
| Contoso | Teams | Asia | No |
| Contoso (default) | Default | Asia | Yes |
| Dev Sandbox | Developer | Asia | No |
Your current environment resolves to Contoso (default).
AI Credits 0.91 (20s)
Three things that will trip you up
Gotcha 1: the copilot command fails on Node below 20.6
PS C:\> copilot --version GitHub Copilot CLI: no platform package found. Reinstall with `npm install -g @github/copilot` to fetch the package for your platform. PS C:\> copilot-win32-x64 --version GitHub Copilot CLI 1.0.83.
The error tells you to reinstall, but reinstalling never fixes it. The launcher uses a Node feature that only arrived in 20.6. Either upgrade Node, or call the platform command copilot-win32-x64 directly. That's what every command in the runbook uses, so it works on any Node version.
Gotcha 2: terminals opened before an install can't see the new command
PS C:\> az login
az: The term 'az' is not recognized as a name of a cmdlet, function,
script file, or executable program.
PowerShell reads PATH when the window opens. Open a new tab, or refresh PATH as in step 2.
Gotcha 3: az login refuses a tenant with no subscriptions
PS C:\> az login
The following tenants don't contain accessible subscriptions.
Use `az login --allow-no-subscriptions` to have tenant level access.
No subscriptions found for admin@contoso.com.
Power Automate is licensed through Microsoft 365, not Azure, so it's normal for your tenant to have no Azure subscriptions. The plugin only needs a tenant-level token, so use az login --allow-no-subscriptions.
Working with flows
There are two modes. Interactive (just run copilot-win32-x64) asks before acting and remembers the conversation, which is best while learning. Prompt mode (-p) runs one instruction, which is good for scripts.
# Discover PS C:\> copilot-win32-x64 -p "Show flows that failed in the last 24 hours" --allow-all-tools PS C:\> copilot-win32-x64 -p "Give me an inventory report of all flows and their owners" --allow-all-tools # Create PS C:\> copilot-win32-x64 -p "Create a flow in Dev Sandbox that runs weekdays at 9am, reads rows from the SharePoint list 'Vendor Reviews' where Status is Overdue, and emails a summary table to the list owner. Validate before creating." --allow-all-tools # Debug PS C:\> copilot-win32-x64 -p "Debug the most recent failed run of flow 'Copilot CLI Demo'" --allow-all-tools # Manage PS C:\> copilot-win32-x64 -p "Turn off all flows in Dev Sandbox that have not run in 90 days" --allow-all-tools
Flows for Copilot Studio agents
A Copilot Studio agent calls a flow as an action. If any of these four rules is broken, the flow won't even appear in the agent's action list:
| Rule | What it means |
|---|---|
| Same environment | The flow must be in the same environment as the agent. |
| Trigger | When an agent calls the flow (not manual, scheduled or HTTP). |
| Response | It must end with Respond to the agent, returning typed outputs. |
| Solution | To ship it with the agent, the flow must be in the same solution. |
PS C:\> copilot-win32-x64 -p "Create a flow in Dev Sandbox using the
'When an agent calls the flow' trigger. Input: a text parameter named VendorName.
Look up that vendor in the SharePoint list 'Vendor Register' and return the
vendor's Tier and RiskRating using 'Respond to the agent'.
Validate before creating." --allow-all-tools
Then in Copilot Studio, open the agent and go to Actions, then Add an action, and pick the flow. Write the flow's description carefully, because that's what the agent matches against the user's request.
Permissions and cost
Prompt mode needs permission up front. --allow-all-tools lets Copilot run anything on your machine without asking. That's fine for a trusted local session, but narrow it for scripts:
# only Azure CLI and Power Platform CLI --allow-tool='shell(az:*)' --allow-tool='shell(pac:*)' # everything except git push --allow-tool='shell(git:*)' --deny-tool='shell(git push)'
Scoping works, but test it: a run scoped to shell(az:*) was still refused az --version and had to work around it. Start narrow and widen only where a run gets blocked.
| Run | GitHub Copilot AI credits | Time |
|---|---|---|
| Prerequisite check | 1.23 | 29 s |
| Listing environments | 0.91 | 20 s |
This is billed as GitHub Copilot AI credits. Creating a flow takes longer than either of these.
copilot-win32-x64 -p "Check my environment routing" --allow-all-tools first.The ten skills
You never call these by name. Copilot picks one from how you phrase the request, so knowing them tells you what to say:
| Skill | Say something like |
|---|---|
setup | "check my prerequisites" |
route-environments | "which environment am I in" |
browse-flows | "list my flows" |
create-flow | "create a flow" (guided, asks questions) |
build-flow | "build a flow that…" (one shot) |
debug-flow | "why did my flow fail" |
diagnose-flow | "diagnose run <id>" (deep, needs the ids) |
manage-flows | "publish", "test", "inventory report" |
manage-desktop-flows | "desktop flows", "machine groups" |
report-issue | "report a bug in the plugin" |
Not a Claude Code plugin
This installs into GitHub Copilot CLI and only works there. It won't appear in Claude Code's plugin list. The two complement each other: Claude Code has its own copilot-studio plugin for building agents, and this one builds the flows those agents call.
A few honest notes
- Everything up to listing environments is verified end to end: install, both sign-ins, the plugin (v3.0.5, 10 skills) and the MCP server. Creating a flow isn't verified yet in my test tenant, because I first need to point it at the Dev Sandbox environment rather than the default.
- Tenant and environment names in the outputs are placeholders.
- Tested on Windows 11 with PowerShell 7. Other setups may need small changes.
--allow-all-toolsgives Copilot full shell access. Only use it in a session you trust.
The full step-by-step guide: github.com/shenukaf69/power-automate-cli-runbook
Microsoft's plugins: microsoft/power-platform-skills
GitHub Copilot CLI plugins: GitHub docs
If it saves you an afternoon, a star on GitHub is much appreciated. Tell me what you build with it.
This runbook is an independent project by Shenuka Fernando, released under the MIT licence. It is not affiliated with Microsoft or GitHub. Microsoft, Power Automate, Power Platform, Copilot Studio and Azure are trademarks of the Microsoft group of companies. GitHub and GitHub Copilot are trademarks of GitHub, Inc.
Comments
Post a Comment