Skip to content

Commit eb4387a

Browse files
gronnerupmlonskotykierMariaJoseFFclaude
authored
Added documentation for new Tabular Editor CLI in Limited Public Prev… (#313)
* Added documentation for new Tabular Editor CLI in Limited Public Preview. This includes new Tabular Editor CLI item and 8 new doc pages covering installation, commands, ci/cd etc. * Delete .claude/settings.local.json * Added link to the GitHub repo for issues and discussions. Updated gitignore. * Include file for preview notice * Updates based on Jeroen's comments * Update config titel * Update docs for CLI to comply with latest changes in commands, flags, auth etc. * cli docs refinement (#318) * Update te-cli docs to reflect TE3 PR 3201 (CLI - Remove TE3 dependencies) (#317) * Update te-cli docs to reflect TE3 PR 3201 (CLI - Remove TE3 dependencies) Aligns te-cli-config, te-cli-commands, and te-cli-cicd with the cross-platform CLI's decoupled configuration model: - Schema: nested `bpa.*` object replaces flat `bpaRules`/`bpaOn*`; add `formatVersion`, `interactiveEditMode`, `queryLog`, `te3ExePath`; remove `te3DataDir`, `preferences`, `bpaMachineRules` - Path resolution: drop auto-detection of `%LocalAppData%\TabularEditor3`; new order is flag > env var > config > CWD fallback - New commands documented: `te bpa rules init`, `te bpa rules disable`, `te bpa rules enable`, `te macro init`, plus the built-in guard on `te bpa rules set / rm` - New flags documented: `te deploy --bpa-rules`, `te save --bpa-rules` - Environment variable renamed: `TE_BPA_RULES_PATH` -> `TE_BPA_PATH` - `TE_CONFIG` now honored by every `te config` operation - `te config paths` JSON output documented (emits null fields explicitly) - Added "Removed keys" reference table * Drop "Removed keys" section from te-cli-config No public preview build of the CLI was released with the older key names, so the migration table has no audience. Also removes the "Unknown or removed keys" wording and the [!NOTE] pointing at the deleted section. The `formatVersion` / `interactiveEditMode` paragraphs are preserved under a new "Other schema keys" heading. --------- * Added limitations page and polished text on all cli doc pages * Adjusted cicd and install docs. Emphasize CLI limited preview limitations * docs(cli): refresh BPA rule limitations after resolver wiring te bpa run now consults bpa.rules and TE_BPA_PATH (the row covering that gap is removed). Add two remaining limitations: --rules is additive with the built-in defaults, and there is no per-invocation flag to skip bpa.rules without also passing --rules. * docs(cli): rename --output to --output-format, --format to --serialization (#322) - Replace --output <fmt> with --output-format <fmt> across all te-cli pages. - Rename save-format --format to --serialization on save/init/add/rm/mv/set/ replace/bpa run/macro/script examples. - Add --error-format to the global options table for independent stderr formatting. - Drop the Auto-mode language: the default is now plain text regardless of TTY, with --output-format json the explicit opt-in. - Drop the -f short alias for te query --file (no -f aliases anywhere in the CLI). * Update cli docs with correct link and verified all commands, subcommands and arguments. * Update incorrect download link * Added connect example to different org. * Update CLI Configs to reflect latest config options also adding additional description on all config settings * Added framing on the use of Python * Update intro, cicd and interactive based on review feedback * Stop tracking generated docfx.json docfx.json is generated by gen_redirects.py from docfx-template.json at build time (see README and .github/workflows/deploy.yml). It should not be committed - it was added accidentally on this branch. Add /docfx.json to .gitignore and untrack the file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Promote platform-table caveat to IMPORTANT callout The note that local SSAS and Power BI Desktop connections are Windows-only materially constrains what macOS/Linux users can do with the CLI. Wrap it in [!IMPORTANT] so it stands out below the cross-platform feature matrix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Moved TE CLI above old CLI in ToC and added warning on overview page regarding preview notice * Address review feedback on auth, path quoting, and CLI scripting - csharp-scripts.md: add Tabular Editor CLI to applies_to and document the TECLI preprocessor symbol (plus the TE3_3_X_OR_GREATER family and the Select* UI-helper caveat under te script) so the cross-reference from te-cli-commands.md lands on relevant content. - te-cli-auth.md: replace "caches the SP record" with "caches the credentials" - the rest of the page spells out "service principal", and "SP record" was the only short-form outlier. - te-cli-commands.md: rewrite "Bare segments cover the common case" as "Most segment names work as-is" - same meaning, plain English. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Rephase risks in pipelines during preview * Removed section on DaxFormatter limitations * Added images for preview notice and ls command * Apply review feedback on auth docs * Apply review feedback on overview and install docs * Apply review feedback on command reference * Apply review feedback across cli docs * Apply review feedback on config page --------- Co-authored-by: Morten Lønskov <morten.lonskov@tabulareditor.com> Co-authored-by: Daniel Otykier <otykier@users.noreply.github.com> Co-authored-by: Maria José Ferreira <171664470+MariaJoseFF@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 04f1ca9 commit eb4387a

18 files changed

Lines changed: 2426 additions & 11 deletions

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/metadata/languages.json
22

3-
43
###############
54
# folder #
65
###############
@@ -21,6 +20,9 @@ artifacts/
2120
target/
2221
/_site/
2322

23+
# Generated by gen_redirects.py at build time from docfx-template.json
24+
/docfx.json
25+
2426
# Localized content
2527
/localizedContent/en/
2628
/localizedContent/*/docfx.json
@@ -31,6 +33,7 @@ target/
3133

3234
.vscode/
3335
.vs/
36+
.claude/
3437

3538
###############
3639
# temp file #
500 KB
Loading
85.8 KB
Loading
173 KB
Loading

content/features/Command-line-Options.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
---
1+
---
22
uid: command-line-options
3-
title: Command Line
3+
title: Command Line (Tabular Editor 2)
44
author: Daniel Otykier
55
updated: 2021-08-26
66
applies_to:
@@ -10,7 +10,10 @@ applies_to:
1010
- product: Tabular Editor 3
1111
none: true
1212
---
13-
# Command Line
13+
# Command Line (Tabular Editor 2)
14+
15+
> [!TIP]
16+
> Looking for the new cross-platform CLI? See @te-cli for the Tabular Editor CLI (Limited Public Preview), a successor that runs on Windows, macOS, and Linux.
1417
1518
Tabular Editor can be executed from the command-line to perform various tasks, which may be useful in Automated Build and Deployment scenarios, etc.
1619

content/features/csharp-scripts.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
uid: csharp-scripts
33
title: C# Scripts
44
author: Daniel Otykier
5-
updated: 2026-03-19
5+
updated: 2026-05-27
66
applies_to:
77
products:
88
- product: Tabular Editor 2
@@ -15,6 +15,8 @@ applies_to:
1515
full: true
1616
- edition: Enterprise
1717
full: true
18+
- product: Tabular Editor CLI
19+
full: true
1820
---
1921
# C# Scripts
2022

@@ -366,18 +368,27 @@ Info($"Configured model for {environment} environment");
366368
<a name="compatibility"></a>
367369
## Compatibility
368370

369-
The scripting APIs for Tabular Editor 2 and Tabular Editor 3 are mostly compatible, however, there are cases where you want to conditionally compile code depending on which version you're using. For this, you can use preprocessor directives, which were introduced in Tabular Editor 3.10.0.
371+
The scripting APIs for Tabular Editor 2, Tabular Editor 3 (Desktop), and the Tabular Editor CLI are mostly compatible, but there are cases where you want to conditionally compile code depending on which host is running. The CLI host defines a `TECLI` preprocessor symbol; TE3 Desktop defines `TE3` (and version-bracketed symbols like `TE3_3_15_OR_GREATER` for the active minor); TE2 defines neither. Preprocessor directives were introduced in Tabular Editor 3.10.0. Use them to write portable scripts:
370372

371373
```csharp
372-
#if TE3
373-
// This code will only be compiled when the script is running in TE3 (version 3.10.0 or newer).
374-
Info("Hello from TE3!");
374+
#if TECLI
375+
// CLI host - no UI APIs available
376+
Info($"Running under the CLI on {Environment.OSVersion.Platform}");
377+
#elif TE3
378+
// TE3 Desktop - UI APIs are available
379+
ShowMessage("Hello from TE3");
375380
#else
376-
// This code will be compiled in all other cases.
377-
Info("Hello from TE2!");
381+
// TE2 (legacy) - neither TECLI nor TE3 is defined
382+
Info("Hello from TE2");
383+
#endif
384+
385+
#if TE3_3_15_OR_GREATER
386+
// Gated on a specific TE3 minor version
378387
#endif
379388
```
380389

390+
One CLI-specific caveat: the TE3-Desktop UI helpers `SelectMeasure()`, `SelectTable()`, `SelectColumn()`, `SelectObject()`, and `SelectObjects()` throw `NotSupportedException` under `te script` since the CLI has no UI to pop up. Wrap such calls in `#if TE3` (or `try/catch`) when sharing scripts across hosts.
391+
381392
If you need to know the exact version of Tabular Editor at script runtime, you can inspect the assembly version:
382393

383394
```csharp
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
> [!IMPORTANT]
2+
> 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.
Lines changed: 225 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
---
2+
uid: te-cli-auth
3+
title: Authentication and Connections
4+
author: Peer Grønnerup
5+
updated: 2026-05-06
6+
applies_to:
7+
products:
8+
- product: Tabular Editor 2
9+
none: true
10+
- product: Tabular Editor 3
11+
none: true
12+
- product: Tabular Editor CLI
13+
full: true
14+
---
15+
# Authentication and Connections
16+
17+
[!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)]
18+
19+
The Tabular Editor CLI authenticates to Power BI Service, Microsoft Fabric, and Azure Analysis Services using the same Power BI Desktop client ID that Tabular Editor 3 uses. Tokens are cached locally so you authenticate once and re-run commands silently until the refresh token expires (typically 90 days).
20+
21+
## Authentication methods
22+
23+
The CLI supports the full Azure Identity credential chain:
24+
25+
| Method | When to use | `--auth` value |
26+
| -- | -- | -- |
27+
| Interactive browser | Local development - opens the system browser | `interactive` (default) |
28+
| Service principal (client secret) | Automation, CI/CD, headless / SSH / WSL | `spn` (with `-u / -p / -t`) or `env` |
29+
| Service principal (certificate) | Automation with certificate-based auth | `spn` (with `-u / -t / --certificate`) |
30+
| Environment variables | `AZURE_CLIENT_ID` / `AZURE_CLIENT_SECRET` / `AZURE_TENANT_ID` | `env` |
31+
| Managed identity | Azure VMs, Azure Container Apps, Azure Functions | `managed-identity` |
32+
33+
> [!NOTE]
34+
> `--auth` is a **global** option, available on every `te` command - not just `te auth login`. Pass it to [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh), [`te query`](xref:te-cli-commands#query), [`te connect`](xref:te-cli-commands#connect), or any other command that connects to a remote endpoint, to override the default chain for that invocation. The default (`auto`) tries environment credentials first, then falls back to the cached or interactive browser login.
35+
36+
For headless, SSH, WSL, or devcontainer scenarios, use a service principal - `te auth login -u <id> -p <secret> -t <tenant>` (or `--certificate`). The login is cached, so subsequent commands acquire tokens silently with `--auth auto`.
37+
38+
## `te auth login`
39+
40+
Authenticate and cache the result for subsequent commands:
41+
42+
```bash
43+
# Browser-based interactive login (default)
44+
te auth login
45+
46+
# Service principal with client secret
47+
te auth login -u "$AZURE_CLIENT_ID" -p "$AZURE_CLIENT_SECRET" -t "$AZURE_TENANT_ID"
48+
49+
# Service principal - read secret from stdin
50+
echo "$AZURE_CLIENT_SECRET" | te auth login -u "$AZURE_CLIENT_ID" -p - -t "$AZURE_TENANT_ID"
51+
52+
# Service principal with certificate
53+
te auth login -u "$AZURE_CLIENT_ID" -t "$AZURE_TENANT_ID" --certificate ./sp.pfx --certificate-password "$CERT_PASSWORD"
54+
55+
# Managed identity (Azure-hosted)
56+
te auth login --identity
57+
```
58+
59+
After a successful service-principal login the CLI **caches the credentials** so every subsequent `te` command can acquire tokens silently - no need to re-pass `-u / -p / -t` or set the `AZURE_CLIENT_*` environment variables. Pass `--save=false` for a one-shot login that doesn't update the cache, or run `te auth logout` to clear it.
60+
61+
> [!WARNING]
62+
> Passing secrets directly on the command line exposes them to process listings and shell history. Prefer the `AZURE_CLIENT_SECRET` environment variable, or pipe the secret via stdin with `-p -`.
63+
64+
## `te auth status`
65+
66+
Display the current authentication state without opening a browser:
67+
68+
```bash
69+
te auth status
70+
te auth status --output-format json
71+
```
72+
73+
This returns an exit code of `0` when a valid session exists, `1` when not logged in or expired.
74+
75+
## `te auth logout`
76+
77+
Clear all cached credentials:
78+
79+
```bash
80+
te auth logout
81+
```
82+
83+
## Credential storage
84+
85+
The CLI stores access/refresh tokens and service-principal records in the **OS-native secure store** by default. A `0600` file fallback is selected automatically only when the OS keystore is unavailable (e.g., headless Linux without libsecret/D-Bus).
86+
87+
| Platform | Backend | Storage location |
88+
| -- | -- | -- |
89+
| Windows | DPAPI | Per-user, managed by MSAL |
90+
| Linux | libsecret (system keyring) | Per-user, managed by MSAL |
91+
| macOS | Keychain | Service `com.tabulareditor.cli.*`, account `te-msal-cache.bin` |
92+
| Any (fallback) | `0600` file | `~/.te-cli/te-msal-cache.bin` and per-key `.bin` blobs |
93+
94+
Interactive browser and service-principal flows share the same cache; MSAL's account model distinguishes them - there are no separate `auth-record*.json` sidecar files. Run any command with `--debug` to see which backend was selected at startup.
95+
96+
`te auth logout` clears every cached record (both the MSAL token cache and any SPN blobs) regardless of which backend is in use.
97+
98+
## `te connect` - set the active connection
99+
100+
`te connect` persists an active connection for the current terminal session. Subsequent commands that take `-s` / `-d` can omit them:
101+
102+
```bash
103+
# Remote workspace
104+
te connect my-workspace my-model
105+
106+
# Local TMDL folder, .bim file, or .SemanticModel container
107+
te connect ./my-model
108+
109+
# Connect to a running Power BI Desktop instance (Windows only)
110+
te connect --local
111+
112+
# Show the active connection
113+
te connect
114+
115+
# Clear the active connection (and any workspace mirror)
116+
te connect --clear
117+
```
118+
119+
Active-connection state is per-terminal-session: opening a new terminal starts fresh.
120+
121+
### Workspace mode (`-w` / `--workspace`)
122+
123+
`te connect -w <target>` pairs a primary source with a secondary mirror so every subsequent `--save` writes to both. Use it to keep a local working copy of a remote model in sync, or to push local edits to a workspace as you save:
124+
125+
```bash
126+
# Mirror remote workspace ↔ local TMDL folder
127+
te connect Finance "Revenue Model" -w ./revenue-model
128+
129+
# Mirror local source ↔ remote workspace (initial deploy + auto-redeploy on save)
130+
te connect ./revenue-model -w Finance "Revenue Model"
131+
```
132+
133+
Save order is always **local first, then remote**, so the on-disk copy reflects the latest user change even if the server push fails. See @te-cli-commands#workspace-mode-w--workspace for `--workspace-format`, overwrite semantics, and clearing the mirror.
134+
135+
## Connecting to different clouds
136+
137+
The CLI detects the correct scope from the server URL for:
138+
139+
- Power BI Service and Fabric (commercial, US Gov, China, Germany clouds)
140+
- Azure Analysis Services (`asazure://...`)
141+
- Local SSAS (`localhost`, named instances - Windows only)
142+
143+
Pass an XMLA endpoint, workspace name, or `powerbi://` URL as `--server`:
144+
145+
```bash
146+
te connect "powerbi://api.powerbi.com/v1.0/myorg/Finance" "Revenue Model"
147+
te connect "powerbi://api.powerbi.com/v1.0/SpaceParts/Finance" "Revenue Model"
148+
te connect "asazure://westeurope.asazure.windows.net/myaas" "MyModel"
149+
te connect localhost "AdventureWorks"
150+
```
151+
152+
## Connection profiles
153+
154+
For repeated use of the same connection - especially when you deploy to multiple environments - save named profiles:
155+
156+
```bash
157+
# Save remote and local profiles
158+
te profile set prod -s my-workspace -d my-model --description "Production"
159+
te profile set dev --model ./model --description "Local dev TMDL"
160+
161+
# List and inspect
162+
te profile list
163+
te profile show prod
164+
165+
# Use a profile as the active connection
166+
te connect --profile prod
167+
168+
# One-shot use without changing the active connection
169+
te deploy ./model --profile staging --force
170+
```
171+
172+
Profiles can also carry behavioral overrides that take effect whenever the profile is active:
173+
174+
```bash
175+
# In dev, disable the BPA gate on deploy and loosen validation
176+
te profile set dev --bpa-on-deploy false --validate-on-mutation false
177+
178+
# In prod, force auto-format before any mutation
179+
te profile set prod --auto-format true
180+
```
181+
182+
See @te-cli-config for the full list of overridable behaviors.
183+
184+
## Non-interactive authentication
185+
186+
For CI/CD pipelines, agents, or any unattended context, avoid interactive flows by combining:
187+
188+
- The `--non-interactive` global flag (fails fast instead of prompting).
189+
- One of the non-interactive auth methods: `env`, `managed-identity`, or explicit service principal credentials.
190+
191+
Environment-based example for a pipeline:
192+
193+
```bash
194+
export AZURE_CLIENT_ID="your-app-id"
195+
export AZURE_CLIENT_SECRET="your-client-secret"
196+
export AZURE_TENANT_ID="your-tenant-id"
197+
198+
te deploy ./model -s my-workspace -d my-model \
199+
--auth env \
200+
--non-interactive \
201+
--force \
202+
--ci github
203+
```
204+
205+
See @te-cli-cicd for complete GitHub Actions and Azure DevOps Pipelines examples.
206+
207+
## Authentication environment variables
208+
209+
The CLI honors the standard Azure.Identity environment variables when you use `--auth env` (and as part of the `auto` chain):
210+
211+
| Variable | Purpose |
212+
| -- | -- |
213+
| `AZURE_CLIENT_ID` | Service principal application ID. |
214+
| `AZURE_CLIENT_SECRET` | Service principal client secret. Used together with `AZURE_CLIENT_ID` and `AZURE_TENANT_ID`. |
215+
| `AZURE_TENANT_ID` | Service principal tenant (directory) ID. |
216+
| `AZURE_CLIENT_CERTIFICATE_PATH` | Path to a PEM or PKCS12 certificate file for certificate-based service principal auth. Used together with `AZURE_CLIENT_ID` and `AZURE_TENANT_ID`. |
217+
| `AZURE_AUTHORITY_HOST` | Override the authority host for sovereign clouds (e.g., `login.microsoftonline.us`, `login.partner.microsoftonline.cn`, `login.microsoftonline.de`). Defaults to the commercial cloud. |
218+
219+
For CLI-specific environment variables (config paths, debug logging, TE2 compatibility), see @te-cli-config.
220+
221+
## Next steps
222+
223+
- @te-cli-commands - what you can do once connected.
224+
- @te-cli-config - configuration and profile behavior.
225+
- @te-cli-cicd - pipeline examples using service principals and managed identity.

0 commit comments

Comments
 (0)