Skip to content

A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.

NPX CLI plugin (#130)

Anshul Jaina39ecb40bb37
diff --git a/plugins/code-apps/AGENTS.md b/plugins/code-apps/AGENTS.md
index db612feb0..85a0a93a0 100644
--- a/plugins/code-apps/AGENTS.md
+++ b/plugins/code-apps/AGENTS.md
@@ -4,7 +4,7 @@ This file provides guidance to AI Agents when working with the **power-apps** pl
## What This Plugin Is
-A plugin for building and deploying Power Apps code apps using React + Vite + TypeScript, connected to Power Platform via connectors (Dataverse, SharePoint, Teams, Azure DevOps, OneDrive, Excel, Office 365, and more). Apps are deployed via PAC CLI (`pac code push`).
+A plugin for building and deploying Power Apps code apps using React + Vite + TypeScript, connected to Power Platform via connectors (Dataverse, SharePoint, Teams, Azure DevOps, OneDrive, Excel, Office 365, and more). Apps are deployed via the Power Apps NPX CLI (`npx power-apps push`).
## Local Development
@@ -89,18 +89,20 @@ Power Apps code apps run in a sandbox — direct HTTP calls (`fetch`, `axios`, G
### Generated Services
-`pac code add-data-source` generates typed TypeScript services in `src/generated/`:
+`npx power-apps add-data-source` generates typed TypeScript services in `src/generated/`:
- `src/generated/models/{Name}Model.ts` — TypeScript interfaces
- `src/generated/services/{Name}Service.ts` — CRUD methods
Always use generated services for data access.
-### Windows CLI
+### CLI
-`pac` is a Windows executable not on the bash PATH. Always invoke via PowerShell:
+The Power Apps CLI (`@microsoft/power-apps-cli`) is installed locally via `npm install` as part of the app template. All commands use `npx power-apps <verb>` from within the project directory — runs natively in bash on all platforms, no PowerShell wrapper needed.
```bash
-pwsh -NoProfile -Command "pac code push"
+npx power-apps push # Deploy app
+npx power-apps add-data-source -a ... # Add connector
+npx power-apps list-connections # List connections
```
### Scaffolding
@@ -118,4 +120,4 @@ After modifying this plugin:
1. Run `claude --debug` to see plugin loading details
2. Test skill invocation with `/create-code-app`
3. Verify connector-first guardrails are enforced
-4. Test Windows CLI compatibility (`pac` via `pwsh`)
+4. Test CLI commands (`npx power-apps push`, `npx power-apps add-data-source`, etc.)
diff --git a/plugins/code-apps/agents/code-app-architect.md b/plugins/code-apps/agents/code-app-architect.md
index 9006405ec..e557c9e0a 100644
--- a/plugins/code-apps/agents/code-app-architect.md
+++ b/plugins/code-apps/agents/code-app-architect.md
@@ -37,15 +37,14 @@ When consulted, you provide guidance on:
Verify prerequisites before proceeding with any implementation work:
```bash
-node --version # Must be v22+
-pwsh -NoProfile -Command "pac" # Windows executable — must use pwsh
+node --version # Must be v22+
```
- **Node.js below v22**: Report "Node.js 22+ is required. Upgrade or switch with `nvm use 22`." and STOP.
-- **Missing @microsoft/power-apps-cli**: Report "Install with `npm install -g @microsoft/power-apps-cli`." and STOP.
-- **Missing pac**: Report "Install Power Platform CLI from https://aka.ms/PowerAppsCLI." and STOP.
- **All present**: Report versions and proceed.
+The Power Apps CLI is installed automatically via `npm install` from the app template — no separate install required.
+
## Key Considerations for Power Apps Code Apps
### Connector-First Principle
@@ -66,11 +65,11 @@ pwsh -NoProfile -Command "pac" # Windows executable — must use pwsh
**If none of the specific skills match**, invoke `/add-connector` — it handles any connector not covered above. Browse available connectors at https://learn.microsoft.com/en-us/connectors/connector-reference/ to find the correct API name. **If no connector exists for the required functionality, tell the user clearly and do not implement a direct API call as a workaround — it will not work in production.**
-**Connection IDs**: All non-Dataverse connectors require a connection ID (`-c` flag). Run `/list-connections` to find it, then run `pwsh -NoProfile -Command "pac code add-data-source -a <connector> -c <connection-id>"`.
+**Connection IDs**: All non-Dataverse connectors require a connection ID (`-c` flag). Run `/list-connections` to find it, then run `npx power-apps add-data-source -a <connector> -c <connection-id>`.
### Generated Code Pattern
-Code apps use `pac code add-data-source` to generate typed services:
+Code apps use `npx power-apps add-data-source` to generate typed services:
- `src/generated/models/{Table}Model.ts` -- TypeScript interfaces
- `src/generated/services/{Table}Service.ts` -- CRUD methods
@@ -86,10 +85,10 @@ cd {folder}
npm install
```
-After scaffolding, initialize with the npm package:
+After scaffolding, initialize:
```bash
-pwsh -NoProfile -Command "pac code init --displayName '{app-name}' -e <environment-id>"
+npx power-apps init -n '{app-name}' -e <environment-id>
```
### Dataverse Gotchas
@@ -111,25 +110,30 @@ pwsh -NoProfile -Command "pac code init --displayName '{app-name}' -e <environme
Check `power.config.json` in the project root for an `environmentId` — use it if present. Otherwise ask the user which environment to use. Only use a different environment if the user explicitly requests it.
-### Running pac on Windows
+### CLI Commands
-`pac` is a Windows executable — **not** on the bash PATH. Always call it via PowerShell:
+The Power Apps CLI (`@microsoft/power-apps-cli`) installs locally via `npm install`. Use `npx power-apps` from within the project directory — works natively in bash on all platforms:
```bash
-pwsh -NoProfile -Command "pac auth list"
-pwsh -NoProfile -Command "pac env select --environment <id>"
-pwsh -NoProfile -Command "pac org who"
+npx power-apps push # Deploy
+npx power-apps add-data-source -a <api> -c <id> # Add connector
+npx power-apps list-connections # List connections
+npx power-apps list-datasets -a <api> -c <id> # List datasets
+npx power-apps list-tables -a <api> -c <id> -d <ds> # List tables
+npx power-apps logout # Log out
```
-Never run `pac <args>` directly in bash (command not found). Never use `cmd /c pac` — CLINK intercepts `cmd.exe` and swallows output.
+**Auth**: MSAL-based — browser popup on first command requiring auth. No separate auth setup needed.
+
+**Environment**: Set once via `npx power-apps init -e <env-id>`, stored in `power.config.json`.
### Build Requirements
Key rules:
-- Always `npm run build` before `pac code push`
+- Always `npm run build` before `npx power-apps push`
- Remove unused imports (TS6133 strict mode)
- Don't edit files in `src/generated/` unless fixing known issues
-- Node.js 22+ required — `code add-data-source` rejects older versions
+- Node.js 22+ required — `add-data-source` rejects older versions
## Response Style
diff --git a/plugins/code-apps/shared/connector-reference.md b/plugins/code-apps/shared/connector-reference.md
index 8326c7e9e..2c733d0fc 100644
--- a/plugins/code-apps/shared/connector-reference.md
+++ b/plugins/code-apps/shared/connector-reference.md
@@ -4,11 +4,11 @@ Applies to all connector skills (`/add-azuredevops`, `/add-teams`, `/add-excel`,
## Connection ID (Required)
-All non-Dataverse connectors require a **connection ID** (`-c`) when adding via `pac code add-data-source`. Without it, the command fails with: `CONNECTION_ID argument is required for connector data sources`.
+All non-Dataverse connectors require a **connection ID** (`-c`) when adding via `npx power-apps add-data-source`. Without it, the command fails with: `CONNECTION_ID argument is required for connector data sources`.
### Step 1: List Existing Connections
-Run the `/list-connections` skill. It runs `pac connection list` and returns a table of connection IDs and connector names (requires the Power Platform CLI to be installed and authenticated).
+Run the `/list-connections` skill. It runs `npx power-apps list-connections` and returns a table of connection IDs and connector names.
Look for the connector in the output. Note the **ConnectionId** column value.
@@ -28,10 +28,10 @@ Always pass `-c <connection-id>` when adding a connector:
```bash
# Non-tabular connectors
-pwsh -NoProfile -Command "pac code add-data-source -a <api-name> -c <connection-id>"
+npx power-apps add-data-source -a <api-name> -c <connection-id>
# Tabular connectors (also need -d and -t)
-pwsh -NoProfile -Command "pac code add-data-source -a <api-name> -c <connection-id> -d '<dataset>' -t '<table>'"
+npx power-apps add-data-source -a <api-name> -c <connection-id> -d '<dataset>' -t '<table>'
```
diff --git a/plugins/code-apps/shared/development-standards.md b/plugins/code-apps/shared/development-standards.md
index 0ba77ec5c..35afe288d 100644
--- a/plugins/code-apps/shared/development-standards.md
+++ b/plugins/code-apps/shared/development-standards.md
@@ -9,13 +9,13 @@ Standards that apply to all Power Apps code app skills.
## Node.js
-- **Node.js 22+ is required** -- `@microsoft/power-apps-cli code add-data-source` rejects Node 20 and earlier
+- **Node.js 22+ is required** -- `npx power-apps add-data-source` rejects Node 20 and earlier
- Check with `node --version` before starting
- If the user has multiple versions, suggest `nvm use 22`
## Build & Deploy
-- **Always** run `npm run build` before `pac code push` -- never skip the build step
+- **Always** run `npm run build` before `npx power-apps push` -- never skip the build step
- Verify `dist/` folder contains `index.html` and `assets/` before deploying
- When adding multiple connectors: do **NOT** deploy after each one — run `npm run build` to verify, then deploy once after all connectors are added
diff --git a/plugins/code-apps/shared/memory-bank.md b/plugins/code-apps/shared/memory-bank.md
index ff3911c9a..c91f9149f 100644
--- a/plugins/code-apps/shared/memory-bank.md
+++ b/plugins/code-apps/shared/memory-bank.md
@@ -118,10 +118,10 @@ Update after:
## Completed Steps
### /create-code-app
-- [x] Prerequisites validated (Node.js, pac CLI)
-- [x] Authenticated and selected environment
+- [x] Prerequisites validated (Node.js)
+- [x] Environment ID confirmed
- [x] Scaffolded from template
-- [x] Initialized with pac code init
+- [x] Initialized with npx power-apps init
- [x] Built successfully
- [x] Deployed to Power Platform
- App URL: [URL]
diff --git a/plugins/code-apps/shared/preferred-environment.md b/plugins/code-apps/shared/preferred-environment.md
index c791d1dea..fc5f5953c 100644
--- a/plugins/code-apps/shared/preferred-environment.md
+++ b/plugins/code-apps/shared/preferred-environment.md
@@ -12,11 +12,5 @@ When selecting an environment for code app creation or deployment, use the follo
1. Check for `power.config.json` in the project root:
- If it contains an `environmentId`, use that value — confirm with the user before proceeding.
- If it does not exist or has no `environmentId`, proceed to step 2.
-2. Run `pwsh -NoProfile -Command "pac env list"` to show available environments. Ask the user to pick one.
-3. Run `pwsh -NoProfile -Command "pac auth list"` to see the active profile.
-4. If the active environment matches the target — confirm and proceed.
-5. If it's a different environment — switch:
- ```bash
- pwsh -NoProfile -Command "pac env select --environment <id>"
- ```
-6. Only use a different environment if the user explicitly requests it.
+2. Ask the user for their environment ID. They can find it in the make.powerapps.com URL: `https://make.powerapps.com/environments/<env-id>/home`
+3. Only use a different environment if the user explicitly requests it.
diff --git a/plugins/code-apps/shared/shared-instructions.md b/plugins/code-apps/shared/shared-instructions.md
index 648a1c543..5d51205d2 100644
--- a/plugins/code-apps/shared/shared-instructions.md
+++ b/plugins/code-apps/shared/shared-instructions.md
@@ -18,7 +18,7 @@ Run at the start of every skill execution (at most once per day). Notifies the u
### MUST (required before acting)
-- **Confirm before any deployment**: Before running `pac code push`, ask: _"Ready to deploy to [environment name]? This will update the live app."_ Wait for explicit user confirmation.
+- **Confirm before any deployment**: Before running `npx power-apps push`, ask: _"Ready to deploy to [environment name]? This will update the live app."_ Wait for explicit user confirmation.
Exception: the baseline deploy in `create-code-app` Step 7 is pre-approved as part of the scaffold flow. The final deploy in Step 10 still requires confirmation.
- **Confirm before any global install**: Before running `npm install -g ...` or `winget install ...`, ask: _"This will install [tool] globally on your machine. OK to proceed?"_ Wait for explicit user confirmation. This applies even when the install is a documented prerequisite.
- **Confirm before writing outside project root**: Before writing, editing, or deleting any file that is not inside the current project directory, ask the user for confirmation.
@@ -26,7 +26,7 @@ Run at the start of every skill execution (at most once per day). Notifies the u
### MUST NOT
-- MUST NOT run `pac code push` if `npm run build` has not succeeded in the current session.
+- MUST NOT run `npx power-apps push` if `npm run build` has not succeeded in the current session.
- MUST NOT edit any file under `src/generated/` unless the step explicitly calls for it (e.g., the `add-azuredevops` HttpRequest fix).
- MUST NOT install packages globally (`npm install -g`, `winget install`) without user confirmation.
- MUST NOT make changes outside the project root without user confirmation.
@@ -74,7 +74,7 @@ Standards for versioning, theme, build workflow, and TypeScript strict mode.
**Key Points:**
- Always display version in UI, increment on each deploy
- Default to dark theme (user can override)
-- Always `npm run build` before `pac code push` -- never skip the build
+- Always `npm run build` before `npx power-apps push` -- never skip the build
- Remove unused imports before building (TS6133 strict mode)
---
@@ -108,8 +108,7 @@ All non-Dataverse connectors require a connection ID. Read this before any `/add
**Key Points:**
- Run `/list-connections` to find the connection ID before adding a connector
-- Always pass `-c <connection-id>` to `pac code add-data-source`
-- Run all `pac code` commands via `pwsh -NoProfile -Command "pac code ..."`
+- Always pass `-c <connection-id>` to `npx power-apps add-data-source`
---
@@ -126,39 +125,32 @@ When selecting an environment, use this priority order: `power.config.json` →
---
-## Windows CLI Compatibility
+## CLI Commands
-The shell running Bash tool commands is bash on Windows. The `pac` CLI is a Windows executable and is **not** on the bash PATH.
+The Power Apps code app CLI (`@microsoft/power-apps-cli`) is installed locally as part of `npm install` when a project is scaffolded with the template. All CLI commands run via `npx power-apps` from within the project directory — no global install or `pwsh` wrapper needed.
-**Always invoke `pac` via `pwsh -NoProfile -Command`:**
+**Core commands:**
```bash
-pwsh -NoProfile -Command "pac auth list"
-pwsh -NoProfile -Command "pac auth clear"
-pwsh -NoProfile -Command "pac env list"
-pwsh -NoProfile -Command "pac env select --environment <id>"
-pwsh -NoProfile -Command "pac code init --displayName '<app-name>' -e <env-id>"
-pwsh -NoProfile -Command "pac code add-data-source -a <api-name> -c <connection-id>"
-pwsh -NoProfile -Command "pac code push"
+npx power-apps init -n '<app-name>' -e <env-id> # Initialize project, create power.config.json
+npx power-apps push # Deploy app to Power Platform (run npm run build first)
+npx power-apps run # Start local dev server
+npx power-apps add-data-source -a <api> [-c <conn-id>] [-d <dataset>] [-t <table>]
+npx power-apps list-connections # List connections in current environment
+npx power-apps list-datasets -a <api> -c <conn-id> # List datasets for a connector
+npx power-apps list-tables -a <api> -c <conn-id> -d <dataset> # List tables in a dataset
+npx power-apps logout # Log out
```
-**Prohibited patterns — never use these, even as a fallback:**
+**Authentication:** The CLI uses MSAL (browser-based login). On the first command that requires auth, a browser window opens for Microsoft sign-in. The token is cached for subsequent commands. No separate auth setup step is needed.
-| ❌ Wrong | Why |
-| ------------------------ | -------------------------------------------------- |
-| `pac auth check` | Not a valid pac command — use `pac auth list` |
-| `pac <any args>` in bash | Fails with `pac: command not found` |
-| `cmd /c pac <args>` | CLINK intercepts `cmd.exe` and swallows all output |
-
-If bash fails for a `pac` command, **do not retry with `cmd /c`**. Switch immediately to `pwsh -NoProfile -Command "pac ..."`.
-
-To verify pac is authenticated, run `pwsh -NoProfile -Command "pac auth list"` — not `pac auth check` (which does not exist).
+**Environment selection:** The environment ID is set once at `init` time and stored in `power.config.json`. There is no separate env select command. Users find their environment ID from make.powerapps.com (the GUID in the URL, e.g. `https://make.powerapps.com/environments/<env-id>/home`).
---
## Command Failure Handling
-Apply these rules whenever a `pac` or `npm` command exits non-zero. Do NOT retry silently or proceed past a failure.
+Apply these rules whenever an `npx power-apps` or `npm` command exits non-zero. Do NOT retry silently or proceed past a failure.
### `npm run build` failures
@@ -175,16 +167,16 @@ Apply these rules whenever a `pac` or `npm` command exits non-zero. Do NOT retry
**Example — build error requiring user input:**
> "Build failed with an error I cannot automatically fix: `[exact error text]`. Please review the error above and let me know how you'd like to proceed."
-### `pac code add-data-source` failures
+### `npx power-apps add-data-source` failures
| Condition | Action |
| --- | --- |
| Non-zero exit / error output | Report the exact error. STOP. Do not continue to the build step. |
| "connectionId not found" or empty `-c` | Ask the user to run `/list-connections` to get a valid connection ID and retry. |
-| "environment not set" or missing envId | Run `pwsh -NoProfile -Command "pac env select --environment <id>"` and retry once. |
+| Auth error / token expired | Run `npx power-apps logout`, then retry — the CLI will prompt re-authentication. |
**Example:**
-> "The `pac code add-data-source` command failed: `Error: connectionId 'abc123' not found in environment.` Please run `/list-connections` to confirm the connection exists and get the correct ID."
+> "The `npx power-apps add-data-source` command failed: `Error: connectionId 'abc123' not found in environment.` Please run `/list-connections` to confirm the connection exists and get the correct ID."
---
diff --git a/plugins/code-apps/skills/add-azuredevops/SKILL.md b/plugins/code-apps/skills/add-azuredevops/SKILL.md
index cee6604ea..d80e79340 100644
--- a/plugins/code-apps/skills/add-azuredevops/SKILL.md
+++ b/plugins/code-apps/skills/add-azuredevops/SKILL.md
@@ -27,7 +27,7 @@ Check for `memory-bank.md` per [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/sh
Run the `/list-connections` skill. Find the Azure DevOps connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create.
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a azuredevops -c <connection-id>"
+npx power-apps add-data-source -a azuredevops -c <connection-id>
```
### Step 3: Apply HttpRequest Fix (Required)
@@ -98,7 +98,7 @@ Use `Grep` to find specific methods in `src/generated/services/AzureDevOpsServic
### Step 5: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-connector/SKILL.md b/plugins/code-apps/skills/add-connector/SKILL.md
index bf5cb1e96..f591f7d71 100644
--- a/plugins/code-apps/skills/add-connector/SKILL.md
+++ b/plugins/code-apps/skills/add-connector/SKILL.md
@@ -65,10 +65,10 @@ Run the `/list-connections` skill. Find the connector in the output. If none exi
```bash
# Non-tabular connectors (Teams, Azure DevOps, etc.)
-pwsh -NoProfile -Command "pac code add-data-source -a <connector-api-name> -c <connection-id>"
+npx power-apps add-data-source -a <connector-api-name> -c <connection-id>
# Tabular connectors (SharePoint, Excel, SQL, etc.) -- also need dataset and table
-pwsh -NoProfile -Command "pac code add-data-source -a <connector-api-name> -c <connection-id> -d '<dataset>' -t '<table>'"
+npx power-apps add-data-source -a <connector-api-name> -c <connection-id> -d '<dataset>' -t '<table>'
```
**Parameter reference:**
@@ -102,7 +102,7 @@ Help the user write code using the generated service methods.
### Step 5: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-dataverse/SKILL.md b/plugins/code-apps/skills/add-dataverse/SKILL.md
index 0bddc8b1f..ae0d26a63 100644
--- a/plugins/code-apps/skills/add-dataverse/SKILL.md
+++ b/plugins/code-apps/skills/add-dataverse/SKILL.md
@@ -48,7 +48,11 @@ See [api-authentication-reference.md](./references/api-authentication-reference.
```powershell
az account show # Verify Azure CLI logged in
-pwsh -NoProfile -Command "pac org who" # Get environment URL
+
+# Find your Dataverse environment URL:
+# In make.powerapps.com → Settings → Developer resources → Web API endpoint
+# It looks like: https://<org-name>.crm.dynamics.com/api/data/v9.2/
+# Use the base URL: https://<org-name>.crm.dynamics.com
$api = Initialize-DataverseApi -EnvironmentUrl "https://<org>.crm.dynamics.com"
$headers = $api.Headers
@@ -93,7 +97,7 @@ Use safe functions from [table-management-reference.md](./references/table-manag
For each table:
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a dataverse -t <table-logical-name>"
+npx power-apps add-data-source -a dataverse -t <table-logical-name>
```
Can add multiple tables by running the command for each one.
@@ -128,7 +132,7 @@ const accounts = result.data || [];
### Step 7: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-dataverse/references/api-authentication-reference.md b/plugins/code-apps/skills/add-dataverse/references/api-authentication-reference.md
index dddd77909..a6823e339 100644
--- a/plugins/code-apps/skills/add-dataverse/references/api-authentication-reference.md
+++ b/plugins/code-apps/skills/add-dataverse/references/api-authentication-reference.md
@@ -16,11 +16,11 @@ az login
## Get Environment URL
-```bash
-pwsh -NoProfile -Command "pac org who"
-```
+Find your Dataverse environment URL in make.powerapps.com:
+
+> **Settings** → **Developer resources** → **Web API endpoint**
-Returns information including the environment URL (e.g., `https://orgname.crm.dynamics.com`).
+It looks like `https://<org-name>.crm.dynamics.com/api/data/v9.2/`. Use the base URL: `https://<org-name>.crm.dynamics.com`.
## Get Access Token
diff --git a/plugins/code-apps/skills/add-excel/SKILL.md b/plugins/code-apps/skills/add-excel/SKILL.md
index ab4dda9c6..431303f6c 100644
--- a/plugins/code-apps/skills/add-excel/SKILL.md
+++ b/plugins/code-apps/skills/add-excel/SKILL.md
@@ -38,10 +38,10 @@ Excel Online is a tabular datasource -- requires `-c` (connection ID), `-d` (dri
```bash
# OneDrive workbook
-pwsh -NoProfile -Command "pac code add-data-source -a excelonlinebusiness -c <connection-id> -d 'me' -t 'Table1'"
+npx power-apps add-data-source -a excelonlinebusiness -c <connection-id> -d 'me' -t 'Table1'
# SharePoint workbook -- dataset is the document library path
-pwsh -NoProfile -Command "pac code add-data-source -a excelonlinebusiness -c <connection-id> -d 'sites/your-site' -t 'Table1'"
+npx power-apps add-data-source -a excelonlinebusiness -c <connection-id> -d 'sites/your-site' -t 'Table1'
```
Run for each table the user needs.
@@ -80,7 +80,7 @@ Use `Grep` to find specific methods in `src/generated/services/ExcelOnlineBusine
### Step 5: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-mcscopilot/SKILL.md b/plugins/code-apps/skills/add-mcscopilot/SKILL.md
index ea1a3fa42..211b57052 100644
--- a/plugins/code-apps/skills/add-mcscopilot/SKILL.md
+++ b/plugins/code-apps/skills/add-mcscopilot/SKILL.md
@@ -27,7 +27,7 @@ Check for `memory-bank.md` per [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/sh
Run the `/list-connections` skill. Find the Microsoft Copilot Studio connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create.
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a microsoftcopilotstudio -c <connection-id>"
+npx power-apps add-data-source -a microsoftcopilotstudio -c <connection-id>
```
### Step 3: Configure
@@ -77,7 +77,7 @@ Use `Grep` to find specific methods in the generated service file (generated fil
### Step 4: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-office365/SKILL.md b/plugins/code-apps/skills/add-office365/SKILL.md
index de6820175..46483f58f 100644
--- a/plugins/code-apps/skills/add-office365/SKILL.md
+++ b/plugins/code-apps/skills/add-office365/SKILL.md
@@ -27,7 +27,7 @@ Check for `memory-bank.md` per [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/sh
Run the `/list-connections` skill. Find the Office 365 Outlook connection in the output (API name contains `office365`). If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create.
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a office365 -c <connection-id>"
+npx power-apps add-data-source -a office365 -c <connection-id>
```
### Step 3: Review Generated Service
@@ -138,7 +138,7 @@ if (result.success) {
### Step 5: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-onedrive/SKILL.md b/plugins/code-apps/skills/add-onedrive/SKILL.md
index 825914ceb..6be5fb9ae 100644
--- a/plugins/code-apps/skills/add-onedrive/SKILL.md
+++ b/plugins/code-apps/skills/add-onedrive/SKILL.md
@@ -27,7 +27,7 @@ Check for `memory-bank.md` per [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/sh
Run the `/list-connections` skill. Find the OneDrive for Business connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create.
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a onedriveforbusiness -c <connection-id>"
+npx power-apps add-data-source -a onedriveforbusiness -c <connection-id>
```
### Step 3: Configure
@@ -70,7 +70,7 @@ Use `Grep` to find specific methods in `src/generated/services/OneDriveForBusine
### Step 4: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-sharepoint/SKILL.md b/plugins/code-apps/skills/add-sharepoint/SKILL.md
index 1dcb1a19c..b8b3a3152 100644
--- a/plugins/code-apps/skills/add-sharepoint/SKILL.md
+++ b/plugins/code-apps/skills/add-sharepoint/SKILL.md
@@ -93,13 +93,13 @@ Run the `/list-connections` skill. Find the SharePoint Online connection in the
List available SharePoint sites the user has access to:
```bash
-pwsh -NoProfile -Command "pac code list-datasets -a sharepointonline -c <connection-id>"
+npx power-apps list-datasets -a sharepointonline -c <connection-id>
```
Present the sites to the user and ask which one(s) they want to connect to. If the user already specified a site URL, confirm it appears in the list.
-**If `pac code list-datasets` fails or returns no results:**
-- Auth error: Run `pwsh -NoProfile -Command "pac auth list"` and re-authenticate if needed.
+**If `npx power-apps list-datasets` fails or returns no results:**
+- Auth error: Run `npx power-apps logout`, then retry — the CLI will re-prompt browser login.
- Empty list: Confirm the connection ID is for a SharePoint Online connection and the user has access to at least one site. STOP if the list is empty after confirming.
- Any other non-zero exit: Report the exact error output. STOP.
@@ -108,10 +108,10 @@ Present the sites to the user and ask which one(s) they want to connect to. If t
For each selected site, list the available lists and document libraries:
```bash
-pwsh -NoProfile -Command "pac code list-tables -a sharepointonline -c <connection-id> -d '<site-url>'"
+npx power-apps list-tables -a sharepointonline -c <connection-id> -d '<site-url>'
```
-**If `pac code list-tables` fails or returns no results:**
+**If `npx power-apps list-tables` fails or returns no results:**
- Confirm the site URL from Step 7 is exact (copy from the output — do not retype).
- If still empty, the user may not have access to that site's lists. Ask them to verify permissions in SharePoint.
- Any other non-zero exit: Report the exact error output. STOP.
@@ -123,7 +123,7 @@ Present the tables to the user and ask which ones they want to add. Suggest tabl
SharePoint is a tabular datasource -- requires `-c` (connection ID), `-d` (site URL), and `-t` (list name):
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a sharepointonline -c <connection-id> -d '<site-url>' -t '<table-name>'"
+npx power-apps add-data-source -a sharepointonline -c <connection-id> -d '<site-url>' -t '<table-name>'
```
Run the command for each list or library the user selected. The `-d` (dataset) is the SharePoint site URL from Step 7, `-t` (table) is the list/library name from Step 8.
@@ -177,7 +177,7 @@ Use `Grep` to find specific methods in `src/generated/services/SharePointOnlineS
### Step 11: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/add-sharepoint/references/sharepoint-reference.md b/plugins/code-apps/skills/add-sharepoint/references/sharepoint-reference.md
index 20939a14e..51b1044b2 100644
--- a/plugins/code-apps/skills/add-sharepoint/references/sharepoint-reference.md
+++ b/plugins/code-apps/skills/add-sharepoint/references/sharepoint-reference.md
@@ -100,7 +100,7 @@ await SharePointOnlineService.PatchItem({
| Error | Cause | Fix |
| ------------------------------------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `"Column 'X' does not exist"` | Using display name instead of internal name | Check generated model for actual property name; may need `_x0020_` encoding |
-| `"The list 'X' does not exist"` | List name doesn't match exactly | Verify list display name via `pac code list-tables`; names are case-sensitive |
+| `"The list 'X' does not exist"` | List name doesn't match exactly | Verify list display name via `npx power-apps list-tables`; names are case-sensitive |
| `"Value does not fall within the expected range"` | Invalid choice value or column type mismatch | Verify the exact choice option strings; SharePoint choices are case-sensitive |
| `"Item does not exist"` | Using wrong ID format or deleted item | SharePoint list item IDs are sequential integers, not GUIDs |
| `"Access denied"` | Insufficient SharePoint permissions | User needs at least Edit permission on the list |
@@ -127,7 +127,7 @@ await SharePointOnlineService.PatchItem({
## Generated Service Patterns
-After running `pac code add-data-source -a sharepointonline`, the generated `SharePointOnlineService.ts` provides methods that work across all connected lists. The `dataset` (site URL) and `table` (list name) parameters select which list to operate on:
+After running `npx power-apps add-data-source -a sharepointonline`, the generated `SharePointOnlineService.ts` provides methods that work across all connected lists. The `dataset` (site URL) and `table` (list name) parameters select which list to operate on:
```typescript
import { SharePointOnlineService } from "../generated/services/SharePointOnlineService";
diff --git a/plugins/code-apps/skills/add-teams/SKILL.md b/plugins/code-apps/skills/add-teams/SKILL.md
index 0351f4ea9..e197950d9 100644
--- a/plugins/code-apps/skills/add-teams/SKILL.md
+++ b/plugins/code-apps/skills/add-teams/SKILL.md
@@ -27,7 +27,7 @@ Check for `memory-bank.md` per [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/sh
Run the `/list-connections` skill. Find the Teams connection in the output. If none exists, direct the user to create one using the environment-specific Connections URL — construct it from the active environment ID in context (from `power.config.json` or a prior step): `https://make.powerapps.com/environments/<environment-id>/connections` → **+ New connection** → search for the connector → Create.
```bash
-pwsh -NoProfile -Command "pac code add-data-source -a teams -c <connection-id>"
+npx power-apps add-data-source -a teams -c <connection-id>
```
### Step 3: Configure
@@ -53,7 +53,7 @@ Use `Grep` to find specific methods in `src/generated/services/TeamsService.ts`
### Step 4: Build
-```powershell
+```bash
npm run build
```
diff --git a/plugins/code-apps/skills/create-code-app/SKILL.md b/plugins/code-apps/skills/create-code-app/SKILL.md
index dfa56a417..68391aadc 100644
--- a/plugins/code-apps/skills/create-code-app/SKILL.md
+++ b/plugins/code-apps/skills/create-code-app/SKILL.md
@@ -17,7 +17,7 @@ model: opus
## Workflow
-1. Prerequisites → 2. Gather Requirements → 3. Plan → 4. Auth & Select Environment → 5. Scaffold → 6. Initialize → 7. Build & Deploy (baseline) → 8. Add Data Sources → 9. Implement App → 10. Final Build & Deploy → 11. Summary
+1. Prerequisites → 2. Gather Requirements → 3. Plan → 4. Scaffold → 5. Initialize → 6. Build & Deploy (baseline) → 7. Add Data Sources → 8. Implement App → 9. Final Build & Deploy → 10. Summary
---
@@ -29,22 +29,15 @@ Check for `memory-bank.md` per [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/sh
Run prerequisite checks **first** -- no point gathering requirements if the environment isn't ready. See [prerequisites-reference.md](./references/prerequisites-reference.md) for details.
-Check Node.js, the npm CLI package, and Git (runs natively in bash):
+Check Node.js and Git (runs natively in bash):
```bash
-node --version # Must be v22+
-git --version # Optional but recommended
-```
-
-Check `pac` CLI via PowerShell — it's a Windows executable not on the bash PATH:
-
-```bash
-pwsh -NoProfile -Command "pac" # Used for auth, env selection, code commands
+node --version # Must be v22+
+git --version # Optional but recommended
```
- **Missing Node.js**: Report "Install Node.js v22+ from https://nodejs.org/" and STOP.
- **Node.js below v22**: Report "Node.js 22+ is required. Please upgrade or switch with `nvm use 22`." and STOP.
-- **Missing pac**: Report "Install Power Platform CLI from https://aka.ms/PowerAppsCLI" and STOP.
- **Missing Git**: Report "Recommended but optional." Continue if approved.
- **All present**: Report versions and proceed.
@@ -82,38 +75,13 @@ Once you have their description:
3. Present plan for approval, include `allowedPrompts` from [prerequisites-reference.md](./references/prerequisites-reference.md)
4. Exit plan mode with `ExitPlanMode` when approved
-### Step 4: Auth & Select Environment
-
-```bash
-pwsh -NoProfile -Command "pac auth list"
-```
-
-If empty, proceed since the command will use system credentials. If profiles are listed, check which environment they target.
-
-**If multiple profiles are listed:** Notify the user that using Microsoft tenant credentials requires clearing all profiles first, then run:
-
-```bash
-pwsh -NoProfile -Command "pac auth clear"
-```
-
-After clearing, there is no need to run `auth create`. The tool picks up the system login automatically.
-
-`pwsh -NoProfile -Command "pac auth list"` shows the active auth profile with its environment. Check which environment it targets.
-
-- **Environment matches user's target**: Confirm and proceed.
-- **On a different environment or no target set**: Run `pwsh -NoProfile -Command "pac env list"`, show up to 10 options, let the user pick, and run `pwsh -NoProfile -Command "pac env select --environment <id>"`.
-
-See [preferred-environment.md](${CLAUDE_PLUGIN_ROOT}/shared/preferred-environment.md) for details.
-
-**Critical:** Capture the environment ID for Step 7.
-
-### Step 5: Scaffold
+### Step 4: Scaffold
Ask the user for a folder name. Default to `powerapps-{app-name-slugified}-{timestamp}` if they don't have a preference.
**IMPORTANT: Use `npx degit` to download the template. Do NOT use `git clone`, do NOT manually create files, do NOT download from GitHub UI. `degit` downloads the template without git history.**
-```powershell
+```bash
npx degit microsoft/PowerAppsCodeApps/templates/vite {folder} --force
cd {folder}
npm install
@@ -127,34 +95,40 @@ npm install
Verify: `package.json` exists, `node_modules/` created.
-### Step 6: Initialize
+### Step 5: Initialize
```bash
-pwsh -NoProfile -Command "pac code init --displayName '{user-provided-app-name}' -e <environment-id>"
+npx power-apps init -n '{user-provided-app-name}' -e <environment-id>
```
-**`pac code init` failure:**
+**Finding the environment ID:** It's the GUID in the make.powerapps.com URL: `https://make.powerapps.com/environments/<env-id>/home`. If you don't pass `-e`, the CLI will prompt for it interactively.
-- Non-zero exit: Report the exact output and STOP. Do not continue to Step 7.
-- "environmentId not found": Confirm the environment ID from Step 4 and retry with the correct `-e` value.
-- Example: _"The `pac code init` command failed: `[error text]`. Please check that environment ID `32a51012-...` is correct and that you have maker permissions in that environment."_
+**Authentication:** On first run, a browser window opens for Microsoft sign-in. Complete the login and the command continues. No separate auth setup is needed.
-**Critical:** Read `power.config.json` and verify `environmentId` matches Step 4. Update if mismatched (common issue).
+See [preferred-environment.md](${CLAUDE_PLUGIN_ROOT}/shared/preferred-environment.md) for environment selection details.
-### Step 7: Build & Deploy (baseline)
+**`npx power-apps init` failure:**
+
+- Non-zero exit: Report the exact output and STOP. Do not continue to Step 6.
+- "environmentId not found" or environment validation error: Verify the environment ID is correct and the user has maker permissions in that environment, then retry.
+- Example: _"The `npx power-apps init` command failed: `[error text]`. Please check that environment ID `32a51012-...` is correct and that you have maker permissions in that environment."_
+
+**Critical:** Read `power.config.json` after init and verify `environmentId` is set correctly.
+
+### Step 6: Build & Deploy (baseline)
> **Pre-approved**: This baseline deploy is part of the scaffold flow and does not require a separate confirmation prompt.
Build and deploy the bare template to verify the pipeline works before adding data sources.
-```powershell
+```bash
npm run build
```
Verify `dist/` folder created with `index.html` and `assets/`.
```bash
-pwsh -NoProfile -Command "pac code push"
+npx power-apps push
```
**Capture app URL** from output: `https://apps.powerapps.com/play/e/{env-id}/app/{app-id}`
@@ -169,7 +143,7 @@ pwsh -NoProfile -Command "pac code push"
This ensures progress is saved even if the session ends unexpectedly.
-### Step 8: Add Data Sources
+### Step 7: Add Data Sources
Invoke the `/add-*` skills identified in the plan (Step 3). Run each in sequence. **Pass context as arguments** so sub-skills skip redundant questions (project path, connector name, etc.):
@@ -187,9 +161,9 @@ Invoke the `/add-*` skills identified in the plan (Step 3). Run each in sequence
Each `/add-*` skill runs `npm run build` to catch errors. Do NOT deploy yet.
-**If no data sources needed:** Skip to Step 9.
+**If no data sources needed:** Skip to Step 8.
-### Step 9: Implement App
+### Step 8: Implement App
**This is the core step.** Build the actual app features described in the plan from Step 3.
@@ -206,9 +180,9 @@ Each `/add-*` skill runs `npm run build` to catch errors. Do NOT deploy yet.
- Remove unused imports before building (TS6133 strict mode)
- Don't edit files in `src/generated/` unless fixing known issues
-### Step 10: Final Build & Deploy
+### Step 9: Final Build & Deploy
-```powershell
+```bash
npm run build
```
@@ -217,16 +191,16 @@ Fix any TypeScript errors. Verify `dist/` contains the updated app.
Ask the user: _"Ready to deploy to [environment name]? This will update the live app."_ Wait for explicit confirmation before proceeding.
```bash
-pwsh -NoProfile -Command "pac code push"
+npx power-apps push
```
-### Step 11: Summary
+### Step 10: Summary
Provide:
- App name, environment, app URL, project location
- What was built: features, data sources, components
-- Next steps: how to iterate (`npm run build && pac code push`), how to add more data sources
+- Next steps: how to iterate (`npm run build && npx power-apps push`), how to add more data sources
- Suggest what else the app could do:
- `/add-datasource` -- add another data source (describe what you need, and the plugin will recommend the best approach)
- `/add-dataverse` -- store and manage custom business data
@@ -239,7 +213,7 @@ Provide:
### Update Memory Bank
-Update the memory bank (created in Step 7) with final state:
+Update the memory bank (created in Step 6) with final state:
- All completed steps (scaffold, data sources, implementation, deploy)
- Features implemented and components created
@@ -264,41 +238,37 @@ These walkthroughs show the full sequence from user request to final output —
```bash
# Step 1: Prerequisites
-node --version # → v22.4.0
-pwsh -NoProfile -Command "pac" # verify installed
-
-# Step 4: Auth
-pwsh -NoProfile -Command "pac auth list" # → verify active environment
+node --version # → v22.4.0
-# Step 5: Scaffold
+# Step 4: Scaffold
npx degit microsoft/PowerAppsCodeApps/templates/vite powerapps-task-tracker-20260302 --force
cd powerapps-task-tracker-20260302
npm install
-# Step 6: Initialize
-pwsh -NoProfile -Command "pac code init --displayName 'Task Tracker' -e <environment-id>"
+# Step 5: Initialize (browser login prompt on first run; CLI prompts for env ID if -e omitted)
+npx power-apps init -n 'Task Tracker' -e <environment-id>
-# Step 7: Baseline deploy (pre-approved as part of scaffold flow)
+# Step 6: Baseline deploy (pre-approved as part of scaffold flow)
npm run build
-pwsh -NoProfile -Command "pac code push"
+npx power-apps push
# → App URL: https://apps.powerapps.com/play/e/32a51012-.../app/<app-id>
-# Step 8: Add Dataverse (via /add-dataverse)
-pwsh -NoProfile -Command "pac code add-data-source -a dataverse -t cr123_task"
+# Step 7: Add Dataverse (via /add-dataverse)
+npx power-apps add-data-source -a dataverse -t cr123_task
npm run build # verify connector — no deploy yet
-# Step 10: Final deploy (requires user confirmation)
+# Step 9: Final deploy (requires user confirmation)
npm run build
-pwsh -NoProfile -Command "pac code push"
+npx power-apps push
```
**Files changed:**
| File | Change |
| --------------------------------------------- | ----------------------------------------------------- |
-| `power.config.json` | Created by `pac code init` — contains `environmentId` |
-| `src/generated/models/Cr123_taskModel.ts` | Generated by `pac code add-data-source` |
-| `src/generated/services/Cr123_taskService.ts` | Generated by `pac code add-data-source` |
+| `power.config.json` | Created by `npx power-apps init` — contains `environmentId` |
+| `src/generated/models/Cr123_taskModel.ts` | Generated by `npx power-apps add-data-source` |
+| `src/generated/services/Cr123_taskService.ts` | Generated by `npx power-apps add-data-source` |
| `src/components/TaskList.tsx` | Created — renders task list with status filter |
| `src/components/AddTaskForm.tsx` | Created — form to add new tasks |
| `src/App.tsx` | Updated — wires components to `Cr123_taskService` |
@@ -320,7 +290,7 @@ What was built:
- Mark complete / delete actions
- Dataverse table `cr123_task` (Title, Description, DueDate, IsComplete)
-To redeploy: npm run build && pac code push (from the project folder)
+To redeploy: npm run build && npx power-apps push (from the project folder)
What you can add next:
- /add-teams — post task updates to a Teams channel
@@ -341,13 +311,13 @@ What you can add next:
## Completed Steps
-- [x] Prerequisites validated
-- [x] Scaffold (npx degit)
-- [x] Initialize (pac code init)
-- [x] Baseline deploy
-- [x] Add Dataverse (cr123_task)
-- [x] Implement app (TaskList, AddTaskForm)
-- [x] Final deploy
+- [x] Step 1: Prerequisites validated
+- [x] Step 4: Scaffold (npx degit)
+- [x] Step 5: Initialize (npx power-apps init)
+- [x] Step 6: Baseline deploy
+- [x] Step 7: Add Dataverse (cr123_task)
+- [x] Step 8: Implement app (TaskList, AddTaskForm)
+- [x] Step 9: Final deploy
## Data Sources
@@ -375,19 +345,19 @@ What you can add next:
```bash
# Step 6: Get connection ID (via /list-connections)
-pwsh -NoProfile -Command "pac connection list"
+npx power-apps list-connections
# → ConnectionId: conn-sp-xyz789 (SharePoint Online)
# Step 7: Discover sites
-pwsh -NoProfile -Command "pac code list-datasets -a sharepointonline -c conn-sp-xyz789"
+npx power-apps list-datasets -a sharepointonline -c conn-sp-xyz789
# → https://contoso.sharepoint.com/sites/Projects
# Step 8: Discover tables
-pwsh -NoProfile -Command "pac code list-tables -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects'"
+npx power-apps list-tables -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects'
# → Project Milestones, Documents, Team Wiki
# Step 9: Add connector
-pwsh -NoProfile -Command "pac code add-data-source -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects' -t 'Project Milestones'"
+npx power-apps add-data-source -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects' -t 'Project Milestones'
# Step 11: Build to verify
npm run build # → success
diff --git a/plugins/code-apps/skills/create-code-app/references/prerequisites-reference.md b/plugins/code-apps/skills/create-code-app/references/prerequisites-reference.md
index 3d43e412d..f4013a12f 100644
--- a/plugins/code-apps/skills/create-code-app/references/prerequisites-reference.md
+++ b/plugins/code-apps/skills/create-code-app/references/prerequisites-reference.md
@@ -2,21 +2,18 @@
## Required Tools
-| Tool | Minimum Version | Check Command | Install |
-| -------------- | --------------- | -------------------------------- | --------------------------- |
-| Node.js | **v22+** | `node --version` | https://nodejs.org/ |
-| pac CLI | **latest** | `pwsh -NoProfile -Command "pac"` | https://aka.ms/PowerAppsCLI |
-| Git (optional) | Any | `git --version` | https://git-scm.com/ |
-
-```bash
-pwsh -NoProfile -Command "pac code push"
-pwsh -NoProfile -Command "pac env list"
-```
+| Tool | Minimum Version | Check Command | Install |
+| -------------- | --------------- | ---------------- | ---------------------- |
+| Node.js | **v22+** | `node --version` | https://nodejs.org/ |
+| Git (optional) | Any | `git --version` | https://git-scm.com/ |
+
+The Power Apps CLI (`@microsoft/power-apps-cli`) is installed automatically as part of `npm install` when the project is scaffolded from the template. No separate CLI install is required.
## Required Account
- Power Platform account with code apps enabled
- At least one environment available
+- Know your environment ID: find it in the URL at make.powerapps.com, e.g. `https://make.powerapps.com/environments/<env-id>/home`
## Required Permissions (allowedPrompts)
@@ -29,11 +26,10 @@ When using plan mode, include these in `allowedPrompts`:
{ "tool": "Bash", "prompt": "scaffold power apps template (npx degit)" },
{ "tool": "Bash", "prompt": "install npm dependencies" },
{ "tool": "Bash", "prompt": "build for production (npm run build)" },
- { "tool": "Bash", "prompt": "authenticate and manage Power Platform (pwsh -NoProfile -Command 'pac auth/env')" },
- { "tool": "Bash", "prompt": "initialize power apps project (pwsh pac code init)" },
- { "tool": "Bash", "prompt": "list connections (/list-connections skill via Power Platform REST API)" },
- { "tool": "Bash", "prompt": "add data sources (pwsh pac code add-data-source)" },
- { "tool": "Bash", "prompt": "deploy to power platform (pac code push)" }
+ { "tool": "Bash", "prompt": "initialize power apps project (npx power-apps init)" },
+ { "tool": "Bash", "prompt": "list connections (npx power-apps list-connections)" },
+ { "tool": "Bash", "prompt": "add data sources (npx power-apps add-data-source)" },
+ { "tool": "Bash", "prompt": "deploy to power platform (npx power-apps push)" }
]
}
```
diff --git a/plugins/code-apps/skills/create-code-app/references/troubleshooting.md b/plugins/code-apps/skills/create-code-app/references/troubleshooting.md
index 6176b621a..0618ef755 100644
--- a/plugins/code-apps/skills/create-code-app/references/troubleshooting.md
+++ b/plugins/code-apps/skills/create-code-app/references/troubleshooting.md
@@ -12,20 +12,19 @@
| Problem | Solution |
| ----------------------- | ------------------------------------------------------------------ |
-| Build fails | Check Node.js LTS version, run `npm install` |
+| Build fails | Check Node.js 22+ version, run `npm install` |
| Build fails with TS6133 | Unused imports cause errors in strict mode. Remove unused imports. |
-| Auth error | Run `pwsh -NoProfile -Command "pac auth clear" && pwsh -NoProfile -Command "pac auth create"` |
+| Auth error | Run `npx power-apps logout`, then retry — the CLI will re-prompt browser login. |
| No data | Verify user has read access to table, check browser console |
| Local testing | Use same browser profile as Power Platform auth |
## Deploy Errors
-| Error | Fix |
-| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| "environment config does not match" | Ask the user: **retarget the app** (update `environmentId` in `power.config.json` to match active env) or **switch auth** (run `pwsh -NoProfile -Command "pac auth create"` to match the app's environment). Then retry. |
-| DNS/network error | Try different environment or contact admin. |
-| Auth error | Run `pwsh -NoProfile -Command "pac auth create"` and retry. |
-| Auth error on macOS (pac bug) | `pac` has known auth bugs on Mac. Use the npx CLI instead: run `npm install -g @microsoft/power-apps-cli` (skip if already installed), then `npx power-apps push`. |
+| Error | Fix |
+| ----------------------------------- | --------------------------------------------------------------------------------------------------------------- |
+| "environment config does not match" | Update `environmentId` in `power.config.json` to match the target environment, then retry. |
+| DNS/network error | Try different environment or contact admin. |
+| Auth error / token expired | Run `npx power-apps logout`, then retry `npx power-apps push` — CLI will prompt re-authentication via browser. |
## Resources
diff --git a/plugins/code-apps/skills/deploy/SKILL.md b/plugins/code-apps/skills/deploy/SKILL.md
index 3fc55a76e..da7382898 100644
--- a/plugins/code-apps/skills/deploy/SKILL.md
+++ b/plugins/code-apps/skills/deploy/SKILL.md
@@ -24,7 +24,7 @@ Check for `memory-bank.md` in the project root. If found, read it for the projec
### Step 2: Build
-```powershell
+```bash
npm run build
```
@@ -40,23 +40,15 @@ Verify `dist/` exists with `index.html` before continuing.
Ask the user: _"Ready to deploy to [environment name]? This will update the live app."_ Wait for explicit confirmation before proceeding.
```bash
-pwsh -NoProfile -Command "pac code push"
+npx power-apps push
```
Capture the app URL from the output if present.
-If deploy fails, report the error and stop — do not retry silently. Common fixes are in the troubleshooting guide:
-
-- Auth error → `pwsh -NoProfile -Command "pac auth create"`
-- Environment mismatch → `pwsh -NoProfile -Command "pac env select --environment <id>"`
+If deploy fails, report the error and stop — do not retry silently. Common fixes:
-**Mac fallback — if `pac code push` fails with an auth error on macOS:**
-`pac` has known authentication bugs on Mac that can block the push. Use the npx CLI instead:
-```bash
-npm install -g @microsoft/power-apps-cli # skip if already installed
-npx power-apps push
-```
-This is functionally equivalent to `pac code push` and bypasses the Mac auth issue.
+- Auth error / token expired → `npx power-apps logout`, then retry — the CLI will re-prompt browser login.
+- Environment mismatch → update `environmentId` in `power.config.json` to the correct value and retry.
### Step 4: Update Memory Bank
diff --git a/plugins/code-apps/skills/list-connections/SKILL.md b/plugins/code-apps/skills/list-connections/SKILL.md
index 57b15346e..a4875f737 100644
--- a/plugins/code-apps/skills/list-connections/SKILL.md
+++ b/plugins/code-apps/skills/list-connections/SKILL.md
@@ -10,7 +10,7 @@ model: haiku
# List Connections
-Lists all Power Platform connections in the default environment using the Power Platform CLI (`pac`).
+Lists all Power Platform connections in the current environment using the Power Apps CLI.
## Workflow
@@ -21,14 +21,14 @@ Lists all Power Platform connections in the default environment using the Power
### Step 1: Fetch Connections
```bash
-pwsh -NoProfile -Command "pac connection list"
+npx power-apps list-connections
```
-If `pac` is not authenticated, tell the user to run `pwsh -NoProfile -Command "pac auth create"` and try again.
+If the CLI is not authenticated, it will open a browser for login automatically. Complete the login and retry.
**Other failures:**
- Non-zero exit for any reason other than auth: Report the exact output. STOP.
-- No output or timeout: Run `pwsh -NoProfile -Command "pac env list"` to verify pac can reach the environment, then retry once.
+- No output or empty results: Verify the correct environment ID is set in `power.config.json`, then retry once.
### Step 2: Present Results