# Power Platform Review Tool

![npm version](https://img.shields.io/npm/v/powerplatform-review-tool)

🔍 A CLI and JavaScript utility to evaluate Power Platform Solution ZIPs based on best practice patterns for **Power Apps**, **Power Automate**, and **Copilot (Power Virtual Agents)**.

---

## ✨ Features

- 🏛️ Analyze Power Platform solution `.zip` files
- 🧠 Evaluate against best practice patterns
- ⚙️ Supports Copilot, Power Apps, and Power Automate
- 📃 CLI and module usage
- 🚀 Ideal for automation via GitHub Actions or Azure DevOps

---

## 📦 Installation

```bash
npm install -g powerplatform-review-tool
```

---

## 🚀 Usage (CLI)

### Review a solution:

```bash
pp-review review -f <path-to-solution.zip> -o <output-file>
```

### Extract metadata without evaluation:

```bash
pp-review extract -f <path-to-solution.zip> -o <output-file>
```

---

### 🔁 Examples

**Review a solution and generate a report:**
```bash
pp-review review -f "./MySolution.zip" -o review-result.json
```

**Extract metadata from a solution zip only:**
```bash
pp-review extract -f "./MySolution.zip" -o metadata.json
```

---

### 💡 Options

| Flag           | Description                              | Required |
|----------------|------------------------------------------|----------|
| `-f, --file`   | Path to the solution zip file            | ✅ Yes    |
| `-o, --output` | Output path for the resulting JSON       | ✅ Yes    |

---

## 📜 Usage (as a Node.js module)

You can also use the tool as a programmatic module:

```ts
import { startReview } from 'powerplatform-review-tool';
import fs from 'fs';

const fileBuffer = fs.readFileSync('./MySolution.zip');
const result = await startReview(fileBuffer, undefined, null, []);
console.log(result);
```

---

## 🧰 Pattern Types Supported

- ✅ Power Apps canvas app patterns
- ✅ Power Automate flow patterns
- ✅ Copilot (PVA) patterns
- ⚖️ Easily extendable pattern logic

---

## 🛠️ Integration Examples

### ✅ GitHub Action

```yaml
- name: Review Power Platform Solution
  run: |
    pp-review review -f ./solutions/Solution.zip -o review-result.json
```

### ✅ Azure DevOps Pipeline

```yaml
- script: |
    pp-review review -f "$(Build.SourcesDirectory)/Solution.zip" -o review-result.json
  displayName: 'Run Power Platform Review Tool'
```

---

## 👨‍💼 Author

Developed with ❤️ by [Ramakrishnan](https://github.com/ramakrishnan24689)

---

## 📄 License

[MIT](https://opensource.org/licenses/MIT)
