Metadata-Version: 2.4
Name: pbi-enterprise-cli
Version: 1.1.0
Summary: Power BI & Microsoft Fabric automation CLI — TMDL/XMLA/REST backends, Python-native BPA governance, DAX testing & lint, PBIR authoring, MCP server, AI measures
Author-email: Mudassir <mir.mudassir1@gmail.com>
Maintainer-email: Mudassir <mir.mudassir1@gmail.com>
License: MIT AND LicenseRef-Microsoft-AS-Client-Libraries
Project-URL: Homepage, https://github.com/mudassir09/pbi-enterprise-cli
Project-URL: Repository, https://github.com/mudassir09/pbi-enterprise-cli
Project-URL: Documentation, https://github.com/mudassir09/pbi-enterprise-cli#readme
Project-URL: Changelog, https://github.com/mudassir09/pbi-enterprise-cli/blob/main/CHANGELOG.md
Project-URL: Bug Tracker, https://github.com/mudassir09/pbi-enterprise-cli/issues
Project-URL: Security Policy, https://github.com/mudassir09/pbi-enterprise-cli/blob/main/SECURITY.md
Keywords: power-bi,powerbi,cli,dax,tmdl,pbir,xmla,fabric,microsoft-fabric,governance,bpa,semantic-model,claude-code,ai-agent,mcp
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1
Requires-Dist: rich>=13.0
Requires-Dist: pythonnet>=3.0
Requires-Dist: pydantic>=2.0
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Provides-Extra: ai
Requires-Dist: anthropic>=0.105.2; extra == "ai"
Provides-Extra: viz
Requires-Dist: Pillow>=10.0; extra == "viz"
Requires-Dist: wcag-contrast-ratio>=0.9; extra == "viz"
Requires-Dist: playwright>=1.44; extra == "viz"
Provides-Extra: xmla
Requires-Dist: msal>=1.28; extra == "xmla"
Provides-Extra: server
Requires-Dist: fastapi>=0.136.3; extra == "server"
Requires-Dist: uvicorn>=0.48.0; extra == "server"
Provides-Extra: sources
Requires-Dist: sqlalchemy>=2.0; extra == "sources"
Requires-Dist: openpyxl>=3.1.5; extra == "sources"
Requires-Dist: httpx>=0.27; extra == "sources"
Provides-Extra: dev
Requires-Dist: pytest>=9.0.3; extra == "dev"
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
Requires-Dist: ruff>=0.15.15; extra == "dev"
Requires-Dist: mypy>=2.1.0; extra == "dev"
Provides-Extra: all
Requires-Dist: pbi-enterprise-cli[ai,dev,server,sources,viz,xmla]; extra == "all"
Dynamic: license-file

# pbi-enterprise-cli

**Enterprise-grade Power BI & Microsoft Fabric automation CLI — TMDL/XMLA/REST backends, Python-native BPA governance, DAX testing & lint, PBIR report intelligence, an MCP server for AI agents, and AI-powered measures.**

[![PyPI](https://img.shields.io/pypi/v/pbi-enterprise-cli?cacheSeconds=300)](https://pypi.org/project/pbi-enterprise-cli/)
[![Python](https://img.shields.io/pypi/pyversions/pbi-enterprise-cli?cacheSeconds=300)](https://pypi.org/project/pbi-enterprise-cli/)
[![License](https://img.shields.io/github/license/mudassir09/pbi-enterprise-cli)](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/LICENSE)
[![Downloads](https://img.shields.io/pypi/dm/pbi-enterprise-cli)](https://pypi.org/project/pbi-enterprise-cli/)
[![codecov](https://codecov.io/gh/mudassir09/pbi-enterprise-cli/graph/badge.svg)](https://codecov.io/gh/mudassir09/pbi-enterprise-cli)

```bash
uv tool install pbi-enterprise-cli
pbi doctor                                   # verify setup
pbi --backend file --path . govern check     # governance on your repo's TMDL — any OS
pbi dax lint --fail-on error                 # static DAX analysis
pbi ask "top 10 customers by revenue"        # English → DAX → results
```

## Key differentiators

- **Real artifacts on any OS** — the `file` backend reads TMDL/PBIP folders straight from your repo (pure Python, no .NET): governance, BPA, lint, docs, and semantic diff on `ubuntu-latest`
- **Live DAX on any OS** — the `rest` backend runs DAX against published datasets via the `executeQueries` API; `xmla` gives full read/write on Windows
- **Python-native BPA runner** — the only Python implementation of Best Practice Analyzer; same ruleset as Tabular Editor
- **Full Fabric lifecycle** — item CRUD (Item Definition API), workspaces, git sync, deployment pipelines, OneLake, capacity ops, jobs, Direct Lake diagnostics
- **Quality platform** — DAX lint/format, report lint + unused-field analysis, dbt-style data tests, schema contracts, RLS matrices, drift detection — all CI-gateable with SARIF output
- **AI-agent native** — `pbi mcp serve` exposes everything to Cursor/Copilot/Claude Desktop; 10 bundled Claude Code skills install with `pbi connect`
- **One-step CI** — published GitHub Action + pre-commit hooks; scaffold a full project with `pbi init`

## Five backends, one API

| Backend | Use for | OS |
|---|---|---|
| `desktop` | Local Power BI Desktop (.pbip) | Windows |
| `xmla` | Premium / Fabric read-write | Windows |
| `file` | TMDL/PBIP repo artifacts — governance, lint, docs, diff | Any |
| `rest` | Live DAX via executeQueries | Any |
| `mock` | Unit tests, demos | Any |

## Command surface

`model` · `measure` · `dax` (query/test/lint/format/coverage) · `report` (authoring + lint/field-usage/diff/a11y) · `visual` · `layout` · `theme` · `filter` · `govern` (rules/BPA/plugins/SARIF/tenant scan) · `tenant` (usage/access/labels) · `security` · `test` (data/schema/rls/seed) · `partition` · `deploy` · `snapshot` · `env` (incl. drift) · `diff` · `fabric` (items/workspaces/git/pipelines/onelake/capacity/jobs/directlake) · `pquery` (M folding/lint) · `ops` (refresh chains/health) · `migrate` (direct-lake/pbix/dbt) · `docs` (dictionary/ERD/site) · `mcp` · `ask` · `introspect` · `init` · `watch` · `server` · `skills`

## Install options

```bash
# Recommended
uv tool install pbi-enterprise-cli
uv tool install "pbi-enterprise-cli[all]"   # everything

# Alternative
pipx install pbi-enterprise-cli

# Fallback
pip install pbi-enterprise-cli
```

| Extra | Adds |
|---|---|
| `[ai]` | Claude AI: `pbi ask`, `measure generate`, `govern explain` |
| `[xmla]` | MSAL auth for XMLA/Fabric + device flow |
| `[sources]` | SQL / Excel / REST source profiling |
| `[server]` | FastAPI REST server |
| `[viz]` | WCAG theme validation |

## Requirements

- Python 3.10–3.13
- Windows for the `desktop` and `xmla` backends (.NET AMO, DLLs bundled)
- Linux/macOS fully supported via the `file`, `rest`, and `mock` backends

## Links

- [GitHub Repository](https://github.com/mudassir09/pbi-enterprise-cli)
- [Full Documentation](https://github.com/mudassir09/pbi-enterprise-cli#readme)
- [Standard Operating Procedure](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/docs/SOP.md)
- [XMLA Auth Guide](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/docs/auth/xmla-auth.md)
- [Changelog](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/CHANGELOG.md)
- [Security Policy](https://github.com/mudassir09/pbi-enterprise-cli/blob/main/SECURITY.md)
- [Issues](https://github.com/mudassir09/pbi-enterprise-cli/issues)
