by MinaSaad1
Power BI CLI - semantic models (.NET TOM) and PBIR reports for token-efficient AI agent usage, built for Claude Code
# Add to your Claude Code skills
git clone https://github.com/MinaSaad1/pbi-clipipx install pbi-cli-tool # 1. Install (handles PATH automatically)
pbi-cli skills install # 2. Register Claude Code skills (one-time setup)
pbi connect # 3. Connect to Power BI Desktop
Open Power BI Desktop with a .pbix file, run the three commands above, and start asking Claude.
Requires: Windows with Python 3.10+ and Power BI Desktop running.
Install and set up pbi-cli from https://github.com/MinaSaad1/pbi-cli.git
Claude will clone, install, connect, and set up skills automatically.
pip install pbi-cli-tool
On Windows, pip install often places the pbi command in a directory that isn't on your PATH.
Fix: Add the Scripts directory to PATH
python -c "import site; print(site.getusersitepackages().replace('site-packages','Scripts'))"
Add the printed path to your system PATH, then restart your terminal. We recommend pipx to avoid this entirely.
Ask Claude to work with your Power BI semantic model. Requires pbi connect.
Ask Claude to build and manage your Power BI reports. No connection needed -- works directly on PBIR files.
No comments yet. Be the first to share your thoughts!
Two layers, one CLI:
.pbip projects.All config lives in ~/.pbi-cli/:
~/.pbi-cli/
config.json # Default connection preference
connections.json # Named connections
repl_history # REPL command history
Bundled DLLs ship inside the Python package (pbi_cli/dlls/).
After running pbi-cli skills install, Claude Code discovers 13 Power BI skills. Each skill teaches Claude a different area. You don't need to memorize commands.
pbi connect)| Skill | What you say | What Claude does | |-------|-------------|-----------------| | DAX | "What are the top 10 products by revenue?" | Writes and executes DAX queries, validates syntax | | Modeling | "Create a star schema with Sales and Calendar" | Creates tables, relationships, measures, hierarchies | | Deployment | "Save a snapshot before I make changes" | Exports/imports TMDL, manages transactions, diffs snapshots | | Security | "Set up RLS for regional managers" | Creates roles, filters, perspectives | | Docs | "Document everything in this model" | Generates data dictionaries, measure inventories | | Partitions | "Show me the M query for the Sales table" | Manages partitions, expressions, calendar config | | Diagnostics | "Why is this query so slow?" | Traces queries, checks model health, benchmarks |
| Skill | What you say | What Claude does |
|-------|-------------|-----------------|
| Report | "Create a new report project for Sales" | Scaffolds PBIR reports, validates structure, previews layout |
| Visuals | "Add a bar chart showing revenue by region" | Adds, binds, updates, bulk-manages 32 visual types |
| Pages | "Add an Executive Overview page" | Manages pages, bookmarks, visibility, drillthrough |
| Themes | "Apply our corporate brand colours" | Applies themes, conditional formatting, colour scales |
| Filters | "Show only the top 10 products" | Adds page/visual filters (TopN, date, categorical) |
| Custom Visuals | "Build a radial gauge Power BI doesn't have" | Scaffolds a TypeScript visual project, iterates on tsc --noEmit, packages .pbiviz, imports into the report |
The Custom Visuals skill turns vibe-coding into the Power BI Visuals SDK loop.
Claude scaffolds a sibling TypeScript project with npx pbiviz new, iterates against
the Power BI Visuals API with tsc --noEmit between every change, packages a
.pbiviz, and embeds it into your report:
# After installing the skill, just describe what you want in Claude Code:
# "Build me a radial gauge that highlights values above target"
#
# Under the hood, the skill drives:
npx --yes powerbi-visuals-tools@^5.6.0 new mygaugevisual
# (Claude edits src/visual.ts + capabilities.json, runs tsc --noEmit until clean)
npx --yes powerbi-visuals-tools@^5.6.0 package
pbi visual import-custom dist/mygaugevisual.1.0.5.pbiviz --replace
The skill auto-installs Node and pbiviz on first run (with your consent), pins
the SDK to a known-good version, keeps the TypeScript project as a sibling to your
.pbip (no PBIR contamination), and operates under a curated npm allowlist for
common deps (D3, Lodash, date-fns) -- anything off-list requires explicit approval.
Three new pbi-cli commands support the loop:
| Command