
Te2 Cli
- 39 installs
- 836 repo stars
- Updated July 29, 2026
- data-goblin/power-bi-agentic-development
Use the Tabular Editor 2 command line (TabularEditor.exe) to deploy semantic models, run BPA, script edits, and integrate model builds into CI/CD.
About
CLI syntax reference for Tabular Editor 2 (TabularEditor.exe) covering deployment, scripting, Best Practice Analyzer runs, and CI/CD integration on Windows. A developer uses it to automate model deployment, run BPA from the command line, or save a model as TMDL.
- Documents TE2 CLI flags for deploy, script, BPA, and TMDL
- Targets Windows CI/CD pipelines for semantic models
Te2 Cli by the numbers
- 39 all-time installs (skills.sh)
- Ranked #1,006 of 2,064 Data Science & ML skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/data-goblin/power-bi-agentic-development --skill te2-cliAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 39 |
|---|---|
| repo stars | ★ 836 |
| Last updated | July 29, 2026 |
| Repository | data-goblin/power-bi-agentic-development ↗ |
What it does
Use the Tabular Editor 2 command line (TabularEditor.exe) to deploy semantic models, run BPA, script edits, and integrate model builds into CI/CD.
Files
Tabular Editor 2 CLI
Command-line interface for Tabular Editor 2 (TE2). This skill covers the TabularEditor.exe executable; TE3 has its own CLI and is a separate product.
[!NOTE]
The TE2 CLI (TabularEditor.exe) is still supported and stable, and remains a solid choice for existing Windows CI/CD pipelines. It is now considered outdated against the newer cross-platform Tabular Editor CLI (te), which is built on TE3 and is in preview until Q4 2026. For thetecommand set and a flag-by-flag migration, see thete-cliskill. Downloadtepreview binaries from the Tabular Editor CLI downloads page.
Installation
Tabular Editor 2 (Free)
- Download: https://github.com/TabularEditor/TabularEditor/releases
- Extract to preferred location or use Chocolatey:
choco install tabulareditor2
Executable
TabularEditor.exe -- free, Windows-only. For Mac/Linux, run via a Windows VM or container.
Connection Sources
Local Files
# model.bim (JSON format)
TabularEditor.exe Model.bim
# TMDL folder
TabularEditor.exe definition/
# PBIP project
TabularEditor.exe MyReport.pbipRemote XMLA Endpoints
# Analysis Services
TabularEditor.exe "localhost\tabular" "AdventureWorks"
# Power BI Premium/Fabric
TabularEditor.exe "powerbi://api.powerbi.com/v1.0/myorg/WorkspaceName" "ModelName"Power BI Desktop
# Auto-detect running instance
TabularEditor.exe localhost:PORT DatabaseNameNote: Find the port in PBIDesktop diagnostic files or use tools like DAX Studio.
Command-Line Reference
Basic Syntax
TabularEditor.exe <source> [options]Script Execution
# Inline C# script
TabularEditor.exe Model.bim -S "Info(Model.Name);"
# Script file
TabularEditor.exe Model.bim -S script.csx
# Multiple scripts (executed in order)
TabularEditor.exe Model.bim -S script1.csx -S script2.csxDeployment
# Deploy to XMLA endpoint
TabularEditor.exe Model.bim -D "server" "database"
# Deploy with options
TabularEditor.exe Model.bim -D "server" "database" -O -C -P -R -M -E -V -WDeployment Options
| Flag | Long Form | Description |
|---|---|---|
-O | -OVERWRITE | Overwrite existing database |
-C | -CONNECTIONS | Deploy/overwrite data sources (supports connection string placeholder substitution) |
-P | -PARTITIONS | Deploy/overwrite existing table partitions |
-R | -ROLES | Deploy roles |
-M | -MEMBERS | Deploy role members |
-S | -SHARED | Deploy shared expressions (within -D context; note: -S also means script outside -D) |
-E | -ERR | Return non-zero exit code if AS returns error messages after deployment |
-V | -VSTS | Output Azure DevOps logging commands |
-W | -WARN | Output warnings for unprocessed objects |
-F | -FULL | Full deployment (equivalent to -O -C -P -S -R -M) |
-X | -XMLA | Generate XMLA/TMSL script instead of deploying |
-L | -LOGIN | Disable integrated security for deployment |
-Y | -SKIPPOLICY | Skip incremental refresh policy partitions |
Save Output
# Save to model.bim
TabularEditor.exe Model.bim -S script.csx -B Output.bim
# Save to TMDL folder
TabularEditor.exe Model.bim -S script.csx -TMDL output/
# Save to legacy folder structure
TabularEditor.exe Model.bim -S script.csx -F output/Best Practice Analyzer
# Run BPA rules
TabularEditor.exe Model.bim -A rules.json
# Run BPA with Azure DevOps logging output
TabularEditor.exe Model.bim -A rules.json -V
# Run BPA with GitHub Actions logging output
TabularEditor.exe Model.bim -A rules.json -G
# Analyze excluding rules embedded in model annotations
TabularEditor.exe Model.bim -AX rules.jsonSchema Check
# Validate data source schemas against the model
TabularEditor.exe Model.bim -SCCommon Operations
1. Deploy Local Model to Service
TabularEditor.exe Model.bim ^
-D "powerbi://api.powerbi.com/v1.0/myorg/Workspace" "SemanticModel" ^
-O -C2. Run Script and Save
TabularEditor.exe Model.bim -S format-dax.csx -B Model.bim3. Run BPA Analysis
TabularEditor.exe Model.bim ^
-A https://raw.githubusercontent.com/microsoft/Analysis-Services/master/BestPracticeRules/BPARules.json ^
-V4. Refresh Model Data
TabularEditor.exe "server" "database" ^
-S "Model.RequestRefresh(RefreshType.Full);" ^
-D "server" "database"5. Export Model from Service
TabularEditor.exe "powerbi://api.powerbi.com/v1.0/myorg/Workspace" "Model" ^
-TMDL output/definitionAuthentication
For authentication methods (Windows, Service Principal, Interactive) and CI/CD integration (Azure DevOps, GitHub Actions), see `references/auth-and-cicd.md`.
Exit Codes
| Code | Description |
|---|---|
| 0 | Success |
| 1 | Any error-level output (script error, deployment failure, BPA violations at severity >= 3) |
File Formats
Input Formats
model.bim- Tabular JSON (legacy)definition/- TMDL folder (modern)*.pbip- Power BI Project (TE3)
Output Formats
| Flag | Format | Description |
|---|---|---|
-B | .bim | Tabular JSON |
-TMDL | folder | TMDL |
-F | folder | Legacy folder structure |
Troubleshooting
For common errors (database not found, authentication failed, script execution failed), see `references/auth-and-cicd.md`.
Quick Reference Card
+---------------------------------------------------------+
| TABULAR EDITOR CLI QUICK REFERENCE |
+---------------------------------------------------------+
| SOURCES |
| Model.bim Local JSON model |
| definition/ TMDL folder |
| "server" "db" XMLA connection |
+---------------------------------------------------------+
| SCRIPTS |
| -S "code" Inline C# script |
| -S file.csx Script file |
+---------------------------------------------------------+
| DEPLOYMENT |
| -D "server" "db" Deploy to target |
| -O Overwrite existing |
| -C Create if not exists |
+---------------------------------------------------------+
| OUTPUT |
| -B output.bim Save as JSON |
| -TMDL folder/ Save as TMDL |
+---------------------------------------------------------+
| BPA |
| -A rules.json Run BPA analysis |
| -G results.sarif Output BPA results |
+---------------------------------------------------------+References
To retrieve current XMLA and deployment docs, use microsoft_docs_search + microsoft_docs_fetch (MCP) if available, otherwise mslearn search + mslearn fetch (CLI). Search based on the user's request and run multiple searches as needed to ensure sufficient context before proceeding.
Authentication & CI/CD Integration
Authentication
Windows Authentication (Default)
Used automatically for on-premises SSAS.
Service Principal (Azure AD App)
Set environment variables:
set AZURE_CLIENT_ID=your-app-id
set AZURE_TENANT_ID=your-tenant-id
set AZURE_CLIENT_SECRET=your-secretConnection string format:
Provider=MSOLAP;
Data Source=powerbi://api.powerbi.com/v1.0/myorg/Workspace;
User ID=app:CLIENT_ID@TENANT_ID;
Password=CLIENT_SECRETInteractive (TE3 Only)
TabularEditor.exe "server" "database" --auth interactiveCI/CD Integration
Azure DevOps Pipeline
steps:
- task: PowerShell@2
displayName: 'Deploy Semantic Model'
inputs:
targetType: 'inline'
script: |
TabularEditor.exe "$(Build.SourcesDirectory)/Model.bim" `
-D "$(XMLA_ENDPOINT)" "$(MODEL_NAME)" -O -CGitHub Actions
jobs:
deploy:
runs-on: windows-latest
steps:
- name: Deploy Model
run: |
TabularEditor.exe Model.bim -D "${{ secrets.XMLA_ENDPOINT }}" "ModelName" -O -CTroubleshooting
"Database not found"
- Check server/workspace name is exact
- Verify access to the workspace
- Ensure XMLA endpoint is enabled
"Authentication failed"
- Verify environment variables are set correctly
- Check service principal has workspace access
- Confirm API permissions are granted
"Script execution failed"
- Check C# syntax is valid
- Verify all referenced objects exist
- Add Info() statements to debug