Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/features/te-cli/includes/te-cli-preview-notice.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
> [!IMPORTANT]
> The Tabular Editor CLI is in **Limited Public Preview**. It is offered for evaluation with a Tabular Editor account; no license is required during preview. Commands, flags, and outputs may change before general availability. **The preview build stops functioning after 2026-09-30.** We recommend against using the CLI in production CI/CD pipelines during preview. Please refer to our license agreement.
> The Tabular Editor CLI is in **Limited Public Preview**. It is offered for evaluation with a Tabular Editor account; no license is required during preview. Commands, flags, and outputs may change before general availability. **The preview build stops functioning after 2026-09-30.** We recommend against using the CLI in production CI/CD pipelines during preview.
3 changes: 3 additions & 0 deletions content/features/te-cli/te-cli-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ te connect ./my-model
# Connect to a running Power BI Desktop instance (Windows only)
te connect --local

# Filter by report name when multiple Power BI Desktop instances are running
te connect --local my-report

# Show the active connection
te connect

Expand Down
2 changes: 1 addition & 1 deletion content/features/te-cli/te-cli-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Every `te` command exits with a predictable status code so callers can branch on
| Exit | Meaning |
| -- | -- |
| `0` | Success. |
| `1` | Generic failure - invalid arguments, command failed, validation errors, auth failure, BPA gate failed at severity error. For `te diff`: differences found (like the `diff`/`cmp` convention). |
| `1` | Generic failure - invalid arguments, command failed, validation errors, auth failure, BPA gate failed at severity >= error. For `te diff`: differences found (like the `diff`/`cmp` convention). |
| `2` | `te diff` only: an error occurred while comparing, so the difference status is unknown. |

Combine exit codes with `--ci <vsts\|github>` annotations and `--trx <file>` to surface rich failure information in CI - see @te-cli-cicd.
Expand Down
2 changes: 1 addition & 1 deletion content/features/te-cli/te-cli-cicd.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ steps:

`te deploy` and `te save` run the Best Practice Analyzer as a pre-flight gate by default. Three behaviors are worth determining up-front:

- **Enforce** - the default. Pipeline fails if BPA finds violations at severity error. Pair with `--fail-on warning` on a standalone `te bpa run` step if you want warnings to fail too.
- **Enforce** - the default. Pipeline fails if BPA finds violations at severity >= error. Pair with `--fail-on warning` on a standalone `te bpa run` step if you want warnings to fail too.
- **Auto-fix** - `--fix-bpa` applies `fixExpression`s in memory for the deployed artifact. Source files are not modified. Useful when the source of truth lives in the model and you want deploys to normalize style without developer intervention.
- **Bypass** - `--skip-bpa` disables the gate for a single command. Useful for emergency hotfixes; not recommended as a default.

Expand Down
150 changes: 106 additions & 44 deletions content/features/te-cli/te-cli-commands.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions content/features/te-cli/te-cli-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ applies_to:

The Tabular Editor CLI reads optional configuration from a JSON file. Configuration controls three things:

- **File paths** where the CLI reads macros, BPA rules, and (optionally) the TE3 Desktop executable, and where to write the query log.
- **Behavioral defaults** BPA gates, auto-format, validation.
- **Saved connection profiles** the list of named profiles you can switch between.
- **File paths** - where the CLI reads macros, BPA rules, and (optionally) the TE3 Desktop executable, and where to write the query log.
- **Behavioral defaults** - BPA gates, auto-format, validation.
- **Saved connection profiles** - the list of named profiles you can switch between.

The CLI is self-contained - it does not read from or write to any Tabular Editor 3 desktop install path. BPA rules and macros files must be set explicitly via this config (or initialized on demand with `te bpa rules init` / `te macro init`).

Expand Down Expand Up @@ -78,7 +78,7 @@ The complete JSON config schema with all keys at their default values. Use this

```json
{
"formatVersion": 1,
"formatVersion": 2,
"macros": null,
"autoFormat": false,
"validateOnMutation": true,
Expand Down Expand Up @@ -146,7 +146,7 @@ All BPA-related settings live under the `bpa` object and are addressed via dotte
| `autoFormat` | `false` | Run the DAX Formatter on modified expressions after `te add` / `te set` / `te mv` / `te macro run`. Uses the in-house formatter by default; opt into the SQL BI web service via `formatOptions.useSqlBiDaxFormatter`. |
| `validateOnMutation` | `true` | After a mutating command (`add`, `set`, `mv`, `replace --save`, `macro run`), check that every `Table[Column]` reference in the model still resolves. Catches dangling references introduced by renames or removals before they reach deploy. |
| `bpa.onMutation` | `false` | Run a scoped BPA analysis after each mutating command (`set`, `add`, `mv`, `rm`, `macro run`). Only the affected table's objects are checked, not the whole model - useful for fast feedback during iterative edits. |
| `bpa.onDeploy` | `true` | Run the BPA gate before `te deploy` executes. The deploy is aborted if any rule fires at severity error. Bypass per-invocation with `--skip-bpa`, or auto-fix with `--fix-bpa`. |
| `bpa.onDeploy` | `true` | Run the BPA gate before `te deploy` executes. The deploy is aborted if any rule fires at severity >= error. Bypass per-invocation with `--skip-bpa`, or auto-fix with `--fix-bpa`. |
| `bpa.onSave` | `true` | Run the BPA gate before `te save -o` writes to disk. Bypass per-invocation with `--skip-bpa` or `--force`. |
| `bpa.builtInRules` | `true` | Include the curated built-in BPA rule set whenever the gate runs. Set to `false` to ignore built-ins entirely; the gate then runs only the rules configured via `bpa.rules` and any model-embedded rules. |
| `bpa.disabledBuiltInRuleIds` | `null` | IDs of individual built-in rules to exclude from the gate. Mutated by `te bpa rules disable <id>` / `te bpa rules enable <id>` - prefer those over editing the array directly. |
Expand Down Expand Up @@ -203,7 +203,7 @@ The BPA gate is the safety net that prevents a model with rule violations from b

The gate loads BPA rules from `bpa.rules` and, by default, the built-in rule set (controlled by `bpa.builtInRules`). Built-in rules can be individually excluded via `bpa.disabledBuiltInRuleIds` - managed with `te bpa rules disable <id>` / `te bpa rules enable <id>`.

When the gate fires and finds violations at severity `error`, the command fails with exit code `1` and a summary of the violations. Options to resolve:
When the gate fires and finds violations at severity >= `error`, the command fails with exit code `1` and a summary of the violations. Options to resolve:

- `--fix-bpa` - apply the rule's `fixExpression` in memory for the deploy/save artifact; source files are not modified.
- `--skip-bpa` - disable the gate for this one command.
Expand All @@ -218,7 +218,7 @@ te bpa run ./model --fix --save # Apply fixes to the source

### Built-in BPA rules

The CLI ships a single canonical set of built-in BPA rules embedded as a JSON resource. Built-in rules are read-only - `te bpa rules set` and `te bpa rules rm` refuse to mutate built-in IDs and point users at `te bpa rules disable` instead. To customize a built-in rule's behavior, copy it into your local rules file as a new rule with a different ID and disable the built-in.
The CLI ships a single canonical set of built-in BPA rules embedded as a JSON resource. Built-in rules are read-only - `te bpa rules set` and `te bpa rules remove` refuse to mutate built-in IDs and point users at `te bpa rules disable` instead. To customize a built-in rule's behavior, copy it into your local rules file as a new rule with a different ID and disable the built-in.

Both `bpa.builtInRules` and `bpa.disabledBuiltInRuleIds` apply consistently to the deploy/save/mutation gate **and** the manual `te bpa run` command - disabling a rule once via `te bpa rules disable` excludes it everywhere.

Expand Down
2 changes: 1 addition & 1 deletion content/features/te-cli/te-cli-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ te config set hidePreviewNotice true

## Shell completion

The CLI provides tab-completion scripts for **Bash**, **Zsh**, **PowerShell** and **Fish**. Pick the block that matches your shell each one installs the completion persistently for new shell sessions.
The CLI provides tab-completion scripts for **Bash**, **Zsh**, **PowerShell** and **Fish**. Pick the block that matches your shell - each one installs the completion persistently for new shell sessions.

### Bash (macOS/Linux)

Expand Down
2 changes: 1 addition & 1 deletion content/features/te-cli/te-cli-limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The CLI runs C# scripts (`te script`) against the same `Model` object you use in

| Limitation | Notes / Workaround |
| -- | -- |
| **`--serialization` cannot combine a serialization with a PBIP container** | The `--serialization` option on [`te save`](xref:te-cli-commands#save) treats `bim`, `tmdl`, `te-folder`, and `pbip` as mutually exclusive, so you cannot currently produce a PBIP container around a TMSL-serialized (`.bim`) model. Save TMDL inside PBIP, or save `.bim` outside a PBIP wrapper. |
| **`--serialization` cannot combine a serialization with a PBIP container** | The `--serialization` option on [`te save`](xref:te-cli-commands#save) treats `bim`, `tmdl`, `database.json`, and `pbip` as mutually exclusive, so you cannot currently produce a PBIP container around a TMSL-serialized (`.bim`) model. Save TMDL inside PBIP, or save `.bim` outside a PBIP wrapper. |

## Authentication

Expand Down
6 changes: 3 additions & 3 deletions content/features/te-cli/te-cli-migrate.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ A non-exhaustive summary of the most commonly used flags. Run `te migrate` for t
| TE2 flag | New CLI equivalent | Notes |
| -- | -- | -- |
| `file` (positional) | `te <command> <path>` or global `--model` | First positional arg on most commands. |
| `server`, `database` | `te connect <server>` or `te deploy <server> <database>` | Server is no longer a global positional. |
| `server`, `database` | `te connect <server> <database>` or `te deploy <model> -s <server> -d <database>` | Server is no longer a global positional; `te deploy` takes only `<model>` positionally, with server and database as named flags. |
| `-L` / `-LOCAL` | `te connect --local` | Windows only. |
| `-S` / `-SCRIPT` | `te script -S <file.csx>` or `-e "code"` | Supports multiple scripts, inline code, and stdin. Note: uppercase `-S` - lowercase `-s` is the global `--server` option. |
| `-A` / `-ANALYZE` | `te bpa run --rules <file-or-url>` | Supports `--fail-on`, `--fix`, multiple rule files. |
| `-AX` / `-ANALYZEX` | `te bpa run --rules <file>` (without `--model-rules`) | Excluding model-embedded rules is the new default. |
| `-B` / `-BIM` | `te save <model> -o <file.bim> --serialization bim` | |
| `-F` / `-FOLDER` | `te save <model> -o <dir> --serialization te-folder` | After `-D`, TE2's `-F` means `-FULL` - see `--deploy-full`. |
| `-F` / `-FOLDER` | `te save <model> -o <dir> --serialization database.json` | After `-D`, TE2's `-F` means `-FULL` - see `--deploy-full`. |
| `-TMDL` | `te save <model> -o <dir> --serialization tmdl` | TMDL is the default save format. |
| `-D` / `-DEPLOY` | `te deploy <server> <database> <model>` | Separate command with named options. |
| `-D` / `-DEPLOY` | `te deploy <model> -s <server> -d <database>` | Separate command with named options; only `<model>` is positional. |
| `-O` / `-OVERWRITE` | (default) or `--create-only` to opt out | Overwrite is the default in the new CLI. |
| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | |
| `-P` / `-PARTITIONS` | `te deploy --deploy-partitions` | |
Expand Down
6 changes: 3 additions & 3 deletions content/features/te-cli/te-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ Unlike the Windows-only `TabularEditor.exe` command-line options (TE2) - which w

Three design pillars run through every command:

- **Structured output** JSON, CSV, TMDL, TMSL alongside default human-readable text.
- **Non-interactive mode** a global `--non-interactive` flag that disables prompts and fails fast.
- **Clear errors** written to stderr with predictable exit codes.
- **Structured output** - JSON, CSV, TMDL, TMSL alongside default human-readable text.
- **Non-interactive mode** - a global `--non-interactive` flag that disables prompts and fails fast.
- **Clear errors** - written to stderr with predictable exit codes.

Together they make the same binary work well for three very different audiences:

Expand Down
Loading