From 6c6322f9cce51fd3b6b24a7e3440fbb8d243d289 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:21 +0200 Subject: [PATCH 01/48] New translations command-line-options.md (Spanish) [ci skip] --- .../content/features/Command-line-Options.md | 114 +++++++++++------- 1 file changed, 68 insertions(+), 46 deletions(-) diff --git a/localizedContent/es/content/features/Command-line-Options.md b/localizedContent/es/content/features/Command-line-Options.md index 8b06a51ea..fda244f9d 100644 --- a/localizedContent/es/content/features/Command-line-Options.md +++ b/localizedContent/es/content/features/Command-line-Options.md @@ -28,52 +28,74 @@ Ejecutar `TabularEditor.exe` en una canalización de CI/CD no requiere una licen ## TabularEditor.exe frente a la CLI de Tabular Editor -La CLI de Tabular Editor (`te`) es la sucesora multiplataforma de `TabularEditor.exe`. No es solo una reescritura para macOS y Linux: incorpora la edición, la inspección, la comparación de diferencias de modelos, las pruebas, la activación de actualizaciones y el análisis de VertiPaq como operaciones de canalización de primera clase; nada de esto era posible con `TabularEditor.exe`. La CLI `te` está en versión preliminar pública limitada (expira el 2026-09-30); por ahora, usa `TabularEditor.exe` en canalizaciones de producción. - -| | CLI de TE2 (`TabularEditor.exe`) | CLI de TE (`te`) | -| ---------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Estado | Estable y lista para producción | Versión preliminar pública limitada (expira el 2026-09-30) | -| Plataforma | Solo para Windows | Windows, macOS, Linux | -| Requiere licencia | No | No (versión preliminar); por determinar cuando llegue a GA | -| Binario | Aplicación WinForms; requiere el wrapper `start /wait` | Binario de consola diseñado específicamente para este fin; no requiere wrapper | -| **Autenticación** | | | -| Entidad de servicio | Mediante una cadena de conexión de MSOLAP | Compatibilidad nativa con `--auth spn`, `--auth env`, `--auth managed-identity`; credenciales a través de variables de entorno, stdin o certificado; almacén seguro de credenciales nativo del sistema operativo | -| Identidad administrada | No | Sí (`--auth managed-identity`), para runners alojados en Azure | -| Inicio de sesión interactivo en el navegador | No | Sí (`te auth login`) | -| **CI/CD** | | | -| Anotaciones de CI | `-V` (Azure DevOps), `-G` (GitHub) | `--ci vsts`, `--ci github` en cada comando | -| Modo no interactivo | Sin opción explícita; si hay errores, puede solicitarte datos | Opción global `--non-interactive`: falla de inmediato, sin solicitar datos | -| Códigos de salida predecibles | Parcial | `0` = éxito, `1` = fallo, `2` = discrepancia del diff | -| Salida estructurada | No | `--output-format json/csv/tmdl/tmsl` en cada comando | -| Resultados de VSTEST | Opción `-T` | `--trx ` en `validate`, `bpa run`, `test run` | -| **Implementación** | | | -| Implementar el modelo | Opción `-D` | `te deploy` con opciones detalladas (`--deploy-roles`, `--deploy-partitions`, `--deploy-connections`, `--deploy-full`, etc.) | -| Generar XMLA/TMSL sin realizar el despliegue | opción `-X` | `te deploy --xmla ` o `--dry-run` | -| Comprobación de BPA antes del despliegue | No | Integrado; usa `--skip-bpa` o `--fix-bpa` para anularlo | -| Perfiles de conexión | No | `te profile set/list/show` - perfiles reutilizables con nombre por entorno | -| **Best Practice Analyzer** | | | -| Ejecutar BPA | opciones `-A` / `-AX` | `te bpa run` con `--fail-on warning/error`, `--fix`, delimitación mediante `--path` y `--vpax` para reglas compatibles con VPA | -| Gestión de reglas de BPA | No | `te bpa rules add/rm/set/list/disable/enable/init` | -| **Edición de modelos en la canalización** | | | -| Ejecutar C# Script | opción `-S` | `te script` - múltiples scripts, código en línea, stdin, `--dry-run`, símbolos del preprocesador (`TECLI`) | -| Ejecutar macros | No | `te macro run` con contexto `--on ` | -| Establecer/consultar propiedades | No | `te get`, `te set`, `te add`, `te rm`, `te mv`, `te replace` | -| Formato DAX | No | `te format` - todas las expresiones o un único objeto; DAX y M | -| **Inspección** | | | -| Listar objetos del modelo | No | `te ls` con filtros de ruta con comodines, `--type`, `--paths-only`, `--output-format bim` | -| Buscar expresiones/nombres | No | `te find` con expresiones regulares y ámbito (`--in expressions/names/descriptions`) | -| Comparar dos modelos | No | `te diff` - comparación estructural con código de salida `2` ante cualquier diferencia | -| Análisis de dependencias | No | `te deps` - dependencias ascendentes y descendentes para cualquier objeto; `--unused` para encontrar código muerto | -| **Actualización** | | | -| Iniciar una actualización | No | `te refresh` con `--type`, `--table`, `--partition`, `--apply-refresh-policy`, `--dry-run` | -| **Pruebas** | | | -| Pruebas de aserción de DAX | No | `te test run` con `--tag`, `--trx`, `--ci`; `te test init/snapshot/compare` | -| **Análisis de VertiPaq** | | | -| Estadísticas de almacenamiento | No | `te vertipaq` - columnas, relaciones, particiones; `--export`/`--import` VPAX | -| **Otro** | | | -| REPL interactivo | No | `te interactive` - shell con reconocimiento del modelo y autocompletado con Tab | -| Autocompletado con Tab en el shell | No | `te completion bash/zsh/pwsh` | -| Compatibilidad con versiones anteriores de TE2 | Nativa | Capa de compatibilidad integrada: las invocaciones existentes de `TabularEditor.exe` funcionan sin cambios | +La CLI de Tabular Editor (`te`) es la sucesora multiplataforma de `TabularEditor.exe`. No es solo una reescritura para macOS y Linux: incorpora la edición, la inspección, la comparación de diferencias de modelos, las pruebas, la activación de actualizaciones y el análisis de VertiPaq como operaciones de canalización de primera clase; nada de esto era posible con `TabularEditor.exe`. La CLI `te` está en versión preliminar pública limitada (expira el 2026-10-31); por ahora, usa `TabularEditor.exe` para las canalizaciones de producción hoy. + +#### De un vistazo + +| Aspecto | CLI de TE2 (`TabularEditor.exe`) | CLI de TE (`te`) | +| ----------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------ | +| Estado | Estable y lista para producción | Versión preliminar pública limitada (expira el 2026-10-31) | +| Plataforma | Solo para Windows | Windows, macOS, Linux | +| Requiere licencia | No | No (versión preliminar); por determinar cuando llegue a GA | +| Binario | Aplicación WinForms; requiere el wrapper `start /wait` | Binario de consola diseñado específicamente para este fin; no requiere wrapper | + +#### Autenticación + +| Capacidad | CLI de TE2 (`TabularEditor.exe`) | CLI de TE (`te`) | +| -------------------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Entidad de servicio | Mediante una cadena de conexión de MSOLAP | Compatibilidad nativa con `--auth spn`, `--auth env`, `--auth managed-identity`; credenciales a través de variables de entorno, stdin o certificado; almacén seguro de credenciales nativo del sistema operativo | +| Identidad administrada | No | Sí (`--auth managed-identity`), para runners alojados en Azure | +| Inicio de sesión interactivo en el navegador | No | Sí (`te auth login`) | + +#### CI/CD + +| Capacidad | CLI de TE2 (`TabularEditor.exe`) | CLI de TE (`te`) | +| ----------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| Anotaciones de CI | `-V` (Azure DevOps), `-G` (GitHub) | `--ci vsts`, `--ci github` en cada comando | +| Modo no interactivo | Sin opción explícita; si hay errores, puede solicitarte datos | Opción global `--non-interactive`: falla de inmediato, sin solicitar datos | +| Códigos de salida predecibles | Parcial | `0` = éxito, `1` = fallo (para `te diff`: se encontraron diferencias), `2` = error en la comparación de `te diff` | +| Salida estructurada | No | `--output-format json/csv/tmdl/tmsl` en cada comando | +| Resultados de VSTEST | Opción `-T` | `--trx ` en `validate`, `bpa run`, `test run` | + +#### Implementación + +| Capacidad | CLI de TE2 (`TabularEditor.exe`) | CLI de TE (`te`) | +| -------------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Implementar el modelo | Opción `-D` | `te deploy` con opciones detalladas (`--deploy-roles`, `--deploy-partitions`, `--deploy-connections`, `--deploy-full`, etc.) | +| Generar XMLA/TMSL sin realizar el despliegue | opción `-X` | De forma predeterminada: `te deploy` sin `--execute` imprime el TMSL en stdout | +| Comprobación de BPA antes del despliegue | No | Integrado; usa `--skip-bpa` o `--fix-bpa` para anularlo | +| Perfiles de conexión | No | `te profile set/list/show` - perfiles reutilizables con nombre por entorno | + +#### Best Practice Analyzer y edición de modelos + +| Capacidad | CLI de TE2 (`TabularEditor.exe`) | CLI de TE (`te`) | +| -------------------------------- | --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Ejecutar BPA | opciones `-A` / `-AX` | `te bpa run` con `--fail-on warning/error`, `--fix`, delimitación mediante `--path` y `--vpax` para reglas compatibles con VPA | +| Gestión de reglas de BPA | No | `te bpa rules add/rm/set/list/disable/enable/init` | +| Ejecutar C# Script | opción `-S` | `te script`: varios scripts, código en línea, stdin, comprobación de compilación con `--validate`, símbolos del preprocesador (`TECLI`) | +| Ejecutar macros | No | `te macro run` con contexto `--on ` | +| Establecer/consultar propiedades | No | `te get`, `te set`, `te add`, `te rm`, `te mv` | +| Formato DAX | No | `te set --format` para objetos del modelo, `te util format-dax` / `format-m` para expresiones sueltas | + +#### Inspección, actualización, pruebas y análisis de VertiPaq + +| Capacidad | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| ------------------------------ | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Listar objetos del modelo | No | `te ls` con filtros de ruta con comodines, `--type`, `--paths-only`, `--output-format bim` | +| Buscar expresiones/nombres | No | `te find` con expresiones regulares y ámbito (`--in expressions/names/descriptions`) | +| Comparar dos modelos | No | `te diff` - comparación estructural con código de salida `1` si hay alguna diferencia | +| Análisis de dependencias | No | `te deps` - dependencias ascendentes y descendentes para cualquier objeto; `--unused` para encontrar código muerto | +| Iniciar una actualización | No | `te refresh` con `--type`, `--table`, `--partition`, `--apply-refresh-policy`; simulación en seco de forma predeterminada; usa `--execute` para ejecutarlo | +| Pruebas de aserción de DAX | No | `te test run` con `--tag`, `--trx`, `--ci`; `te test init/snapshot/compare` | +| Estadísticas de almacenamiento | No | `te vertipaq` - columnas, relaciones, particiones; `--export`/`--import` VPAX | + +#### Otros + +| Capacidad | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| ---------------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | +| REPL interactivo | No | `te interactive` - shell con conocimiento del modelo, historial persistente y ediciones por etapas | +| Autocompletado con Tab en el shell | No | `te completion bash/zsh/pwsh` | +| Compatibilidad con versiones anteriores de TE2 | Nativa | Capa de compatibilidad integrada: las invocaciones existentes de `TabularEditor.exe` funcionan sin cambios | Para ver una correspondencia opción por opción entre la sintaxis de TE2 y la nueva CLI, consulta @te-cli-migrate. From 44d72bda07c737dc47077dd3addd1606015382c2 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:26 +0200 Subject: [PATCH 02/48] New translations te-cli-commands.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-commands.md | 511 ++++++++++-------- 1 file changed, 295 insertions(+), 216 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-commands.md b/localizedContent/es/content/features/te-cli/te-cli-commands.md index fa8fd8c1b..7f5f243f0 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-commands.md +++ b/localizedContent/es/content/features/te-cli/te-cli-commands.md @@ -2,7 +2,7 @@ uid: te-cli-commands title: Referencia de comandos author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -31,8 +31,8 @@ te bpa run --help # Help for a command with subcommands El direccionamiento de objetos en la CLI usa una única gramática compartida por todos los comandos. En la referencia siguiente aparecen dos tipos de ruta: -- **``**: identifica **exactamente un** objeto o contenedor. Los utilizan los comandos que operan sobre un único destino: `te get`, `te set`, `te add`, `te remove`, `te move`, `te format -p`, `te deps`, `te macro run --on`. -- **``**: identifica **cero o más** objetos y admite comodines. Los utilizan los comandos que operan sobre un conjunto: `te list`, `te bpa run --path` y otros comandos de inspección. +- **``**: identifica **exactamente un** objeto o contenedor. Used by commands that change the model or need a single target: `te set`, `te add`, `te remove`, `te move`, `te deps`, `te macro run --on`, and `te get` with `-p`, `--deps`, or `--properties`. +- **``**: identifica **cero o más** objetos y admite comodines. Used by commands that operate on a set: `te list`, plain `te get` (a wildcard or container path lists every match), `te bpa run --path`, and other inspection-style commands. Ambas formas de ruta comparten las mismas reglas de sintaxis; solo se diferencian en dos puntos: @@ -61,6 +61,8 @@ La mayoría de los nombres de segmentos funcionan tal cual. Pon un segmento entr Dentro de los segmentos entre comillas, `*` se trata como un carácter literal, no como un comodín. Por tanto, `'Sa*'` coincide con una tabla cuyo nombre es exactamente `Sa*`. +The reserved characters in paths are `/ [ ] ' " * ? { }`. A segment containing any of `* ? { }` must be quoted (`te get "Tables/'{foo}'"`, `te get 'Sales/"my*name"'`); unquoted use is rejected with an error naming the character and showing the quoted form. `?` is reserved and has no wildcard meaning. Every path the CLI prints - in errors, hints, `--paths-only` output, and the `objectPath` field in JSON - is canonically quoted and can be pasted straight back into `te get`. The mixed-quote forms require PowerShell or bash; cmd.exe cannot express them. + ### Referencias al estilo DAX (solo rutas de objeto) Se aceptan dos formas con sintaxis DAX en cualquier lugar donde se admita un ``: @@ -80,12 +82,14 @@ Varios nombres funcionan como palabras clave de contenedor. Una palabra clave pu | Palabra clave | Ámbito | Significado | | -------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | -| `Tables`, `Medidas`, `Columns`, `Hierarchies`, `Particiones` | Modelo | Todos los objetos de ese tipo en todo el modelo. | +| `Tables`, `Measures`, `Columns`, `Hierarchies`, `Partitions`, `KPIs`, `Sets` | Modelo | Todos los objetos de ese tipo en todo el modelo. | | `Relaciones`, `Roles`, `Perspectives`, `Cultures`, `DataSources`, `Expressions`, `CalculationGroups`, `Functions`, `Annotations` | Modelo | Contenedores a nivel de modelo. | -| `Medidas`, `Columns`, `Hierarchies`, `Particiones`, `Calendars`, `CalculationItems` | Tabla | Subcontenedores dentro de una tabla. | +| `Measures`, `Columns`, `Hierarchies`, `Partitions`, `Calendars`, `CalculationItems`, `KPIs`, `Sets` | Tabla | Subcontenedores dentro de una tabla. | | `Levels` | Jerarquía | Niveles de una jerarquía. | | `Members`, `TablePermissions` (alias `Permissions`) | Rol | Elementos hijos de un rol. | +Calculated sets are addressable in container form only (`/Sets/`); an individual KPI is `
//KPI`; calendars resolve at `
/Calendars/`; relationships resolve at `Relationships/` (the relationship's own name in the model: a GUID, or a label such as `Relationship 1`; `--paths-only` prints it, and the display name is also accepted). + Algunos ejemplos muestran en qué se diferencian las rutas simples y las rutas con ámbito de contenedor: ```bash @@ -94,10 +98,10 @@ te get Sales/Measures/Revenue # Same, container-scoped - disambigua te get Sales/Geography/Levels/Year # Specific level of a hierarchy te get Roles/Admin/Members/bob@example.com # Role member te get Sales/refreshPolicy # Refresh-policy sub-object on a table -te get "Measures/Revenue/KPI" # KPI sub-object of a measure +te get Sales/Revenue/KPI # KPI sub-object of a measure ``` -Pon un segmento entre comillas para forzar la coincidencia literal del nombre cuando el nombre real de un objeto coincide con una palabra clave. La tabla cuyo nombre literal es `Tables` es `'Tables'` y se accede con `te get "'Tables'"`. +Pon un segmento entre comillas para forzar la coincidencia literal del nombre cuando el nombre real de un objeto coincide con una palabra clave. La tabla cuyo nombre literal es `Tables` es `'Tables'` y se accede con `te get "'Tables'"`. The same applies to tables named `KPIs` or `Sets`. ### Comodines en rutas de filtro @@ -116,27 +120,27 @@ El sufijo entre corchetes de DAX se rechaza en las rutas de filtro; pon entre co ### Errores y sugerencias -Los segmentos mal escritos generan un error contextual con una sugerencia de "quizás quisiste decir" cuando la CLI puede deducir lo que querías decir. Las rutas a las que les falta el elemento padre fallan antes de la comprobación del elemento hoja, así que los mensajes señalan el segmento que realmente está mal. Los contenedores vacíos (por ejemplo, `te list Hierarchies` en un modelo sin jerarquías) devuelven una sencilla indicación de "no hay nada aquí" en lugar de un error. +Los segmentos mal escritos generan un error contextual con una sugerencia de "quizás quisiste decir" cuando la CLI puede deducir lo que querías decir. The list offers tables, measures, columns, and hierarchies, each as a full `Table/Object` path that pastes straight back into the next command. A name written in single quotes is a table reference (`te deps 'Revenue'` looks for a table named Revenue), and the error points at the `Table/Object` and `"[Object]"` forms for anything that is not a table. Las rutas a las que les falta el elemento padre fallan antes de la comprobación del elemento hoja, así que los mensajes señalan el segmento que realmente está mal. Every path an error or hint prints is taken from your model and quoted so it resolves as printed - a refusal never suggests a path that does not exist. Empty containers (e.g., `te list Hierarchies` on a model without hierarchies) emit a simple "nothing here" hint rather than an error. ## Alias de comandos La mayoría de los verbos en formato largo también aceptan un alias corto. Cada fila muestra el comando canónico y el comando equivalente en formato corto que admite como alias. -| Canónico | Forma(s) con alias | -| ------------------------------- | ------------------------------------- | -| `te list` | `te ls` | -| `te remove` | `te rm` | -| `te move` | `te mv`, `te rename` | -| `te bpa rules list` | `te bpa rules ls` | -| `te bpa rules remove` | `te bpa rules rm` | -| `te config list` | `te config ls` | -| `te macro list` | `te macro ls` | -| `te macro remove` | `te macro rm` | -| `te incremental-refresh remove` | `te incremental-refresh rm` | -| `te profile list` | `te profile ls` | -| `te profile remove` | `te profile rm` | -| `te session list` | `te session ls` | -| `te test list` | `te test ls` | +| Canónico | Forma(s) con alias | +| --------------------- | ------------------------------------- | +| `te save-as` | `te save` | +| `te list` | `te ls` | +| `te remove` | `te rm` | +| `te move` | `te mv`, `te rename` | +| `te bpa rules list` | `te bpa rules ls` | +| `te bpa rules remove` | `te bpa rules rm` | +| `te config list` | `te config ls` | +| `te macro list` | `te macro ls` | +| `te macro remove` | `te macro rm` | +| `te profile list` | `te profile ls` | +| `te profile remove` | `te profile rm` | +| `te session list` | `te session ls` | +| `te test list` | `te test ls` | ## Opciones globales @@ -147,7 +151,7 @@ Estas opciones están disponibles en todos los comandos y se pueden usar antes o | `-m, --model ` | Ruta al modelo semántico (carpeta TMDL, archivo `.bim`, carpeta `Database.json` o carpeta `.SemanticModel`). | | `-s, --server ` | Punto de conexión de Analysis Services o un Workspace de Power BI. Un nombre de servidor/FQDN (`MY.SERVER.COM`), una dirección IP (`192.168.1.1`), `host:port`, `localhost`, `SERVER\INSTANCE`, `asazure://...` o una cadena de conexión de MSOLAP se conecta directamente a Analysis Services/AAS. Un nombre sencillo de un solo token (`MyWorkspace`), una ruta de Fabric `Name.Workspace[/Model.SemanticModel]` o una URL `powerbi://...` apunta a un Workspace de Power BI. Un nombre de Workspace que contiene un punto no se puede distinguir de un nombre de servidor, por lo que se trata como un servidor y la CLI muestra una advertencia; usa su forma `.Workspace` o la URL completa `powerbi://` para dirigirte a Power BI. | | `-d, --database ` | Nombre del modelo semántico en el Workspace. | -| `--local` | Conecta a una instancia de Power BI Desktop en ejecución local (solo Windows). | +| `--local` | Connect to a locally running Analysis Services instance - Power BI Desktop, Visual Studio workspaces, or standalone SSAS (Windows only). | | `--auth ` | Método de autenticación: `auto`, `interactive`, `spn`, `env`, `managed-identity` (predeterminado: `auto`). | | `--output-format ` | Formato de Stdout: `text` (predeterminado), `json`, `csv`, `tmsl` (alias `bim`), `tmdl`. `csv` se respeta en los comandos que emiten datos tabulares; `tmsl`/`tmdl` solo se respetan en `te get` y `te list` para la serialización de objetos completos. Los comandos rechazan los formatos que no admiten. | | `--error-format ` | Formato de stderr para errores, advertencias y sugerencias: `text` (predeterminado) o `json`. Para cualquier otro valor, se usa `text`. Es independiente de `--output-format`, así que puedes combinar stdout en JSON con errores en texto sin formato (o viceversa). | @@ -159,7 +163,9 @@ Estas opciones están disponibles en todos los comandos y se pueden usar antes o En los comandos que leen un modelo, el orden de resolución es: -el argumento posicional `` → la opción global `--model` → `--server`/`--database` (remoto) → conexión activa de `te connect` → `--recent`. +`--recent` → `--local` → `--server`/`--database` (remote) → `--model` → active connection from `te connect`. + +The model is never a positional argument - a stray path on the command line is rejected with an "unrecognized command or argument" error. (Positional arguments on `te connect`, `te init`, `te diff`, and `te query` are those commands' own subjects, not the model.) > [!NOTE] > **Las opciones mal escritas se rechazan de entrada.** Si pasas un `--flag` que no se reconoce en el comando que invocaste, la CLI finaliza con un error claro en lugar de interpretarlo silenciosamente como un argumento posicional. Esto detecta errores tipográficos como, por ejemplo, que `--force ` se convierta accidentalmente en `--forec` en scripts de CI. @@ -167,26 +173,16 @@ el argumento posicional `` → la opción global `--model` → `--server` > [!NOTE] > **Nombres de servidor con puntos.** `-s`/`--server` trata un nombre con puntos (por ejemplo, `Sales.2026`) como el nombre de host de un servidor de Analysis Services, no como un Workspace de Power BI. Se muestra una advertencia cuando la CLI tiene que hacer esta interpretación, con una sugerencia para agregar `.Workspace` (por ejemplo, `Sales.2026.Workspace`) o usar una URL `powerbi://` completa si en realidad te referías al Workspace de Power BI. Se aplica a `te connect`, `te deploy`, `te refresh`, `te query`, `te vertipaq` y `te test run`. -## E/S del modelo +## Model initialization and save -### load +### save-as -Carga un modelo semántico y muestra un resumen del modelo: nombre, nivel de compatibilidad y recuentos generales de objetos (tablas, medidas, columnas). - -```bash -te load ./model # TMDL folder -te load model.bim # BIM file -te load -s MyWorkspace -d MyModel # Remote workspace -``` +Re-serialize a model to a different format or location. Úsalo para escribir en archivos locales un modelo de un Workspace remoto, convertir formatos o guardar de nuevo las ediciones en el origen. (Alias: `save`.) -### save +`te save-as` accepts: -Guarda un modelo en disco. Úsalo para escribir en archivos locales un modelo de un Workspace remoto, convertir formatos o guardar de nuevo las ediciones en el origen. - -`te save` acepta: - -- `-o, --output-path ` - archivo o carpeta de destino. **Opcional** - si se omite, `te save` vuelve a escribir en la ubicación de origen y conserva el formato original. La extensión del archivo también sirve para inferir el formato: `.bim` escribe un BIM en un solo archivo, `.json` escribe una carpeta `Database.json` y una ruta sin extensión escribe una carpeta TMDL. -- `--serialization ` - `tmdl`, `bim` (alias `tmsl`), `Database.json`, `pbip`. Si se omite, el formato se infiere a partir de la extensión de la ruta `-o` (o del modelo cargado cuando `-o` se omite por completo). +- `-o, --output-path ` - archivo o carpeta de destino. **Optional** - when omitted, `te save-as` writes back to the source location, preserving the original format. +- `--serialization ` - `tmdl`, `bim` (alias `tmsl`), `Database.json`, `pbip`. When omitted, the format is the loaded model's format; with `-o`, it is inferred from the output path (`.bim` writes a single-file BIM, `.json` a `database.json` folder). - `--force` - omite la validación y sobrescribe la salida existente. Algunos rechazos (contenedores ambiguos, raíces de proyecto con varios `SemanticModel`) siguen ocurriendo incluso con `--force`. - `--skip-bpa` - omite por completo el control de BPA. - `--fix-bpa` - corrige automáticamente las infracciones de BPA cuando las reglas definen una expresión de corrección. @@ -195,94 +191,126 @@ Guarda un modelo en disco. Úsalo para escribir en archivos locales un modelo de - `--supporting-files` - genera archivos auxiliares de Fabric (`.platform`, `definition.pbism`). ```bash -te save # Save back to source (no -o needed) -te save ./model.bim -o ./tmdl-out # Convert BIM to TMDL -te save -o ./project --serialization pbip # Save as a PBIP project -te save -o ./out -s my-workspace -d my-model --skip-validation # Fast download +te save-as # Save back to source (no -o needed) +te save-as -m ./model.bim -o ./tmdl-out # Convert BIM to TMDL +te save-as -o ./project --serialization pbip # Save as a PBIP project +te save-as -o ./out -s my-workspace -d my-model --skip-validation # Fast download ``` -> [!TIP] -> Use `te save -o -s -d ` para descargar un modelo remoto a disco. Combínalo con `--skip-validation` para obtener el passthrough más rápido cuando solo necesites los bytes (sin análisis semántico de DAX). +`--serialization pbip` output opens directly in Power BI Desktop and is named after the source model (`SpaceParts.pbip`, not `Model.pbip`). Saving into a folder that already holds a project adds only the files that are missing and leaves everything already there - the report's pages, theme, connection, and item identity - exactly as it was, so a save that changes nothing leaves the project unchanged under source control. -### open +Validation guards saving: a model with a name collision Analysis Services would refuse (`TE0012` / `TE0013`, see [validate](#validate)) is not written unless `--force` or `--skip-validation` is passed. -Abre un modelo en la aplicación de escritorio de Tabular Editor 3. **Solo para Windows** (requiere que TE3 esté instalado). Sin argumentos, inicia TE3 con un Workspace en blanco. - -```bash -te open # Launch TE3 with a blank workspace -te open ./my-model # Open a TMDL folder in TE3 -te open ./model.bim # Open a BIM file in TE3 -``` +> [!TIP] +> Use `te save-as -o -s -d ` to download a remote model to disk. Combínalo con `--skip-validation` para obtener el passthrough más rápido cuando solo necesites los bytes (sin análisis semántico de DAX). ### init -Crea un nuevo modelo semántico vacío en la ruta especificada. De forma predeterminada, usa un modelo TMDL en modo de compatibilidad `PowerBI`, con nivel de compatibilidad 1702. +Crea un nuevo modelo semántico vacío en la ruta especificada. Defaults to a TMDL model in `PowerBI` compatibility mode at compatibility level 1705. `te init` acepta: - `` - argumento posicional: directorio donde se creará el modelo (omítelo para usar la ruta global `--model`). - `--compatibility-mode ` - `PowerBI` (predeterminado) o `AnalysisServices`. -- `--compatibility-level ` (alias `--compat`) - nivel de compatibilidad. De forma predeterminada, usa `1702` cuando el modo es `PowerBI`; `1500` en caso contrario. Consulta @update-compatibility-level. +- `--compatibility-level ` (alias `--compat`) - nivel de compatibilidad. Defaults to `1705` when the mode is `PowerBI`, `1500` otherwise. Consulta @update-compatibility-level. - `--name ` - nombre del modelo o de la base de datos (predeterminado: el nombre del directorio). - `--serialization ` - `tmdl` (predeterminado), `bim` (alias `tmsl`), `Database.json`, `pbip`. - `--force` - reemplaza cualquier archivo o directorio existente en la ruta de destino. ```bash -te init ./new-model # TMDL, PowerBI mode, compat 1702 +te init ./new-model # TMDL, PowerBI mode, compat 1705 te init ./new-model --serialization bim # Single-file BIM model te init ./as-model --compatibility-mode AnalysisServices # AS model, compat 1500 te init ./existing-dir --force # Overwrite non-empty directory ``` +`te init` is idempotent: re-running it over a model it already created prints `Already exists` and exits `0` (under `--output-format json`: `{"created": false, "reason": "already_exists", ...}`). Real conflicts still exit `1`; `--force` re-creates from scratch. + ## Edición del modelo +Mutating commands (`set`, `add`, `remove`, `move`, and also `script`, `macro run`, `bpa run --fix`) are **dry runs by default**: without `--save` the command reports what would change and discards it (`Dry run - nothing saved. Add --save to persist.`). Add `--save` to persist to the source, or `--save-to ` to write elsewhere. On `set`, `add`, `remove`, `move`, `script`, and `bpa run`, the change output renders as a unified diff per changed object; switch it with `--stat` or `--name-only` (mutually exclusive with `--diff`, the default), or set a standing default with `te config set mutationOutput diff|stat|name-only|none`. JSON output always carries the full changes array. A save is refused when the mutation introduces new DAX validation errors, unless `--force`. + ### set -Establece una propiedad en un objeto del modelo. Acepta un argumento ``. +Set properties on a model object, format its expressions, or sync a table with its source schema. Acepta un argumento ``. `te set` acepta: -- `-q ` - nombre de la propiedad (por ejemplo, `expression`, `formatString`, `description`, `isHidden`). **Se puede repetir** — empareja cada `-q` con el `-i` siguiente para establecer varias propiedades en un solo comando. -- `-i ` - valor (usa `-` para leer desde stdin). Un `-i` por cada `-q`. +- `-p, --property ` - property assignment (e.g., `-p expression="SUM(Sales[Amt])"`, `-p isHidden=true`). **Repeatable** - everything after the first `=` is the value. Bare positional assignments work too: `te set Sales/Amount formatString="#,0" --save`. Property names are case-insensitive, accept both spellings where the grid label and the TOM name differ (`Hidden` and `IsHidden`), and accept dotted paths and indexers: `-p KPI.StatusGraphic=...`, `-p "Annotations[Tabular Editor]=..."`, `-p "TranslatedNames[fr-FR]=..."`. Run `te get --properties` to list every name an object accepts - see [get](#get). A partition's expression is `-p Expression` whatever kind of partition it is (`MExpression` and `Query` still work). Use `-p Name=-` to read the value from stdin (one assignment per stream; a piped value is taken verbatim, so piping the text `null` stores the word `null`). `-p Name=` assigns an empty string. +- `--unset ` - clear a property; repeatable (`--unset description --unset displayFolder`). `-p Name=null` is the shorthand. Works on every property that can hold nothing - text properties included - and on object-valued ones (`SortByColumn`, `RefreshPolicy`); `-p "Annotations[key]=null"` removes an annotation. Numbers, booleans, and fixed-choice properties cannot be cleared and are refused. +- `--format ` - format that expression property (repeatable; DAX or M is detected from the property). The formatter tweaks `--long` (fewer line breaks) and `--no-space-after-function` require `--format` on a DAX property. `--semicolons` is refused together with `--format`: an expression stored in a model is always comma-separated, so the semicolon dialect can never parse it - format semicolon-authored DAX with [`te util format-dax --semicolons`](#util-format-dax) instead. +- `--update-schema` - sync a table's columns with its source schema: adds new source columns with detected types, retypes drifted ones, and preserves everything else about every existing column (name, description, format string, display folder, sort-by column, visibility, annotations, translations, perspective membership). Removed source columns only warn unless `--drop-removed-columns` (destructive). A renamed source column looks like remove + add - remap it first with `-p SourceColumn=`. Refused on calculated tables and calculation groups; cannot combine with `-p` or `--format`. With no connection flags, the connection is read from the model itself - the data source the table's partitions are bound to, the connection written into the table's own query, or the model's single usable data source - and the source table from the partition's binding, falling back to the model table's name; `--data-source ` chooses when the model has several usable sources. Naming a connection explicitly with the schema-detection flags shared with `te add` (`--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`) always wins. When no source can be worked out, or the source table cannot be found, the error says which case you are in and names the table it looked for. - `-t, --type ` - desambiguación cuando la misma ruta podría referirse a varios tipos de objeto (`medida`, `Column`, `CalculatedColumn`, `Hierarchy`, `Calendar`, `partición`, `CalculationItem`). - `--save` / `--save-to ` - guarda los cambios. +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the note above). - `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). - `--force` - guarda incluso si la modificación introduce errores de validación de DAX. ```bash -te set Sales/Amount -q expression -i "SUM(Sales[Amt])" --save -te set "'Net Sales'[Sales Amount]" -q formatString -i "#,0" --save # DAX form with spaced names -te set Sales -q isHidden -i true --save -te set Sales/Amount -q formatString -i "#,0" -q description -i "Net sales" --save # Multi-property +te set Sales/Amount -p expression="SUM(Sales[Amt])" --save +te set "'Net Sales'[Sales Amount]" -p formatString="#,0" --save # DAX form with spaced names +te set Sales -p isHidden=true --save +te set Sales/Amount -p formatString="#,0" -p description="Net sales" --save # Multiple properties, one atomic change +te set "Sales/Total Sales" --unset description --save # Clear a property (same as -p description=null) +te set Sales/Amount --format Expression --save # Format one expression property +te set Sales --update-schema --save # Sync columns with the source schema (connection inferred from the model) +te set Sales --update-schema --data-source "Sales DW" --save # Pick the data source when the model has several +``` + +#### Incremental refresh policies + +Refresh policies are plain properties on a table's `RefreshPolicy` sub-object, so `te get` and `te set` manage them like anything else. Property names: `Mode`, `RollingWindowPeriods`/`RollingWindowGranularity`, `IncrementalPeriods`/`IncrementalGranularity`, `IncrementalPeriodsOffset`, `SourceExpression`, `PollingExpression` (file input: `-p SourceExpression=- < src.m`). + +```bash +te get Sales/RefreshPolicy # Inspect a table's refresh policy +te set Sales/RefreshPolicy -p RollingWindowPeriods=5 -p RollingWindowGranularity=Day -p IncrementalPeriods=1 -p IncrementalGranularity=Day --save +te set Sales -p RefreshPolicy=null --save # Remove the policy ``` +The policy is created implicitly on the first `set`. Removing one leaves policy-generated partitions in place, and is refused when they are the table's only partitions. To apply a policy on the server, see [`te refresh --apply-refresh-policy`](#refresh); to apply it metadata-only, use `te script --inline "Model.Tables[\"Sales\"].ApplyRefreshPolicy();" --save`. + ### add -Agrega un objeto al modelo. Especifica un `` para el nuevo objeto (el elemento padre ya debe existir; el segmento final es el nuevo nombre) y el tipo mediante `-t` / `--type`. Las relaciones mantienen su sintaxis abreviada (`Sales[Key]->Dim[Key]`). +Agrega un objeto al modelo. Especifica un `` para el nuevo objeto (el elemento padre ya debe existir; el segmento final es el nuevo nombre) y el tipo mediante `-t` / `--type`. Las relaciones mantienen su sintaxis abreviada (`Sales[Key]->Dim[Key]`). Container-form paths are valid add targets (`Sales/Measures/Margin`, `Sales/Partitions/Q1`, `Sales/Calendars/Fiscal`, `Roles/Admin/TablePermissions/Sales`, `Roles/Admin/Members/user@x.com`) - any path the CLI prints can be fed back to `te add`. `te add` acepta: -- `-t, --type `: tipo de objeto. Valores comunes: `Table`, `Measure`, `Column`, `CalculatedColumn`, `Hierarchy`, `Role`, `Perspective`, `Culture`, `CalculationGroup`, `CalculationItem`. Se admite el autocompletado con la tecla Tab; la lista completa se puede obtener ejecutando `te add --help`. -- `-i ` - expresión o valor que se asignará al nuevo objeto (DAX para medidas/columnas calculadas, M para particiones, etc.). Combínalo con `-q` para establecer propiedades adicionales en el nuevo objeto en el mismo comando. -- `-q ` - propiedad adicional que se establecerá en el nuevo objeto (se puede repetir; se combina con `-i`). -- `--file ` - lee la expresión de `-i` desde un archivo en lugar de incluirla directamente en el comando. -- `--mode ` - modo de almacenamiento para tablas nuevas: `import` (predeterminado), `directQuery`, `dual`, `directLake`. +- `-t, --type `: tipo de objeto. Common values: `Table`, `CalculatedTable`, `CalcGroup`, `Measure`, `CalculatedColumn`, `DataColumn`, `Hierarchy`, `Level`, `Calendar`, `CalcItem`, `KPI`, `Partition`, `Expression`, `Function`, `Perspective`, `Culture`, `Role`, `TablePermission`, `Member`. Se admite el autocompletado con la tecla Tab; la lista completa se puede obtener ejecutando `te add --help`. +- `-p, --property ` - property assignment on the new object (repeatable). The expression goes in `-p Expression="..."`, or use `--file`, or `-p Expression=-` to read it from stdin. +- `--file ` - read the expression from a file instead of inline. +- `--mode ` - storage mode for new tables: `import` (default), `directquery` (alias `dq`), `dual`, `directlake` (alias `dl`). - `--if-not-exists` - sale con código `0` sin error si el objeto ya existe. Úsalo en canalizaciones de CI/CD idempotentes. - `--save` / `--save-to ` - guarda los cambios. -- `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). -- `--source-type ` - tipo de origen inicial de la partición en una tabla nueva: `m`, `query` o `calculated`. Anula la detección heurística. `calculated` solo es válido con `-t CalculatedTable`. +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--serialization ` - override the serialization when saving (`tmdl`, `bim` (alias `tmsl`), `database.json`, `pbip`). +- `--source-type ` - tipo de origen inicial de la partición en una tabla nueva: `m`, `query` o `calculated`. Anula la detección heurística. `query` builds a legacy SQL `SELECT` partition bound to the model's provider data source and is refused with lakehouse/warehouse sources or when no provider source exists; `calculated` is only valid with `-t CalculatedTable`. +- `--partition-expression ` - raw M expression for the new table's initial partition. - `--force` - guarda incluso si la modificación introduce errores de validación de DAX. +Adding a single data column to an existing table takes `-t DataColumn` with both `SourceColumn` and `DataType` required (refused on calculated tables and calculation groups): + ```bash -te add Sales/Revenue -t Measure -i "SUM(Sales[Amount])" --save -te add Sales -t Table --save -te add "Sales[ProdKey]->Product[ProdKey]" --save # Relationship shorthand -te add Sales/MarketingFlag -t CalculatedColumn -i "Sales[Amount] > 1000" --if-not-exists --save -te add Perspectives/Default/Sales --save # Include Sales in the Default perspective -te add Roles/Reader -t Role --save # New role at the model level +te add Sales/Quantity -t DataColumn -p SourceColumn=Qty -p DataType=Int64 --save ``` -En las tablas vinculadas a datos, `te add` también admite la detección del esquema desde orígenes SQL, Lakehouse o Warehouse. Consulta `te add --help` para ver `--source`, `--endpoint`, `--source-table`, `--columns`, etc. +Tables can be created in one shot from the model's **own** data source - no connection flags needed. The CLI reads the connection off the model's data source, discovers the source table's columns and their types, and creates the table with a partition already bound to that source. Over a legacy (provider) data source the partition is a legacy SQL query holding the generated `SELECT`, matching what the desktop **Import Tables** wizard writes; pass `--source-type m` for a Power Query (M) partition instead. Over a structured (Power Query) data source the partition is always M. Refusals are clean and create nothing: several usable data sources and no `--data-source`, no data source the CLI can read (SQL Server, Azure SQL, and Fabric SQL sources are covered), a source whose password the model does not store, or a source table the connection cannot find - the error names the table it looked for and where that name came from. + +- `--source-table ` - create the table from this source table. +- `--query "SELECT ..."` - create the table from a query instead: the query is described against the connection without being run, the new table gets exactly the columns it returns, and the query is kept as the partition's content. Works with an inferred connection and with one named explicitly. `--source-type query` places the SQL in a legacy Query partition bound to the model's legacy data source. Refused together with `--mode directlake` (a Direct Lake partition holds no query), with `--columns`, and with an expression of its own (`-p Expression=` or `--file`). +- `--data-source ""` - disambiguate when the model has several data sources. + +Schema detection against an explicit source also works, and always wins over inference: `--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`, or a manual column spec `--columns "Id:Int64,Name:String"`. `te add "
" -t Table` with no source at all still creates an empty table to fill in yourself. + +```bash +te add Sales/Revenue -t Measure -p Expression="SUM(Sales[Amount])" --save +te add Sales/Quantity -t DataColumn -p SourceColumn=Qty -p DataType=Int64 --save +te add "Sales[ProdKey]->Product[ProdKey]" --save # Relationship shorthand +te add Sales/MarketingFlag -t CalculatedColumn -p Expression="Sales[Amount] > 1000" --if-not-exists --save +te add Perspectives/Default/Sales --save # Include Sales in the Default perspective +te add Roles/Reader -t Role --save # New role at the model level +te add Inventory -t Table --source-table dbo.Inventory --save # Table from the model's own data source +te add TopCustomers -t Table --query "SELECT TOP 100 * FROM dbo.Customers" --save +``` ### remove @@ -296,6 +324,7 @@ Elimina un objeto. De forma predeterminada, comprueba las dependencias para evit - `--if-exists` - sale con código `0` sin error si el objeto no existe. Úsalo en canalizaciones de CI/CD idempotentes. - `--dry-run` - muestra una vista previa de la eliminación sin aplicarla. - `--save` / `--save-to ` - guarda el cambio. +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). - `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). ```bash @@ -313,44 +342,17 @@ Mueve o renombra un objeto del modelo. Tanto el origen como el destino son argum - `-t, --type ` - desambigua cuando la ruta de origen coincide con varios tipos de objeto (p. ej., una columna y una jerarquía con el mismo nombre). - `--save` / `--save-to ` - guarda el cambio. +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). - `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). - `--force` - guarda incluso si la mutación introduce errores de validación de DAX. +Renaming an object whose name is not yours to set is refused with a non-zero exit code rather than reported as `No changes.` - a relationship (its name always describes the columns it joins), a measure's KPI, a role's table permission. + ```bash te move Sales/Revenue Finance/Revenue --save # Move measure to another table te move Sales/Revenue Sales/TotalRevenue --save # Rename measure te move Sales/Date Sales/CalendarDate -t Hierarchy --save # Disambiguate hierarchy from column -``` - -### replace - -Busca y reemplaza texto en los objetos del modelo. Simulación de forma predeterminada; añade `--save` para aplicar. - -`te replace` acepta: - -- `--in ` — ámbito: `names`, `expressions`, `descriptions`, `displayFolders`, `formatStrings`, `annotations`, `all` (predeterminado: `all`). -- `--regex` — trata el patrón de búsqueda como una expresión regular. -- `--case-sensitive` — habilita la coincidencia que distingue entre mayúsculas y minúsculas. -- `--dry-run` - previsualiza los cambios sin aplicarlos. Comportamiento predeterminado. -- `--save` - guarda la modificación en la ubicación de origen. Incompatible con `--revert` y `--stage`. -- `--save-to ` - guarda en una ruta diferente (implica `--save`). -- `--serialization ` - serialización del modelo: `tmdl`, `bim` (alias `tmsl`), `database.json`. -- `--force` - guarda incluso si la sustitución introduce errores de validación de DAX. - -`--in expressions` recorre todas las propiedades que contienen expresiones: - -- **Medida**: `Expression`, `DetailRowsExpression` -- **KPI**: `TargetExpression`, `StatusExpression`, `TrendExpression` -- **Partición**: M de origen y M de sondeo -- **Permiso de tabla**: `FilterExpression` -- **Grupo de cálculo**: expresiones de selección -- **Columna calculada**: expresión DAX - -Al añadir al modelo nuevas propiedades basadas en expresiones, se muestran automáticamente. - -```bash -te replace "OldTable" "NewTable" --in expressions --save -te replace "SUM" "SUMX" --regex --in expressions --save +te move "Sales/Partitions/Old" "Sales/Partitions/New" --save # Container-form paths work too ``` ## Inspección @@ -361,7 +363,7 @@ Enumera objetos con una navegación similar a la del sistema de archivos. Acepta `te list` acepta: -- `--type ` - limita a un tipo de objeto (`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`). Sin ``, esto equivale a escribir la palabra clave del contenedor correspondiente. +- `--type ` - narrow to one object kind (`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`, `calculationitem`, `kpi`, `set`, `function`). Sin ``, esto equivale a escribir la palabra clave del contenedor correspondiente. - `--paths-only` - emite una ruta de objeto por línea, ideal para pasarlo a `xargs`, `te get` o `te set`. - `--no-multiline` - contrae las celdas multilínea (normalmente expresiones DAX o M) a una sola línea y las trunca para que las filas sigan siendo fáciles de recorrer en tablas anchas. Solo afecta a la salida de texto; la salida JSON/CSV/TMSL no se ve afectada. - `--output-format tmsl` (alias `bim`) - genera los objetos coincidentes como un script TMSL/BIM. Útil para `te list Tables --output-format bim > tables.json`. `--output-format tmdl` no es compatible con `ls` (TMDL solo admite un único objeto; usa `te get`). @@ -375,6 +377,10 @@ te list 'Sa*' # Tables whose name starts with Sa ( te list '*/Amount' # An Amount column/measure across every table te list 'Roles/Re*/Members' # Members of every role matching Re* te list Sales/Geography/Levels # All levels of the Geography hierarchy +te list KPIs # All KPIs (with parent measure) +te list Sales/KPIs # KPIs on measures of Sales +te list Sets # Calculated sets +te list Functions # DAX user-defined functions te list "'Net Sales'/'Sales Amount'" # Quote names containing spaces te list Measures --paths-only # One Table/Measure per line for piping te list --type measure # Same as `te list Measures` @@ -382,52 +388,73 @@ te list Measures --no-multiline # Wide table with column dividers, s te list Tables --output-format bim > tables.json # All tables emitted as TMSL/BIM ``` +In JSON output, every listed object leads with its `objectPath` - a canonical path that resolves with `te get`. + ### get -Obtiene las propiedades de un objeto del modelo. Acepta un ``. +Get properties of a model object, filter and list sets of objects, and analyze dependencies - `get` is the CLI's one read pipeline (`te list` and `te deps` remain as shortcuts). Takes a ``; omit it to list the model (same as `te list`), or pass `.` for the model root. A wildcard path (`te get "Sa*"`) or a container path (`te get Sales/Measures`) lists every match without needing `--ls`; `-p`, `--deps`, and `--properties` need exactly one object, so on a wildcard path they say so and suggest dropping the flag. `te get` acepta: -- `-q, --query ` - obtiene una única propiedad (por ejemplo, `expression`, `formatString`). +- `-p, --property ` - project a single property (e.g. `expression`, `formatString`). +- `--where ` - filter the result set; repeatable (AND), case-insensitive. A value with no `*` is an exact match; `*` is a wildcard, so a contains-search is `--where Name=*margin*`. With no path, `--where` filters the model's **top-level tables** - pass a container to search other kinds (`te get Measures --where Name=*margin*`). An empty result names what was searched and how the pattern was matched, and offers commands that widen the search. +- `--properties` - list the property names `-p` accepts on the resolved object, with each property's type, whether it can be written, what it holds, and - where a property takes a fixed set of values - the values it accepts. Both spellings are shown where they differ (`Hidden` / `IsHidden`), and annotations and translations appear in the bracket form they have to be written in. Internal bookkeeping properties are left out; `--all` adds them. Text and JSON output only; needs a single-object path and cannot combine with `-p`, `--ls`, `--where`, `--deps`, or `--unused`. +- `--ls` - compact table layout (the same rendering as `te list`). +- `--deps [upstream|downstream]` - dependency analysis (default: both directions); `--deep` for the recursive tree, `--max-depth ` (default `10`). +- `--unused` / `--hidden` - surface unused objects, as on `te deps`. +- `--paths-only` - one canonical object path per line, for piping. +- `--no-multiline` - collapse multi-line cells (with `--ls`/`--where`). Solo para la salida de texto. - `-t, --type ` - desambigua cuando la ruta coincide con varios elementos secundarios de una tabla (p. ej., una columna y una jerarquía con el mismo nombre). Valores: `Measure`, `Column`, `CalculatedColumn`, `Hierarchy`, `Calendar`, `Partition`, `CalculationItem`. - `--output-format tmsl` (alias `bim`) - genera el objeto resuelto como JSON TMSL/BIM. - `--output-format tmdl` - genera el objeto resuelto como TMDL (solo objetos con nombre). `te get` y `te list` comparten un único catálogo de descriptores, de modo que todas las propiedades se muestran igual en todos los formatos: la tabla de texto, JSON y CSV ven el mismo conjunto, y al agregar una propiedad nueva al modelo, esta queda expuesta en todos ellos. +The `Settable:` line under a `te get ` result lists the properties `te set` accepts on that object (`SortByColumn` among them) and ends with a pointer to `--properties` for the full list; an unknown property name on `te get -p` or `te set -p` points at the same listing. `te get -p` syntax-highlights every expression-valued property, detail rows and format string expressions included. In JSON output, a single object leads with `objectPath` (the canonical path, resolvable as-is by `te get`, `te set`, or `te remove`), followed by `type` and `properties`; a listing that matches nothing prints an empty array. + ```bash -te get Sales/Amount -q expression # Print DAX +te get Sales/Amount -p expression # Print DAX te get "'Sales'[Amount]" # DAX form: same as Sales/Amount te get "[Total Sales]" # Lone-bracket: model-wide measure-or-column -te get "'Net Sales'[Sales Amount]" -q expression # DAX form with spaced names -te get "Sales/Revenue/KPI" # KPI sub-object of a measure -te get Sales --output-format tmdl # Emit the table as TMDL -te get Sales --output-format bim # Emit the table as TMSL/BIM -te get Model -q description +te get "'Net Sales'[Sales Amount]" -p expression # DAX form with spaced names +te get Sales/Revenue/KPI # KPI sub-object of a measure +te get Sales --output-format tmdl # Emit the table as TMDL +te get Sales --output-format bim # Emit the table as TMSL/BIM +te get . -p description # Model-level property +te get "Sa*" # Every table matching the wildcard, no --ls needed +te get Measures --where IsHidden=true --ls # Filter + list rendering +te get Measures --where Name=*margin* # Contains-search across all measures +te get Sales/Amount --properties # Property names -p accepts, with types and allowed values +te get Sales/Revenue --deps downstream --deep # Recursive dependents ``` ### find -Busca texto en todos los objetos del modelo. +Search string properties for text and report each match site. The pattern is a **literal, case-insensitive substring** by default - `te find "Gross*"` looks for a literal asterisk - so pass `--regex` for pattern matching. Use `te get --where Name=*Gross*` when you want to filter objects by a property value rather than search text. An empty result names the scope that was searched and the matching mode used, and offers commands that widen the search; a `--regex` pattern that is not a valid regular expression is refused with an error naming the flag and the pattern. `te find` acepta: -- `--in ` - igual que en `te replace` (valor predeterminado: `all`). +- `--in ` — ámbito: `names`, `expressions`, `descriptions`, `displayFolders`, `formatStrings`, `annotations`, `all` (predeterminado: `all`). - `--regex`, `--case-sensitive`, `--paths-only`. -- `--no-multiline` - contrae el contexto de coincidencia multilínea a una sola línea. Solo para la salida de texto. +- `--no-multiline` - contrae el contexto de coincidencia multilínea a una sola línea. Solo salida de texto. `--in expressions` abarca todos los `IExpressionObject` del modelo, incluidas las `TargetExpression` / `StatusExpression` / `TrendExpression` de los KPI, la `DetailRowsExpression` de la medida, el M de origen/sondeo de la partición, la `FilterExpression` de los permisos de tabla y las expresiones `MultipleOrEmptySelection` / `NoSelection` del grupo de cálculo; así, un literal como `123` definido en el objetivo de un KPI aparece igual que el cuerpo de una medida. ```bash te find "CALCULATE" --in expressions te find "Revenue" --in names -te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -q expression +te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -p expression +te find "Gross.*Margin" --in names --regex ``` +Under `--output-format json`, `te find` reports the scope it searched and the matching mode it used alongside the matches. + ### diff Compara dos modelos para detectar diferencias estructurales. Devuelve los siguientes códigos de salida: `0` = idéntico, `1` = diferencias encontradas, `2` = error. +Changes are reported the same way the mutating commands report theirs: one consolidated entry per changed object, with `-`/`+` lines per property in text output. In JSON, the `changes` array entries carry `objectPath` (the canonical path, pipeable into `te get`), `objectType` (the same closed vocabulary as the findings JSON - `KPI`, `Member`, ...), `changeKind` (`created`, `deleted`, `modified`, or `moved` - a renamed object that carries a lineage tag is a single `moved` entry with `movedFromObjectPath`), and a `properties` array of `{property, before, after}` with PascalCase property names. An object that exists in only one of the two models is listed together with its contents - a new role's row-level security filters, a new table's columns, measures, and partitions, a new hierarchy's levels - each as its own entry, and the summary counts include them. + ```bash te diff ./model-v1 ./model-v2 te diff old.bim new.bim @@ -441,7 +468,7 @@ te diff ./a ./b; switch ($LASTEXITCODE) { 0 { 'same' } 1 { 'different' } default ### deps -Analiza las dependencias ascendentes y descendentes de un objeto, o detecta objetos sin usar en todo el modelo. La forma de un solo objeto acepta un ``. +Analiza las dependencias ascendentes y descendentes de un objeto, o detecta objetos sin usar en todo el modelo. A shortcut for `te get --deps` / `te get --unused`. La forma de un solo objeto acepta un ``. `te deps` admite: @@ -453,6 +480,8 @@ Analiza las dependencias ascendentes y descendentes de un objeto, o detecta obje - `--unused` - enumera las medidas, las columnas calculadas y **todas las columnas de datos** a las que no hace referencia ninguna expresión DAX y que no se usan en ninguna relación, nivel de jerarquía, ordenación por columna, variación, base de AlternateOf ni rol de tiempo de calendario. Cada resultado muestra `(hidden)` en modo de texto y un campo `isHidden` en JSON. - `--hidden` - limita `--unused` a solo los objetos ocultos. Los objetos ocultos y sin usar son los candidatos más seguros para eliminar, porque ningún elemento visible para el usuario depende de ellos. +In JSON output, every entry - and every `upstream`, `downstream`, and `--deep` tree node - is named the way the rest of the CLI names objects: `objectPath` (canonical path, pipeable into `te get`), `object` (bare name), and `objectType`. + ```bash te deps Sales/Revenue # Upstream + downstream for one object te deps "'Sales'[Revenue]" # DAX form is accepted everywhere a is @@ -469,20 +498,24 @@ Valida las expresiones del modelo, la integridad del esquema y los errores de TO `te validate` admite: -- `--ci ` - emite anotaciones de CI en stderr: `vsts` o `github`. +- `--ci ` - emit CI annotations to stderr: `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`). `none` or an empty value means no annotations; any other value is rejected before the command runs. - `--trx ` - escribe los resultados en un archivo `.trx` de VSTEST. - `--errors-only` - forma abreviada de `--no-warnings --no-antipatterns`: muestra solo errores. - `--no-warnings` - oculta las advertencias del analizador semántico. - `--no-antipatterns` - oculta las sugerencias de antipatrones (recomendaciones de buenas prácticas de DAX). - `--server-only` - muestra solo los errores notificados por el servidor conectado; omite el análisis semántico local. -- `--no-multiline` - contrae el contenido de varias líneas de las celdas (mensajes de error, expresiones) en una sola línea. Solo salida de texto. +- `--no-multiline` - contrae el contenido de varias líneas de las celdas (mensajes de error, expresiones) en una sola línea. Solo para la salida de texto. ```bash -te validate ./model +te validate -m ./model te validate --ci github --trx results.trx te validate --errors-only # Hide warnings and anti-pattern hints ``` +Every finding carries a stable code, shown in the **Code** column of the Errors, Warnings, and Anti-patterns tables as well as in JSON, `--ci` annotations, and `--trx`. Three codes are worth knowing when a hand-written model is involved: `TE0012` (a column and a measure, or two columns, share a name within one table) and `TE0013` (a measure name is repeated across tables) are errors - Analysis Services refuses to load such a model, and `te save-as` refuses to write one unless `--force` or `--skip-validation` is passed; `TE0014` is a warning that a TMDL folder has no `database.tmdl`, so the compatibility level in effect is a substitute for the one the model declared. The folder still loads and `te validate` still exits `0` for `TE0014`; hide it like any other warning with `--no-warnings` or `--errors-only`. + +Under `--output-format json`, `te validate` emits the shared findings JSON document (`summary` plus a flat `findings[]` array) shared with `te bpa run`, `te test run`, and `te query` - see @te-cli-findings. + > [!NOTE] > `te validate` no admite `--output-format csv`: CSV se rechaza desde el principio con un error claro, en lugar de producir un resultado parcial. Usa `text` o `json` para la salida de validación. @@ -492,21 +525,20 @@ Ejecuta reglas de Best Practice Analyzer contra un modelo. `te bpa run` admite: -- `` - argumento posicional: ruta al modelo (alternativa a la opción global `--model`). - `-r, --rules ` - ruta(s) o URL(s) a archivo(s) de reglas BPA en formato JSON. Se puede repetir. Sustituye la capa de reglas de usuario en esta invocación: consulta [Orígenes y resolución de reglas](#rule-sources-and-resolution) más abajo. - `--no-model-rules` - excluye las reglas de BPA incrustadas en las anotaciones del modelo. - `--no-defaults` - excluye las reglas predeterminadas de BPA integradas. - `--vpax ` - carga estadísticas del Analizador VertiPaq desde un archivo `.vpax` para habilitar reglas compatibles con VPA. -- `--vpa-rules` - incluir reglas integradas compatibles con VPA (requiere `--vpax` o un modelo preanotado). - `--allow-external-rules` - permitir obtener archivos de reglas de BPA desde direcciones URL incrustadas en las anotaciones del modelo. - `--rule ` - ejecutar solo regla(s) específicas por ID. Se puede repetir. - `--path ` - limitar el análisis a las tablas que contengan los objetos coincidentes. Acepta nombres literales, palabras clave de contenedor y comodines (por ejemplo, `'Sales'`, `'Sa*'`, `'Sales/Medidas'`, `'*/Amount'`). - `--fix` - aplicar expresiones de corrección para corregir automáticamente las infracciones cuando sea posible. - `--save` - volver a guardar el modelo en el origen después de aplicar las correcciones. - `--save-to ` - guardar el modelo en una ruta diferente después de aplicar las correcciones. +- `--diff` / `--stat` / `--name-only` - change-output rendering for the fix pass (see the [Model editing](#model-editing) note). - `--serialization ` - serialización del modelo: `tmdl`, `bim` (alias `tmsl`), `database.json`. - `--fail-on ` - umbral de fallo: `error` (predeterminado) o `warning`. Sale con el código `1` cuando las infracciones alcanzan el umbral. Los errores al cargar o evaluar reglas (expresiones no válidas, archivos de reglas ilegibles) también provocan un código de salida distinto de cero, independientemente de `--fail-on`. -- `--ci ` - emitir comandos de registro de CI a stderr: `vsts` (Azure DevOps), `github` (GitHub Actions). +- `--ci ` - emit CI logging commands to stderr: `vsts` (Azure DevOps; aliases `azdo`, `azure-devops`), `github` (GitHub Actions; alias `gh`). Unrecognised values are rejected up front. - `--trx ` - escribir los resultados como un archivo `.trx` de VSTEST en la PATH especificada. - `--no-multiline` - contraer el contenido de varias líneas de las celdas de la tabla de infracciones en una sola línea. Solo para la salida de texto. @@ -519,6 +551,8 @@ te bpa run --path 'Sa*' # Wildcard - every table starting with Sa te bpa run --path Sales/Measures # Path filter applied to the matched tables ``` +Under `--output-format json`, `te bpa run` emits the shared findings JSON document (see @te-cli-findings); with `--fix`, the JSON is a single document that also includes the `fix` change set. + #### Orígenes de las reglas y su resolución Cada invocación de `te bpa run` reúne reglas de tres capas independientes: @@ -530,12 +564,14 @@ Cada invocación de `te bpa run` reúne reglas de tres capas independientes: 2. **Reglas integradas predeterminadas** - se cargan a menos que se pase `--no-defaults` o que [`bpa.builtInRules`](xref:te-cli-config#built-in-bpa-rules) sea `false` en la configuración. Se omiten las reglas integradas individuales incluidas en `bpa.disabledBuiltInRuleIds`. 3. **Reglas integradas en el modelo** - reglas en la anotación `BestPracticeAnalyzer_Rules` del modelo; se cargan a menos que se pase `--no-model-rules`. Se omiten las anotaciones de URL externas, a menos que también pases `--allow-external-rules`. -Se eliminan los ID de reglas duplicados (las reglas del usuario prevalecen sobre las integradas). Después se eliminan los ID de reglas de la anotación `BestPracticeAnalyzer_IgnoreRules` del modelo. +The built-in defaults are exactly Tabular Editor 3's documented [built-in rule set](xref:built-in-bpa-rules) (the `TE3_BUILT_IN_*` IDs), so `te bpa run` and TE3 Desktop agree on what the built-ins flag. The six VertiPaq Analyzer rules (`VPA_*`) that earlier previews presented as built-in are not part of that set, and the `--vpa-rules` flag no longer exists; if a pipeline gates on one of them, copy its definition into your own rules file and point at it with `--rules`, `bpa.rules`, or `TE_BPA_RULES`. `--vpax` is unchanged and still supplies the statistics a VPA-aware rule of your own reads. C# scripts (`te script`, `te macro run`) see the same rule set through `Bpa.Rules` and `Bpa.Analyze()`. + +Each rule ID is evaluated once. When the same ID appears in more than one layer, an explicit `--rules` file's definition wins in `te bpa run`, while the built-in definition wins in the deploy/save gates. Después se eliminan los ID de reglas de la anotación `BestPracticeAnalyzer_IgnoreRules` del modelo. La línea `Rules loaded:` de la salida atribuye cada capa que contribuye, por ejemplo: ``` -Rules loaded: 41 from 1 file(s) from bpa.rules config + built-in defaults + model annotations +Rules loaded: 38 from 1 file(s) from bpa.rules config + built-in defaults + model annotations ``` ### bpa rules @@ -544,17 +580,17 @@ Administra colecciones de reglas de BPA: enumera, inspecciona, inicializa y acti Subcomandos: -| Subcomando | Propósito | -| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `add [model]` | Agrega una nueva regla de BPA. | -| [`disable`](#bpa-rules-disable) | Desactiva una regla de BPA integrada para el usuario actual. | -| [`enable`](#bpa-rules-enable) | Vuelve a activar una regla de BPA integrada que se había desactivado antes. | -| `ignore [model]` | Agrega una regla a la lista de ignorados del modelo. | -| [`init`](#bpa-rules-init) | Crea un archivo vacío de reglas de BPA en la ruta PATH resuelta. | -| [`list`](#bpa-rules-list) (alias `ls`) | Enumera las reglas de BPA de todos los orígenes con su estado. | -| `remove [model]` (alias `rm`) | Elimina una regla de BPA. | -| `set [model]` | Actualiza las propiedades de una regla del BPA. | -| `unignore [model]` | Elimina una regla de la lista de reglas ignoradas del modelo. | +| Subcomando | Propósito | +| --------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `add ` | Agrega una nueva regla de BPA. | +| [`disable`](#bpa-rules-disable) | Desactiva una regla de BPA integrada para el usuario actual. | +| [`enable`](#bpa-rules-enable) | Vuelve a activar una regla de BPA integrada que se había desactivado antes. | +| `ignore ` | Agrega una regla a la lista de ignorados del modelo. | +| [`init`](#bpa-rules-init) | Crea un archivo vacío de reglas de BPA en la ruta PATH resuelta. | +| [`list`](#bpa-rules-list) (alias `ls`) | Enumera las reglas de BPA de todos los orígenes con su estado. | +| `remove ` (alias `rm`) | Elimina una regla de BPA. | +| `set ` | Actualiza las propiedades de una regla del BPA. | +| `unignore ` | Elimina una regla de la lista de reglas ignoradas del modelo. | Todos los subcomandos de `te bpa rules` aceptan: @@ -618,7 +654,7 @@ Modifica el archivo de reglas (`add`, `set`, `remove` (alias `rm`)) o la lista d - `--severity <1|2|3>` - `1` (información), `2` (advertencia, valor predeterminado), `3` (error). - `--description ` - descripción orientada al usuario que se muestra cuando se activa la regla. - `--fix-expression ` - expresión de Dynamic LINQ que utiliza `te bpa run --fix` para corregir automáticamente. -- `te bpa rules set ` - actualiza las propiedades de una regla existente. Utiliza pares `-q -i ` (repetibles). Nombres de propiedades: `name`, `expression`, `scope`, `category`, `severity`, `description`, `fixExpression`. +- `te bpa rules set ` - actualiza las propiedades de una regla existente. Uses `-p, --property ` (repeatable; `-` reads the value from stdin). Nombres de propiedades: `name`, `expression`, `scope`, `category`, `severity`, `description`, `fixExpression`. - `te bpa rules remove ` - elimina una regla. - `te bpa rules ignore ` - añade un ID de regla a la anotación `BestPracticeAnalyzer_IgnoreRules` del modelo. - `te bpa rules unignore ` - elimina un ID de regla de la lista de reglas ignoradas del modelo. @@ -633,7 +669,7 @@ te bpa rules add MEASURE_NEEDS_DESCRIPTION \ --category Metadata # Update severity on an existing rule -te bpa rules set MEASURE_NEEDS_DESCRIPTION -q severity -i 3 +te bpa rules set MEASURE_NEEDS_DESCRIPTION -p severity=3 # Remove the rule te bpa rules remove MEASURE_NEEDS_DESCRIPTION @@ -681,27 +717,15 @@ te vertipaq --export stats.vpax te vertipaq --import stats.vpax # Analyze offline ``` -### format +### Formatting expressions -Da formato a expresiones DAX o M/Power Query. +Expression formatting lives in three places, depending on what you are formatting: -`te format` acepta: +- **An expression in the model**: `te set --format --save` - see [set](#set). +- **A loose expression** (not in any model): `te util format-dax` / `te util format-m` - see [Utilities](#utilities). +- **A whole-model sweep**: `te script --inline "Model.AllMeasures.FormatDax();" --save`. -- `-e, --expression ` - da formato a una sola expresión en línea. -- `-p, --path ` - da formato a una medida o columna específica mediante su ruta. -- `-t, --type ` - desambigua cuando la ruta coincide con varios elementos secundarios de la tabla. -- `--lang ` - lenguaje de expresión: `dax` (predeterminado) o `m`/`pq` para Power Query. -- `--semicolons` - usa el punto y coma como separador de listas (configuración regional europea). -- `--long` - usa el formato largo (más saltos de línea). De forma predeterminada se usa el formato corto. -- `--no-space-after-function` - omite el espacio después de los nombres de función. -- `--save` / `--save-to` - guarda las expresiones formateadas. - -```bash -te format --save # Format all DAX -te format -p Sales/Amount --save # Single measure -te format -e "SUM ( Sales[Amount] )" # Inline -te format --lang m --save # Format M -``` +DAX in a model is always comma-separated, so `--semicolons` exists only on `te util format-dax`, for DAX you have typed with semicolons yourself. ## Ejecución @@ -712,7 +736,7 @@ Ejecuta una consulta DAX contra un modelo implementado. `te query` admite: - `` - argumento posicional: la consulta DAX que se va a ejecutar. Equivale a pasar `-q`. Utiliza la forma que se lea mejor; el `-q` explícito tiene prioridad si se proporcionan ambas. -- `-q, --query ` - consulta en línea (variante con opción con nombre del argumento posicional anterior). +- `-q, --query ` - consulta en línea (variante con opción con nombre del argumento posicional anterior). `-q -` reads the query from stdin; with input piped and no query given at all, stdin is read implicitly. - `--file ` - consulta desde un archivo. - `--limit ` - valor predeterminado: 100. - `-o, --output-file ` - escribe los resultados en un archivo (`.csv`, `.tsv`, `.json`, `.dax`). @@ -731,17 +755,25 @@ Ejecuta uno o varios C# Scripts contra un modelo semántico. La CLI usa el mismo `te script` admite: -- `-S, --script ` - archivo `.cs` / `.csx` (repetible). -- `-e, --expression ` - C# en línea (usa `-` para stdin). +- `--file ` - `.cs` / `.csx` file (repeatable). Bare positional `.cs`/`.csx` arguments are also accepted. +- `--inline ` - inline C# (repeatable; use `-` for stdin). +- `--validate` - compile the script(s) and report errors without executing them. Needs no model at all, so it works offline as a CI lint. - `--save` / `--save-to` / `--serialization`. -- `--dry-run` - compila el/los script(s) y genera un Report de errores sin ejecutarlos. +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--force` - save even if the mutation introduces DAX validation errors. + +Files and inline snippets run in the order they are written on the command line. ```bash -te script --script fix.cs --save -te script -e "Info(Model.Tables.Count)" -echo "Info(Model.Name);" | te script -e - +te script --file fix.cs --save +te script fix.cs cleanup.csx --save # Bare positionals, run in order +te script --inline "Info(Model.Tables.Count);" +echo "Info(Model.Name);" | te script --inline - +te script --file fix.cs --validate # Compile-only, no model needed ``` +A run in which any script calls `Error(...)` exits non-zero, reports `"success": false` in JSON, and closes by saying the run completed with errors; changes the script already made are still saved when `--save` is given. `Warning(...)` and `Info(...)` never fail a run. On Windows, the `DisableCSharpScripts` administrator policy refuses `te script` outright - see [Administrator policies](xref:te-cli-config#administrator-policies). + > [!IMPORTANT] > Dos detalles de comportamiento que conviene conocer si vas a portar un script antiguo: > @@ -772,7 +804,7 @@ echo "Info(Model.Name);" | te script -e - ### macro -Administra y ejecuta macros desde un archivo JSON de macros (normalmente `MacroActions.json`). El archivo de macros se determina en este orden: `--macros ` → la variable de entorno `TE_MACROS_PATH` → `macros` en la configuración de la CLI → `./MacroActions.json`. +Administra y ejecuta macros desde un archivo JSON de macros (normalmente `MacroActions.json`). El archivo de macros se determina en este orden: `--macros ` → la variable de entorno `TE_MACROS_PATH` → `macros` en la configuración de la CLI → `./MacroActions.json`. On Windows, the `DisableMacros` administrator policy refuses every `te macro` command - see [Administrator policies](xref:te-cli-config#administrator-policies). Subcomandos: @@ -791,12 +823,12 @@ Subcomandos: Modifica el archivo de macros (`add`, `set`, `remove` (alias `rm`)). Los tres operan sobre `--macros ` (o el archivo de macros resultante). - `te macro add ` - crea una nueva macro. Indica el cuerpo del script mediante `-e ""` (en línea) o `-s ` (archivo de script). Opcional: `--tooltip `, `--contexts ` (donde se aplica la macro; por ejemplo, `Table,Medida`), `--enabled true|false`. -- `te macro set `: actualiza las propiedades de la macro. Usa pares `-q -i ` (se pueden repetir). Nombres de las propiedades: `name`, `execute`, `enabled`, `tooltip`, `validContexts`. +- `te macro set `: actualiza las propiedades de la macro. Use `-p, --property ` (repeatable; `-` reads the value from stdin). Nombres de las propiedades: `name`, `execute`, `enabled`, `tooltip`, `validContexts`. - `te macro remove `: elimina una macro. ```bash te macro add MyMacro -e "Info(Selected.Measure.Name);" --tooltip "Print measure name" --contexts Measure -te macro set MyMacro -q tooltip -i "Updated tooltip" +te macro set MyMacro -p tooltip="Updated tooltip" te macro remove MyMacro ``` @@ -822,7 +854,8 @@ Ejecuta una macro. Las macros que emiten tablas mediante `dataTable.Output()` mu `te macro run` acepta: - `--on ` - establece el contexto de selección de la macro en un único objeto con nombre (una tabla, una medida, una columna, …). Equivale a hacer clic con el botón derecho en ese objeto en TE3 e invocar la macro desde el menú contextual. -- `--save` / `--save-to` - guarda cualquier cambio que realice la macro. +- `--save` / `--save-to` - guarda cualquier cambio que realice la macro. Like every mutating command, `te macro run` is a dry run without `--save`. +- `--serialization ` / `--force` - as on the other mutating commands. ```bash te macro run "Hide all measures" @@ -836,9 +869,13 @@ te macro run "Format DAX" --on "'Net Sales'[Sales Amount]" --save # DAX form w Implementa un modelo semántico en Power BI, Fabric, Azure Analysis Services o en SQL Server Analysis Services en local. +**Dry run by default**: `te deploy` connects read-only and prints the exact TMSL it would send to stdout. Add `--execute` to actually deploy. + `te deploy` acepta: -- `-s, --server` / `-d, --database`: servidor/Workspace y modelo de destino. Un nombre de servidor, FQDN, dirección IP o una cadena de conexión de MSOLAP implementa en Analysis Services (autenticación integrada de Windows para entornos locales); un nombre de Workspace o una URL `powerbi://...` implementa en Power BI. Consulta la tabla de [opciones globales](#global-options) para ver cómo se interpreta `-s`. +- `-s, --server` / `-d, --database` - the model **source**, exactly as on every other command. +- `--target-server ` / `--target-database ` - the deploy **destination**: a workspace name, endpoint, or server, and the semantic model name to create or overwrite. Un nombre de servidor, FQDN, dirección IP o una cadena de conexión de MSOLAP implementa en Analysis Services (autenticación integrada de Windows para entornos locales); un nombre de Workspace o una URL `powerbi://...` implementa en Power BI. For local model sources, the target falls back to the active `te connect` connection; when the source is remote, the target flags are required. Deploying a model onto itself is refused. +- `--execute` - actually deploy. In interactive mode this shows a summary + confirmation prompt with **`n` as the safe default**; `--execute --force` skips the prompt (required in CI, where a prompt without `--force` is an error). - `--deploy-full` - sobrescribir + conexiones + particiones + expresiones compartidas + roles + miembros de roles. - `--deploy-connections` - `--deploy-partitions` @@ -847,57 +884,60 @@ Implementa un modelo semántico en Power BI, Fabric, Azure Analysis Services o e - `--deploy-role-members` - `--deploy-shared-expressions` - `--create-only` -- `--xmla ` - genera un script XMLA/TMSL en lugar de realizar el despliegue (`-` para stdout). - `--skip-bpa` - omite por completo el control de BPA. - `--fix-bpa` - corrige automáticamente las infracciones de BPA cuando las reglas definan una expresión de corrección. - `--bpa-rules ` - se puede repetir; anula `bpa.rules` de la configuración de tu CLI solo para este despliegue. Las reglas integradas siguen aplicándose a menos que `bpa.builtInRules` sea `false`. -- `--force` - omite la confirmación interactiva (necesario para CI). -- `--ci ` - `vsts` o `github`. +- `--force` - skip the interactive confirmation. +- `--ci ` - `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`); unrecognised values are rejected up front. - `-p, --profile ` - uso puntual de un perfil de @te-cli-auth guardado. +`--output-format bim|tmdl` is rejected on deploy. To capture the deployment script for review, redirect the dry-run output: `te deploy ... > deploy.tmsl`. + ```bash -te deploy ./model -s my-workspace -d my-model --force --ci github -te deploy ./model -s MY.SERVER.COM -d my-model --force # On-prem SSAS (Integrated auth) -te deploy ./model --xmla script.tmsl # Generate TMSL only -te deploy ./model --profile staging --force +te deploy -m ./model --target-server my-workspace --target-database my-model --execute --force --ci github +te deploy -m ./model --target-server MY.SERVER.COM --target-database my-model --execute --force # On-prem SSAS +te deploy -m ./model --target-server my-workspace --target-database my-model > deploy.tmsl # Dry run: TMSL only +te deploy -s src-workspace -d src-model --target-server dst-workspace --target-database copy --execute # Remote to remote +te deploy --local --target-server my-workspace --target-database my-model --execute # Publish a Desktop model ``` > [!IMPORTANT] -> `te deploy` ejecuta el Best Practice Analyzer como control previo antes de realizar el despliegue. En modo interactivo, se muestran un resumen y un mensaje de confirmación, con **`n` como opción segura predeterminada**. En CI, pasa `--force` para omitir la confirmación. Consulta @te-cli-config para la configuración del control de BPA. +> `te deploy` ejecuta el Best Practice Analyzer como control previo antes de realizar el despliegue. Consulta @te-cli-config para la configuración del control de BPA. + +A deploy **fails** when the server reports errors on one or more objects, even though the metadata has been written: the exit code is non-zero, JSON reports `"success": false` with the reason in `error`, the headline says the deploy landed with errors, and `--ci` reports the object errors as errors. Unprocessed objects are not a failure - a metadata-only deploy legitimately leaves objects holding no data. The workspace mirror set up with `te connect -w` applies the same rule. > [!NOTE] -> Cuando se establece `--output-format json`, la carga JSON de `te deploy` siempre incluye los valores resueltos de `server` y `database`, incluso cuando se han resuelto a partir de la conexión activa o de un perfil, en lugar de pasarse explícitamente. Las canalizaciones pueden usar estos campos para confirmar el destino del despliegue sin volver a analizar la línea de comandos. `te deploy` y `te format` también devuelven un código de salida distinto de cero si fallan con `--output-format json`, igual que en modo texto: la carga JSON es el registro del error, no una señal de éxito. +> Cuando se establece `--output-format json`, la carga JSON de `te deploy` siempre incluye los valores resueltos de `server` y `database`, incluso cuando se han resuelto a partir de la conexión activa o de un perfil, en lugar de pasarse explícitamente. Las canalizaciones pueden usar estos campos para confirmar el destino del despliegue sin volver a analizar la línea de comandos. `te deploy` also exits non-zero on failure under `--output-format json`, matching its text-mode behavior - the JSON payload is the failure record, not a success signal. ### refresh Inicia una actualización de datos en un modelo implementado. +**Dry run by default**: `te refresh` prints the TMSL a refresh would send to stdout. Add `--execute` to run it. + `te refresh` admite: - `--type ` - `full`, `dataonly` (alias `data-only`, `data`), `automatic` (alias `auto`), `calculate` (alias `calc`), `clearvalues` (alias `clear`), `defragment` (alias `defrag`), `add` (predeterminado: `automatic`). - `--table ` - actualiza tabla(s) específicas; se puede repetir. - `--partition ` - actualiza partición(es) específicas. -- `--apply-refresh-policy` - aplica la política de actualización para determinar qué particiones se actualizan con la actualización incremental. -- `--effective-date ` - establece la fecha efectiva que usa la política de actualización. +- `--execute` - actually run the refresh. At a terminal it asks for confirmation with **`n` as the safe default**; add `--force` to skip the question. An unattended run (redirected output, `--output-format json`, or `--non-interactive`) stops with an error unless `--force` is given, so `te refresh --type full --execute --force` is the CI form. +- `--force` - skip the confirmation prompt. +- `--apply-refresh-policy ` - apply incremental refresh policies to determine which partitions are refreshed; pass a table name to scope the refresh to that table. Policies apply by default when the refresh type and scope are compatible, except for models hosted in Power BI Desktop. An explicit value wins (with warnings when it cannot take effect). +- `--effective-date ` - set the effective date used by the refresh policy (ignored, with a warning, when no policy applies). - `--max-parallelism ` - establece el número máximo de particiones que se pueden actualizar en paralelo. Encapsula la actualización en un comando TMSL `sequence`. -- `--dry-run` - muestra el script TMSL sin ejecutarlo. -- `--no-progress`, `--trace [path]`. - -```bash -te refresh --type full # Full refresh -te refresh --table Sales --type full # Single table -te refresh --type full --dry-run > refresh.tmsl # Emit TMSL only -``` - -### incremental-refresh +- `--no-progress`, `--trace [path]`. `--trace` without `--execute` warns and prints the TMSL. Trace timing comes from the server's clock, the log is kept until the server has finished delivering buffered events, and `te-refresh-*` traces older than an hour that interrupted runs left behind are stopped and dropped at the start of a traced refresh (traces from other tools are never touched). -Gestiona las políticas de actualización para la actualización incremental de las tablas. +Executed refreshes under `--output-format json` always include a `progress` array; with the `vertipaqOnRefresh` config key enabled, a per-table `vertipaq` array (rows, size, columns) is included too - no `--trace` needed. ```bash -te incremental-refresh show
+te refresh --type full --execute # Full refresh (asks for confirmation at a terminal) +te refresh --type full --execute --force # Unattended: skip the confirmation +te refresh --table Sales --type full --execute # Single table +te refresh --type full > refresh.tmsl # Dry run: emit TMSL only +te refresh --apply-refresh-policy Sales --execute # Apply Sales' incremental refresh policy ``` -Los subcomandos adicionales (`set`, `remove` (alias `rm`), `apply`) están documentados en `te incremental-refresh --help`. +Incremental refresh policies are authored with [`te set`](#incremental-refresh-policies) on a table's `RefreshPolicy` sub-object. ## Pruebas @@ -917,6 +957,8 @@ te test run --ci github --trx results.trx te test run --tag revenue ``` +Suites are validated before any connection is made; a suite that fails validation (for example, a missing `query_file`) exits `1` without running anything. Under `--output-format json`, `te test run` emits the shared findings JSON document with test-specific extras (`suites`, `invalidSuites`, `testSummary`) - see @te-cli-findings. + ### test init / spec / use / list / snapshot / compare `te test list` también acepta el alias `ls`. @@ -940,12 +982,14 @@ te connect # Show current active connection te connect my-workspace my-model # Remote (positional) te connect -s my-workspace -d my-model # Remote (named-flag form) te connect ./model # Local -te connect --local # Power BI Desktop (Windows) -te connect --local my-report # Filter by report name (multiple PBI Desktop instances) +te connect --local # Local Analysis Services instance (Windows) +te connect --local my-model # Match an instance (e.g. an open report's window title) or a database name te connect --profile prod # Activate a saved profile te connect --clear # Clear the active connection (and any workspace mirror) ``` +`te connect --local` lists every local Analysis Services instance - Power BI Desktop (Store and installer versions), Visual Studio workspaces, and standalone SSAS - with a two-step prompt (instance, then database) when an instance hosts several databases. Non-interactive mode fails with the candidate list instead of picking silently; narrow it with `te connect --local `. + #### Modo del área de trabajo (`-w` / `--workspace`) Empareja un origen principal con un destino secundario para que cada `--save` posterior sincronice el modelo entre ambos. Útil para mantener una copia de trabajo local de un Workspace remoto o para enviar los cambios locales a un Workspace al guardar. @@ -975,23 +1019,56 @@ Administra perfiles de conexión con nombre. (`te profile list` tiene como alias ### config list / paths / init / set -Consulta y administra la configuración de la CLI y las sobrescrituras de PATH de TE3. (`te config list`, alias: `ls`.) Consulta @te-cli-config. +View and manage CLI configuration. (`te config list`, alias: `ls`.) Consulta @te-cli-config. + +`te config set` takes a positional `key value` pair or the equivalent `-p key=value`. ```bash te config list # Display all settings -te config paths # Resolved TE3 file paths +te config paths # Resolved macros and BPA rules file paths te config init # Create default config te config set autoFormat true +te config set -p spinner=false # -p form ``` -### migrate +## Utilities + +Model-free helpers. `te util` subcommands never touch a model - `--model`, `-s`/`-d`, `--local`, `--recent`, and `--auth` are rejected. + +### util format-dax + +Format a loose DAX expression. + +- `` - the expression to format; `-` reads it from stdin. +- `--semicolons` - format DAX written with semicolons as list separators (European locale). The flag selects the semicolon dialect for the expression that is read as well as for the output, so it is for DAX you authored with semicolons - comma-separated DAX fails with a syntax error under it. It is accepted only here: `te set --format` refuses it, because an expression stored in a model is always comma-separated. +- `--long` - long format with fewer line breaks. De forma predeterminada se usa el formato corto. +- `--no-space-after-function` - omite el espacio después de los nombres de función. + +```bash +te util format-dax "SUM ( Sales[Amount] )" +cat query.dax | te util format-dax - +te util format-dax "CALCULATE(SUM(Sales[Amt]); Sales[Region] = \"EU\")" --semicolons # Semicolon-authored DAX +``` + +JSON output carries `success`, `formatted`, and `errors`. For expressions already in the model, use `te set --format ` instead; for a whole-model sweep, `te script --inline "Model.AllMeasures.FormatDax();" --save`. + +### util format-m + +Format a loose M/Power Query expression. `-` reads from stdin; no language-specific options. A malformed expression - an unterminated string, for example - is reported as a failure with a non-zero exit code and the original text returned unchanged, never a silently shortened result. + +```bash +te util format-m "let x = 1 in x" +cat partition.m | te util format-m - +``` + +### util migrate Guía de referencia que muestra cómo las opciones heredadas de la CLI de Tabular Editor 2 se corresponden con la nueva CLI. Útil como referencia rápida mientras migras una canalización basada en TE2. Consulta @te-cli-migrate para ver la guía de migración completa. ```bash -te migrate # Full flag mapping table -te migrate -A # Look up a single TE2 flag -te migrate --output-format json # Machine-readable mapping +te util migrate # Full flag mapping table +te util migrate -A # Look up a single TE2 flag +te util migrate --output-format json # Machine-readable mapping ``` ## Shell @@ -1005,7 +1082,6 @@ Inicia una sesión REPL guiada con un prompt adaptado al modelo. Consulta @te-cl `te interactive` admite: -- `` - argumento posicional opcional: inicia la sesión con un modelo local, un archivo `.bim` o una carpeta `.SemanticModel` ya cargados. - `--no-banner` - omite el banner de bienvenida al iniciar. Útil si controlas el REPL desde scripts. - `--echo` - muestra en stdout cada comando ejecutado antes de su salida. Útil cuando canalizas comandos por stdin para que el registro muestre qué se ejecutó. - `--batch` - modo por lotes no interactivo: lee comandos de stdin línea a línea, ejecuta cada uno y sale al llegar al EOF. Se habilita automáticamente cuando stdin se redirige. @@ -1013,11 +1089,13 @@ Inicia una sesión REPL guiada con un prompt adaptado al modelo. Consulta @te-cl ```bash te interactive # Connect later -te interactive ./model # Start with a local model +te interactive --model ./model # Start with a local model te interactive -s MyWorkspace -d MyModel # Start with a remote model -printf "list Measures\nexit\n" | te interactive ./model # Pipe commands via stdin +printf "list Measures\nexit\n" | te interactive --model ./model # Pipe commands via stdin ``` +Inside the session, mutating commands stage in memory: `save` (no arguments) commits the staged edits and `revert` discards them, while `save-as` re-serializes to a format or location. Closing a session that still holds staged edits asks for confirmation (or, when nobody can answer, warns and exits non-zero); `exit --force` throws them away deliberately - see @te-cli-interactive. + Las comillas y las referencias de estilo DAX funcionan igual que fuera de la sesión - consulta la sección [Rutas de objetos](#object-paths) de arriba y @te-cli-interactive para más detalles sobre la división de argv con reconocimiento de corchetes dentro del REPL. ### sesión @@ -1059,11 +1137,11 @@ te completion fish ## Códigos de salida -| Código de salida | Significado | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `0` | Éxito. | -| `1` | Fallo genérico (argumentos no válidos, fallo del comando, errores de validación, fallo de autenticación, el gate de BPA falló con una gravedad >= error). Para `te diff`: se encontraron diferencias. | -| `2` | Solo en `te diff`: se produjo un error durante la comparación, por lo que se desconoce el estado de las diferencias. | +| Código de salida | Significado | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | Éxito. | +| `1` | Generic failure (invalid arguments, command failed, validation errors, auth failure, BPA gate failed at severity >= error, a `te script` run in which a script reported an error, a `te deploy` the server accepted with object errors). Para `te diff`: se encontraron diferencias. | +| `2` | Solo en `te diff`: se produjo un error durante la comparación, por lo que se desconoce el estado de las diferencias. | Para un control detallado en las canalizaciones de CI, combina los códigos de salida con las anotaciones `--ci ` y los archivos de resultados `--trx`; consulta @te-cli-cicd. @@ -1073,4 +1151,5 @@ Para un control detallado en las canalizaciones de CI, combina los códigos de s - @te-cli-install - instalación y configuración de la CLI. - @te-cli-auth - autenticación y administración de conexiones. - @te-cli-config - archivo de configuración, BPA gate y comportamiento tras la mutación. +- @te-cli-findings - the findings JSON shared by validate, bpa run, test run, and query. - @te-cli-migrate - mapeo de opciones TE2 → TE3. From 99e92e3969bf72784d0725563fd3657f3ad6738b Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:30 +0200 Subject: [PATCH 03/48] New translations te-cli-config.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-config.md | 73 +++++++++++-------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-config.md b/localizedContent/es/content/features/te-cli/te-cli-config.md index 3eab6e00e..59625f10a 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-config.md +++ b/localizedContent/es/content/features/te-cli/te-cli-config.md @@ -2,7 +2,7 @@ uid: te-cli-config title: Configuración personalizada author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -19,7 +19,7 @@ applies_to: La CLI de Tabular Editor lee una configuración opcional desde un archivo JSON. La configuración controla tres cosas: -- **Rutas de archivos** — dónde la CLI lee las macros, las reglas de BPA y (opcionalmente) el ejecutable de TE3 Desktop, y dónde escribir el registro de consultas. +- **File paths** - where the CLI reads macros and BPA rules, and where to write the query log. - **Valores predeterminados de comportamiento** — controles de BPA, formato automático y validación. - **Perfiles de conexión guardados** — la lista de perfiles con nombre entre los que puedes alternar. @@ -64,9 +64,10 @@ te config set autoFormat true te config set bpa.onDeploy false te config set hidePreviewNotice true te config set macros null # Clear a path override +te config set -p spinner=false # -p key=value works too ``` -Las claves desconocidas provocan que el comando finalice con el código de salida `1` y un error que enumera las claves válidas. +Keys can be passed positionally (`te config set `) or as `-p key=value`. Las claves desconocidas provocan que el comando finalice con el código de salida `1` y un error que enumera las claves válidas. Si no existe ningún archivo de configuración, `te config set` crea uno automáticamente en la ruta resuelta (`$TE_CONFIG` si está establecido; de lo contrario, `~/.config/te/config.json`) antes de aplicar el cambio. @@ -84,6 +85,7 @@ El esquema completo de configuración JSON con todas las claves en sus valores p "autoFormat": false, "validateOnMutation": true, "vertipaqOnRefresh": false, + "mutationOutput": "diff", "bpa": { "rules": null, @@ -98,7 +100,6 @@ El esquema completo de configuración JSON con todas las claves en sus valores p "launchInteractiveMode": "auto", "formatOptions": { - "useSemicolons": false, "shortFormat": false, "skipSpaceAfterFunction": false, "useSqlBiDaxFormatter": false @@ -110,7 +111,6 @@ El esquema completo de configuración JSON con todas las claves en sus valores p "disableTelemetry": false, "queryLog": null, - "te3ExePath": null, "profiles": {} } @@ -120,12 +120,11 @@ El esquema completo de configuración JSON con todas las claves en sus valores p Configúralas en tu configuración para evitar pasar las mismas rutas en cada comando. Las opciones específicas de cada comando y las variables de entorno prevalecen sobre los valores de configuración; consulta [Prioridad de resolución de rutas](#path-resolution-priority) más abajo. -| Clave | Significado | -| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `macros` | Ruta explícita a un archivo JSON de macros (normalmente `MacroActions.json`). La resuelve cualquier comando `te macro`. Apunta a un archivo compartido (un recurso compartido de red, un archivo local del repositorio o incluso el archivo de escritorio de TE3) para reutilizar el mismo conjunto de macros en distintos equipos y entre la CLI y TE3 Desktop. | -| `bpa.rules` | Lista ordenada de rutas o URL a archivos de reglas de BPA. `te bpa run` y la compuerta de implementación/guardado cargan **todas** las entradas existentes; `te bpa rules list` y `te config paths` usan la primera entrada existente. Los valores separados por comas en `te config set bpa.rules ...` se separan en el arreglo. | -| `te3ExePath` | Ruta explícita al ejecutable de Tabular Editor 3 Desktop (`TabularEditor.exe`). `te open` lo usa **solo** para iniciar la aplicación de escritorio; puedes dejarlo sin configurar en Linux/macOS o cuando no uses `te open`. Si no está configurado, `te open` recurre a una búsqueda en `PATH`. | -| `queryLog` | Ruta a un archivo de registro en el que cada invocación de `te query` añade el texto de la consulta y los metadatos de ejecución. Útil para mantener registros de auditoría o analizar patrones de consulta a lo largo del tiempo. Admite `~` para el directorio personal (p. ej., `~/.config/te/queries.log`). | +| Clave | Significado | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `macros` | Ruta explícita a un archivo JSON de macros (normalmente `MacroActions.json`). La resuelve cualquier comando `te macro`. Apunta a un archivo compartido (un recurso compartido de red, un archivo local del repositorio o incluso el archivo de escritorio de TE3) para reutilizar el mismo conjunto de macros en distintos equipos y entre la CLI y TE3 Desktop. | +| `bpa.rules` | Lista ordenada de rutas o URL a archivos de reglas de BPA. `te bpa run` y la compuerta de implementación/guardado cargan **todas** las entradas existentes; `te bpa rules list` y `te config paths` usan la primera entrada existente. Los valores separados por comas en `te config set bpa.rules ...` se separan en el arreglo. | +| `queryLog` | Ruta a un archivo de registro en el que cada invocación de `te query` añade el texto de la consulta y los metadatos de ejecución. Útil para mantener registros de auditoría o analizar patrones de consulta a lo largo del tiempo. Admite `~` para el directorio personal (p. ej., `~/.config/te/queries.log`). | ### Prioridad de resolución de rutas @@ -145,11 +144,12 @@ Toda la configuración relacionada con BPA está en el objeto `bpa` y se referen | Clave | Predeterminado | Descripción | | ---------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoFormat` | `false` | Ejecuta DAX Formatter en las expresiones modificadas después de `te add` / `te set` / `te move` / `te macro run`. Usa el formateador interno de forma predeterminada; puedes optar por el servicio web de SQL BI mediante `formatOptions.useSqlBiDaxFormatter`. | -| `validateOnMutation` | `true` | Después de un comando de modificación (`add`, `set`, `mv`, `replace --save`, `macro run`), comprueba que todas las referencias `Table[Column]` del modelo se sigan resolviendo. Detecta referencias huérfanas introducidas por cambios de nombre o eliminaciones antes de llegar al despliegue. | +| `autoFormat` | `false` | Automatically format the DAX expressions changed by a mutating command. Formatting is scoped to the objects the command touched but covers every DAX expression property they hold (expressions, format string expressions, detail rows, KPI target/status/trend, calculation group and table permission expressions, etc.). Power Query (M) and SQL partition queries are never reformatted. Always uses the built-in offline formatter in the comma dialect; the `formatOptions` layout keys apply. | +| `validateOnMutation` | `true` | After a mutating command (`add`, `set`, `mv`, `macro run`), check that every `Table[Column]` reference in the model still resolves. Detecta referencias huérfanas introducidas por cambios de nombre o eliminaciones antes de llegar al despliegue. | +| `mutationOutput` | `diff` | How mutating commands (`add`, `set`, `move`, `remove`, `script`, `bpa run --fix`) render the resulting change set in text output: `diff` (full before/after diff), `stat` (per-object change counts), `name-only` (changed object paths), or `none` (suppress the change set; config-only - there is no `--none` flag). The per-command `--diff` / `--stat` / `--name-only` flags override for one invocation. JSON output always carries the full `changes` array regardless. | | `bpa.onMutation` | `false` | Ejecuta un análisis de BPA acotado después de cada comando de modificación (`set`, `add`, `mv`, `rm`, `macro run`). Solo se comprueban los objetos de la tabla afectada, no los de todo el modelo; útil para obtener retroalimentación rápida durante ediciones iterativas. | | `bpa.onDeploy` | `true` | Ejecuta el control de BPA antes de que se ejecute `te deploy`. El despliegue se aborta si se dispara alguna regla con una gravedad >= error. Omítelo en una invocación concreta con `--skip-bpa`, o corrígelo automáticamente con `--fix-bpa`. | -| `bpa.onSave` | `true` | Ejecuta el control de BPA antes de que `te save -o` escriba en disco. Omítelo en una invocación concreta con `--skip-bpa` o `--force`. | +| `bpa.onSave` | `true` | Run the BPA gate before `te save-as` writes to disk. Omítelo en una invocación concreta con `--skip-bpa` o `--force`. | | `bpa.builtInRules` | `true` | Incluye el conjunto depurado de reglas integradas de BPA cada vez que se ejecute el control. Configúralo en `false` para ignorar por completo las reglas integradas; entonces el control ejecutará solo las reglas configuradas mediante `bpa.rules` y cualquier regla incrustada en el modelo. | | `bpa.disabledBuiltInRuleIds` | `null` | ID de reglas integradas individuales que se excluirán de la puerta de calidad. Este valor se modifica mediante `te bpa rules disable ` / `te bpa rules enable `; es preferible usar esos comandos en lugar de editar el arreglo directamente. | | `vertipaqOnRefresh` | `false` | Tras una actualización correcta (`full`, `dataonly`, `automatic` o `add`), ejecuta automáticamente el análisis de VertiPaq para mostrar estadísticas de almacenamiento de las tablas actualizadas. Útil para detectar de inmediato regresiones inesperadas de cardinalidad o memoria. | @@ -166,14 +166,13 @@ te config set bpa.disabledBuiltInRuleIds "TE3_BUILT_IN_DATE_TABLE_EXISTS,TE3_BUI ### Opciones de formato -Se aplica siempre que la CLI invoque un formateador de DAX (para `te format` y, cuando está habilitado, para `autoFormat` en las mutaciones). La CLI incluye un formateador propio que funciona completamente sin conexión; activa el servicio web de SQL BI [daxformatter.com](https://www.daxformatter.com) mediante `formatOptions.useSqlBiDaxFormatter` si necesitas ese estilo o quieres igualar el comportamiento de TE2 o TE3 con "Use daxformatter.com..." activado. +Applied whenever the CLI formats DAX. The CLI ships a formatter that works fully offline. The layout keys (`shortFormat`, `skipSpaceAfterFunction`) apply when `autoFormat` reformats mutated expressions and when `te query` renders query text; explicit formatting via `te set --format ` and `te util format-dax` takes the equivalent per-invocation flags (`--long`, `--no-space-after-function`) instead. There is deliberately no list-separator key: DAX stored in a model or sent to Analysis Services is always comma-separated, so every config-driven formatting pass uses commas. The one place the semicolon dialect applies is the `--semicolons` flag on `te util format-dax`, for DAX you have typed with semicolons yourself. `formatOptions.useSqlBiDaxFormatter` routes explicit formatting and `te query`'s rendering through the SQL BI [daxformatter.com](https://www.daxformatter.com) web service (requires internet access) if you need that style; `autoFormat` always uses the built-in formatter regardless. -| Clave | Predeterminado | Descripción | -| -------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `formatOptions.useSemicolons` | `false` | Usa `;` como separador de listas (según la configuración regional europea/de la UE). El valor predeterminado `,` coincide con la configuración regional en-US. | -| `formatOptions.shortFormat` | `false` | Prefiere un formato corto, de una sola línea, cuando sea posible, en lugar del diseño predeterminado de varias líneas. | -| `formatOptions.skipSpaceAfterFunction` | `false` | Omite el espacio entre el nombre de una función y su paréntesis de apertura (por ejemplo, `SUM(x)` en lugar de `SUM (x)`). | -| `formatOptions.useSqlBiDaxFormatter` | `false` | Formatea DAX con el servicio web [SQL BI daxformatter.com](https://www.daxformatter.com) en lugar del formateador interno. Requiere acceso a Internet. El formateador interno (predeterminado) funciona sin conexión y coincide con la configuración predeterminada de Tabular Editor 3 Desktop. | +| Clave | Predeterminado | Descripción | +| -------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `formatOptions.shortFormat` | `false` | Prefiere un formato corto, de una sola línea, cuando sea posible, en lugar del diseño predeterminado de varias líneas. | +| `formatOptions.skipSpaceAfterFunction` | `false` | Omite el espacio entre el nombre de una función y su paréntesis de apertura (por ejemplo, `SUM(x)` en lugar de `SUM (x)`). | +| `formatOptions.useSqlBiDaxFormatter` | `false` | Format DAX via the [SQL BI daxformatter.com](https://www.daxformatter.com) web service instead of the built-in formatter. Requiere acceso a Internet. The built-in formatter (default) works offline and matches the Tabular Editor 3 Desktop default. | ### Visualización @@ -189,20 +188,22 @@ Ajustes que controlan la salida del terminal de la CLI y el nivel de detalle de Los perfiles de conexión guardados se almacenan bajo la clave `profiles`. No los edites a mano; usa `te profile set / remove / list`. Consulta @te-cli-auth para la gestión de perfiles. -Los perfiles pueden incluir **anulaciones** que sustituyen los valores predeterminados de comportamiento anteriores siempre que el perfil esté activo. Así, un perfil de desarrollo puede relajar la validación y el BPA, mientras que uno de producción los mantiene estrictos: +Los perfiles pueden incluir **anulaciones** que sustituyen los valores predeterminados de comportamiento anteriores siempre que el perfil esté activo. The keys a profile can override are `autoFormat`, `validateOnMutation`, `mutationOutput`, `bpa.onMutation`, `bpa.onDeploy`, `bpa.onSave`, `vertipaqOnRefresh`, `spinner`, and `interactiveEditMode`. Así, un perfil de desarrollo puede relajar la validación y el BPA, mientras que uno de producción los mantiene estrictos: ```bash te profile set dev --validate-on-mutation false --bpa-on-deploy false te profile set prod --auto-format true ``` +`te profile set` exposes flags for the common ones (`--auto-format`, `--validate-on-mutation`, `--bpa-on-mutation`, `--bpa-on-deploy`, `--vertipaq-on-refresh`, `--spinner`); each accepts `true`, `false`, or `null` to clear the override. + ## Control BPA El control BPA es la red de seguridad que impide que se guarde o se despliegue un modelo con infracciones de reglas. Se ejecuta automáticamente con los siguientes comandos: - `te deploy` ejecuta el control, a menos que se pase `--skip-bpa` o que `bpa.onDeploy` sea `false`. -- `te save` ejecuta el control, a menos que se pase `--skip-bpa` (o `--force`) o que `bpa.onSave` sea `false`. -- `te add`, `te set`, `te move`, `te macro run` ejecutan el control solo cuando `bpa.onMutation` es `true`. +- `te save-as` runs the gate unless `--skip-bpa` (or `--force`) is passed or `bpa.onSave` is `false`. +- `te add`, `te set`, `te move`, `te remove`, `te macro run` run the gate only when `bpa.onMutation` is `true`. El control carga las reglas de BPA desde `bpa.rules` y, de forma predeterminada, el conjunto de reglas integrado (controlado por `bpa.builtInRules`). Las reglas integradas pueden excluirse individualmente mediante `bpa.disabledBuiltInRuleIds`; se administran con `te bpa rules disable ` / `te bpa rules enable `. @@ -210,13 +211,13 @@ Cuando el control se activa y detecta incumplimientos con gravedad >= `error`, e - `--fix-bpa` - aplica en memoria la `fixExpression` de la regla al artefacto que se va a desplegar o guardar; los archivos fuente no se modifican. - `--skip-bpa` - desactiva el control solo para este comando. -- `--bpa-rules ` - repetible; sobrescribe `bpa.rules` para esta única invocación de `te deploy` o `te save`. Las reglas integradas siguen aplicándose salvo que `bpa.builtInRules` sea `false`. +- `--bpa-rules ` - repeatable; override `bpa.rules` for this single `te deploy` or `te save-as` invocation. Las reglas integradas siguen aplicándose salvo que `bpa.builtInRules` sea `false`. Ejecuta `te bpa run` de forma independiente para previsualizar el comportamiento del control sin desplegar: ```bash -te bpa run ./model --fail-on error -te bpa run ./model --fix --save # Apply fixes to the source +te bpa run --model ./model --fail-on error +te bpa run --model ./model --fix --save # Apply fixes to the source ``` ### Reglas de BPA integradas @@ -227,7 +228,7 @@ Tanto `bpa.builtInRules` como `bpa.disabledBuiltInRuleIds` se aplican de forma c ## Comportamiento tras la mutación -Cuando ejecutas un comando que modifica (`te add`, `te set`, `te move`, `te replace --save`, `te macro run`), la CLI realiza estas comprobaciones automáticamente: +When you run a mutating command (`te add`, `te set`, `te move`, `te macro run`), the CLI performs these checks automatically: 1. **Los errores de TOM** siempre se muestran. Un DAX o M no válidos en medidas, columnas, particiones o elementos de cálculo siempre hacen que el comando falle. 2. **La validación del esquema** (`validateOnMutation`, valor predeterminado `true`) comprueba que las referencias `Table[Column]` en DAX sigan resolviéndose y verifica la consistencia de los metadatos. @@ -236,17 +237,29 @@ Cuando ejecutas un comando que modifica (`te add`, `te set`, `te move`, `te repl Deshabilita una comprobación con `te config set false`, o limita esa relajación a un entorno concreto mediante un perfil. +## Administrator policies + +On Windows, `te` honors the same administrator policies as Tabular Editor 3. Policies are read from the registry under `Software\Policies\Tabular Editor ApS` - with an optional `TECLI` subkey for values that should apply to the CLI only, and a `TE3` subkey for the desktop - and from the earlier `Software\Policies\Kapacity\Tabular Editor` key, which keeps working unchanged. A machine-wide value (`HKEY_LOCAL_MACHINE`) takes precedence over a per-user one (`HKEY_CURRENT_USER`), and within a hive a product-specific value takes precedence over a shared one. Where a policy turns a feature off, the command names the policy responsible, does nothing, and exits with a failure - so a pipeline that depends on something an administrator has since turned off fails visibly rather than reporting success for work it never did. + +| Policy | Effect on the CLI | +| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `DisableCSharpScripts` | Refuses `te script` and the automatic fixes of `te bpa run --fix`. | +| `DisableMacros` | Refuses every `te macro` command. | +| `DisableBpaDownload` | Refuses Best Practice Analyzer rules given as a URL. Rule files on disk and the built-in rules are unaffected. | +| `DisableTelemetry` | Turns anonymous usage statistics off, whatever `disableTelemetry` in config says. | + +Policies that govern features the CLI does not have - update checks, error reports, DAX Optimizer, the DAX Package Manager, the AI assistant, and the MCP server - have no effect on it. See @policies for the full list of policies and how to deploy them. + ## Variables de entorno Usa las siguientes variables de entorno específicas de la CLI para PATH, comportamiento y diagnósticos. Para las variables de autenticación de Azure (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_CERTIFICATE_PATH`, etc.), consulta @te-cli-auth. | Variable | Propósito | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `TE_CONFIG` | Ruta de acceso a un archivo de configuración alternativo. Se respeta en todas las operaciones de `te config` (`show`, `set`, `init`, `paths`). | +| `TE_CONFIG` | Ruta de acceso a un archivo de configuración alternativo. Honored by every `te config` operation (`list`, `set`, `init`, `paths`). | | `TE_MACROS_PATH` | Anula la ruta del archivo de macros (segundo en el orden de resolución; ver arriba). La leen los comandos `te macro`. | | `TE_BPA_RULES` | Anula la lista de archivos/URL de reglas de BPA utilizada por los subcomandos `te bpa run` y `te bpa rules`. | | `TE_BPA_CONFIG` | Anula la ruta de acceso a la configuración del gate de BPA (`.te-bpa.json`) que lee el gate de despliegue/guardado. | -| `TE3_EXE_PATH` | Ruta al binario de escritorio de Tabular Editor 3. Se usa **solo** con `te open`; puedes dejarla sin definir en Linux/macOS o si no usas `te open`. Si no se especifica, se usa la búsqueda en `PATH`. | | `TE_DEBUG` | Establece el valor en `1` para habilitar el registro de depuración globalmente (igual que `--debug` o `debug: true` en la configuración). | | `NO_SPINNER` | Establece el valor en `1` o `true` para desactivar los indicadores de progreso animados (alternativa a `spinner: false` en la configuración). | | `CI` | Se detecta automáticamente. Cuando vale `1` o `true`, la CLI desactiva el spinner y cambia a una salida de texto sin formato. La mayoría de los runners de CI lo configuran automáticamente. | From 9151fb838d95970affa5dfd65f71309e8c85f841 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:33 +0200 Subject: [PATCH 04/48] New translations te-cli-limitations.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-limitations.md | 56 ++++++++++--------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-limitations.md b/localizedContent/es/content/features/te-cli/te-cli-limitations.md index 79b497c51..fa6f7b219 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-limitations.md +++ b/localizedContent/es/content/features/te-cli/te-cli-limitations.md @@ -1,8 +1,8 @@ --- uid: te-cli-limitations -title: Limitaciones conocidas +title: Behavior Differences and Known Limitations author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -13,14 +13,14 @@ applies_to: full: true --- -# Limitaciones conocidas +# Behavior Differences and Known Limitations [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -En esta página se enumeran las limitaciones conocidas de la CLI de Tabular Editor (`te`) para que puedas planificar en consecuencia y evitar errores habituales. Se actualiza con cada versión; si encuentras un problema que no figura aquí, abre una incidencia en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI). +This page collects the places where the Tabular Editor CLI (`te`) behaves differently from Tabular Editor 2 and 3, together with the things it cannot do yet, so you can plan around both and avoid common pitfalls. Se actualiza con cada versión; si encuentras un problema que no figura aquí, abre una incidencia en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI). > [!NOTE] -> Las limitaciones se agrupan por área. Cada entrada describe la restricción y, cuando existe, una solución alternativa o la alternativa recomendada compatible con la CLI. +> Entries are grouped by area. Each one describes the difference or constraint and, where one exists, a workaround or the recommended CLI-friendly alternative. ## Scripts @@ -33,20 +33,20 @@ La CLI ejecuta C# Scripts (`te script`) sobre el mismo objeto `Model` que usas e | **`Selected.` genera un error en tiempo de ejecución** | `Selected.Table`, `Selected.Measure`, `Selected.Column`, `Selected.Hierarchy`, etc. devuelven un error porque requieren exactamente un objeto seleccionado de ese tipo y la selección de la CLI siempre está vacía. Haz referencia al objeto directamente, por ejemplo, `Model.Tables["Sales"]`. | | **`Selected.ActivePerspectives` y `Selected.ActiveCulture`** | Siempre devuelven una colección vacía y `null`, respectivamente. Establece la perspectiva o la configuración regional explícitamente en el script si es necesario. | | **Los cuadros de diálogo `Select` lanzan `NotSupportedException`** | `SelectTable`, `SelectColumn`, `SelectMeasure`, `SelectObject`, `SelectObjects` (y todas las sobrecargas) devuelven el siguiente error: _"Los cuadros de diálogo de selección de objetos … no están disponibles en los scripts de la CLI. Preselecciona el objeto por nombre o ruta antes de ejecutar el script."_ Resuelve los objetivos de antemano a partir de variables de entorno, la configuración o consultando el modelo. | -| **`Info` / `Warning` / `Error` / `Output` escriben en la consola** | Estos siguen funcionando, pero se envían a stdout/stderr en lugar de abrir un cuadro de diálogo. Nunca bloquean ni muestran un aviso para "ignorar más ventanas emergentes". Se pueden usar con seguridad en CI. | +| **`Info` / `Warning` / `Error` / `Output` escriben en la consola** | Estos siguen funcionando, pero se envían a stdout/stderr en lugar de abrir un cuadro de diálogo. Nunca bloquean ni muestran un aviso para "ignorar más ventanas emergentes". Se pueden usar con seguridad en CI. A script that calls `Error(...)` makes `te script` exit non-zero (changes are still saved with `--save`); `Warning` and `Info` do not. | | **`ShowPrompt(...)` siempre devuelve `Cancel`** | No es posible realizar una confirmación interactiva. Decide la respuesta de antemano mediante variables de entorno o configuración. | | **`SuspendWaitForm` / `WaitFormVisible` no hacen nada** | El indicador giratorio de "Please wait" es un elemento de la interfaz de TE3. `WaitFormVisible` es una bandera configurable sin efecto Visual, y `SuspendWaitForm` se ignora silenciosamente; los scripts existentes siguen compilando. | -| **`host.Macro(...)` / `CustomAction(...)` lanzan un error** | La CLI no carga `%APPDATA%/TabularEditor3/MacroActions.json`, por lo que invocar una macro desde dentro de un script devuelve un error. Inserta la lógica de la macro en línea o llama directamente al archivo de script subyacente de la macro. | +| **`host.Macro(...)` / `CustomAction(...)` throws an error** | La CLI no carga `%APPDATA%/TabularEditor3/MacroActions.json`, por lo que invocar una macro desde dentro de un script devuelve un error. Inline the macro logic, call the macro's underlying script file directly, or invoke the macro through `te macro run ` with a CLI macros file (`--macros` / `TE_MACROS_PATH` / the `macros` config key). | | **`table.GetCardinality()` / `column.GetTotalSize()` devuelven 0** | Los auxiliares de cardinalidad de VertiPaq dentro del script no tienen un VPA en vivo en el host de la CLI. Para obtener estadísticas de VPA, carga explícitamente un VPAX y usa `host.Vpa.*`, o ejecuta [`te vertipaq`](xref:te-cli-commands#vertipaq). | ## Best Practice Analyzer -| Limitación | Notas / Solución alternativa | -| --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Las fuentes de reglas de BPA deben ser URL HTTPS o rutas de archivos locales** | Solo se aceptan las URL `https://` y las rutas de archivo locales sin esquema. `http://` se reconoce, pero se rechaza deliberadamente en tiempo de carga con un error claro; como las reglas de BPA son expresiones de reglas ejecutables, obtenerlas a través de un canal no autenticado supondría un riesgo de manipulación. Otros esquemas de URL (`file://`, `ftp://`, …) no se admiten. Se aplica tanto a `te bpa run --rules` como a la lista de reglas configurada mediante [`te config set`](xref:te-cli-commands#config-list--paths--init--set). | -| **La validación de las URL de las reglas se realiza en el gate, no en `te config set`** | Un error tipográfico como `http://` lo acepta `te config set` y solo sale a la luz cuando BPA se ejecuta realmente. Después de editar las fuentes de reglas configuradas, ejecuta `te bpa run` (o `te validate`) una vez para comprobar que cada URL se carga correctamente. | -| **`--rules` no desactiva las reglas integradas** | Cuando se pasa `te bpa run --rules `, las reglas proporcionadas sustituyen las entradas de [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) y `TE_BPA_RULES` para esa invocación, pero los valores predeterminados integrados se cargan igualmente. Para ejecutar solo el archivo de reglas explícito, pasa también `--no-defaults`. | -| **No hay ninguna opción por invocación para omitir la configuración de `bpa.rules`** | Una vez configurado `bpa.rules`, cada `te bpa run` carga esas reglas además de las integradas. Actualmente no hay ninguna opción para omitir los archivos de reglas configurados en una sola ejecución. Solución alternativa: pasa `--rules ` explícitamente; esta opción sustituye por completo `bpa.rules` y `TE_BPA_RULES` para esa invocación. | +| Limitación | Notas / Solución alternativa | +| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Las fuentes de reglas de BPA deben ser URL HTTPS o rutas de archivos locales** | Solo se aceptan las URL `https://` y las rutas de archivo locales sin esquema. `http://` se reconoce, pero se rechaza deliberadamente en tiempo de carga con un error claro; como las reglas de BPA son expresiones de reglas ejecutables, obtenerlas a través de un canal no autenticado supondría un riesgo de manipulación. Otros esquemas de URL (`file://`, `ftp://`, …) no se admiten. Se aplica tanto a `te bpa run --rules` como a la lista de reglas configurada mediante [`te config set`](xref:te-cli-commands#config-list--paths--init--set). | +| **La validación de las URL de las reglas se realiza en el gate, no en `te config set`** | Un error tipográfico como `http://` lo acepta `te config set` y solo sale a la luz cuando BPA se ejecuta realmente. Después de editar las fuentes de reglas configuradas, ejecuta `te bpa run` (o `te validate`) una vez para comprobar que cada URL se carga correctamente. | +| **`--rules` no desactiva las reglas integradas** | Cuando se pasa `te bpa run --rules `, las reglas proporcionadas sustituyen las entradas de [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) y `TE_BPA_RULES` para esa invocación, pero los valores predeterminados integrados se cargan igualmente. Para ejecutar solo el archivo de reglas explícito, pasa también `--no-defaults`. When a supplied rule file defines the same rule ID as a built-in rule, the rule is evaluated once - the definition from the explicit `--rules` file wins for that `te bpa run` invocation (in the deploy/save gate, the built-in definition wins). | +| **No hay ninguna opción por invocación para omitir la configuración de `bpa.rules`** | Una vez configurado `bpa.rules`, cada `te bpa run` carga esas reglas además de las integradas. Actualmente no hay ninguna opción para omitir los archivos de reglas configurados en una sola ejecución. Solución alternativa: pasa `--rules ` explícitamente; esta opción sustituye por completo `bpa.rules` y `TE_BPA_RULES` para esa invocación. | ## Validación @@ -54,11 +54,19 @@ La CLI ejecuta C# Scripts (`te script`) sobre el mismo objeto `Model` que usas e | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`te validate` no puede corregir automáticamente las infracciones de Code Action** | `te validate` genera un Report de infracciones de Code Action, pero no ofrece ningún parámetro de la CLI para aplicar la corrección sugerida. Aplica la corrección en Tabular Editor 3, o usa `te bpa run --fix` para el subconjunto de Code Actions que se solapan con las reglas de BPA. | -## E/S del modelo +## Model initialization and save -| Limitación | Notas / Solución alternativa | -| -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`--serialization` no puede combinar una serialización con un contenedor PBIP** | La opción `--serialization` en [`te save`](xref:te-cli-commands#save) trata `bim`, `tmdl`, `Database.json` y `pbip` como mutuamente excluyentes, por lo que actualmente no es posible generar un contenedor PBIP alrededor de un modelo serializado con TMSL (`.bim`). Guarda TMDL dentro de un contenedor PBIP, o guarda `.bim` fuera de un contenedor PBIP. | +| Limitación | Notas / Solución alternativa | +| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`--serialization` no puede combinar una serialización con un contenedor PBIP** | The `--serialization` option on [`te save-as`](xref:te-cli-commands#save-as) treats `bim`, `tmdl`, `database.json`, and `pbip` as mutually exclusive, so you cannot produce a full PBIP container around a TMSL-serialized (`.bim`) model. To wrap a `tmdl` or `bim` output in a `{modelName}.SemanticModel/` folder with `.platform` and `definition.pbism` files, pass `--supporting-files`; for a complete PBIP (including the report artifact), use `--serialization pbip`. | + +## Edición del modelo + +| Limitación | Notas / Solución alternativa | +| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Calculated sets cannot be created, removed, or moved from the CLI** | Sets are addressable for inspection (`te list Sets`, `te get "Sales/Sets/"`), but `te add`, `te remove`, and `te move` do not support set objects. Use `te script` for set mutations. | +| **No whole-model Power Query formatting sweep** | `te set --format ` formats named expression properties on one object and `te util format-m` formats a single loose expression, but there is no command to format every M expression in a model in one pass. (Whole-model DAX formatting is available via `te script --inline "Model.AllMeasures.FormatDax();" --save`.) | +| **Schema sync treats renamed source columns as removed + added** | `te set
--update-schema` cannot detect a rename; a renamed source column shows up as one removed and one new column. Remap manually with `te set
/ -p SourceColumn=` before syncing. `--update-schema` is refused on calculated tables and calculation groups. | ## Autenticación @@ -68,15 +76,11 @@ La CLI ejecuta C# Scripts (`te script`) sobre el mismo objeto `Model` que usas e ## Entrada en la línea de comandos -| Limitación | Notas / Solución alternativa | -| --------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Las rutas de objetos DAX con espacios deben ir entre comillas del shell** | Cuando el nombre de una tabla o columna contiene espacios, toda la referencia al objeto DAX debe ir entre comillas del shell desde el terminal: `te get "'My Table'[My Column]"`. Sin las comillas externas, el shell divide la ruta en varios argumentos y el análisis sintáctico falla. Dentro de [`te interactive`](xref:te-cli-interactive) no se necesitan comillas del shell porque el REPL recibe la entrada sin procesar antes de que el shell la divida en argumentos. | - -## Paridad con TE2 - -| Limitación | Notas / Solución alternativa | -| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`te schemacheck` todavía no se ha implementado** | La opción `-SC` / `-SCHEMACHECK` de TE2 no tiene hoy por hoy ningún equivalente en `te`; la detección de deriva del esquema con respecto a las Data source de origen está prevista para una versión futura. Consulta @te-cli-migrate para ver la tabla completa de equivalencias de opciones entre TE2 y `te`. | +| Limitación | Notas / Solución alternativa | +| ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Las rutas de objetos DAX con espacios deben ir entre comillas del shell** | Cuando el nombre de una tabla o columna contiene espacios, toda la referencia al objeto DAX debe ir entre comillas del shell desde el terminal: `te get "'My Table'[My Column]"`. Sin las comillas externas, el shell divide la ruta en varios argumentos y el análisis sintáctico falla. Dentro de [`te interactive`](xref:te-cli-interactive) no se necesitan comillas del shell porque el REPL recibe la entrada sin procesar antes de que el shell la divida en argumentos. | +| **Object names containing reserved path characters must be quoted** | `/ [ ] ' " * ? { }` are reserved in object and filter paths. A name containing one must be quoted with the segment quoting rules, e.g. `te get "Tables/'{foo}'"` or `te get 'Sales/"my*name"'`. `?` is reserved but has no wildcard meaning. The Windows `cmd.exe` shell cannot express the mixed-quote forms - use PowerShell or a POSIX shell for such names (or `te interactive`, which takes the raw line). | +| **`-` (read from stdin) is not available inside `te interactive`** | The shell rejects it with _'-' (stdin) is not available inside the interactive shell._ Pass the value inline, or run the command from your OS shell where piping works. | ## Enviar un Report de una limitación no documentada From 48e1e4ab9ef7455fa092dbfac465a7a8f476bf73 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:36 +0200 Subject: [PATCH 05/48] New translations te-cli-skill.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-skill.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-skill.md b/localizedContent/es/content/features/te-cli/te-cli-skill.md index 9ee4c3721..92c067f10 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-skill.md +++ b/localizedContent/es/content/features/te-cli/te-cli-skill.md @@ -2,7 +2,7 @@ uid: te-cli-skill title: Habilidad de agente de IA author: Morten Lønskov -updated: 2026-06-04 +updated: 2026-09-04 applies_to: products: - product: Tabular Editor 2 @@ -17,39 +17,38 @@ applies_to: [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -Tabular Editor CLI incluye un **skill de agente** listo para usar que enseña a los agentes de programación con IA a manejar la interfaz de línea de comandos `te`. Es un único archivo Markdown, [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli), que reúne las convenciones de la CLI, la referencia de comandos, los flujos de trabajo y los aspectos a tener en cuenta. Una vez instalado, un agente responde a «despliega este modelo» o «añade una medida que calcule el margen» con invocaciones idiomáticas de `te`, en lugar de adivinar o inventarse parámetros. +Tabular Editor CLI incluye un **skill de agente** listo para usar que enseña a los agentes de programación con IA a manejar la interfaz de línea de comandos `te`. It's a skill folder - a [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) entry point plus a `references/` set of on-demand deep-dive files - packed with the CLI's conventions, command reference, workflows, and gotchas. Una vez instalado, un agente responde a «despliega este modelo» o «añade una medida que calcule el margen» con invocaciones idiomáticas de `te`, en lugar de adivinar o inventarse parámetros. El skill se mantiene en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) y hace un seguimiento de las funcionalidades en versión preliminar de la CLI a medida que evoluciona. ## Qué es un skill -Un skill es un archivo Markdown que un agente de IA carga bajo demanda en función de tu prompt. Su frontmatter YAML (`name`, `description`, `version`) le indica al agente **cuándo** cargarlo y **qué** cubre. El cuerpo en Markdown le enseña al agente **cómo** realizar la tarea. +A skill is a folder with a `SKILL.md` entry point that the agent loads on demand, based on your prompt. Su frontmatter YAML (`name`, `description`, `version`) le indica al agente **cuándo** cargarlo y **qué** cubre. The Markdown body teaches the agent **how** to do the job, and larger skills - like this one - bundle extra reference files under `references/` that the agent reads only when needed. ## Qué cubre el skill El skill enseña al agente toda la superficie de `te`: -- todos los comandos de `te` en todas sus familias: load, save, init, deploy, refresh, bpa, validate, query, script, format y más +- every `te` command across all families - save-as, init, deploy, refresh, bpa, validate, query, script, util, and more - patrones de autenticación: interactiva, entidad de servicio con secreto o certificado, variables de entorno, identidad administrada - gramática de rutas de objeto: forma con barras, forma DAX y comodines -- el modelo de staging: comportamiento de `--save`, `--stage` y `--revert` +- the save model - dry run by default, `--save` to persist, and the interactive shell's `--stage`/`--revert` - Correspondencias de migración de TE2 a CLI - Recetas de CI/CD para GitHub Actions y Azure DevOps - formatos de salida, códigos de salida, variables de entorno y claves de configuración -- una hoja de referencia de propiedades comunes de `-q` +- a cheatsheet of common property names for `-p Name=Value` - los escollos que hacen tropezar a los agentes en la práctica Esto cubre lo mismo que el resto de esta sección documenta para humanos. Consulta @te-cli-commands para la referencia de comandos, @te-cli-auth para la autenticación y @te-cli-cicd para patrones de canalización. -## Descarga el archivo del skill +## Download the skill -Este skill es un único archivo: [`SKILL.md`](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/SKILL.md). +The skill lives in the [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder of the CLI repository - `SKILL.md` plus its `references/` subfolder. -1. Abre [`SKILL.md`](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/SKILL.md) en GitHub. -2. Haz clic en **Download raw file** (en la parte superior derecha del visor de archivos). -3. Guarda el archivo en un lugar práctico. +1. Clone the [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository, or download the repository ZIP (**Code > Download ZIP**) and extract it. +2. Copy the whole `skills/te-cli/` folder somewhere convenient, keeping the `references/` subfolder next to `SKILL.md`. -Moverás este archivo a una ubicación específica de la herramienta en los pasos de instalación que se indican a continuación. Para ver qué cambió entre versiones antes de descargar una copia más reciente, consulta el [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md). +You'll move this folder to a tool-specific location in the install steps below. Para ver qué cambió entre versiones antes de descargar una copia más reciente, consulta el [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md). ## Elige un ámbito de instalación @@ -65,16 +64,16 @@ Claude Code carga las habilidades desde una carpeta con un nombre específico de **Ámbito de proyecto** - la habilidad solo se carga dentro de este proyecto: 1. En la raíz de tu proyecto, crea la carpeta `.claude/skills/te-cli/`. -2. Coloca el archivo `SKILL.md` descargado dentro de esa carpeta. +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. -La ruta final es `/.claude/skills/te-cli/SKILL.md`. +The final path is `/.claude/skills/te-cli/SKILL.md`, with `references/` alongside it. **Ámbito de usuario** - la habilidad se carga en todos los proyectos del usuario actual: 1. Crea una carpeta `te-cli` dentro de tu directorio de habilidades de Claude a nivel de usuario: - **macOS / Linux:** `~/.claude/skills/te-cli/` - **Windows:** `%USERPROFILE%\.claude\skills\te-cli\` (normalmente `C:\Users\\.claude\skills\te-cli\`) -2. Coloca el archivo `SKILL.md` descargado dentro de esa carpeta. +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. > [!NOTE] > Claude Code vigila los directorios de habilidades y detecta habilidades nuevas o editadas durante la sesión actual; no necesitas reiniciar. La excepción es crear un directorio `.claude/skills/` que no existía al iniciar la sesión: reinicia Claude Code una vez para que empiece a vigilar el nuevo directorio. @@ -92,17 +91,17 @@ Deberías ver `te-cli` en la lista. Si no aparece, confirma la ruta del archivo Para hacer una prueba de humo funcional, pregunta: ``` -what does `te deploy --xmla` do? +what does `te deploy` do without `--execute`? ``` -Claude responde con el comportamiento documentado: genera un script TMSL/XMLA en stdout en lugar de desplegarlo, lo que confirma que la skill está cargada y en uso. +Claude answers with the documented behavior - it's a dry run that prints the TMSL deployment script to stdout without deploying anything - which confirms the skill is loaded and in use. ## Instalación para Claude.ai y Claude Desktop Claude.ai (web y escritorio) incluye una función integrada de **Skills**. Las Skills requieren ejecución de código, y debes subirlas como un archivo ZIP de la carpeta de la skill, en lugar del `SKILL.md` suelto. 1. Activa la ejecución de código: ve a **Configuración > Capacidades** y habilita **Ejecución de código y creación de archivos**. En los planes Team y Enterprise, un propietario lo habilita en la configuración de la organización. -2. Coloca el `SKILL.md` descargado dentro de una carpeta llamada `te-cli` y, después, comprime esa carpeta en `te-cli.zip`. +2. Compress the whole downloaded `te-cli` folder (including `references/`) into `te-cli.zip`. 3. Ve a **Configuración > Capacidades > Skills** (también accesible desde **Personalizar > Skills**). 4. Haz clic en **+**, elige **Subir una skill** y selecciona `te-cli.zip`. Claude lee el `SKILL.md` incluido y muestra un resumen de la skill. 5. Activa la skill. Se carga automáticamente cuando mencionas `te` o un concepto relacionado. @@ -113,11 +112,11 @@ Consulta el [artículo de ayuda sobre Skills de Anthropic](https://support.claud ## Instalación para GitHub Copilot -GitHub Copilot en VS Code es compatible de forma nativa con el estándar abierto Agent Skills: el mismo formato `SKILL.md` que usan Claude Code y Codex. Este es el enfoque recomendado porque la skill solo se carga cuando es relevante. En configuraciones de Copilot anteriores a Agent Skills, usa como alternativa el archivo de instrucciones personalizadas siempre activo que aparece más abajo. +GitHub Copilot en VS Code es compatible de forma nativa con el estándar abierto Agent Skills: el mismo formato `SKILL.md` que usan Claude Code y Codex. Este es el enfoque recomendado porque la skill solo se carga cuando es relevante. For Copilot setups that predate Agent Skills, fall back to the generic `AGENTS.md` install below. ### Agent Skills (VS Code) -Coloca la skill en una carpeta con nombre dentro de un directorio de skills. El nombre de la carpeta debe coincidir con el campo `name` del frontmatter, así que usa `te-cli` y mantén intacto el frontmatter YAML. +Place the skill folder contents (`SKILL.md` and `references/`) in a named folder under a skills directory. El nombre de la carpeta debe coincidir con el campo `name` del frontmatter, así que usa `te-cli` y mantén intacto el frontmatter YAML. - **Alcance del Workspace:** `.github/skills/te-cli/SKILL.md` (Copilot también lee `.claude/skills/` y `.agents/skills/`). - **Ámbito de usuario:** `~/.copilot/skills/te-cli/SKILL.md` (Copilot también lee `~/.claude/skills/` y `~/.agents/skills/`). @@ -131,14 +130,14 @@ Codex CLI carga skills de forma nativa desde una carpeta con nombre dentro de `. **Ámbito de proyecto**: la skill se carga solo dentro de este proyecto: 1. En la raíz del proyecto, crea la carpeta `.agents/skills/te-cli/`. -2. Coloca el archivo `SKILL.md` descargado dentro de esa carpeta. +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. Codex busca hacia arriba desde tu directorio de trabajo, así que una skill incluida en la raíz del repositorio (`$REPO_ROOT/.agents/skills/te-cli/`) se comparte con todos los que trabajan en el repositorio. **Ámbito personal**: la skill se carga en todos los proyectos del usuario actual: 1. Crea la carpeta `te-cli` dentro de tu directorio personal de skills de Codex: `~/.agents/skills/te-cli/`. -2. Coloca el archivo `SKILL.md` descargado dentro de esa carpeta. +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. Ejecuta `/skills` en la CLI de Codex o en el IDE para confirmar que `te-cli` aparece en la lista, y escribe `te-cli` para mencionar una skill explícitamente. @@ -146,20 +145,21 @@ Ejecuta `/skills` en la CLI de Codex o en el IDE para confirmar que `te-cli` apa Para herramientas que siguen la [convención `AGENTS.md`](https://agents.md) o aceptan un archivo de instrucciones arbitrario —Aider, Continue, agentes internos personalizados—: -1. Descarga `SKILL.md`. -2. Elimina el bloque de frontmatter YAML de la parte superior (todo lo que haya entre la primera y la segunda línea `---`, incluidas esas líneas). -3. Cambia el nombre del archivo a `AGENTS.md` y colócalo en la raíz del proyecto, o donde la herramienta espere su archivo de instrucciones. -4. La siguiente invocación del agente en ese proyecto detectará las instrucciones. +1. Download the skill folder. +2. In a copy of `SKILL.md`, remove the YAML frontmatter block at the top (everything between the first and second `---` lines, including those lines). +3. Rename that file to `AGENTS.md` and place it at your project root, or wherever the tool expects its instructions file. +4. Copy the `references/` folder next to your `AGENTS.md` so its relative links keep working. +5. La siguiente invocación del agente en ese proyecto detectará las instrucciones. ## Actualizar la skill Para obtener una versión más reciente: -1. Abre [`SKILL.md`](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/SKILL.md) en GitHub y usa **Download raw file** para descargar la copia más reciente. -2. Sustituye el archivo que instalaste antes: - - **Skills nativas (Claude Code, Codex, Copilot Agent Skills):** sobrescribe `SKILL.md` en la carpeta de la skill. +1. Grab the latest [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder from GitHub (re-clone, pull, or re-download the repository ZIP). +2. Replace what you previously installed: + - **Native skills (Claude Code, Codex, Copilot Agent Skills):** replace the whole skill folder contents (`SKILL.md` and `references/`). - **Claude.ai / Desktop:** vuelve a comprimir en ZIP la carpeta `te-cli` y vuelve a subirla desde la interfaz de Skills. - - **Instalaciones mediante archivos de instrucciones (instrucciones personalizadas de Copilot, AGENTS.md):** vuelve a pegar el texto completo en `.github/copilot-instructions.md` o `AGENTS.md`. + - **Instruction-file installs (AGENTS.md):** re-paste the body into `AGENTS.md` and refresh the copied `references/` folder. Consulta el [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md) para ver qué cambió entre versiones. From 96ddd9173bd5460a76366428a8fc92cf15b31fef Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:39 +0200 Subject: [PATCH 06/48] New translations te-cli-preview-notice.md (Spanish) [ci skip] --- .../content/features/te-cli/includes/te-cli-preview-notice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localizedContent/es/content/features/te-cli/includes/te-cli-preview-notice.md b/localizedContent/es/content/features/te-cli/includes/te-cli-preview-notice.md index e92f53863..ea5e36c0a 100644 --- a/localizedContent/es/content/features/te-cli/includes/te-cli-preview-notice.md +++ b/localizedContent/es/content/features/te-cli/includes/te-cli-preview-notice.md @@ -1,2 +1,2 @@ > [!IMPORTANT] -> La CLI de Tabular Editor se encuentra en **vista previa pública limitada**. Se ofrece para su evaluación con una cuenta de Tabular Editor; no se requiere ninguna licencia durante la vista previa. Los comandos, las opciones y las salidas pueden cambiar antes de la disponibilidad general. **La versión preliminar deja de funcionar después de 2026-09-30.** No recomendamos usar la CLI en pipelines de CI/CD de producción durante la vista previa. +> La CLI de Tabular Editor se encuentra en **vista previa pública limitada**. Se ofrece para su evaluación con una cuenta de Tabular Editor; no se requiere ninguna licencia durante la vista previa. Los comandos, las opciones y las salidas pueden cambiar antes de la disponibilidad general. **La versión preliminar dejará de funcionar después del 2026-10-31.** No recomendamos usar la CLI en pipelines de CI/CD de producción mientras esté en vista previa. From 4b15c911c2ce3b2418b4c69a9709c2daadbc7f47 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:42 +0200 Subject: [PATCH 07/48] New translations te-cli-auth.md (Spanish) [ci skip] --- .../es/content/features/te-cli/te-cli-auth.md | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-auth.md b/localizedContent/es/content/features/te-cli/te-cli-auth.md index d01d63632..d8b9bbbf4 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-auth.md +++ b/localizedContent/es/content/features/te-cli/te-cli-auth.md @@ -2,7 +2,7 @@ uid: te-cli-auth title: Autenticación y conexiones author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -37,6 +37,9 @@ La CLI admite la cadena completa de credenciales de Azure Identity: En escenarios sin interfaz gráfica, con SSH, WSL o devcontainer, usa una entidad de servicio: `te auth login -u -p -t ` (o `--certificate`). El inicio de sesión se guarda en caché, por lo que los comandos posteriores obtienen tokens de forma silenciosa con `--auth auto`. +> [!NOTE] +> Las opciones de detección de esquema de `te add -t Table` y `te set --update-schema` (`--source sql`, `--endpoint`) usan Entra ID para iniciar sesión en los puntos de conexión SQL de la familia de Azure (`*.database.windows.net`, `*.datawarehouse.fabric.microsoft.com`, `*.sql.azuresynapse.net`) y respetan `--auth`. Los servidores locales usan la autenticación integrada de Windows; `--connection-string` se respeta literalmente. + ## `te auth login` Autentícate y guarda el resultado en caché para los comandos posteriores: @@ -108,11 +111,12 @@ te connect my-workspace my-model # Local TMDL folder, .bim file, or .SemanticModel container te connect ./my-model -# Connect to a running Power BI Desktop instance (Windows only) +# Connect to a locally running Analysis Services instance +# (Power BI Desktop, Visual Studio workspace, standalone SSAS - Windows only) te connect --local -# Filter by report name when multiple Power BI Desktop instances are running -te connect --local my-report +# Match an instance (e.g. an open report's window title) or a database name +te connect --local my-model # Show the active connection te connect @@ -121,7 +125,9 @@ te connect te connect --clear ``` -El estado de la conexión activa es específico de cada sesión de terminal: al abrir un terminal nuevo, se empieza desde cero. Inspecciona o limpia el estado de la sesión con [`te session`](xref:te-cli-commands#session). +Cuando se encuentran varias instancias o bases de datos locales, la CLI solicita la selección en dos pasos (primero la instancia y luego la base de datos); con `--non-interactive`, falla con la lista de candidatos en lugar de elegir de forma silenciosa. + +El estado de la conexión activa es específico de cada sesión de terminal: al abrir un terminal nuevo, se empieza desde cero. Inspecciona o limpia el estado de la sesión con [`te session`](xref:te-cli-commands#session). En `te deploy`, la conexión activa también se usa como valor predeterminado para `--target-server`/`--target-database` cuando el origen del modelo es local. ### Modo del área de trabajo (`-w` / `--workspace`) @@ -171,7 +177,7 @@ te profile show prod te connect --profile prod # One-shot use without changing the active connection -te deploy ./model --profile staging --force +te deploy --model ./model --profile staging --execute --force ``` Los perfiles también pueden incluir sobrescrituras de comportamiento que se aplican siempre que el perfil esté activo: @@ -193,6 +199,8 @@ En canalizaciones de CI/CD, agentes o cualquier contexto desatendido, evita los - La opción global `--non-interactive` (falla de inmediato en lugar de pedir datos). - Uno de los métodos de autenticación no interactiva: `env`, `managed-identity` o credenciales explícitas de una entidad de servicio. +Con `--non-interactive` y sin nada con lo que iniciar sesión —sin un inicio de sesión en caché, sin variables `AZURE_CLIENT_*` ni una identidad administrada—, un comando que se conecta a un Workspace o a un servidor se detiene de inmediato, no abre nunca un navegador, muestra un Report que indica que no hay credenciales disponibles y enumera todas las formas de proporcionarlas: `te auth login`, una entidad de servicio almacenada en caché con `te auth login -u -p -t `, `--auth env` o `--auth managed-identity`. Una entidad de servicio almacenada en caché se usa de forma silenciosa, por lo que solo fallan así las ejecuciones en las que realmente no hay nada con lo que iniciar sesión. + Ejemplo basado en variables de entorno para una canalización: ```bash @@ -200,9 +208,11 @@ export AZURE_CLIENT_ID="your-app-id" export AZURE_CLIENT_SECRET="your-client-secret" export AZURE_TENANT_ID="your-tenant-id" -te deploy ./model -s my-workspace -d my-model \ +te deploy --model ./model \ + --target-server my-workspace --target-database my-model \ --auth env \ --non-interactive \ + --execute \ --force \ --ci github ``` From 8a58a72ee93c42f0b0fbd7524d98a3e48f03e63f Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:45 +0200 Subject: [PATCH 08/48] New translations te-cli-automation.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-automation.md | 69 +++++++++++-------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-automation.md b/localizedContent/es/content/features/te-cli/te-cli-automation.md index 061c5f724..94b664551 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-automation.md +++ b/localizedContent/es/content/features/te-cli/te-cli-automation.md @@ -2,7 +2,7 @@ uid: te-cli-automation title: Automatización y scripts author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -23,13 +23,13 @@ La CLI de Tabular Editor es componible: cada comando admite salida estructurada, Use `--output-format` para alternar cualquier comando entre el formato de texto (legible para personas) y formatos legibles por máquina: -| Formato | Se utiliza para | Notas | -| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `text` (predeterminado) | Para uso humano | Texto sin formato en stdout, independientemente de si el flujo es un TTY o se canaliza. | -| `json` | Para uso por máquina | Siempre devuelve JSON válido en stdout. Use `--error-format json` si también quiere errores legibles por máquina en stderr. | -| `csv` | Resultados tabulares (`query`, `bpa run`, `bpa rules`, `vertipaq`, `validate`, `test`, `refresh`, `profile list`, `session list`, `find`, `replace`, `get`, `ls`) | Escapado según RFC 4180. | -| `tmsl` (alias `bim`) | Serialización TMSL/BIM del objeto completo | Admitido por `te get` y `te list`. | -| `tmdl` | Serialización TMDL del objeto completo | Aceptado solo por `te get` (un solo objeto). | +| Formato | Se utiliza para | Notas | +| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `text` (predeterminado) | Para uso humano | Texto sin formato en stdout, independientemente de si el flujo es un TTY o se canaliza. | +| `json` | Para uso por máquina | Siempre devuelve JSON válido en stdout. Use `--error-format json` si también quiere errores legibles por máquina en stderr. | +| `csv` | Resultados tabulares (`query`, `bpa run`, `bpa rules`, `vertipaq`, `validate`, `test`, `refresh`, `profile list`, `session list`, `find`, `get`, `ls`) | Escapado según RFC 4180. | +| `tmsl` (alias `bim`) | Serialización TMSL/BIM del objeto completo | Admitido por `te get` y `te list`. | +| `tmdl` | Serialización TMDL del objeto completo | Aceptado solo por `te get` (un solo objeto). | ```bash te list --output-format json @@ -37,6 +37,8 @@ te query -q "EVALUATE VALUES('Date'[Year])" --output-format csv te bpa run --output-format json ``` +Con `--output-format json`, `te validate`, `te bpa run`, `te test run` y `te query` comparten una misma estructura de documento JSON con un `summary`, una matriz plana `findings[]` y `durationMs`; consulta @te-cli-findings para ver la estructura que debes analizar. + > [!NOTE] > `--output-format` y `--error-format` son independientes. Establecer `--output-format json` _no_ cambia stderr a JSON; usa `--error-format json` para eso. No hay cambio automático de formato cuando stdout se redirige; el valor predeterminado siempre es `text`, a menos que indiques lo contrario. @@ -44,25 +46,28 @@ te bpa run --output-format json Agrega `--non-interactive` a cualquier comando para deshabilitar las solicitudes de confirmación, las listas de selección de credenciales y los asistentes guiados. Si el comando necesita una entrada que no pueda determinar mediante opciones, variables de entorno o configuración, finaliza con un código distinto de cero y un error accionable, en lugar de quedarse bloqueado. +Además, `te deploy` y `te refresh` se ejecutan en modo de simulación de forma predeterminada: imprimen el TMSL que enviarían y no tocan nada. `--execute` realiza la acción y, en ejecuciones con entrada canalizada o en CI, `--execute` requiere `--force` (no se puede responder al aviso de confirmación). + ```bash -te deploy ./model --non-interactive --force --ci github +te deploy --model ./model --target-server my-workspace --target-database my-model \ + --non-interactive --execute --force --ci github ``` ## Códigos de salida Todos los comandos de `te` finalizan con un código de estado predecible, para que quien los invoque pueda tomar decisiones según el éxito o el error sin tener que analizar stdout. -| Código de salida | Significado | -| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `0` | Éxito. | -| `1` | Fallo genérico: argumentos no válidos, fallo del comando, errores de validación, fallo de autenticación, fallo en la comprobación de BPA con severidad >= error. En `te diff`: se encontraron diferencias (como en la convención `diff`/`cmp`). | -| `2` | Solo en `te diff`: se produjo un error durante la comparación, por lo que se desconoce el estado de las diferencias. | +| Código de salida | Significado | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | Éxito. | +| `1` | Error genérico: argumentos no válidos, fallo del comando, errores de validación, fallo de autenticación, gate de BPA fallido con gravedad >= error, una ejecución de `te script` en la que un script llamó a `Error(...)`, un `te deploy` que el servidor aceptó, pero con errores de objeto. En `te diff`: se encontraron diferencias (como en la convención `diff`/`cmp`). | +| `2` | Solo en `te diff`: se produjo un error durante la comparación, por lo que se desconoce el estado de las diferencias. | Combina los códigos de salida con las anotaciones `--ci ` y `--trx ` para mostrar información detallada sobre los errores en CI; consulta @te-cli-cicd. ## Errores en stderr -Los errores, las advertencias y el banner de versión preliminar se escriben en **stderr**; los datos estructurados se escriben en **stdout**. Esto significa que puedes canalizar JSON de forma segura sin que se contamine con indicadores de progreso ni mensajes de diagnóstico: +Los errores, las advertencias y los avisos de progreso y estado (el indicador giratorio, `Using active connection:`), el recordatorio de uso que aparece tras un error de argumentos y el banner de vista previa se escriben en **stderr**; stdout solo contiene el resultado. Por tanto, un comando rechazado deja stdout vacío, así que una ejecución de simulación capturada es o bien una salida válida o bien nada en absoluto, y puedes canalizar JSON con seguridad sin que se contamine con indicadores de progreso ni mensajes de diagnóstico: ```bash te list --output-format json | jq '.[] | .name' @@ -89,7 +94,7 @@ def query(server: str, database: str, dax: str) -> list[dict]: capture_output=True, text=True, ) - return json.loads(result.stdout) + return json.loads(result.stdout)["rows"] rows = query("Finance", "Revenue Model", "EVALUATE TOPN(10, 'Sales')") for row in rows: @@ -103,9 +108,10 @@ import json import subprocess result = subprocess.run( - ["te", "deploy", "./model", - "-s", "Finance", "-d", "Revenue", - "--output-format", "json", "--non-interactive", "--force"], + ["te", "deploy", "--model", "./model", + "--target-server", "Finance", "--target-database", "Revenue", + "--output-format", "json", "--error-format", "json", + "--non-interactive", "--execute", "--force"], capture_output=True, text=True, ) @@ -122,10 +128,10 @@ if result.returncode != 0: PowerShell maneja JSON de forma nativa. `te` es un ejecutable de consola normal que funciona directamente en canalizaciones de PowerShell (consulta @te-cli-migrate si estás migrando desde la antigua CLI de `TabularEditor.exe`): ```powershell -$rows = te query -s Finance -d Revenue -q "EVALUATE TOPN(10, 'Sales')" --output-format json --non-interactive +$result = te query -s Finance -d Revenue -q "EVALUATE TOPN(10, 'Sales')" --output-format json --non-interactive | ConvertFrom-Json -$rows | Format-Table +$result.rows | Format-Table # Check exit code after the pipeline if ($LASTEXITCODE -ne 0) { @@ -141,9 +147,9 @@ $env:AZURE_CLIENT_ID = "your-app-id" $env:AZURE_CLIENT_SECRET = "your-client-secret" $env:AZURE_TENANT_ID = "your-tenant-id" -te deploy ./model ` - -s my-workspace -d my-model ` - --auth env --non-interactive --force --ci vsts +te deploy --model ./model ` + --target-server my-workspace --target-database my-model ` + --auth env --non-interactive --execute --force --ci vsts ``` ## Bash @@ -169,22 +175,25 @@ Generar un script TMSL de actualización y ponerlo bajo control de versiones sol ```bash te connect MyWorkspace MyModel -te refresh --type full --dry-run > refresh.tmsl +te refresh --type full > refresh.tmsl cat refresh.tmsl ``` -El TMSL resultante puede revisarse en un pull request, confirmarse mediante un commit, ejecutarse mediante la CLI (`te refresh --type full`), entregarse a un DBA o aplicarse con cualquier herramienta compatible con XMLA. La CLI se convierte en un componente en lugar de una caja negra. +El TMSL resultante puede revisarse en un pull request, incluirse en un commit, ejecutarse con la CLI (`te refresh --type full --execute`), entregarse a un DBA o aplicarse con cualquier herramienta compatible con XMLA. La CLI se convierte en un componente en lugar de una caja negra. ## Patrones útiles Algunos patrones pequeños que aparecen a menudo al componer comandos de `te` en scripts o pipelines: -- **Creaciones y eliminaciones idempotentes de medidas.** `te add Sales/Marker -t Measure -i "0" --if-not-exists --save` y `te remove Sales/OldMeasure --if-exists --save` terminan con código de salida `0` exista o no el objeto; es seguro volver a ejecutarlos en CI. -- **Diferencias en modo de prueba.** `te replace` funciona en modo de prueba de forma predeterminada; añade `--save` solo cuando estés conforme con la vista previa. -- **Genera TMSL para revisión.** `te deploy ./model --xmla deploy.tmsl` produce el script de implementación sin tocar el servidor; útil para que lo revise un DBA o para aplicarlo manualmente. +- **Creaciones y eliminaciones idempotentes de medidas.** `te add Sales/Marker -t Measure -p Expression="0" --if-not-exists --save` y `te remove Sales/OldMeasure --if-exists --save` salen con código `0` exista o no el objeto; es seguro volver a ejecutarlos en CI. +- **Nada persiste sin `--save`.** Los comandos que modifican (`te add`, `te set`, `te move`, `te remove`, `te script`, `te macro run`) aplican el cambio en memoria, generan un Report de lo que han hecho y luego imprimen `Ejecución de simulación: no se guardó nada.`. Agrega --save para que el cambio persista.`Ejecuta uno sin opciones para confirmar que resuelve los objetos que esperas y luego vuelve a ejecutarlo con`--save`. `te remove --dry-run\` va un paso más allá y genera un Report de lo que se quitaría sin aplicar nada. +- **Genera TMSL para revisión.** `te deploy --model ./model --target-server my-workspace --target-database my-model > deploy.tmsl` - deploy se ejecuta en modo de simulación de forma predeterminada e imprime en stdout el TMSL exacto ajustado al destino, por lo que al redirigirlo obtienes el script de implementación sin tocar el servidor. Útil para que lo revise un DBA o para aplicarlo manualmente. +- **Valores canalizados mediante `-`.** Todas las opciones que aceptan un valor leen la entrada estándar stdin canalizada a través de `-` (se quita la nueva línea final, se elimina la marca de orden de bytes; si no se canaliza nada, falla de inmediato): `cat query.dax | te query -q -` (también funciona canalizar la stdin sin `-q`), `te set Sales/Amount -p Expression=- < expr.dax --save`, `cat fix.csx | te script --inline - --save`, `cat messy.dax | te util format-dax -`. Un valor canalizado se toma literalmente: canalizar el texto `null` almacena la palabra `null`, mientras que `-p Name=null` o `--unset Name` borra la propiedad. +- **Descubre los nombres de las propiedades.** `te get --properties --output-format json` devuelve cada nombre que `-p` acepta en ese objeto, junto con su tipo, si es editable y sus valores permitidos; es la lista que debes consultar antes de generar llamadas a `te set`. +- **Conjuntos de cambios analizables.** Los comandos que modifican (`set`, `add`, `remove`, `move`, `script`, `bpa run --fix`) muestran un diff de forma predeterminada; `--stat` y `--name-only` ofrecen alternativas de texto compactas, y `te config set mutationOutput diff|stat|name-only|none` establece un valor predeterminado permanente. La salida JSON siempre incluye la matriz completa `changes` (una entrada por cada objeto cambiado con `objectPath`, `objectType`, `changeKind` y pares de propiedades antes/después) independientemente de estas opciones; es la estructura estable que debes analizar en scripts. `te diff` genera un Report de sus diferencias con la misma estructura. - **Salida solo con rutas.** `te list --paths-only` y `te find --paths-only` emiten una ruta de objeto por línea, ideal para canalizar la salida a `xargs`, `te get` o `te set`. Los contenedores a nivel de modelo para medidas (`te list Measures`, `te list Columns`) se combinan bien con esto para realizar barridos de todo el modelo. - **Pruebas de rendimiento de consultas.** `te query --trace --cold --runs 5` ejecuta una consulta DAX con caché en frío, cinco iteraciones y captura eventos de traza de FE/SE. -- **Tiempos por paso en los logs de CI.** Los comandos de larga duración (`te deploy`, `te refresh`, `te script`, `te validate`) incluyen un campo `durationMs` en la salida JSON; útil para mostrar los tiempos de cada paso en los resúmenes del pipeline. +- **Tiempos por paso en los logs de CI.** Los comandos de larga duración (`te deploy`, `te refresh`, `te script`, `te validate`, `te query`) incluyen un campo `durationMs` en la salida JSON; útil para mostrar los tiempos de cada paso en los resúmenes del pipeline. ## Páginas relacionadas From 09241dea29f888cb3f1d0f4893fef939deb61fcf Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:48 +0200 Subject: [PATCH 09/48] New translations te-cli-cicd.md (Spanish) [ci skip] --- .../es/content/features/te-cli/te-cli-cicd.md | 70 +++++++++++-------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-cicd.md b/localizedContent/es/content/features/te-cli/te-cli-cicd.md index b5d8b9689..49e65b0e6 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-cicd.md +++ b/localizedContent/es/content/features/te-cli/te-cli-cicd.md @@ -2,7 +2,7 @@ uid: te-cli-cicd title: Integración de CI/CD author: Peer Grønnerup -updated: 2026-05-06 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -22,7 +22,7 @@ La CLI de Tabular Editor está diseñada para ejecutarse sin supervisión en pip > [!WARNING] > **No uses la CLI en pipelines de producción durante la versión preliminar pública limitada.** Hay dos riesgos específicos de esta versión preliminar que afectan a los propietarios de pipelines: > -> - **Caducidad estricta.** El binario preliminar deja de funcionar el **2026-09-30**; cualquier pipeline que dependa de él fallará en esa fecha, independientemente de tu calendario de versiones. +> - **Caducidad estricta.** El binario preliminar deja de funcionar el **2026-10-31**; cualquier pipeline que dependa de él fallará en esa fecha, independientemente de tu calendario de versiones. > - **Sin garantía de compatibilidad con versiones anteriores.** Los comandos, las opciones, los formatos de salida y los códigos de salida pueden cambiar entre compilaciones preliminares, así que quizá tengas que actualizar los pasos del pipeline cuando actualices el binario incluido en el repositorio. > > Compila y evalúa en pipelines que no sean de producción, y comparte tus comentarios en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI) para que la versión GA se ajuste a tus necesidades. @@ -31,10 +31,12 @@ La CLI de Tabular Editor está diseñada para ejecutarse sin supervisión en pip - **Un único binario autocontenido.** Sin necesidad de instalar un entorno de ejecución, sin `TabularEditor.exe`, sin `start /wait`. - **Opción global `--non-interactive`.** Desactiva todas las indicaciones; falla de inmediato con errores claros y útiles. -- **`--force`** en comandos que realizan cambios (`te deploy`, `te refresh`) omite las indicaciones de confirmación. -- **`--ci vsts` / `--ci github`.** Emite anotaciones nativas del pipeline en stderr. +- **Simulación por defecto.** `te deploy` y `te refresh` imprimen el TMSL exacto que enviarían; añade `--execute` para que el comando se ejecute de verdad. Ambos piden confirmación en la terminal, así que `--execute --force` es obligatorio en CI, donde no se puede responder a una solicitud interactiva. +- **Si falla, falla.** `te deploy` sale con un código distinto de cero cuando el servidor acepta los metadatos pero deja objetos con errores, y `te script` sale con un código distinto de cero cuando un script emite un Report de error; un control basado en el código de salida no puede dar por buena una ejecución con errores. +- **`--ci vsts` / `--ci github`.** Emite anotaciones nativas del pipeline en stderr, con el código del hallazgo (`code=` en Azure DevOps, `title=` en GitHub). `azdo` / `azure-devops` y `gh` son alias aceptados; `none` significa que no se emiten anotaciones, y un valor mal escrito se rechaza antes de que se ejecute el comando, en lugar de no emitir nada en silencio. - **`--trx `.** Genera resultados VSTEST que Azure DevOps puede consumir al publicar los resultados de pruebas. -- **Errores estructurados.** `--output-format json` emite `{"error": "...", "hint": "..."}` en stderr para que los pasos del pipeline puedan fallar con mensajes útiles. +- **Errores estructurados.** `--error-format json` emite `{"error": "...", "hint": "..."}` en stderr para que los pasos del pipeline puedan fallar con un mensaje útil. +- **Un único JSON de hallazgos.** `te validate`, `te bpa run`, `te test run` y `te query` comparten un único documento JSON legible por máquina con `--output-format json`: un `summary`, un array plano `findings[]` con `severity`/`source`/`code`/`message` y, cuando sea posible, un `objectPath` que puedes volver a pasar a `te get`. Consulta @te-cli-findings. ## Agregar la CLI a tu repositorio @@ -53,7 +55,7 @@ your-repo/ Coloca el binario **extraído** —no el archivo comprimido— para que el pipeline pueda invocarlo directamente. Elige la compilación que coincida con el SO y la arquitectura de tu runner; consulta @te-cli-install para ver la tabla de nombres de archivo. El binario autocontenido ocupa ~70 MB; considera usar Git LFS si tu repositorio es sensible al tamaño. > [!NOTE] -> Al hacer commit del binario, también dejas fijada la versión de la CLI que hayas incluido en el repositorio, lo cual es deseable para la reproducibilidad de la CI. Para actualizar, sustituye el binario en `tools/te/` y haz commit: los mensajes del commit serán tu registro de versiones. Ten en cuenta que el binario preliminar caduca el **2026-09-30** independientemente de cuándo lo hayas incorporado al repositorio, así que una copia incluida en el repositorio no es una dependencia permanente; planifica renovarla (y volver a validar tu pipeline con la nueva superficie de la API) siguiendo la cadencia de las compilaciones preliminares. +> Al hacer commit del binario, también dejas fijada la versión de la CLI que hayas incluido en el repositorio, lo cual es deseable para la reproducibilidad de la CI. Para actualizar, sustituye el binario en `tools/te/` y haz commit: los mensajes del commit serán tu registro de versiones. Ten en cuenta que el binario preliminar caduca el **2026-10-31** independientemente de cuándo lo hayas incorporado al repositorio, así que una copia incluida en el repositorio no es una dependencia permanente; planifica actualizarla (y volver a validar tu pipeline con la nueva superficie de la API) siguiendo la cadencia de las compilaciones preliminares. ## GitHub Actions @@ -82,18 +84,19 @@ jobs: echo "$GITHUB_WORKSPACE/tools/te" >> $GITHUB_PATH - name: Validate - run: te validate ./model --ci github --trx validate.trx + run: te validate --model ./model --ci github --trx validate.trx - name: Best Practice Analyzer (gate) - run: te bpa run ./model --fail-on error --ci github --trx bpa.trx + run: te bpa run --model ./model --fail-on error --ci github --trx bpa.trx - name: Deploy run: | - te deploy ./model \ - -s "${{ vars.WORKSPACE }}" \ - -d "${{ vars.MODEL }}" \ + te deploy --model ./model \ + --target-server "${{ vars.WORKSPACE }}" \ + --target-database "${{ vars.MODEL }}" \ --auth env \ --non-interactive \ + --execute \ --force \ --ci github @@ -133,16 +136,16 @@ steps: - powershell: Write-Host "##vso[task.prependpath]$(Build.SourcesDirectory)\tools\te" displayName: 'Set up Tabular Editor CLI' - - script: te validate ./model --ci vsts --trx validate.trx + - script: te validate --model ./model --ci vsts --trx validate.trx displayName: 'Validate' - - script: te bpa run ./model --fail-on error --ci vsts --trx bpa.trx + - script: te bpa run --model ./model --fail-on error --ci vsts --trx bpa.trx displayName: 'BPA gate' - script: | - te deploy ./model ^ - -s "$(WORKSPACE)" -d "$(MODEL)" ^ - --auth env --non-interactive --force --ci vsts + te deploy --model ./model ^ + --target-server "$(WORKSPACE)" --target-database "$(MODEL)" ^ + --auth env --non-interactive --execute --force --ci vsts displayName: 'Deploy' env: AZURE_CLIENT_ID: $(AZURE_CLIENT_ID) @@ -165,7 +168,7 @@ steps: ## Patrones de compuerta del BPA -`te deploy` y `te save` ejecutan el Best Practice Analyzer como compuerta de verificación previa de forma predeterminada. Hay tres comportamientos que conviene definir de antemano: +`te deploy` y `te save-as` ejecutan el Best Practice Analyzer como comprobación previa por defecto. Hay tres comportamientos que conviene definir de antemano: - **Aplicar**: el valor predeterminado. El pipeline falla si BPA detecta infracciones con severidad >= error. Combínalo con `--fail-on warning` en un paso independiente de `te bpa run` si quieres que las advertencias también hagan fallar el pipeline. - **Corrección automática**: `--fix-bpa` aplica las `fixExpression`s en memoria al artefacto desplegado. Los archivos de origen no se modifican. Es útil cuando la fuente de verdad está en el modelo y quieres que los despliegues normalicen el estilo sin intervención del desarrollador. @@ -173,44 +176,53 @@ steps: ```bash # Treat warnings as failures in PR validation -te bpa run ./model --fail-on warning --ci github --trx bpa.trx +te bpa run --model ./model --fail-on warning --ci github --trx bpa.trx # Auto-fix during deploy (source unchanged) -te deploy ./model -s my-ws -d my-model --fix-bpa --force --ci github +te deploy --model ./model --target-server my-ws --target-database my-model --fix-bpa --execute --force --ci github # Emergency bypass -te deploy ./model -s my-ws -d my-model --skip-bpa --force --ci github +te deploy --model ./model --target-server my-ws --target-database my-model --skip-bpa --execute --force --ci github ``` Consulta @te-cli-config para controlar globalmente el control del BPA mediante las claves de configuración `bpa.onDeploy` / `bpa.onSave`. +## Validación de scripts + +Los C# Script pueden comprobarse en compilación sin cargar ningún modelo: un paso de lint sin conexión para validar PR: + +```bash +# Compile-check C# scripts without a model (offline lint) +te script --file ./scripts/fix.csx --validate +``` + ## Patrones de actualización -La actualización en los pipelines suele ser un paso posterior al despliegue. Usa `--non-interactive` y elige un `--type` determinista: +La actualización en los pipelines suele ser un paso posterior al despliegue. Añade `--execute --force` (sin `--execute`, el comando solo imprime el TMSL que ejecutaría; sin `--force`, se detiene para pedir una confirmación que nadie puede dar), usa `--non-interactive` y elige un `--type` determinista: ```bash # Full refresh of the whole model after deploy -te refresh -s my-ws -d my-model --type full --non-interactive +te refresh -s my-ws -d my-model --type full --execute --force --non-interactive # Refresh a single fact table (e.g., daily incremental pipeline) -te refresh -s my-ws -d my-model --table Sales --type full --non-interactive +te refresh -s my-ws -d my-model --table Sales --type full --execute --force --non-interactive # Recalculate only (useful after calculation-group changes) -te refresh -s my-ws -d my-model --type calculate --non-interactive +te refresh -s my-ws -d my-model --type calculate --execute --force --non-interactive ``` -Para flujos de trabajo de actualización incremental, combina las opciones `--apply-refresh-policy`, `--effective-date ` y `--partition `. Consulta @te-cli-commands para más detalles. +En los flujos de trabajo de actualización incremental, usa `--apply-refresh-policy` (pasa `true`, `false` o el nombre de una tabla para limitar la actualización a esa tabla) junto con `--effective-date ` y `--execute --force`. Consulta @te-cli-commands para más detalles. ## Patrones de artefactos Genera TMSL o XMLA como artefacto sin desplegarlo, para que los DBA o un trabajo posterior puedan revisarlo o aplicarlo: ```bash -# Produce the XMLA/TMSL script that would deploy - do not deploy -te deploy ./model -s my-ws -d my-model --xmla deploy.tmsl --force +# Produce the TMSL script that a deploy would send - do not deploy (dry run is the default) +te deploy --model ./model --target-server my-ws --target-database my-model > deploy.tmsl -# Produce the TMSL refresh command - do not execute -te refresh -s my-ws -d my-model --type full --dry-run > refresh.tmsl +# Produce the TMSL refresh command - do not execute (dry run is the default) +te refresh -s my-ws -d my-model --type full > refresh.tmsl ``` Confirma estos artefactos en git, súbelos al almacenamiento de artefactos del pipeline o pásalos entre trabajos. Son texto sin formato y se pueden comparar fácilmente en las pull requests. From bf13bb7af8ef42756c522b84d2b3f324e54ae39a Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:51 +0200 Subject: [PATCH 10/48] New translations te-cli-install.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-install.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-install.md b/localizedContent/es/content/features/te-cli/te-cli-install.md index 8f97d2647..2cceb9d40 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-install.md +++ b/localizedContent/es/content/features/te-cli/te-cli-install.md @@ -2,7 +2,7 @@ uid: te-cli-install title: Instalación y configuración author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-04 applies_to: products: - product: Tabular Editor 2 @@ -128,7 +128,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> El banner vuelve a aparecer en cada comando durante los **14 días previos a la fecha de finalización de la versión preliminar** (2026-09-30), independientemente de `hidePreviewNotice`. Esto garantiza que tengas una advertencia visible antes de que la CLI deje de funcionar. +> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. Esto garantiza que tengas una advertencia visible antes de que la CLI deje de funcionar. ## Autocompletado del shell @@ -169,16 +169,16 @@ El autocompletado abarca subcomandos, opciones globales y rutas de modelos (cuan La mayoría de las funcionalidades son idénticas en todas las plataformas. Unas pocas dependen de transportes exclusivos de Windows: -| Funcionalidad | Windows | macOS / Linux | -| --------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------- | -| Cargar/guardar BIM y TMDL | Sí | Sí | -| Desplegar en Power BI / Fabric / Azure Analysis Services | Sí | Sí | -| Best Practice Analyzer y Analizador VertiPaq | Sí | Sí | -| C# Script | Sí | Sí | -| Consultas DAX en modelos en la nube | Sí | Sí | -| Autenticación: navegador, código de dispositivo, entidad de servicio, env, variables de entorno, identidad administrada | Sí | Sí | -| Conectarse a una instancia local de SSAS (transporte TCP) | Sí | **No** | -| Conectarse a Power BI Desktop (transporte por canalización con nombre) | Sí | **No** | +| Funcionalidad | Windows | macOS / Linux | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------- | ------------- | +| Work with local TMDL and BIM model files | Sí | Sí | +| Desplegar en Power BI / Fabric / Azure Analysis Services | Sí | Sí | +| Best Practice Analyzer y Analizador VertiPaq | Sí | Sí | +| C# Script | Sí | Sí | +| Consultas DAX en modelos en la nube | Sí | Sí | +| Authentication: browser (interactive), service principal, environment variables, managed identity | Sí | Sí | +| Conectarse a una instancia local de SSAS (transporte TCP) | Sí | **No** | +| Conectarse a Power BI Desktop (transporte por canalización con nombre) | Sí | **No** | > [!IMPORTANT] > Las conexiones locales a SSAS y Power BI Desktop dependen de protocolos de transporte solo disponibles en Windows. Todos los flujos de trabajo basados en la nube (Power BI Service, Fabric y Azure Analysis Services) funcionan en cualquier plataforma. From 1fdd0e8061a3e50c1b0f29f9af87020a8bcbd2ee Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:54 +0200 Subject: [PATCH 11/48] New translations te-cli-interactive.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-interactive.md | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-interactive.md b/localizedContent/es/content/features/te-cli/te-cli-interactive.md index 98df33d5a..f6b1a5d70 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-interactive.md +++ b/localizedContent/es/content/features/te-cli/te-cli-interactive.md @@ -2,7 +2,7 @@ uid: te-cli-interactive title: Modo interactivo author: Peer Grønnerup -updated: 2026-06-26 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -25,7 +25,7 @@ Para iniciar una sesión, ejecuta cualquiera de estos comandos: ```bash te interactive # Start and connect to a model later -te interactive ./model # Start with a local model +te interactive --model ./model # Start with a local model te interactive -s MyWorkspace -d MyModel # Start with a remote model ``` @@ -48,7 +48,7 @@ Una vez iniciado un REPL, todos los subcomandos de `te` están disponibles **sin ``` ls tables -get "Sales/Revenue" -q expression +get Sales/Revenue -p expression query -q "EVALUATE TOPN(5, 'Sales')" bpa run --fail-on error ``` @@ -78,32 +78,59 @@ Los grupos sin cerrar abarcan hasta el final de la línea, por lo que una comill Estos comandos los gestiona el propio REPL, no el árbol de comandos habitual: -| Comando | Propósito | -| -------------------- | ------------------------------------------------------- | -| `help` o `?` | Lista los comandos disponibles. | -| `status` o `pwd` | Muestra el modelo o la conexión en uso. | -| `clear` o `cls` | Limpia la pantalla. | -| `exit`, `quit` o `q` | Sale del modo interactivo. | +| Comando | Propósito | +| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `help` o `?` | Lista los comandos disponibles. | +| `status` o `pwd` | Muestra el modelo o la conexión en uso. | +| `save` | Commit all staged in-memory edits back to the model source. | +| `revert` | Discard all staged edits made since the last save. | +| `clear` o `cls` | Limpia la pantalla. | +| `exit`, `quit` o `q` | Sale del modo interactivo. If staged edits are unsaved you are asked to confirm (`n` is the default); `exit --force` discards them without asking. | + +`save` inside the session takes no arguments - re-serializing the model to another format or location is `save-as` (e.g. `save-as -o ./out --serialization bim`), exactly as outside the session. + +## Staged edits + +Inside the session, mutating commands (`set`, `add`, `remove`, `move`, `script`, `macro run`, ...) stage their changes in memory instead of writing to the source, and the prompt shows an indicator while unsaved staged edits exist. The built-in `save` command commits everything staged; `revert` discards everything staged. + +Each mutating command can also decide for itself: `--save` persists that one command's change immediately, `--stage` keeps it in memory (the default), and `--revert` rolls the command's change back after showing its effect - useful for a "what would this do?" probe. The three are mutually exclusive, and `--stage`/`--revert` exist only inside the session. + +The default per-command behavior is the `interactiveEditMode` config key (`stage` | `save` | `revert`) - see @te-cli-config. + +Staged edits are never thrown away silently. Closing a session that still holds them - with `exit`, **Ctrl+D**, or by reaching the end of piped input - first checks for unsaved changes. If unsaved changes exist and a terminal is active, you are asked to confirm, with "no" as the default, and declining returns you to the prompt with the edits intact. Where nobody can answer (stdin piped or redirected, or `--non-interactive`), the session writes a warning naming the unsaved changes and exits with a failure code instead of a success one. Nothing is saved on the way out either way: run `save` first, or `exit --force` to discard the edits deliberately. + +## Line editing and keys + +The prompt offers single-line editing: + +- **Left/Right** move the caret; **Home/End** (also **Ctrl+A**/**Ctrl+E**) jump to the ends; **Backspace/Delete** edit in place. +- **Up/Down** browse the command history, which persists across sessions. +- **Ctrl+C** cancels the current command without leaving the session and abandons the half-typed line for good - it is never run, Up does not bring it back, and it is not added to the history. +- **Ctrl+D** on an empty prompt exits (**Ctrl+Z** then **Enter** on Windows). + +There is no tab completion inside the session - shell completion via `te completion` applies to the outer shell only. ## Indicaciones guiadas -Cuando el modo interactivo está activo, los comandos que necesitan información faltante la solicitan en lugar de fallar. Ejecutar `auth` sin un subcomando abre un menú para Iniciar sesión / Estado / Cerrar sesión; ejecutar `deploy` sin `--force` muestra un resumen y pide confirmación (`n` es la opción predeterminada más segura). +Cuando el modo interactivo está activo, los comandos que necesitan información faltante la solicitan en lugar de fallar. Running `auth` without a subcommand opens a picker for Login / Status / Logout; running `deploy --execute` or `refresh --execute` without `--force` shows a summary and asks for confirmation (`n` is the safe default). A `deploy` or `refresh` without `--execute` is a dry run that prints the TMSL it would send, so it never prompts. Para desactivar las indicaciones en un único comando dentro de la sesión, pasa `--non-interactive`. ## Entrada canalizada y redirigida -El modo interactivo también acepta stdin canalizado o redirigido, de modo que puedes controlar la misma REPL desde un script en lugar de introducir los comandos a mano. Cada línea de entrada se ejecuta como un comando, exactamente igual que si la hubieras introducido en el prompt, y la sesión termina cuando se agota la entrada (o cuando llega a una línea `exit`). +El modo interactivo también acepta stdin canalizado o redirigido, de modo que puedes controlar la misma REPL desde un script en lugar de introducir los comandos a mano. Cada línea de entrada se ejecuta como un comando, exactamente igual que si la hubieras introducido en el prompt, y la sesión termina cuando se agota la entrada (o cuando llega a una línea `exit`). If staged edits are still unsaved at that point, the session warns and exits non-zero - end a mutating script with `save` (or `exit --force` to discard on purpose). ```bash -printf "ls\nexit\n" | te interactive ./model # bash / git-bash -te interactive ./model < script.te # redirected file +printf "ls\nexit\n" | te interactive --model ./model # bash / git-bash +te interactive --model ./model < script.te # redirected file ``` ```bat -(echo ls & echo exit) | te interactive .\model :: Windows cmd.exe +(echo ls & echo exit) | te interactive --model .\model :: Windows cmd.exe ``` +The `-` stdin convention (`set -p Expression=-`, `query -q -`, and so on) is refused inside the interactive session, because the session itself owns stdin - use it from the outer shell instead. + Las líneas que empiezan por `#` se tratan como comentarios y se omiten, así que puedes anotar un archivo de script: ``` @@ -119,10 +146,10 @@ Cuando stdin está canalizado, `--batch` es el valor **predeterminado**: la sesi ```bash # Default when piped: stop at the first failing command, exit non-zero -printf "bpa run --fail-on error\ndeploy --force\nexit\n" | te interactive ./model +printf "bpa run --fail-on error\ndeploy --execute --force\nexit\n" | te interactive --model ./model # Run every line regardless of failures -printf "bpa run --fail-on error\ndeploy --force\nexit\n" | te interactive ./model --no-batch +printf "bpa run --fail-on error\ndeploy --execute --force\nexit\n" | te interactive --model ./model --no-batch ``` ### Transcripciones legibles @@ -130,7 +157,7 @@ printf "bpa run --fail-on error\ndeploy --force\nexit\n" | te interactive ./mode `--echo` escribe cada línea de entrada en stdout antes de su salida, lo que resulta práctico al capturar una transcripción de una ejecución canalizada. Las líneas de comentario no se muestran. ```bash -printf "ls tables\nexit\n" | te interactive ./model --echo +printf "ls tables\nexit\n" | te interactive --model ./model --echo ``` ### Opciones @@ -155,11 +182,11 @@ Ejecutar `te` en una terminal sin argumentos te lleva directamente al REPL inter Este comportamiento se controla con la clave de configuración `launchInteractiveMode`, que admite tres valores: -| Valor | Efecto | -| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `auto` (predeterminado) | Inicia el REPL solo cuando los tres flujos están adjuntos a un TTY. De lo contrario, pasa al análisis normal. | -| `always` | Inicia el REPL aunque haya redirección de flujos. Útil si siempre quieres una sesión interactiva. | -| `never` | No inicia nunca el REPL automáticamente. `te` por sí solo muestra la ayuda, igual que antes de la versión 0.6.0. | +| Valor | Efecto | +| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | +| `auto` (predeterminado) | Inicia el REPL solo cuando los tres flujos están adjuntos a un TTY. De lo contrario, pasa al análisis normal. | +| `always` | Inicia el REPL aunque haya redirección de flujos. Útil si siempre quieres una sesión interactiva. | +| `never` | No inicia nunca el REPL automáticamente. `te` on its own prints help. | Cámbialo globalmente con: From e83ac26357a0e9d9f211fe2afb701e639ceb233c Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:02:57 +0200 Subject: [PATCH 12/48] New translations te-cli-migrate.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-migrate.md | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-migrate.md b/localizedContent/es/content/features/te-cli/te-cli-migrate.md index 4e7faf5e0..07a697616 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-migrate.md +++ b/localizedContent/es/content/features/te-cli/te-cli-migrate.md @@ -2,7 +2,7 @@ uid: te-cli-migrate title: Migración desde la línea de comandos de TE2 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -27,7 +27,7 @@ El modo de compatibilidad con TE2 se activa de cualquiera de estas tres maneras: 1. **Nombre del binario.** Cambia el nombre de `te` a `te2` (o crea un enlace simbólico) y la CLI se ejecutará en el modo exacto de TE2. Esta es la vía de reemplazo directo: sustituye `TabularEditor.exe` por `te2` en tu canalización existente y los mismos argumentos funcionarán. 2. **Variable de entorno.** Establece `TE_COMPAT=te2` antes de invocar `te` para forzar el modo TE2. -3. **Detección automática.** Si el primer argumento no es un subcomando de `te` (`load`, `deploy`, …) y aparece al menos una opción de TE2 reconocida en algún punto de la lista de argumentos, la CLI redirige automáticamente al modo TE2. Esto significa que la mayoría de las invocaciones existentes de TE2 funcionan sin ningún cambio. +3. **Auto-detection.** If the first argument isn't a `te` subcommand (`deploy`, `validate`, …) y aparece al menos una opción de TE2 reconocida en algún punto de la lista de argumentos, la CLI redirige automáticamente al modo TE2. Esto significa que la mayoría de las invocaciones existentes de TE2 funcionan sin ningún cambio. ```bash # All three are equivalent - each runs in TE2 mode @@ -41,48 +41,48 @@ te Model.bim -S fix.csx -D "localhost\tabular" MyDB -O ## El comando `migrate` -Usa `te migrate` como referencia práctica de cómo las opciones de TE2 se asignan a la nueva CLI. Muestra una tabla en color con todas las opciones conocidas de TE2, su estado (compatible, renombrada, prevista) y el comando `te` equivalente. +Use `te util migrate` as a live reference for how TE2 flags map to the new CLI. Muestra una tabla en color con todas las opciones conocidas de TE2, su estado (compatible, renombrada, prevista) y el comando `te` equivalente. ```bash -te migrate # Full flag mapping table -te migrate -A # Look up a single flag -te migrate --output-format json # Machine-readable mapping +te util migrate # Full flag mapping table +te util migrate -A # Look up a single flag +te util migrate --output-format json # Machine-readable mapping ``` -Consulta la salida del comando `te migrate` para ver el mapeo actual, que refleja la versión de la CLI que tienes instalada. +Refer to the output of the `te util migrate` command for the current mapping that reflects the CLI version you have installed. ## Mapeo de flags (subconjunto seleccionado) -Un resumen no exhaustivo de los flags más usados. Ejecuta `te migrate` para ver la lista completa. - -| Flag de TE2 | Nuevo equivalente en la CLI | Notas | -| ------------------------------------------------------------------ | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` (posicional) | `te ` o el flag global `--model` | Primer argumento posicional en la mayoría de los comandos. | -| `server`, `database` | `te connect ` o `te deploy -s -d ` | El servidor ya no es un argumento posicional global; `te deploy` solo toma `` como argumento posicional, y server y database se especifican mediante opciones con nombre. | -| `-L` / `-LOCAL` | `te connect --local` | Solo para Windows. | -| `-S` / `-SCRIPT` | `te script -S ` o `-e "code"` | Admite varios scripts, código en línea y stdin. Nota: `-S` en mayúsculas; `-s` en minúsculas corresponde a la opción global `--server`. | -| `-A` / `-ANALYZE` | `te bpa run --rules ` | Admite `--fail-on`, `--fix` y varios archivos de reglas. | -| `-AX` / `-ANALYZEX` | `te bpa run --rules ` (sin `--model-rules`) | Excluir las reglas incrustadas en el modelo es ahora el comportamiento predeterminado. | -| `-B` / `-BIM` | `te save -o --serialization bim` | | -| `-F` / `-FOLDER` | `te save -o --serialization Database.json` | Tras `-D`, el `-F` de TE2 significa `-FULL`. Consulta `--deploy-full`. | -| `-TMDL` | `te save -o --serialization tmdl` | TMDL es el formato de guardado predeterminado. | -| `-D` / `-DEPLOY` | `te deploy -s -d ` | Comando independiente con opciones con nombre; solo `` es un argumento posicional. | -| `-O` / `-OVERWRITE` | (predeterminado) o `--create-only` para no aplicarlo | La sobrescritura es el comportamiento predeterminado en la nueva CLI. | -| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | -| `-P` / `-PARTITIONS` | `te deploy --deploy-partitions` | | -| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` | Requiere `--deploy-partitions`. | -| `-SHARED` | `te deploy --deploy-shared-expressions` | Después de `-D`, `-S` en TE2 significa `-SHARED`. | -| `-R` / `-ROLES` | `te deploy --deploy-roles` | | -| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | -| `-FULL` (después de `-D`) | `te deploy --deploy-full` | Equivale a: sobrescritura + conexiones + particiones + elementos compartidos + roles + miembros de rol. | -| `-X` / `-XMLA ` | `te deploy ... --xmla ` | Usa `-` para stdout. | -| `-V` / `-VSTS` | `--ci vsts` en `validate`, `bpa run`, `deploy` | Emite anotaciones `##vso[...]` en stderr. | -| `-G` / `-GITHUB` | `--ci github` | Emite anotaciones `::error::` / `::warning::`. | -| `-T` / `-TRX ` | `--trx ` en `validate`, `bpa run`, `test run` | Archivo `.trx` de VSTEST para publicar pruebas en Azure DevOps. | -| `-W` / `-WARN` | (predeterminado) | Las advertencias siempre se incluyen en el Report de resultados de la implementación. | -| `-E` / `-ERR` | (predeterminado) | La implementación devuelve un código de salida distinto de cero cuando hay errores de DAX. | -| `-SC` / `-SCHEMACHECK` | _Aún no se ha implementado._ | La comprobación del esquema de TE2 se conecta a los Data source reales. A diferencia de `te validate` (validación semántica de DAX, sin conexión al Data source). | -| `-L` / `-LOGIN ` (después de `-D`) | `te auth login -u -p -t ` | Usa una entidad de servicio o credenciales basadas en variables de entorno. El inicio de sesión se guarda en caché, así que los comandos posteriores obtienen tokens de forma silenciosa; consulta @te-cli-auth. | +Below is a non-exhaustive summary of the most commonly used flags. Run `te util migrate` for the full list. + +| Flag de TE2 | Nuevo equivalente en la CLI | Notas | +| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` (posicional) | `--model ` (global option) | Always the global `--model` option; no command takes the model as a positional argument. Or set an active model once with `te connect `. | +| `server`, `database` | `te connect ` or global `-s -d ` | `-s`/`-d` always identify the model source; deploy destinations use `--target-server` / `--target-database`. | +| `-L` / `-LOCAL` | `te connect --local` | Solo para Windows. | +| `-S` / `-SCRIPT` | `te script --file ` or `--inline "code"` | A bare `.csx` path also works (`te script fix.csx`). Supports multiple scripts (`--file a.csx --file b.csx`), inline code, and stdin (`--inline -`); files and inline code run in the order given. | +| `-A` / `-ANALYZE` | `te bpa run --rules ` | Admite `--fail-on`, `--fix` y varios archivos de reglas. | +| `-AX` / `-ANALYZEX` | `te bpa run --rules --no-model-rules` | Model-embedded rules are included by default; `--no-model-rules` excludes them, matching what `-AX` did. | +| `-B` / `-BIM` | `te save-as --model -o --serialization bim` | | +| `-F` / `-FOLDER` | `te save-as --model -o --serialization database.json` | Tras `-D`, el `-F` de TE2 significa `-FULL`. Consulta `--deploy-full`. | +| `-TMDL` | `te save-as --model -o --serialization tmdl` | `--serialization` can be omitted - the format is inferred from the output path. | +| `-D` / `-DEPLOY` | `te deploy --model --target-server --target-database --execute` | Comando independiente con opciones con nombre. Without `--execute`, `te deploy` is a dry run that prints the TMSL it would send. | +| `-O` / `-OVERWRITE` | (predeterminado) o `--create-only` para no aplicarlo | La sobrescritura es el comportamiento predeterminado en la nueva CLI. | +| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | +| `-P` / `-PARTITIONS` | `te deploy --deploy-partitions` | | +| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` | Requiere `--deploy-partitions`. | +| `-SHARED` | `te deploy --deploy-shared-expressions` | Después de `-D`, `-S` en TE2 significa `-SHARED`. | +| `-R` / `-ROLES` | `te deploy --deploy-roles` | | +| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | +| `-FULL` (después de `-D`) | `te deploy --deploy-full` | Equivale a: sobrescritura + conexiones + particiones + elementos compartidos + roles + miembros de rol. | +| `-X` / `-XMLA ` | `te deploy ... > ` (omit `--execute`) | Script emission is the default: without `--execute`, deploy connects read-only and prints the TMSL to stdout - redirect it to a file. | +| `-V` / `-VSTS` | `--ci vsts` on `validate`, `bpa run`, `deploy`, `test run` | Emite anotaciones `##vso[...]` en stderr. `azdo` and `azure-devops` are accepted aliases. | +| `-G` / `-GITHUB` | `--ci github` (alias `gh`) | Emits `::error::` / `::warning::` / `::notice::` annotations. | +| `-T` / `-TRX ` | `--trx ` en `validate`, `bpa run`, `test run` | Archivo `.trx` de VSTEST para publicar pruebas en Azure DevOps. | +| `-W` / `-WARN` | (predeterminado) | Las advertencias siempre se incluyen en el Report de resultados de la implementación. | +| `-E` / `-ERR` | (predeterminado) | La implementación devuelve un código de salida distinto de cero cuando hay errores de DAX. | +| `-SC` / `-SCHEMACHECK` | _Aún no se ha implementado._ | La comprobación del esquema de TE2 se conecta a los Data source reales. A diferencia de `te validate` (validación semántica de DAX, sin conexión al Data source). | +| `-L` / `-LOGIN ` (después de `-D`) | `te auth login -u -p -t ` | Usa una entidad de servicio o credenciales basadas en variables de entorno. El inicio de sesión se guarda en caché, así que los comandos posteriores obtienen tokens de forma silenciosa; consulta @te-cli-auth. | ## Guía de migración @@ -93,13 +93,13 @@ La ruta recomendada para pasar de un pipeline basado en TE2 al nuevo CLI: - Empieza con `-A` / `-AX` → `te bpa run` para obtener una salida de BPA más completa (`--fail-on`, `--fix`, `--trx`). - Después, `-D` → `te deploy` para un control de despliegue más detallado. - Por último, `-V` / `-G` → `--ci vsts` / `--ci github`. -3. **Cambia a flags de CI no interactivos.** Añade `--non-interactive --ci ` a todos los comandos `te` y elimina cualquier wrapper `start /wait`: el nuevo CLI es un binario de consola estándar y no los necesita. +3. **Switch to non-interactive CI flags.** Add `--non-interactive` to every `te` command (and `--ci ` on `validate`, `bpa run`, `deploy`, and `test run`), pass `--execute --force` on `deploy`/`refresh` steps that must act, and remove any `start /wait` wrappers - the new CLI is a regular console binary and doesn't need them. 4. **Adopta la autenticación con entidad de servicio.** Sustituye `-D -L ` por `te auth login -u ... -p ... -t ...` o un paso del pipeline con credenciales de entorno. Consulta @te-cli-auth. ## Diferencias importantes - **BPA como control previo al despliegue.** `te deploy` ahora ejecuta BPA como comprobación previa de forma predeterminada. Usa `--skip-bpa` para mantener el comportamiento anterior, o `--fix-bpa` para corregir automáticamente los incumplimientos antes del despliegue. Consulta @te-cli-config. -- **Confirmación interactiva al desplegar.** `te deploy` pide confirmación de forma predeterminada (siendo `n` la respuesta predeterminada segura). Las canalizaciones de CI deben especificar `--force`. +- **Dry run by default.** `te deploy` and `te refresh` print the exact TMSL they would send and change nothing; pass `--execute` to act. `--execute` asks for confirmation at a terminal (with `n` as the safe default); CI pipelines must pass `--execute --force`. - **Salida estructurada.** Todos los comandos admiten `--output-format json` para una salida procesable por máquinas; consulta @te-cli-automation. - **No hace falta `start /wait`.** La nueva CLI es un binario de consola normal; ejecútalo directamente en scripts de shell, PowerShell y tareas de CI. - **Multiplataforma.** La CLI funciona en Windows, macOS y Linux. Las conexiones locales a SSAS y Power BI Desktop siguen estando disponibles solo en Windows. From 61930ca6b3ced3b91849885542bd1761494b10d5 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:00 +0200 Subject: [PATCH 13/48] New translations te-cli.md (Spanish) [ci skip] --- .../es/content/features/te-cli/te-cli.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli.md b/localizedContent/es/content/features/te-cli/te-cli.md index 0677c3349..fafdc9645 100644 --- a/localizedContent/es/content/features/te-cli/te-cli.md +++ b/localizedContent/es/content/features/te-cli/te-cli.md @@ -2,7 +2,7 @@ uid: te-cli title: Tabular Editor CLI (Vista previa pública limitada) author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -23,12 +23,13 @@ A diferencia de las opciones de línea de comandos de `TabularEditor.exe` exclus [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -## Diseñado para tres tipos de usuarios +## Design pillars and target audiences -Tres pilares de diseño están presentes en todos los comandos: +Four design pillars shape every command: - **Salida estructurada** — JSON, CSV, TMDL y TMSL, junto con el texto predeterminado legible para humanos. - **Modo no interactivo** — una opción global `--non-interactive` que desactiva los avisos y hace que el comando falle inmediatamente. +- **Safe by default** - editing commands such as `te set`, `te add` and `te remove` show their change as a diff and write nothing until you add `--save`; adding `--force` saves even when the change introduces validation errors. `te deploy` and `te refresh` print the exact TMSL they would send until you add `--execute`, and then ask for confirmation first unless you add `--force`. - **Errores claros** — se escriben en stderr con códigos de salida predecibles. En conjunto, hacen que el mismo binario funcione bien para tres perfiles muy distintos: @@ -42,22 +43,22 @@ En conjunto, hacen que el mismo binario funcione bien para tres perfiles muy dis ## Qué puede hacer la CLI -La CLI organiza más de 50 comandos en 10 familias. Cada familia se corresponde con una etapa concreta del ciclo de vida del modelo semántico. +The CLI organizes its commands into 10 families. Cada familia se corresponde con una etapa concreta del ciclo de vida del modelo semántico. Consulta @te-cli-commands para ver una referencia completa de los comandos, con la sintaxis, las opciones y ejemplos de cada uno. Haz clic en cualquier comando de ejemplo de la tabla para ir directamente a su entrada de referencia. -| Familia | Qué hace | Comandos de ejemplo | -| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [E/S del modelo](xref:te-cli-commands#model-io) | Cargar, guardar, convertir e inicializar modelos | [`te load`](xref:te-cli-commands#load), [`te save`](xref:te-cli-commands#save), [`te init`](xref:te-cli-commands#init) | -| [Edición del modelo](xref:te-cli-commands#model-editing) | Obtener y establecer propiedades; añadir, quitar y mover objetos | [`te set`](xref:te-cli-commands#set), [`te add`](xref:te-cli-commands#add), [`te remove`](xref:te-cli-commands#remove), [`te move`](xref:te-cli-commands#move) | -| [Inspección](xref:te-cli-commands#inspection) | Listar objetos, buscar, comparar y analizar dependencias | [`te list`](xref:te-cli-commands#list), [`te find`](xref:te-cli-commands#find), [`te diff`](xref:te-cli-commands#diff), [`te deps`](xref:te-cli-commands#deps) | -| [Análisis y calidad](xref:te-cli-commands#analysis-and-quality) | Validar, ejecutar BPA, dar formato a DAX y analizar el almacenamiento | [`te validate`](xref:te-cli-commands#validate), [`te bpa run`](xref:te-cli-commands#bpa-run), [`te format`](xref:te-cli-commands#format), [`te vertipaq`](xref:te-cli-commands#vertipaq) | -| [Ejecución](xref:te-cli-commands#execution) | Ejecutar consultas DAX, C# Scripts y macros | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te macro`](xref:te-cli-commands#macro) | -| [Implementación y actualización](xref:te-cli-commands#deployment-and-refresh) | Implementar en el Workspace, iniciar una actualización y realizar una actualización incremental | [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh), [`te incremental-refresh`](xref:te-cli-commands#incremental-refresh) | -| [Pruebas](xref:te-cli-commands#testing) | Pruebas de aserciones, instantáneas, comparación A/B | [`te test run`](xref:te-cli-commands#test-run) | -| [Conexión y autenticación](xref:te-cli-commands#connection-and-authentication) | Conéctate a los Workspace y gestiona la autenticación y los perfiles | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | -| [Configuración](xref:te-cli-commands#configuration) | Configuración y licencias | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | -| [Shell](xref:te-cli-commands#shell) | Modo interactivo, estado de la sesión, completado automático del shell | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | +| Familia | Qué hace | Comandos de ejemplo | +| ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Model initialization and save](xref:te-cli-commands#model-initialization-and-save) | Save, convert, initialize models | [`te save-as`](xref:te-cli-commands#save-as), [`te init`](xref:te-cli-commands#init) | +| [Edición del modelo](xref:te-cli-commands#model-editing) | Obtener y establecer propiedades; añadir, quitar y mover objetos | [`te set`](xref:te-cli-commands#set), [`te add`](xref:te-cli-commands#add), [`te remove`](xref:te-cli-commands#remove), [`te move`](xref:te-cli-commands#move) | +| [Inspección](xref:te-cli-commands#inspection) | Listar objetos, buscar, comparar y analizar dependencias | [`te list`](xref:te-cli-commands#list), [`te find`](xref:te-cli-commands#find), [`te diff`](xref:te-cli-commands#diff), [`te deps`](xref:te-cli-commands#deps) | +| [Análisis y calidad](xref:te-cli-commands#analysis-and-quality) | Validate, run BPA, format DAX and M, analyze storage | [`te validate`](xref:te-cli-commands#validate), [`te bpa run`](xref:te-cli-commands#bpa-run), [`te util`](xref:te-cli-commands#utilities), [`te vertipaq`](xref:te-cli-commands#vertipaq) | +| [Ejecución](xref:te-cli-commands#execution) | Ejecutar consultas DAX, C# Scripts y macros | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te macro`](xref:te-cli-commands#macro) | +| [Implementación y actualización](xref:te-cli-commands#deployment-and-refresh) | Deploy to workspace, trigger refresh, apply refresh policies | [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh) | +| [Pruebas](xref:te-cli-commands#testing) | Pruebas de aserciones, instantáneas, comparación A/B | [`te test run`](xref:te-cli-commands#test-run) | +| [Conexión y autenticación](xref:te-cli-commands#connection-and-authentication) | Conéctate a los Workspace y gestiona la autenticación y los perfiles | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | +| [Configuración](xref:te-cli-commands#configuration) | CLI settings and defaults | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | +| [Shell](xref:te-cli-commands#shell) | Modo interactivo, estado de la sesión, completado automático del shell | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | > [!TIP] > La documentación usa los verbos canónicos en formato largo (`list`, `remove`, `move`), pero las formas cortas clásicas siguen funcionando como alias (`ls`, `rm`, `mv`, `rename`). Esto se aplica a los comandos de nivel superior y a los subcomandos `remove` / `list` dentro de grupos como `te bpa rules`, `te macro`, `te config`, `te profile`, `te session` y `te test`. Consulta @te-cli-commands#command-aliases para ver el mapeo completo. @@ -91,7 +92,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> El banner vuelve a aparecer con cada comando en los **14 días previos a la fecha de finalización de la versión preliminar** (2026-09-30), independientemente de `hidePreviewNotice`. Esto garantiza que veas una advertencia antes de que la CLI deje de funcionar. +> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. Esto garantiza que veas una advertencia antes de que la CLI deje de funcionar. ## Perspectiva de licencias From be0cc90a2d98726baa164b7ced48dc9299bfe030 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:04 +0200 Subject: [PATCH 14/48] New translations github-flow.md (Spanish) [ci skip] --- localizedContent/es/content/getting-started/github-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localizedContent/es/content/getting-started/github-flow.md b/localizedContent/es/content/getting-started/github-flow.md index d358249d0..493c7c1d0 100644 --- a/localizedContent/es/content/getting-started/github-flow.md +++ b/localizedContent/es/content/getting-started/github-flow.md @@ -79,7 +79,7 @@ flowchart LR ``` > [!NOTE] -> Tabular Editor ahora dispone de una CLI multiplataforma (`te`) en versión preliminar pública limitada, diseñada específicamente para CI/CD: modo no interactivo, anotaciones nativas de GitHub Actions/Azure DevOps, salida VSTEST y un comando `te test run` para ejecutar pruebas de regresión como parte de un pipeline. Encaja de forma natural con el tipo de pipeline descrito a continuación, y merece la pena seguirlo de cerca. En el momento de escribir esto, la propia documentación de Tabular Editor desaconseja usarlo en pipelines de producción durante la versión preliminar (se indica que la compilación preliminar caduca el 2026-09-30), por lo que la implementación de referencia de este artículo usa en su lugar la CLI consolidada `TabularEditor.exe`. Consulta [Integración de CI/CD](xref:te-cli-cicd) para conocer las capacidades actuales y ver ejemplos de la nueva CLI. +> Tabular Editor ahora dispone de una CLI multiplataforma (`te`) en versión preliminar pública limitada, diseñada específicamente para CI/CD: modo no interactivo, anotaciones nativas de GitHub Actions/Azure DevOps, salida VSTEST y un comando `te test run` para ejecutar pruebas de regresión como parte de un pipeline. Encaja de forma natural con el tipo de pipeline descrito a continuación, y merece la pena seguirlo de cerca. As of this writing, Tabular Editor's own documentation advises against using it in production pipelines during preview (the preview build is stated to expire 2026-10-31), so the reference implementation in this article uses the established `TabularEditor.exe` CLI instead. Consulta [Integración de CI/CD](xref:te-cli-cicd) para conocer las capacidades actuales y ver ejemplos de la nueva CLI. From b7a78c35c1c79daf3c41b03376c783517828eee6 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:07 +0200 Subject: [PATCH 15/48] New translations te-cli-findings.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-findings.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 localizedContent/es/content/features/te-cli/te-cli-findings.md diff --git a/localizedContent/es/content/features/te-cli/te-cli-findings.md b/localizedContent/es/content/features/te-cli/te-cli-findings.md new file mode 100644 index 000000000..e9f9a44f2 --- /dev/null +++ b/localizedContent/es/content/features/te-cli/te-cli-findings.md @@ -0,0 +1,106 @@ +--- +uid: te-cli-findings +title: Resultados legibles por máquina (JSON) +author: Peer Grønnerup +updated: 2026-09-11 +applies_to: + products: + - product: Tabular Editor 2 + none: true + - product: Tabular Editor 3 + none: true + - product: Tabular Editor CLI + full: true +--- + +# Resultados legibles por máquina (JSON) + +[!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] + +`te validate`, `te bpa run`, `te test run` y `te query` generan un Report de problemas en un mismo formato JSON. Con `--output-format json`, cada uno de estos comandos emite un **único documento**; no hay forma de que alguno de ellos no genere nada para analizar. + +> [!NOTE] +> `te query` usa esta estructura JSON solo cuando su validación DAX previa a la ejecución produce al menos un error. Si la consulta se ejecuta correctamente, emite en su lugar el resultado de la consulta: `{columns, rows, rowCount, truncated, durationMs, trace?}`. + +## El documento JSON + +```json +{ + "command": "validate", + "durationMs": 412, + "summary": { "errors": 1, "warnings": 2, "info": 0, "total": 3 }, + "findings": [ + { + "severity": "error", + "source": "validate", + "code": "TE0001", + "message": "Unknown column 'Sales'[Amt]", + "object": "Revenue", + "objectType": "Measure", + "objectPath": "Sales/Revenue", + "expressionPosition": { "property": "Expression", "lineNumber": 3, "column": 9 }, + "fixable": false + } + ], + "valid": false +} +``` + +- `command` - qué comando generó el documento. +- `durationMs` - duración total de la ejecución. +- `summary` - recuento por gravedad: `errors`, `warnings`, `info`, `total`. +- `findings` - un único array plano, clasificado por `severity`. + +## Claves de cada hallazgo + +Presentes en **cada** hallazgo: + +| Clave | Valores / significado | +| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `severity` | `error`, `warning` o `info`. | +| `source` | `validate`, `bpa`, `test` o `query`. | +| `code` | Código estable del hallazgo (ID de mensaje de validación, ID de regla de BPA, `TEST_FAIL` / `TEST_ERROR` / `TEST_SUITE_INVALID`, ...). | +| `message` | Descripción legible para humanos. | +| `object` | Nombre sin calificar del objeto al que se refiere el hallazgo. | +| `objectType` | Un valor de un vocabulario cerrado; véase más abajo. | +| `fixable` | `true` solo en las infracciones de BPA cuya regla define una expresión de corrección. | + +Se incluyen **solo cuando la CLI las conoce**; estas claves están _ausentes_ en lugar de `null` cuando no se establecen: + +| Clave | Generado por | Significado | +| ---------------------- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `objectPath` | Solo para infracciones de `validate` y `bpa` | Ruta canónica del objeto, resoluble tal cual mediante `te get` o `te set`. No aparece en los hallazgos de pruebas, los hallazgos de consultas ni los errores de reglas de BPA. | +| `expressionPosition` | Solo en `validate` y `query` | `{property, lineNumber, column}` dentro de la propiedad `Named Expression` de la expresión. **Opcional en todos los orígenes, incluidos validate y query**: no aparece cuando el analizador no hizo Report de ninguna posición utilizable y es de todo o nada (nunca una posición parcial). | +| `ruleName`, `category` | Solo en `bpa` | El nombre y la categoría de la regla infringida. | + +### vocabulario de objectType + +El conjunto cerrado de valores de `objectType` (las formas singulares de los contenedores de la gramática de rutas, no una enumeración de TOM): + +`medida`, `Column`, `Hierarchy`, `Level`, `partición`, `CalculationItem`, `Table`, `rol`, `TablePermission`, `perspectiva`, `configuración regional`, `DataSource`, `Expression`, `Function`, `relación`, `KPI`, `RefreshPolicy`, `Member`, `Calendar`, `Variation`, `Model`, `BpaRule`, `Test`, `TestSuite`, `Query`. + +## Elementos adicionales por comando + +Cada comando mantiene algunas claves propias en el nivel superior del documento: + +| Comando | Claves adicionales | +| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `te validate` | `valid` (booleano). | +| `te bpa run` | `model`, `rulesEvaluated`, `violations`, `ruleErrors`, `ignoredRules`. Los errores de evaluación de reglas aparecen en `findings` con severidad `error` y `objectType: "BpaRule"`; `violations` y `ruleErrors` desglosan ambos recuentos. | +| `te bpa run --fix` | Una clave `fix` dentro del mismo documento: `changes`, `fixed`, `fixErrors`, `skipped`, `fixedItems`, `fixErrorItems`. Si falla la propia pasada de corrección, el documento se sigue escribiendo con la causa en `fix.error`. No está presente sin `--fix`. | +| `te test run` | `suites`, `invalidSuites`, `testSummary` (recuentos de pruebas por estado; `summary` sigue siendo el recuento compartido por gravedad). | +| `te query` | Ninguno, y solo en caso de errores de validación; consulta la nota anterior. | + +## Anotaciones de CI + +Los cuatro comandos comparten un único generador de anotaciones para `--ci vsts` / `--ci github` (`azdo`, `azure-devops` y `gh` son alias admitidos; `none` desactiva las anotaciones; cualquier otro valor se rechaza antes de que se ejecute el comando). Las anotaciones se envían a stderr; stdout sigue siendo analizable: + +- Las anotaciones incluyen el código del hallazgo: `code=` en Azure DevOps, `title=` en GitHub. +- Los hallazgos de severidad informativa no son advertencias: en GitHub se emiten como `::notice::`; en Azure DevOps, como una simple línea de registro. Una ejecución de Azure DevOps cuyos únicos hallazgos son informativos muestra **Succeeded** en el Report. +- Los mensajes de varias líneas se escapan en una sola línea de anotación, para que la descripción de una regla no pueda romper el formato del registro. + +## Páginas relacionadas + +- @te-cli-commands#exit-codes - los códigos de salida no se ven afectados por el formato de salida. +- @te-cli-cicd - patrones de pipeline que consumen esta estructura. +- @te-cli-automation - parseo de salida estructurada desde scripts. From 427abe16a70b2fe6d78b87e603e032488136cb2e Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:10 +0200 Subject: [PATCH 16/48] New translations command-line-options.md (Chinese Simplified) [ci skip] --- .../content/features/Command-line-Options.md | 114 +++++++++++------- 1 file changed, 68 insertions(+), 46 deletions(-) diff --git a/localizedContent/zh/content/features/Command-line-Options.md b/localizedContent/zh/content/features/Command-line-Options.md index b9af9c04b..85d82adf7 100644 --- a/localizedContent/zh/content/features/Command-line-Options.md +++ b/localizedContent/zh/content/features/Command-line-Options.md @@ -28,52 +28,74 @@ Tabular Editor 3 是面向开发人员的桌面应用程序。 它本身不提 ## TabularEditor.exe 与 Tabular Editor CLI 对比 -Tabular Editor CLI(`te`)是 `TabularEditor.exe` 的跨平台后继版本。 它不仅仅是面向 macOS 和 Linux 的重写版本——还将模型编辑、检查、差异对比、测试、触发刷新和 VertiPaq 分析作为管道中的一等公民操作引入,而这些都是 `TabularEditor.exe` 无法实现的。 `te` CLI 目前处于有限公开预览阶段(将于 2026-09-30 到期);当前生产环境的管道请使用 `TabularEditor.exe`。 - -| | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | -| -------------------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | -| 状态 | 稳定,可用于生产环境 | 有限公开预览(将于 2026-09-30 到期) | -| 平台 | 仅限 Windows | Windows、macOS、Linux | -| 需要许可证 | 否 | 否(预览版);正式发布时待定 | -| 二进制文件 | WinForms 应用,需要通过 `start /wait` 进行封装 | 专为控制台设计的二进制文件,无需包装器 | -| **身份验证** | | | -| 服务主体 | 通过 MSOLAP 连接字符串 | 原生支持 `--auth spn`、`--auth env`、`--auth managed-identity`;凭据可通过环境变量、stdin 或证书提供;支持操作系统原生的安全凭据存储 | -| 托管标识 | 否 | 是(`--auth managed-identity`),适用于 Azure 托管运行器 | -| 交互式浏览器登录 | 否 | 是(`te auth login`) | -| **CI/CD** | | | -| CI 注释 | `-V`(Azure DevOps)、`-G`(GitHub) | 每个命令都可使用 `--ci vsts`、`--ci github` | -| 非交互模式 | 无显式标志;出错时可能会提示 | 全局标志 `--non-interactive`——快速失败,不会出现提示 | -| 可预测的退出代码 | 部分支持 | `0` = 成功,`1` = 失败,`2` = 差异不一致 | -| 结构化输出 | 否 | 每个命令都支持 `--output-format json/csv/tmdl/tmsl` | -| VSTEST 结果 | `-T` 标志 | 在 `validate`、`bpa run` 和 `test run` 命令中使用 `--trx ` | -| **部署** | | | -| 部署模型 | `-D` 标志 | `te deploy` 提供细粒度标志(`--deploy-roles`、`--deploy-partitions`、`--deploy-connections`、`--deploy-full` 等),可分别部署角色、分区、连接或完整内容 | -| 无需部署即可生成 XMLA/TMSL | `-X` 标志 | `te deploy --xmla ` 或 `--dry-run` | -| 部署前 BPA 门禁检查 | 否 | 内置;可用 `--skip-bpa` 或 `--fix-bpa` 覆盖默认行为 | -| 连接配置文件 | 否 | `te profile set/list/show` - 为每个环境提供可复用的命名配置文件 | -| **Best Practice Analyzer** | | | -| 运行 BPA | `-A` / `-AX` 选项 | `te bpa run`,支持 `--fail-on warning/error`、`--fix`、`--path` 范围限定,以及用于 VPA 感知规则的 `--vpax` | -| BPA 规则管理 | 否 | `te bpa rules add/rm/set/list/disable/enable/init` | -| **在流水线中编辑模型** | | | -| 运行 C# Script | `-S` 选项 | `te script`:支持多个脚本、内联代码、stdin、`--dry-run` 以及预处理器符号(`TECLI`) | -| 运行宏 | 否 | `te macro run`,可通过 `--on ` 指定上下文 | -| 设置/获取属性 | 否 | `te get`, `te set`, `te add`, `te rm`, `te mv`, `te replace` | -| DAX 格式化 | 否 | `te format` - 格式化所有表达式或单个对象,支持 DAX 和 M | -| **检查** | | | -| 列出模型对象 | 否 | `te ls`,支持通配符路径筛选、`--type`、`--paths-only`、`--output-format bim` | -| 搜索表达式/名称 | 否 | `te find`,支持正则表达式和搜索范围 (`--in expressions/names/descriptions`) | -| 比较两个模型的差异 | 否 | `te diff` - 结构比较;如有任何差异则以退出代码 `2` 退出 | -| 依赖关系分析 | 否 | `te deps` - 查看任何对象的上游/下游依赖;使用 `--unused` 查找死代码 | -| **刷新** | | | -| 触发刷新 | 否 | `te refresh` 支持 `--type`、`--table`、`--partition`、`--apply-refresh-policy`、`--dry-run` | -| **测试** | | | -| DAX 断言测试 | 否 | `te test run` 支持 `--tag`、`--trx`、`--ci`;也可使用 `te test init/snapshot/compare` | -| **VertiPaq 分析** | | | -| 存储统计 | 否 | `te vertipaq` - 列、关系、分区;`--export`/`--import` VPAX | -| **其他** | | | -| 交互式 REPL | 否 | `te interactive` - 支持模型感知的 Shell,提供 Tab 补全 | -| Shell Tab 自动补全 | 否 | `te completion bash/zsh/pwsh` | -| TE2 向后兼容性 | 原生 | 内置兼容层——现有 `TabularEditor.exe` 调用无需修改即可继续使用 | +Tabular Editor CLI(`te`)是 `TabularEditor.exe` 的跨平台后继版本。 它不仅仅是面向 macOS 和 Linux 的重写版本——还将模型编辑、检查、差异对比、测试、触发刷新和 VertiPaq 分析作为管道中的一等公民操作引入,而这些都是 `TabularEditor.exe` 无法实现的。 `te` CLI 目前处于有限公开预览阶段(将于 2026-10-31 到期);目前用于生产流水线请使用 `TabularEditor.exe`。 + +#### 概览 + +| 方面 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| ----- | ------------------------------------------------ | -------------------------------- | +| 状态 | 稳定,可用于生产环境 | 有限公开预览(将于 2026-10-31 结束) | +| 平台 | 仅限 Windows | Windows、macOS、Linux | +| 需要许可证 | 否 | 否(预览版);正式发布时待定 | +| 二进制文件 | WinForms 应用,需要通过 `start /wait` 进行封装 | 专为控制台设计的二进制文件,无需包装器 | + +#### 身份验证 + +| 功能 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| -------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------- | +| 服务主体 | 通过 MSOLAP 连接字符串 | 原生支持 `--auth spn`、`--auth env`、`--auth managed-identity`;凭据可通过环境变量、stdin 或证书提供;支持操作系统原生的安全凭据存储 | +| 托管标识 | 否 | 是(`--auth managed-identity`),适用于 Azure 托管运行器 | +| 交互式浏览器登录 | 否 | 是(`te auth login`) | + +#### CI/CD + +| 功能 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| --------- | ------------------------------------------------ | ----------------------------------------------------------- | +| CI 注释 | `-V`(Azure DevOps)、`-G`(GitHub) | 每个命令都可使用 `--ci vsts`、`--ci github` | +| 非交互模式 | 无显式标志;出错时可能会提示 | 全局标志 `--non-interactive`——快速失败,不会出现提示 | +| 可预测的退出代码 | 部分支持 | `0` = 成功,`1` = 失败(对于 `te diff`:表示发现差异),`2` = `te diff` 比较错误 | +| 结构化输出 | 否 | 每个命令都支持 `--output-format json/csv/tmdl/tmsl` | +| VSTEST 结果 | `-T` 标志 | 在 `validate`、`bpa run` 和 `test run` 命令中使用 `--trx ` | + +#### 部署 + +| 功能 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| ------------------ | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- | +| 部署模型 | `-D` 标志 | `te deploy` 提供细粒度标志(`--deploy-roles`、`--deploy-partitions`、`--deploy-connections`、`--deploy-full` 等),可分别部署角色、分区、连接或完整内容 | +| 无需部署即可生成 XMLA/TMSL | `-X` 标志 | 默认行为:不带 `--execute` 的 `te deploy` 会将 TMSL 输出到 stdout | +| 部署前 BPA 门禁检查 | 否 | 内置;可用 `--skip-bpa` 或 `--fix-bpa` 覆盖默认行为 | +| 连接配置文件 | 否 | `te profile set/list/show` - 为每个环境提供可复用的命名配置文件 | + +#### Best Practice Analyzer 与模型编辑 + +| 功能 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| ------------ | ------------------------------------------------ | --------------------------------------------------------------------------------------- | +| 运行 BPA | `-A` / `-AX` 选项 | `te bpa run`,支持 `--fail-on warning/error`、`--fix`、`--path` 范围限定,以及用于 VPA 感知规则的 `--vpax` | +| BPA 规则管理 | 否 | `te bpa rules add/rm/set/list/disable/enable/init` | +| 运行 C# Script | `-S` 选项 | `te script`:多个脚本、内联代码、stdin、`--validate` 编译检查、预处理器符号(`TECLI`) | +| 运行宏 | 否 | `te macro run`,可通过 `--on ` 指定上下文 | +| 设置/获取属性 | 否 | `te get`, `te set`, `te add`, `te rm`, `te mv` | +| DAX 格式化 | 否 | 模型对象使用 `te set --format`,独立表达式使用 `te util format-dax` / `format-m` | + +#### 检查、刷新、测试和 VertiPaq 分析 + +| 功能 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| --------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | +| 列出模型对象 | 否 | `te ls`,支持通配符路径筛选、`--type`、`--paths-only`、`--output-format bim` | +| 搜索表达式/名称 | 否 | `te find`,支持正则表达式和搜索范围 (`--in expressions/names/descriptions`) | +| 比较两个模型的差异 | 否 | `te diff` - 结构比较;如有任何差异则以退出代码 `1` 结束 | +| 依赖关系分析 | 否 | `te deps` - 查看任何对象的上游/下游依赖;使用 `--unused` 查找死代码 | +| 触发刷新 | 否 | `te refresh` 可与 `--type`、`--table`、`--partition`、`--apply-refresh-policy` 一起使用;默认仅进行干运行,需加 `--execute` 才会实际运行 | +| DAX 断言测试 | 否 | `te test run` 支持 `--tag`、`--trx`、`--ci`;也可使用 `te test init/snapshot/compare` | +| 存储统计 | 否 | `te vertipaq` - 列、关系、分区;`--export`/`--import` VPAX | + +#### 其他 + +| 功能 | TE2 CLI (`TabularEditor.exe`) | TE CLI (`te`) | +| -------------- | ------------------------------------------------ | -------------------------------------------------- | +| 交互式 REPL | 否 | `te interactive` - 具备模型感知能力的 shell,提供持久化历史记录和分阶段编辑 | +| Shell Tab 自动补全 | 否 | `te completion bash/zsh/pwsh` | +| TE2 向后兼容性 | 原生 | 内置兼容层——现有 `TabularEditor.exe` 调用无需修改即可继续使用 | 如需查看从 TE2 语法到新 CLI 的逐项标志映射,请参见 @te-cli-migrate。 From 87068cccf3dd25dd40bf0b990eb8c9c86b7b00d2 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:15 +0200 Subject: [PATCH 17/48] New translations te-cli-commands.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-commands.md | 513 ++++++++++-------- 1 file changed, 296 insertions(+), 217 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-commands.md b/localizedContent/zh/content/features/te-cli/te-cli-commands.md index d2c3b0f20..8df4393bc 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-commands.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-commands.md @@ -2,7 +2,7 @@ uid: te-cli-commands title: 命令参考 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -31,8 +31,8 @@ te bpa run --help # Help for a command with subcommands CLI 中的对象定位在所有命令中都采用同一套语法。 以下参考中会出现两种路径形式: -- **``** - 解析为**恰好一个**对象或容器。 用于对单个目标执行操作的命令:`te get`、`te set`、`te add`、`te remove`、`te move`、`te format -p`、`te deps`、`te macro run --on`。 -- **``** - 解析为**零个或多个**对象,并支持通配符。 用于对一组目标执行操作的命令:`te list`、`te bpa run --path` 以及其他检查类命令。 +- **``** - 解析为**恰好一个**对象或容器。 Used by commands that change the model or need a single target: `te set`, `te add`, `te remove`, `te move`, `te deps`, `te macro run --on`, and `te get` with `-p`, `--deps`, or `--properties`. +- **``** - 解析为**零个或多个**对象,并支持通配符。 Used by commands that operate on a set: `te list`, plain `te get` (a wildcard or container path lists every match), `te bpa run --path`, and other inspection-style commands. 两种路径形式共用同一套语法规则;仅有两处不同: @@ -61,6 +61,8 @@ CLI 中的对象定位在所有命令中都采用同一套语法。 以下参考 在带引号的分段内,`*` 会被视为字面字符,而不是通配符。 因此,`'Sa*'` 会匹配名称恰好为 `Sa*` 的表。 +The reserved characters in paths are `/ [ ] ' " * ? { }`. A segment containing any of `* ? { }` must be quoted (`te get "Tables/'{foo}'"`, `te get 'Sales/"my*name"'`); unquoted use is rejected with an error naming the character and showing the quoted form. `?` is reserved and has no wildcard meaning. Every path the CLI prints - in errors, hints, `--paths-only` output, and the `objectPath` field in JSON - is canonically quoted and can be pasted straight back into `te get`. The mixed-quote forms require PowerShell or bash; cmd.exe cannot express them. + ### DAX 风格的引用(仅对象路径) 凡是允许使用 `` 的位置,都接受两种 DAX 形式: @@ -80,12 +82,14 @@ te get "[Total Sales]" # Model-wide measure-or-column lookup | 关键字 | 范围 | 含义 | | --------------------------------------------------------------------------------------------------------------------- | ---- | ------------ | -| `Tables`, `度量值`, `Columns`, `Hierarchies`, `分区` | 模型 | 模型中该类型的所有对象。 | +| `Tables`, `Measures`, `Columns`, `Hierarchies`, `Partitions`, `KPIs`, `Sets` | 模型 | 模型中该类型的所有对象。 | | `关系`, `角色`, `Perspectives`, `Cultures`, `DataSources`, `Expressions`, `CalculationGroups`, `Functions`, `Annotations` | 模型 | 模型级容器。 | -| `度量值`, `Columns`, `Hierarchies`, `分区`, `Calendars`, `CalculationItems` | 表 | 表下的子容器。 | +| `Measures`, `Columns`, `Hierarchies`, `Partitions`, `Calendars`, `CalculationItems`, `KPIs`, `Sets` | 表 | 表下的子容器。 | | `Levels` | 层次结构 | 层次结构的级别。 | | `Members`, `TablePermissions`(别名 `Permissions`) | 角色 | 角色的子级对象。 | +Calculated sets are addressable in container form only (`
/Sets/`); an individual KPI is `
//KPI`; calendars resolve at `
/Calendars/`; relationships resolve at `Relationships/` (the relationship's own name in the model: a GUID, or a label such as `Relationship 1`; `--paths-only` prints it, and the display name is also accepted). + 以下示例展示普通路径与限定容器范围的路径之间的区别: ```bash @@ -94,10 +98,10 @@ te get Sales/Measures/Revenue # Same, container-scoped - disambigua te get Sales/Geography/Levels/Year # Specific level of a hierarchy te get Roles/Admin/Members/bob@example.com # Role member te get Sales/refreshPolicy # Refresh-policy sub-object on a table -te get "Measures/Revenue/KPI" # KPI sub-object of a measure +te get Sales/Revenue/KPI # KPI sub-object of a measure ``` -当实际对象名称恰好与关键字同名时,可为该分段加上引号,以强制进行字面名称匹配。 字面名称为 `Tables` 的表需要写作 `'Tables'`,可通过 `te get "'Tables'"` 访问。 +当实际对象名称恰好与关键字同名时,可为该分段加上引号,以强制进行字面名称匹配。 字面名称为 `Tables` 的表需要写作 `'Tables'`,可通过 `te get "'Tables'"` 访问。 The same applies to tables named `KPIs` or `Sets`. ### 筛选路径中的通配符 @@ -116,27 +120,27 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* ### 错误和提示 -分段拼写错误时会给出一条与上下文相关的错误;如果 CLI 能猜到你的意图,还会附带“你是不是想输入……”的提示。 缺少父级的路径会在检查叶节点之前失败,因此信息会指向真正出错的分段。 空容器(例如,在没有层次结构的模型上运行 `te list Hierarchies`)会给出简单的“这里没有内容”提示,而不是报错。 +分段拼写错误时会给出一条与上下文相关的错误;如果 CLI 能猜到你的意图,还会附带“你是不是想输入……”的提示。 The list offers tables, measures, columns, and hierarchies, each as a full `Table/Object` path that pastes straight back into the next command. A name written in single quotes is a table reference (`te deps 'Revenue'` looks for a table named Revenue), and the error points at the `Table/Object` and `"[Object]"` forms for anything that is not a table. 缺少父级的路径会在检查叶节点之前失败,因此信息会指向真正出错的分段。 Every path an error or hint prints is taken from your model and quoted so it resolves as printed - a refusal never suggests a path that does not exist. Empty containers (e.g., `te list Hierarchies` on a model without hierarchies) emit a simple "nothing here" hint rather than an error. ## 命令别名 大多数长格式命令也有对应的简短别名。 每行显示规范命令及其可用的等效短格式别名。 -| 规范命令 | 别名形式(s) | -| ------------------------------- | --------------------------- | -| `te list` | `te ls` | -| `te remove` | `te rm` | -| `te move` | `te mv`, `te rename` | -| `te bpa rules list` | `te bpa rules ls` | -| `te bpa rules remove` | `te bpa rules rm` | -| `te config list` | `te config ls` | -| `te 宏 list` | `te 宏 ls` | -| `te 宏 remove` | `te 宏 rm` | -| `te incremental-refresh remove` | `te incremental-refresh rm` | -| `te profile list` | `te profile ls` | -| `te profile remove` | `te profile rm` | -| `te session list` | `te session ls` | -| `te test list` | `te test ls` | +| 规范命令 | 别名形式(s) | +| --------------------- | -------------------------- | +| `te save-as` | `te save` | +| `te list` | `te ls` | +| `te remove` | `te rm` | +| `te move` | `te mv`, `te rename` | +| `te bpa rules list` | `te bpa rules ls` | +| `te bpa rules remove` | `te bpa rules rm` | +| `te config list` | `te config ls` | +| `te 宏 list` | `te 宏 ls` | +| `te 宏 remove` | `te 宏 rm` | +| `te profile list` | `te profile ls` | +| `te profile remove` | `te profile rm` | +| `te session list` | `te session ls` | +| `te test list` | `te test ls` | ## 全局选项 @@ -147,7 +151,7 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* | `-m, --model ` | 语义模型的路径(TMDL 文件夹、`.bim` 文件、`Database.json` 文件夹或 `.SemanticModel` 文件夹)。 | | `-s, --server ` | Analysis Services 端点或 Power BI Workspace。 服务器名称/FQDN(`MY.SERVER.COM`)、IP 地址(`192.168.1.1`)、`host:port`、`localhost`、`SERVER\\INSTANCE`、`asazure://...` 或 MSOLAP 连接字符串可用于直接连接到 Analysis Services / AAS。 单一标记名称(`MyWorkspace`)、Fabric `Name.Workspace[/Model.SemanticModel]` 路径或 `powerbi://...` URL 会指向 Power BI Workspace。 名称中包含点号的 Workspace 无法与服务器名称区分,因此会被视为服务器,CLI 会输出警告;如需指向 Power BI,请使用其 `.Workspace` 形式或完整的 `powerbi://` URL。 | | `-d, --database ` | Workspace 上的语义模型名称。 | -| `--local` | 连接到本地运行的 Power BI Desktop 实例(仅限 Windows)。 | +| `--local` | Connect to a locally running Analysis Services instance - Power BI Desktop, Visual Studio workspaces, or standalone SSAS (Windows only). | | `--auth ` | 身份验证方法:`auto`、`interactive`、`spn`、`env`、`managed-identity`(默认值:`auto`)。 | | `--output-format ` | 标准输出格式:`text` (默认)、`json`、`csv`、`tmsl` (别名 `bim`)、`tmdl`。 输出表格数据的命令会识别 `csv`;`tmsl`/`tmdl` 仅由 `te get` 和 `te list` 用于整个对象的序列化。 命令会拒绝其不支持的格式。 | | `--error-format ` | 用于错误、警告和提示的 stderr 格式:`text`(默认)或 `json`。 其他值将回退为 `text`。 它独立于 `--output-format`,因此你可以将 JSON 格式的 stdout 与纯文本错误配合使用(反之亦然)。 | @@ -159,7 +163,9 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* 对于读取模型的命令,解析顺序如下: -位置参数 `` → 全局选项 `--model` → `--server`/`--database`(远程)→ `te connect` 的当前活动连接 → `--recent`。 +`--recent` → `--local` → `--server`/`--database` (remote) → `--model` → active connection from `te connect`. + +The model is never a positional argument - a stray path on the command line is rejected with an "unrecognized command or argument" error. (Positional arguments on `te connect`, `te init`, `te diff`, and `te query` are those commands' own subjects, not the model.) > [!NOTE] > **拼写错误的选项会被立即拒绝。** 如果你传入了当前命令无法识别的 `--flag`,CLI 会直接退出并给出可操作的错误信息,而不是悄悄把该标记当作位置参数吞掉。 这可以捕获 CI 脚本中把 `--force ` 误写成 `--forec` 之类的拼写错误。 @@ -167,26 +173,16 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* > [!NOTE] > **带点号的服务器名称。** `-s`/`--server` 会将带点号的名称(例如 `Sales.2026`)视为 Analysis Services 服务器主机名,而不是 Power BI Workspace。 当 CLI 需要这样判断时,会发出警告,并提示:如果你指的是 Power BI Workspace,请在末尾追加 `.Workspace`(例如 `Sales.2026.Workspace`),或使用完整的 `powerbi://` URL。 适用于 `te connect`、`te deploy`、`te refresh`、`te query`、`te vertipaq` 和 `te test run`。 -## 模型 I/O +## Model initialization and save -### load +### save-as -加载语义模型,并显示模型摘要——名称、兼容级别以及主要对象数量(表、度量值、列)。 - -```bash -te load ./model # TMDL folder -te load model.bim # BIM file -te load -s MyWorkspace -d MyModel # Remote workspace -``` +Re-serialize a model to a different format or location. 可用于将远程 Workspace 中的模型写入本地文件、转换格式,或将编辑内容保存回源位置。 (Alias: `save`.) -### save +`te save-as` accepts: -将模型保存到磁盘。 可用于将远程 Workspace 中的模型写入本地文件、转换格式,或将编辑内容保存回源位置。 - -`te save` 接受: - -- `-o, --output-path ` - 目标文件或文件夹。 **可选** - 若省略,`te save` 会写回源位置,保留原始格式。 文件扩展名也会用于推断格式:`.bim` 会写出单个 BIM 文件,`.json` 会写出 `Database.json` 文件夹,而不带扩展名的路径会写出 TMDL 文件夹。 -- `--serialization ` - `tmdl`、`bim`(别名 `tmsl`)、`database.json`、`pbip`。 省略时,格式会从 `-o` 路径的扩展名推断(如果完全省略 `-o`,则从已加载的模型推断)。 +- `-o, --output-path ` - 目标文件或文件夹。 **Optional** - when omitted, `te save-as` writes back to the source location, preserving the original format. +- `--serialization ` - `tmdl`、`bim`(别名 `tmsl`)、`database.json`、`pbip`。 When omitted, the format is the loaded model's format; with `-o`, it is inferred from the output path (`.bim` writes a single-file BIM, `.json` a `database.json` folder). - `--force` - 跳过验证并覆盖现有输出。 某些拒绝情况(例如容器不明确、项目根目录中存在多个 `SemanticModel`)即使使用 `--force` 也会触发。 - `--skip-bpa` - 完全绕过 BPA 检查。 - `--fix-bpa` - 当规则定义了修复表达式时,自动修复 BPA 违规项。 @@ -195,94 +191,126 @@ te load -s MyWorkspace -d MyModel # Remote workspace - `--supporting-files` - 生成 Fabric 支持文件(`.platform`、`definition.pbism`)。 ```bash -te save # Save back to source (no -o needed) -te save ./model.bim -o ./tmdl-out # Convert BIM to TMDL -te save -o ./project --serialization pbip # Save as a PBIP project -te save -o ./out -s my-workspace -d my-model --skip-validation # Fast download +te save-as # Save back to source (no -o needed) +te save-as -m ./model.bim -o ./tmdl-out # Convert BIM to TMDL +te save-as -o ./project --serialization pbip # Save as a PBIP project +te save-as -o ./out -s my-workspace -d my-model --skip-validation # Fast download ``` -> [!TIP] -> 你可以用 `te save -o -s -d ` 把远程模型下载到磁盘。 如果你只需要原始字节数据(不做 DAX 语义分析),配合 `--skip-validation` 可实现最快的直通下载。 +`--serialization pbip` output opens directly in Power BI Desktop and is named after the source model (`SpaceParts.pbip`, not `Model.pbip`). Saving into a folder that already holds a project adds only the files that are missing and leaves everything already there - the report's pages, theme, connection, and item identity - exactly as it was, so a save that changes nothing leaves the project unchanged under source control. -### open +Validation guards saving: a model with a name collision Analysis Services would refuse (`TE0012` / `TE0013`, see [validate](#validate)) is not written unless `--force` or `--skip-validation` is passed. -在 Tabular Editor 3 桌面版中打开模型。 **仅限 Windows**(需要先安装 TE3)。 不带参数时,会启动 TE3 并打开一个空白的 Workspace。 - -```bash -te open # Launch TE3 with a blank workspace -te open ./my-model # Open a TMDL folder in TE3 -te open ./model.bim # Open a BIM file in TE3 -``` +> [!TIP] +> Use `te save-as -o -s -d ` to download a remote model to disk. 如果你只需要原始字节数据(不做 DAX 语义分析),配合 `--skip-validation` 可实现最快的直通下载。 ### init -在指定路径创建一个新的空语义模型。 默认采用兼容级别为 1702 的 `PowerBI` 兼容模式 TMDL 模型。 +在指定路径创建一个新的空语义模型。 Defaults to a TMDL model in `PowerBI` compatibility mode at compatibility level 1705. `te init` 接受以下参数: - `` - 位置参数:用于创建模型的目录(省略时使用全局 `--model` 路径)。 - `--compatibility-mode ` - `PowerBI`(默认)或 `AnalysisServices`。 -- `--compatibility-level `(别名 `--compat`)- 兼容级别。 当模式为 `PowerBI` 时,默认值为 `1702`;否则为 `1500`。 参见 @update-compatibility-level。 +- `--compatibility-level `(别名 `--compat`)- 兼容级别。 Defaults to `1705` when the mode is `PowerBI`, `1500` otherwise. 参见 @update-compatibility-level。 - `--name ` - 模型/数据库名称(默认:目录名称)。 - `--serialization ` - `tmdl`(默认)、`bim`(别名 `tmsl`)、`database.json`、`pbip`。 - `--force` - 覆盖目标路径下任何现有文件或目录。 ```bash -te init ./new-model # TMDL, PowerBI mode, compat 1702 +te init ./new-model # TMDL, PowerBI mode, compat 1705 te init ./new-model --serialization bim # Single-file BIM model te init ./as-model --compatibility-mode AnalysisServices # AS model, compat 1500 te init ./existing-dir --force # Overwrite non-empty directory ``` +`te init` is idempotent: re-running it over a model it already created prints `Already exists` and exits `0` (under `--output-format json`: `{"created": false, "reason": "already_exists", ...}`). Real conflicts still exit `1`; `--force` re-creates from scratch. + ## 模型编辑 +Mutating commands (`set`, `add`, `remove`, `move`, and also `script`, `macro run`, `bpa run --fix`) are **dry runs by default**: without `--save` the command reports what would change and discards it (`Dry run - nothing saved. Add --save to persist.`). Add `--save` to persist to the source, or `--save-to ` to write elsewhere. On `set`, `add`, `remove`, `move`, `script`, and `bpa run`, the change output renders as a unified diff per changed object; switch it with `--stat` or `--name-only` (mutually exclusive with `--diff`, the default), or set a standing default with `te config set mutationOutput diff|stat|name-only|none`. JSON output always carries the full changes array. A save is refused when the mutation introduces new DAX validation errors, unless `--force`. + ### set -设置模型对象的属性。 接受 `` 参数。 +Set properties on a model object, format its expressions, or sync a table with its source schema. 接受 `` 参数。 `te set` 接受以下参数: -- `-q ` - 属性名称(例如 `expression`、`formatString`、`description`、`isHidden`)。 **可重复** - 将每个 `-q` 与其后紧跟的 `-i` 配对,即可在一条命令中设置多个属性。 -- `-i ` - 值(使用 `-` 可从 stdin 读取)。 每个 `-q` 对应一个 `-i`。 +- `-p, --property ` - property assignment (e.g., `-p expression="SUM(Sales[Amt])"`, `-p isHidden=true`). **Repeatable** - everything after the first `=` is the value. Bare positional assignments work too: `te set Sales/Amount formatString="#,0" --save`. Property names are case-insensitive, accept both spellings where the grid label and the TOM name differ (`Hidden` and `IsHidden`), and accept dotted paths and indexers: `-p KPI.StatusGraphic=...`, `-p "Annotations[Tabular Editor]=..."`, `-p "TranslatedNames[fr-FR]=..."`. Run `te get --properties` to list every name an object accepts - see [get](#get). A partition's expression is `-p Expression` whatever kind of partition it is (`MExpression` and `Query` still work). Use `-p Name=-` to read the value from stdin (one assignment per stream; a piped value is taken verbatim, so piping the text `null` stores the word `null`). `-p Name=` assigns an empty string. +- `--unset ` - clear a property; repeatable (`--unset description --unset displayFolder`). `-p Name=null` is the shorthand. Works on every property that can hold nothing - text properties included - and on object-valued ones (`SortByColumn`, `RefreshPolicy`); `-p "Annotations[key]=null"` removes an annotation. Numbers, booleans, and fixed-choice properties cannot be cleared and are refused. +- `--format ` - format that expression property (repeatable; DAX or M is detected from the property). The formatter tweaks `--long` (fewer line breaks) and `--no-space-after-function` require `--format` on a DAX property. `--semicolons` is refused together with `--format`: an expression stored in a model is always comma-separated, so the semicolon dialect can never parse it - format semicolon-authored DAX with [`te util format-dax --semicolons`](#util-format-dax) instead. +- `--update-schema` - sync a table's columns with its source schema: adds new source columns with detected types, retypes drifted ones, and preserves everything else about every existing column (name, description, format string, display folder, sort-by column, visibility, annotations, translations, perspective membership). Removed source columns only warn unless `--drop-removed-columns` (destructive). A renamed source column looks like remove + add - remap it first with `-p SourceColumn=`. Refused on calculated tables and calculation groups; cannot combine with `-p` or `--format`. With no connection flags, the connection is read from the model itself - the data source the table's partitions are bound to, the connection written into the table's own query, or the model's single usable data source - and the source table from the partition's binding, falling back to the model table's name; `--data-source ` chooses when the model has several usable sources. Naming a connection explicitly with the schema-detection flags shared with `te add` (`--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`) always wins. When no source can be worked out, or the source table cannot be found, the error says which case you are in and names the table it looked for. - `-t, --type ` - 用于在同一路径可能解析为多种对象类型时消除歧义(`度量值`、`Column`、`CalculatedColumn`、`Hierarchy`、`Calendar`、`分区`、`CalculationItem`)。 - `--save` / `--save-to ` - 保存更改。 +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the note above). - `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 - `--force` - 即使修改引入 DAX 验证错误,也会保存。 ```bash -te set Sales/Amount -q expression -i "SUM(Sales[Amt])" --save -te set "'Net Sales'[Sales Amount]" -q formatString -i "#,0" --save # DAX form with spaced names -te set Sales -q isHidden -i true --save -te set Sales/Amount -q formatString -i "#,0" -q description -i "Net sales" --save # Multi-property +te set Sales/Amount -p expression="SUM(Sales[Amt])" --save +te set "'Net Sales'[Sales Amount]" -p formatString="#,0" --save # DAX form with spaced names +te set Sales -p isHidden=true --save +te set Sales/Amount -p formatString="#,0" -p description="Net sales" --save # Multiple properties, one atomic change +te set "Sales/Total Sales" --unset description --save # Clear a property (same as -p description=null) +te set Sales/Amount --format Expression --save # Format one expression property +te set Sales --update-schema --save # Sync columns with the source schema (connection inferred from the model) +te set Sales --update-schema --data-source "Sales DW" --save # Pick the data source when the model has several ``` +#### Incremental refresh policies + +Refresh policies are plain properties on a table's `RefreshPolicy` sub-object, so `te get` and `te set` manage them like anything else. Property names: `Mode`, `RollingWindowPeriods`/`RollingWindowGranularity`, `IncrementalPeriods`/`IncrementalGranularity`, `IncrementalPeriodsOffset`, `SourceExpression`, `PollingExpression` (file input: `-p SourceExpression=- < src.m`). + +```bash +te get Sales/RefreshPolicy # Inspect a table's refresh policy +te set Sales/RefreshPolicy -p RollingWindowPeriods=5 -p RollingWindowGranularity=Day -p IncrementalPeriods=1 -p IncrementalGranularity=Day --save +te set Sales -p RefreshPolicy=null --save # Remove the policy +``` + +The policy is created implicitly on the first `set`. Removing one leaves policy-generated partitions in place, and is refused when they are the table's only partitions. To apply a policy on the server, see [`te refresh --apply-refresh-policy`](#refresh); to apply it metadata-only, use `te script --inline "Model.Tables[\"Sales\"].ApplyRefreshPolicy();" --save`. + ### add -向模型添加对象。 为新对象传入 ``(父级必须已存在;最后一个分段就是新名称),并通过 `-t` / `--type` 指定类型。 关系仍使用其简写语法(`Sales[Key]->Dim[Key]`)。 +向模型添加对象。 为新对象传入 ``(父级必须已存在;最后一个分段就是新名称),并通过 `-t` / `--type` 指定类型。 关系仍使用其简写语法(`Sales[Key]->Dim[Key]`)。 Container-form paths are valid add targets (`Sales/Measures/Margin`, `Sales/Partitions/Q1`, `Sales/Calendars/Fiscal`, `Roles/Admin/TablePermissions/Sales`, `Roles/Admin/Members/user@x.com`) - any path the CLI prints can be fed back to `te add`. `te add` 支持以下选项: -- `-t, --type ` - 指定对象类型。 常用值:`Table`、`Measure`、`Column`、`CalculatedColumn`、`Hierarchy`、`Role`、`Perspective`、`Culture`、`CalculationGroup`、`CalculationItem`。 支持 Tab 自动补全;可通过运行 `te add --help` 获取完整列表。 -- `-i ` - 要赋给新对象的表达式或值(度量值/计算列使用 DAX,分区使用 M,等等)。 与 `-q` 搭配使用,可在同一条命令中为新对象设置其他属性。 -- `-q ` - 要在新对象上设置的其他属性(可重复;与 `-i` 搭配使用)。 -- `--file ` - 从文件读取 `-i` 的表达式,而不是直接写在命令里。 -- `--mode ` - 新表的存储模式:`import`(默认)、`directQuery`、`dual`、`directLake`。 +- `-t, --type ` - 指定对象类型。 Common values: `Table`, `CalculatedTable`, `CalcGroup`, `Measure`, `CalculatedColumn`, `DataColumn`, `Hierarchy`, `Level`, `Calendar`, `CalcItem`, `KPI`, `Partition`, `Expression`, `Function`, `Perspective`, `Culture`, `Role`, `TablePermission`, `Member`. 支持 Tab 自动补全;可通过运行 `te add --help` 获取完整列表。 +- `-p, --property ` - property assignment on the new object (repeatable). The expression goes in `-p Expression="..."`, or use `--file`, or `-p Expression=-` to read it from stdin. +- `--file ` - read the expression from a file instead of inline. +- `--mode ` - storage mode for new tables: `import` (default), `directquery` (alias `dq`), `dual`, `directlake` (alias `dl`). - `--if-not-exists` - 如果对象已存在,则直接以 `0` 退出且不报错。 可用于幂等的 CI/CD 管道。 - `--save` / `--save-to ` - 保存更改。 -- `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 -- `--source-type ` - 新表的初始分区源类型:`m`、`query` 或 `calculated`。 这会覆盖启发式检测结果。 `calculated` 仅在与 `-t CalculatedTable` 搭配使用时有效。 +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--serialization ` - override the serialization when saving (`tmdl`, `bim` (alias `tmsl`), `database.json`, `pbip`). +- `--source-type ` - 新表的初始分区源类型:`m`、`query` 或 `calculated`。 这会覆盖启发式检测结果。 `query` builds a legacy SQL `SELECT` partition bound to the model's provider data source and is refused with lakehouse/warehouse sources or when no provider source exists; `calculated` is only valid with `-t CalculatedTable`. +- `--partition-expression ` - raw M expression for the new table's initial partition. - `--force` - 即使修改引入 DAX 验证错误,也会保存。 +Adding a single data column to an existing table takes `-t DataColumn` with both `SourceColumn` and `DataType` required (refused on calculated tables and calculation groups): + ```bash -te add Sales/Revenue -t Measure -i "SUM(Sales[Amount])" --save -te add Sales -t Table --save -te add "Sales[ProdKey]->Product[ProdKey]" --save # Relationship shorthand -te add Sales/MarketingFlag -t CalculatedColumn -i "Sales[Amount] > 1000" --if-not-exists --save -te add Perspectives/Default/Sales --save # Include Sales in the Default perspective -te add Roles/Reader -t Role --save # New role at the model level +te add Sales/Quantity -t DataColumn -p SourceColumn=Qty -p DataType=Int64 --save ``` -对于数据绑定表,`te add` 还支持从 SQL、Lakehouse 或 Warehouse 源推断架构。 有关 `--source`、`--endpoint`、`--source-table`、`--columns` 等参数,可查看 `te add --help`。 +Tables can be created in one shot from the model's **own** data source - no connection flags needed. The CLI reads the connection off the model's data source, discovers the source table's columns and their types, and creates the table with a partition already bound to that source. Over a legacy (provider) data source the partition is a legacy SQL query holding the generated `SELECT`, matching what the desktop **Import Tables** wizard writes; pass `--source-type m` for a Power Query (M) partition instead. Over a structured (Power Query) data source the partition is always M. Refusals are clean and create nothing: several usable data sources and no `--data-source`, no data source the CLI can read (SQL Server, Azure SQL, and Fabric SQL sources are covered), a source whose password the model does not store, or a source table the connection cannot find - the error names the table it looked for and where that name came from. + +- `--source-table ` - create the table from this source table. +- `--query "SELECT ..."` - create the table from a query instead: the query is described against the connection without being run, the new table gets exactly the columns it returns, and the query is kept as the partition's content. Works with an inferred connection and with one named explicitly. `--source-type query` places the SQL in a legacy Query partition bound to the model's legacy data source. Refused together with `--mode directlake` (a Direct Lake partition holds no query), with `--columns`, and with an expression of its own (`-p Expression=` or `--file`). +- `--data-source ""` - disambiguate when the model has several data sources. + +Schema detection against an explicit source also works, and always wins over inference: `--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`, or a manual column spec `--columns "Id:Int64,Name:String"`. `te add "
" -t Table` with no source at all still creates an empty table to fill in yourself. + +```bash +te add Sales/Revenue -t Measure -p Expression="SUM(Sales[Amount])" --save +te add Sales/Quantity -t DataColumn -p SourceColumn=Qty -p DataType=Int64 --save +te add "Sales[ProdKey]->Product[ProdKey]" --save # Relationship shorthand +te add Sales/MarketingFlag -t CalculatedColumn -p Expression="Sales[Amount] > 1000" --if-not-exists --save +te add Perspectives/Default/Sales --save # Include Sales in the Default perspective +te add Roles/Reader -t Role --save # New role at the model level +te add Inventory -t Table --source-table dbo.Inventory --save # Table from the model's own data source +te add TopCustomers -t Table --query "SELECT TOP 100 * FROM dbo.Customers" --save +``` ### 删除 @@ -296,6 +324,7 @@ te add Roles/Reader -t Role --save # New - `--if-exists` - 如果对象不存在,则直接以 `0` 退出且不报错。 可用于幂等的 CI/CD 管道。 - `--dry-run` - 预览删除操作而不实际执行。 - `--save` / `--save-to ` - 保存更改。 +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). - `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 ```bash @@ -313,44 +342,17 @@ te remove Sales/OldMeasure --if-exists --save # Idempotent - `-t, --type ` - 当源路径匹配到多种对象类型时,用于消除歧义(例如同名的列和层次结构)。 - `--save` / `--save-to ` - 保存更改。 -- `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)或 `database.json`)。 +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 - `--force` - 即使该变更会引入 DAX 验证错误,也仍会保存。 +Renaming an object whose name is not yours to set is refused with a non-zero exit code rather than reported as `No changes.` - a relationship (its name always describes the columns it joins), a measure's KPI, a role's table permission. + ```bash te move Sales/Revenue Finance/Revenue --save # Move measure to another table te move Sales/Revenue Sales/TotalRevenue --save # Rename measure te move Sales/Date Sales/CalendarDate -t Hierarchy --save # Disambiguate hierarchy from column -``` - -### replace - -在各个模型对象中查找并替换文本。 默认仅进行干运行;添加 `--save` 才会实际应用更改。 - -`te replace` 接受: - -- `--in ` - 作用域:`names`、`expressions`、`descriptions`、`displayFolders`、`formatStrings`、`annotations`、`all`(默认值:`all`)。 -- `--regex` - 将查找模式视为正则表达式。 -- `--case-sensitive` - 启用大小写敏感匹配。 -- `--dry-run` - 仅预览更改,不会实际应用。 默认行为。 -- `--save` - 将变更保存回源位置。 与 `--revert` 和 `--stage` 互斥。 -- `--save-to ` - 保存到不同的路径(意味着 `--save`)。 -- `--serialization ` - 模型序列化: `tmdl`、`bim` (别名 `tmsl`)、`database.json`。 -- `--force` - 即使替换引入 DAX 验证错误,也会保存。 - -`--in expressions` 会遍历所有包含表达式的属性: - -- **度量值**:`Expression`、`DetailRowsExpression` -- **KPI**:`TargetExpression`、`StatusExpression`、`TrendExpression` -- **分区**:源 M、轮询 M -- **表格权限**:`FilterExpression` -- **计算组**:选择表达式 -- **计算列**:DAX 表达式 - -在模型中新增具有表达式形态的属性后,工具会自动将其纳入遍历范围。 - -```bash -te replace "OldTable" "NewTable" --in expressions --save -te replace "SUM" "SUMX" --regex --in expressions --save +te move "Sales/Partitions/Old" "Sales/Partitions/New" --save # Container-form paths work too ``` ## 检查 @@ -361,7 +363,7 @@ te replace "SUM" "SUMX" --regex --in expressions --save `te list` 支持: -- `--type ` - 限定为一种对象类型(`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`)。 如果不提供 ``,这等同于输入匹配的容器关键字。 +- `--type ` - narrow to one object kind (`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`, `calculationitem`, `kpi`, `set`, `function`). 如果不提供 ``,这等同于输入匹配的容器关键字。 - `--paths-only` - 每行输出一个对象路径,适合通过管道传给 `xargs`、`te get` 或 `te set`。 - `--no-multiline` - 将多行单元格(通常是 DAX 或 M 表达式)折叠为单行并截断,让宽表中的各行仍便于浏览。 仅影响文本输出;JSON/CSV/TMSL 输出不受影响。 - `--output-format tmsl`(别名 `bim`)- 将匹配的对象输出为 TMSL/BIM 脚本。 适用于 `te list Tables --output-format bim > tables.json`。 `ls` 不支持 `--output-format tmdl`(TMDL 仅支持单对象输出——请使用 `te get`)。 @@ -375,6 +377,10 @@ te list 'Sa*' # Tables whose name starts with Sa ( te list '*/Amount' # An Amount column/measure across every table te list 'Roles/Re*/Members' # Members of every role matching Re* te list Sales/Geography/Levels # All levels of the Geography hierarchy +te list KPIs # All KPIs (with parent measure) +te list Sales/KPIs # KPIs on measures of Sales +te list Sets # Calculated sets +te list Functions # DAX user-defined functions te list "'Net Sales'/'Sales Amount'" # Quote names containing spaces te list Measures --paths-only # One Table/Measure per line for piping te list --type measure # Same as `te list Measures` @@ -382,37 +388,53 @@ te list Measures --no-multiline # Wide table with column dividers, s te list Tables --output-format bim > tables.json # All tables emitted as TMSL/BIM ``` +In JSON output, every listed object leads with its `objectPath` - a canonical path that resolves with `te get`. + ### get -获取模型对象的属性。 接受一个 ``。 +Get properties of a model object, filter and list sets of objects, and analyze dependencies - `get` is the CLI's one read pipeline (`te list` and `te deps` remain as shortcuts). Takes a ``; omit it to list the model (same as `te list`), or pass `.` for the model root. A wildcard path (`te get "Sa*"`) or a container path (`te get Sales/Measures`) lists every match without needing `--ls`; `-p`, `--deps`, and `--properties` need exactly one object, so on a wildcard path they say so and suggest dropping the flag. `te get` 支持: -- `-q, --query ` - 获取单个属性(例如 `expression`、`formatString`)。 +- `-p, --property ` - project a single property (e.g. `expression`, `formatString`). +- `--where ` - filter the result set; repeatable (AND), case-insensitive. A value with no `*` is an exact match; `*` is a wildcard, so a contains-search is `--where Name=*margin*`. With no path, `--where` filters the model's **top-level tables** - pass a container to search other kinds (`te get Measures --where Name=*margin*`). An empty result names what was searched and how the pattern was matched, and offers commands that widen the search. +- `--properties` - list the property names `-p` accepts on the resolved object, with each property's type, whether it can be written, what it holds, and - where a property takes a fixed set of values - the values it accepts. Both spellings are shown where they differ (`Hidden` / `IsHidden`), and annotations and translations appear in the bracket form they have to be written in. Internal bookkeeping properties are left out; `--all` adds them. Text and JSON output only; needs a single-object path and cannot combine with `-p`, `--ls`, `--where`, `--deps`, or `--unused`. +- `--ls` - compact table layout (the same rendering as `te list`). +- `--deps [upstream|downstream]` - dependency analysis (default: both directions); `--deep` for the recursive tree, `--max-depth ` (default `10`). +- `--unused` / `--hidden` - surface unused objects, as on `te deps`. +- `--paths-only` - one canonical object path per line, for piping. +- `--no-multiline` - collapse multi-line cells (with `--ls`/`--where`). 仅适用于文本输出。 - `-t, --type ` - 当路径匹配到表下的多个子对象时,用于消除歧义(例如同名的列和层次结构)。 可选值:`Measure`、`Column`、`CalculatedColumn`、`Hierarchy`、`Calendar`、`Partition`、`CalculationItem`。 - `--output-format tmsl`(别名 `bim`)- 将解析后的对象输出为 TMSL/BIM JSON。 - `--output-format tmdl` - 将解析后的对象输出为 TMDL(仅限命名对象)。 `te get` 和 `te list` 共用同一个描述符目录,因此无论输出为哪种格式,属性的呈现方式都一致:文本表格、JSON 和 CSV 显示的都是同一组属性;给模型新增属性后,也会在所有格式中自动可见。 +The `Settable:` line under a `te get ` result lists the properties `te set` accepts on that object (`SortByColumn` among them) and ends with a pointer to `--properties` for the full list; an unknown property name on `te get -p` or `te set -p` points at the same listing. `te get -p` syntax-highlights every expression-valued property, detail rows and format string expressions included. In JSON output, a single object leads with `objectPath` (the canonical path, resolvable as-is by `te get`, `te set`, or `te remove`), followed by `type` and `properties`; a listing that matches nothing prints an empty array. + ```bash -te get Sales/Amount -q expression # Print DAX +te get Sales/Amount -p expression # Print DAX te get "'Sales'[Amount]" # DAX form: same as Sales/Amount te get "[Total Sales]" # Lone-bracket: model-wide measure-or-column -te get "'Net Sales'[Sales Amount]" -q expression # DAX form with spaced names -te get "Sales/Revenue/KPI" # KPI sub-object of a measure -te get Sales --output-format tmdl # Emit the table as TMDL -te get Sales --output-format bim # Emit the table as TMSL/BIM -te get Model -q description +te get "'Net Sales'[Sales Amount]" -p expression # DAX form with spaced names +te get Sales/Revenue/KPI # KPI sub-object of a measure +te get Sales --output-format tmdl # Emit the table as TMDL +te get Sales --output-format bim # Emit the table as TMSL/BIM +te get . -p description # Model-level property +te get "Sa*" # Every table matching the wildcard, no --ls needed +te get Measures --where IsHidden=true --ls # Filter + list rendering +te get Measures --where Name=*margin* # Contains-search across all measures +te get Sales/Amount --properties # Property names -p accepts, with types and allowed values +te get Sales/Revenue --deps downstream --deep # Recursive dependents ``` ### find -在模型对象中搜索文本。 +Search string properties for text and report each match site. The pattern is a **literal, case-insensitive substring** by default - `te find "Gross*"` looks for a literal asterisk - so pass `--regex` for pattern matching. Use `te get --where Name=*Gross*` when you want to filter objects by a property value rather than search text. An empty result names the scope that was searched and the matching mode used, and offers commands that widen the search; a `--regex` pattern that is not a valid regular expression is refused with an error naming the flag and the pattern. `te find` 支持: -- `--in ` - 与 `te replace` 相同(默认值为 `all`)。 +- `--in ` - 作用域:`names`、`expressions`、`descriptions`、`displayFolders`、`formatStrings`、`annotations`、`all`(默认值:`all`)。 - `--regex`、`--case-sensitive`、`--paths-only`。 - `--no-multiline` - 将多行匹配上下文折叠为单行。 仅适用于文本输出。 @@ -421,13 +443,18 @@ te get Model -q description ```bash te find "CALCULATE" --in expressions te find "Revenue" --in names -te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -q expression +te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -p expression +te find "Gross.*Margin" --in names --regex ``` +Under `--output-format json`, `te find` reports the scope it searched and the matching mode it used alongside the matches. + ### diff 比较两个模型的结构差异。 返回以下退出码:`0` 表示相同,`1` 表示发现差异,`2` 表示错误。 +Changes are reported the same way the mutating commands report theirs: one consolidated entry per changed object, with `-`/`+` lines per property in text output. In JSON, the `changes` array entries carry `objectPath` (the canonical path, pipeable into `te get`), `objectType` (the same closed vocabulary as the findings JSON - `KPI`, `Member`, ...), `changeKind` (`created`, `deleted`, `modified`, or `moved` - a renamed object that carries a lineage tag is a single `moved` entry with `movedFromObjectPath`), and a `properties` array of `{property, before, after}` with PascalCase property names. An object that exists in only one of the two models is listed together with its contents - a new role's row-level security filters, a new table's columns, measures, and partitions, a new hierarchy's levels - each as its own entry, and the summary counts include them. + ```bash te diff ./model-v1 ./model-v2 te diff old.bim new.bim @@ -441,7 +468,7 @@ te diff ./a ./b; switch ($LASTEXITCODE) { 0 { 'same' } 1 { 'different' } default ### deps -分析对象的上游和下游依赖关系,或找出整个模型中未使用的对象。 单对象形式接受一个 ``。 +分析对象的上游和下游依赖关系,或找出整个模型中未使用的对象。 A shortcut for `te get --deps` / `te get --unused`. 单对象形式接受一个 ``。 `te deps` 接受以下选项: @@ -453,6 +480,8 @@ te diff ./a ./b; switch ($LASTEXITCODE) { 0 { 'same' } 1 { 'different' } default - `--unused` - 列出未被任何 DAX 引用,且未用于任何关系、层次结构级别、排序依据、变体、AlternateOf 基对象或日历时间角色的度量值、计算列以及**所有数据列**。 每条结果在文本模式下会显示 `(hidden)`,在 JSON 中则包含 `isHidden` 字段。 - `--hidden` - 将 `--unused` 限制为仅包含隐藏对象。 隐藏且未使用的对象是最安全的清理候选项,因为没有任何用户可见内容依赖它们。 +In JSON output, every entry - and every `upstream`, `downstream`, and `--deep` tree node - is named the way the rest of the CLI names objects: `objectPath` (canonical path, pipeable into `te get`), `object` (bare name), and `objectType`. + ```bash te deps Sales/Revenue # Upstream + downstream for one object te deps "'Sales'[Revenue]" # DAX form is accepted everywhere a is @@ -469,20 +498,24 @@ te deps --unused --hidden # Only hidden, unused objects `te validate` 接受以下选项: -- `--ci ` - 将 CI 注释输出到 stderr:`vsts` 或 `github`。 +- `--ci ` - emit CI annotations to stderr: `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`). `none` or an empty value means no annotations; any other value is rejected before the command runs. - `--trx ` - 将结果写入 VSTEST `.trx` 文件。 - `--errors-only` - `--no-warnings --no-antipatterns` 的简写:仅显示错误。 - `--no-warnings` - 隐藏语义分析器发出的警告。 - `--no-antipatterns` - 隐藏反模式建议(DAX 最佳实践提示)。 - `--server-only` - 仅显示所连接服务器报告的错误;跳过本地语义分析。 -- `--no-multiline` - 将多行单元格内容(错误信息、表达式)折叠为单行。 仅适用于文本输出。 +- `--no-multiline` - 将多行单元格内容(错误信息、表达式)折叠为单行。 仅文本输出。 ```bash -te validate ./model +te validate -m ./model te validate --ci github --trx results.trx te validate --errors-only # Hide warnings and anti-pattern hints ``` +Every finding carries a stable code, shown in the **Code** column of the Errors, Warnings, and Anti-patterns tables as well as in JSON, `--ci` annotations, and `--trx`. Three codes are worth knowing when a hand-written model is involved: `TE0012` (a column and a measure, or two columns, share a name within one table) and `TE0013` (a measure name is repeated across tables) are errors - Analysis Services refuses to load such a model, and `te save-as` refuses to write one unless `--force` or `--skip-validation` is passed; `TE0014` is a warning that a TMDL folder has no `database.tmdl`, so the compatibility level in effect is a substitute for the one the model declared. The folder still loads and `te validate` still exits `0` for `TE0014`; hide it like any other warning with `--no-warnings` or `--errors-only`. + +Under `--output-format json`, `te validate` emits the shared findings JSON document (`summary` plus a flat `findings[]` array) shared with `te bpa run`, `te test run`, and `te query` - see @te-cli-findings. + > [!NOTE] > `te validate` 不支持 `--output-format csv`——CSV 会在一开始就被拒绝,并给出可操作的错误提示,而不是生成不完整的结果。 验证输出使用 `text` 或 `json`。 @@ -492,23 +525,22 @@ te validate --errors-only # Hide warnings and anti-pattern hints `te bpa run` 接受以下选项: -- `` - 位置参数:模型路径(可替代全局标志 `--model`)。 - `-r, --rules ` - JSON 格式的 BPA 规则文件(s)的路径(s)或 URL(s)。 可重复指定。 替换本次调用的用户规则层:请参阅下文的 [规则源和解析](#rule-sources-and-resolution)。 - `--no-model-rules` - 排除嵌入在模型注释中的 BPA 规则。 - `--no-defaults` - 排除内置的默认 BPA 规则。 - `--vpax ` - 从 `.vpax` 文件加载 VertiPaq分析器统计信息,以启用可感知 VPA 的规则。 -- `--vpa-rules` - 包含内置的 VPA 感知规则(需要 `--vpax` 或预先标注的模型)。 - `--allow-external-rules` - 允许从嵌入在模型注释中的 URL 获取 BPA 规则文件。 - `--rule ` - 仅按 ID 运行指定规则(s)。 可重复指定。 - `--path ` - 将分析限制为包含匹配对象的表。 支持字面名称、容器关键字和通配符(例如 `'Sales'`、`'Sa*'`、`'Sales/度量值'`、`'*/Amount'`)。 - `--fix` - 应用修复表达式,在可能的情况下自动修复违规项。 - `--save` - 应用修复后,将模型保存回原始位置。 - `--save-to ` - 应用修复后,将模型保存到其他路径。 +- `--diff` / `--stat` / `--name-only` - change-output rendering for the fix pass (see the [Model editing](#model-editing) note). - `--serialization ` - 模型序列化: `tmdl`、`bim` (别名 `tmsl`)、`database.json`。 - `--fail-on ` - 失败阈值:`error`(默认)或 `warning`。 当违规项达到该阈值时,将以退出代码 `1` 退出。 无论 `--fail-on` 如何设置,规则加载或求值错误(表达式无效、规则文件无法读取)也会导致命令以非零状态退出。 -- `--ci ` - 向 stderr 输出 CI 日志命令:`vsts`(Azure DevOps)、`github`(GitHub Actions)。 +- `--ci ` - emit CI logging commands to stderr: `vsts` (Azure DevOps; aliases `azdo`, `azure-devops`), `github` (GitHub Actions; alias `gh`). Unrecognised values are rejected up front. - `--trx ` - 将结果作为 VSTEST `.trx` 文件写入指定路径。 -- `--no-multiline` - 将违规表中的多行单元格内容折叠为单行。 仅文本输出。 +- `--no-multiline` - 将违规表中的多行单元格内容折叠为单行。 Text output only. ```bash te bpa run --fail-on error --ci github @@ -519,6 +551,8 @@ te bpa run --path 'Sa*' # Wildcard - every table starting with Sa te bpa run --path Sales/Measures # Path filter applied to the matched tables ``` +Under `--output-format json`, `te bpa run` emits the shared findings JSON document (see @te-cli-findings); with `--fix`, the JSON is a single document that also includes the `fix` change set. + #### 规则来源与解析 每次调用 `te bpa run` 时,都会从三个彼此独立的层级整合规则: @@ -530,12 +564,14 @@ te bpa run --path Sales/Measures # Path filter applied to the matched tables 2. **内置默认规则** - 除非传入 `--no-defaults`,或配置中的 [`bpa.builtInRules`](xref:te-cli-config#built-in-bpa-rules) 为 `false`,否则会加载。 `bpa.disabledBuiltInRuleIds` 中列出的单个内置规则会被跳过。 3. **模型嵌入规则** - 模型 `BestPracticeAnalyzer_Rules` 注释中的规则;除非传入 `--no-model-rules`,否则会加载。 除非同时传入 `--allow-external-rules` 参数,否则会跳过外部 URL 注释。 -重复的规则 ID 会被去重(用户规则优先于内置规则)。 然后会移除模型 `BestPracticeAnalyzer_IgnoreRules` 注释中的规则 ID。 +The built-in defaults are exactly Tabular Editor 3's documented [built-in rule set](xref:built-in-bpa-rules) (the `TE3_BUILT_IN_*` IDs), so `te bpa run` and TE3 Desktop agree on what the built-ins flag. The six VertiPaq Analyzer rules (`VPA_*`) that earlier previews presented as built-in are not part of that set, and the `--vpa-rules` flag no longer exists; if a pipeline gates on one of them, copy its definition into your own rules file and point at it with `--rules`, `bpa.rules`, or `TE_BPA_RULES`. `--vpax` is unchanged and still supplies the statistics a VPA-aware rule of your own reads. C# scripts (`te script`, `te macro run`) see the same rule set through `Bpa.Rules` and `Bpa.Analyze()`. + +Each rule ID is evaluated once. When the same ID appears in more than one layer, an explicit `--rules` file's definition wins in `te bpa run`, while the built-in definition wins in the deploy/save gates. 然后会移除模型 `BestPracticeAnalyzer_IgnoreRules` 注释中的规则 ID。 输出中的 `Rules loaded:` 行会列出每个提供规则的层级,例如: ``` -Rules loaded: 41 from 1 file(s) from bpa.rules config + built-in defaults + model annotations +Rules loaded: 38 from 1 file(s) from bpa.rules config + built-in defaults + model annotations ``` ### bpa rules @@ -544,17 +580,17 @@ Rules loaded: 41 from 1 file(s) from bpa.rules config + built-in defaults + mode 子命令: -| 子命令 | 用途 | -| ----------------------------------- | ---------------------------- | -| `add [model]` | 添加新的 BPA 规则。 | -| [`disable`](#bpa-rules-disable) | 为当前用户禁用一条内置 BPA 规则。 | -| [`enable`](#bpa-rules-enable) | 重新启用先前已禁用的内置 BPA 规则。 | -| `ignore [model]` | 将规则添加到模型的忽略列表。 | -| [`init`](#bpa-rules-init) | 在解析后的 PATH 下创建一个空的 BPA 规则文件。 | -| [`list`](#bpa-rules-list)(别名 `ls`) | 列出来自所有来源的 BPA 规则及其状态。 | -| `remove [model]`(别名 `rm`) | 删除一条 BPA 规则。 | -| `set [model]` | 更新 BPA 规则的属性。 | -| `unignore [model]` | 从模型的忽略列表中移除一条规则。 | +| 子命令 | 用途 | +| -------------------------------------------------- | ---------------------------- | +| `add ` | 添加新的 BPA 规则。 | +| [`disable`](#bpa-rules-disable) | 为当前用户禁用一条内置 BPA 规则。 | +| [`enable`](#bpa-rules-enable) | 重新启用先前已禁用的内置 BPA 规则。 | +| `ignore ` | 将规则添加到模型的忽略列表。 | +| [`init`](#bpa-rules-init) | 在解析后的 PATH 下创建一个空的 BPA 规则文件。 | +| [`list`](#bpa-rules-list)(别名 `ls`) | 列出来自所有来源的 BPA 规则及其状态。 | +| `remove ` (alias `rm`) | 删除一条 BPA 规则。 | +| `set ` | 更新 BPA 规则的属性。 | +| `unignore ` | 从模型的忽略列表中移除一条规则。 | `te bpa rules` 的所有子命令都接受以下选项: @@ -618,7 +654,7 @@ te bpa rules init --force - `--severity <1|2|3>` - `1`(信息)、`2`(警告,默认)、`3`(错误)。 - `--description ` - 规则触发时向用户显示的说明。 - `--fix-expression ` - `te bpa run --fix` 用于自动修复的 Dynamic LINQ 表达式。 -- `te bpa rules set ` - 更新现有规则的属性。 使用 `-q -i ` 参数对(可重复)。 属性名称:`name`、`expression`、`scope`、`category`、`severity`、`description`、`fixExpression`。 +- `te bpa rules set ` - 更新现有规则的属性。 Uses `-p, --property ` (repeatable; `-` reads the value from stdin). 属性名称:`name`、`expression`、`scope`、`category`、`severity`、`description`、`fixExpression`。 - `te bpa rules remove ` - 删除规则。 - `te bpa rules ignore ` - 将规则 ID 添加到模型的 `BestPracticeAnalyzer_IgnoreRules` 注解中。 - `te bpa rules unignore ` - 从模型的忽略列表中移除规则 ID。 @@ -633,7 +669,7 @@ te bpa rules add MEASURE_NEEDS_DESCRIPTION \ --category Metadata # Update severity on an existing rule -te bpa rules set MEASURE_NEEDS_DESCRIPTION -q severity -i 3 +te bpa rules set MEASURE_NEEDS_DESCRIPTION -p severity=3 # Remove the rule te bpa rules remove MEASURE_NEEDS_DESCRIPTION @@ -681,27 +717,15 @@ te vertipaq --export stats.vpax te vertipaq --import stats.vpax # Analyze offline ``` -### format +### Formatting expressions -格式化 DAX 或 M/Power Query 表达式。 +Expression formatting lives in three places, depending on what you are formatting: -`te format` 支持: +- **An expression in the model**: `te set --format --save` - see [set](#set). +- **A loose expression** (not in any model): `te util format-dax` / `te util format-m` - see [Utilities](#utilities). +- **A whole-model sweep**: `te script --inline "Model.AllMeasures.FormatDax();" --save`. -- `-e, --expression ` - 格式化单个内联表达式。 -- `-p, --path ` - 格式化指定的度量值或列。 -- `-t, --type ` - 当路径匹配到表下的多个子对象时,用于消除歧义。 -- `--lang ` - 表达式语言:`dax`(默认),或用于 Power Query 的 `m`/`pq`。 -- `--semicolons` - 使用分号作为列表分隔符(欧洲区域设置)。 -- `--long` - 使用长格式(更多换行)。 默认为短格式。 -- `--no-space-after-function` - 省略函数名称后的空格。 -- `--save` / `--save-to` - 持久化保存格式化后的表达式。 - -```bash -te format --save # Format all DAX -te format -p Sales/Amount --save # Single measure -te format -e "SUM ( Sales[Amount] )" # Inline -te format --lang m --save # Format M -``` +DAX in a model is always comma-separated, so `--semicolons` exists only on `te util format-dax`, for DAX you have typed with semicolons yourself. ## 执行 @@ -712,7 +736,7 @@ te format --lang m --save # Format M `te query` 支持以下选项: - `` - 位置参数:要执行的 DAX 查询。 等同于传入 `-q`。 选择你觉得更易读的写法即可;如果两者都提供,以显式的 `-q` 为准。 -- `-q, --query ` - 内联查询(即上述位置参数的命名参数形式)。 +- `-q, --query ` - 内联查询(即上述位置参数的命名参数形式)。 `-q -` reads the query from stdin; with input piped and no query given at all, stdin is read implicitly. - `--file ` - 从文件读取查询。 - `--limit ` - 默认为 100。 - `-o, --output-file ` - 将结果写入文件(`.csv`、`.tsv`、`.json`、`.dax`)。 @@ -731,17 +755,25 @@ te query --file query.dax --output-format json `te script` 支持以下选项: -- `-S, --script ` - `.cs` / `.csx` 文件(可重复指定)。 -- `-e, --expression ` - 内联 C#(使用 `-` 表示从 stdin 读取)。 +- `--file ` - `.cs` / `.csx` file (repeatable). Bare positional `.cs`/`.csx` arguments are also accepted. +- `--inline ` - inline C# (repeatable; use `-` for stdin). +- `--validate` - compile the script(s) and report errors without executing them. Needs no model at all, so it works offline as a CI lint. - `--save` / `--save-to` / `--serialization`。 -- `--dry-run` - 编译脚本(s)并报告错误,但不执行它们。 +- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--force` - save even if the mutation introduces DAX validation errors. + +Files and inline snippets run in the order they are written on the command line. ```bash -te script --script fix.cs --save -te script -e "Info(Model.Tables.Count)" -echo "Info(Model.Name);" | te script -e - +te script --file fix.cs --save +te script fix.cs cleanup.csx --save # Bare positionals, run in order +te script --inline "Info(Model.Tables.Count);" +echo "Info(Model.Name);" | te script --inline - +te script --file fix.cs --validate # Compile-only, no model needed ``` +A run in which any script calls `Error(...)` exits non-zero, reports `"success": false` in JSON, and closes by saying the run completed with errors; changes the script already made are still saved when `--save` is given. `Warning(...)` and `Info(...)` never fail a run. On Windows, the `DisableCSharpScripts` administrator policy refuses `te script` outright - see [Administrator policies](xref:te-cli-config#administrator-policies). + > [!IMPORTANT] > 如果你要迁移旧脚本,需要了解以下两个行为差异: > @@ -772,7 +804,7 @@ echo "Info(Model.Name);" | te script -e - ### macro -通过宏 JSON 文件(通常为 `MacroActions.json`)管理和运行宏。 宏文件的 PATH 按以下顺序解析:`--macros ` → 环境变量 `TE_MACROS_PATH` → CLI 配置中的 `macros` → `./MacroActions.json`。 +通过宏 JSON 文件(通常为 `MacroActions.json`)管理和运行宏。 宏文件的 PATH 按以下顺序解析:`--macros ` → 环境变量 `TE_MACROS_PATH` → CLI 配置中的 `macros` → `./MacroActions.json`。 On Windows, the `DisableMacros` administrator policy refuses every `te macro` command - see [Administrator policies](xref:te-cli-config#administrator-policies). 子命令: @@ -791,12 +823,12 @@ echo "Info(Model.Name);" | te script -e - 修改宏文件 (`add`、`set`、`remove` (别名 `rm`))。 这三个命令都操作 `--macros `(或解析得到的宏文件)。 - `te macro add ` - 创建新宏。 使用 `-e ""`(内联)或 `-s `(脚本文件)提供脚本主体。 可选:`--tooltip `、`--contexts `(宏适用的上下文,例如 `Table,Measure`,即“表、度量值”)、`--enabled true|false`。 -- `te macro set ` - 更新宏属性。 使用成对的 `-q -i ` 参数(可重复)。 属性名称:`name`、`execute`、`enabled`、`tooltip`、`validContexts`。 +- `te macro set ` - 更新宏属性。 Use `-p, --property ` (repeatable; `-` reads the value from stdin). 属性名称:`name`、`execute`、`enabled`、`tooltip`、`validContexts`。 - `te macro remove ` - 删除宏。 ```bash te macro add MyMacro -e "Info(Selected.Measure.Name);" --tooltip "Print measure name" --contexts Measure -te macro set MyMacro -q tooltip -i "Updated tooltip" +te macro set MyMacro -p tooltip="Updated tooltip" te macro remove MyMacro ``` @@ -822,7 +854,8 @@ te macro init --force `te macro run` 接受: - `--on ` - 将宏的选择上下文设置为单个已命名对象(如表、度量值、列等…)。 这相当于在 TE3 中右键单击该对象,并从上下文菜单调用宏。 -- `--save` / `--save-to` - 将宏所做的所有更改持久化保存。 +- `--save` / `--save-to` - 将宏所做的所有更改持久化保存。 Like every mutating command, `te macro run` is a dry run without `--save`. +- `--serialization ` / `--force` - as on the other mutating commands. ```bash te macro run "Hide all measures" @@ -836,9 +869,13 @@ te macro run "Format DAX" --on "'Net Sales'[Sales Amount]" --save # DAX form w 将语义模型部署到 Power BI、Fabric、Azure Analysis Services 或本地 SQL Server Analysis Services。 +**Dry run by default**: `te deploy` connects read-only and prints the exact TMSL it would send to stdout. Add `--execute` to actually deploy. + `te deploy` 支持以下参数: -- `-s, --server` / `-d, --database` - 指定目标服务器/Workspace 和模型。 使用服务器名称、FQDN、IP 地址或 MSOLAP 连接字符串时,会部署到 Analysis Services(本地环境使用 Windows 集成身份验证);使用 Workspace 名称或 `powerbi://...` URL 时,会部署到 Power BI。 有关 `-s` 的含义,请参阅 [全局选项](#global-options) 表。 +- `-s, --server` / `-d, --database` - the model **source**, exactly as on every other command. +- `--target-server ` / `--target-database ` - the deploy **destination**: a workspace name, endpoint, or server, and the semantic model name to create or overwrite. 使用服务器名称、FQDN、IP 地址或 MSOLAP 连接字符串时,会部署到 Analysis Services(本地环境使用 Windows 集成身份验证);使用 Workspace 名称或 `powerbi://...` URL 时,会部署到 Power BI。 For local model sources, the target falls back to the active `te connect` connection; when the source is remote, the target flags are required. Deploying a model onto itself is refused. +- `--execute` - actually deploy. In interactive mode this shows a summary + confirmation prompt with **`n` as the safe default**; `--execute --force` skips the prompt (required in CI, where a prompt without `--force` is an error). - `--deploy-full` - 覆盖现有内容,并同时部署连接、分区、共享表达式、角色及角色成员。 - `--deploy-connections` - `--deploy-partitions` @@ -847,57 +884,60 @@ te macro run "Format DAX" --on "'Net Sales'[Sales Amount]" --save # DAX form w - `--deploy-role-members` - `--deploy-shared-expressions` - `--create-only` -- `--xmla ` - 生成 XMLA/TMSL 脚本,而不是部署(`-` 表示输出到标准输出)。 - `--skip-bpa` - 完全跳过 BPA 门控检查。 - `--fix-bpa` - 如果规则定义了修复表达式,则自动修复 BPA 违规项。 - `--bpa-rules ` - 可重复指定;仅针对本次部署覆盖 CLI 配置中的 `bpa.rules`。 除非 `bpa.builtInRules` 为 `false`,否则内置规则仍会生效。 -- `--force` - 跳过交互式确认(CI 必需)。 -- `--ci ` - `vsts` 或 `github`。 +- `--force` - skip the interactive confirmation. +- `--ci ` - `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`); unrecognised values are rejected up front. - `-p, --profile ` - 一次性使用已保存的 @te-cli-auth 配置文件。 +`--output-format bim|tmdl` is rejected on deploy. To capture the deployment script for review, redirect the dry-run output: `te deploy ... > deploy.tmsl`. + ```bash -te deploy ./model -s my-workspace -d my-model --force --ci github -te deploy ./model -s MY.SERVER.COM -d my-model --force # On-prem SSAS (Integrated auth) -te deploy ./model --xmla script.tmsl # Generate TMSL only -te deploy ./model --profile staging --force +te deploy -m ./model --target-server my-workspace --target-database my-model --execute --force --ci github +te deploy -m ./model --target-server MY.SERVER.COM --target-database my-model --execute --force # On-prem SSAS +te deploy -m ./model --target-server my-workspace --target-database my-model > deploy.tmsl # Dry run: TMSL only +te deploy -s src-workspace -d src-model --target-server dst-workspace --target-database copy --execute # Remote to remote +te deploy --local --target-server my-workspace --target-database my-model --execute # Publish a Desktop model ``` > [!IMPORTANT] -> `te deploy` 会在执行前运行 Best Practice Analyzer 作为门控检查。 在交互模式下,会显示摘要和确认提示,且 **默认安全选项为 `n`**。 在 CI 中,传入 `--force` 可跳过该提示。 BPA 门控配置请参见 @te-cli-config。 +> `te deploy` 会在执行前运行 Best Practice Analyzer 作为门控检查。 BPA 门控配置请参见 @te-cli-config。 + +A deploy **fails** when the server reports errors on one or more objects, even though the metadata has been written: the exit code is non-zero, JSON reports `"success": false` with the reason in `error`, the headline says the deploy landed with errors, and `--ci` reports the object errors as errors. Unprocessed objects are not a failure - a metadata-only deploy legitimately leaves objects holding no data. The workspace mirror set up with `te connect -w` applies the same rule. > [!NOTE] -> 当设置 `--output-format json` 时,`te deploy` 的 JSON 输出始终包含解析后的 `server` 和 `database`,即使它们是从活动连接或配置文件中解析得到的,而不是显式传入的。 管道可使用这些字段来确认部署目标,而无需重新解析命令行。 在使用 `--output-format json` 时,`te deploy` 和 `te format` 失败时也会以非零退出码退出,这与其文本模式下的行为一致——JSON 输出记录的是失败信息,而不是成功信号。 +> 当设置 `--output-format json` 时,`te deploy` 的 JSON 输出始终包含解析后的 `server` 和 `database`,即使它们是从活动连接或配置文件中解析得到的,而不是显式传入的。 管道可使用这些字段来确认部署目标,而无需重新解析命令行。 `te deploy` also exits non-zero on failure under `--output-format json`, matching its text-mode behavior - the JSON payload is the failure record, not a success signal. ### refresh 在已部署的模型上触发数据刷新。 +**Dry run by default**: `te refresh` prints the TMSL a refresh would send to stdout. Add `--execute` to run it. + `te refresh` 支持: - `--type ` - `full`、`dataonly`(别名 `data-only`、`data`)、`automatic`(别名 `auto`)、`calculate`(别名 `calc`)、`clearvalues`(别名 `clear`)、`defragment`(别名 `defrag`)、`add`(默认值:`automatic`)。 - `--table ` - 刷新特定表(可为多个);可重复指定。 - `--partition ` - 刷新特定分区(可为多个)。 -- `--apply-refresh-policy` - 应用增量刷新的刷新策略,以确定要刷新的分区。 -- `--effective-date ` - 设置刷新策略使用的生效日期。 +- `--execute` - actually run the refresh. At a terminal it asks for confirmation with **`n` as the safe default**; add `--force` to skip the question. An unattended run (redirected output, `--output-format json`, or `--non-interactive`) stops with an error unless `--force` is given, so `te refresh --type full --execute --force` is the CI form. +- `--force` - skip the confirmation prompt. +- `--apply-refresh-policy ` - apply incremental refresh policies to determine which partitions are refreshed; pass a table name to scope the refresh to that table. Policies apply by default when the refresh type and scope are compatible, except for models hosted in Power BI Desktop. An explicit value wins (with warnings when it cannot take effect). +- `--effective-date ` - set the effective date used by the refresh policy (ignored, with a warning, when no policy applies). - `--max-parallelism ` - 设置可并行刷新的最大分区数。 将刷新封装在 TMSL `sequence` 命令中。 -- `--dry-run` - 输出 TMSL 脚本而不执行。 -- `--no-progress`, `--trace [path]`。 - -```bash -te refresh --type full # Full refresh -te refresh --table Sales --type full # Single table -te refresh --type full --dry-run > refresh.tmsl # Emit TMSL only -``` - -### incremental-refresh +- `--no-progress`, `--trace [path]`。 `--trace` without `--execute` warns and prints the TMSL. Trace timing comes from the server's clock, the log is kept until the server has finished delivering buffered events, and `te-refresh-*` traces older than an hour that interrupted runs left behind are stopped and dropped at the start of a traced refresh (traces from other tools are never touched). -管理表的增量刷新策略。 +Executed refreshes under `--output-format json` always include a `progress` array; with the `vertipaqOnRefresh` config key enabled, a per-table `vertipaq` array (rows, size, columns) is included too - no `--trace` needed. ```bash -te incremental-refresh show
+te refresh --type full --execute # Full refresh (asks for confirmation at a terminal) +te refresh --type full --execute --force # Unattended: skip the confirmation +te refresh --table Sales --type full --execute # Single table +te refresh --type full > refresh.tmsl # Dry run: emit TMSL only +te refresh --apply-refresh-policy Sales --execute # Apply Sales' incremental refresh policy ``` -其他子命令(`set`、`remove`(别名 `rm`)、`apply`)可通过 `te incremental-refresh --help` 查看说明。 +Incremental refresh policies are authored with [`te set`](#incremental-refresh-policies) on a table's `RefreshPolicy` sub-object. ## 测试 @@ -917,6 +957,8 @@ te test run --ci github --trx results.trx te test run --tag revenue ``` +Suites are validated before any connection is made; a suite that fails validation (for example, a missing `query_file`) exits `1` without running anything. Under `--output-format json`, `te test run` emits the shared findings JSON document with test-specific extras (`suites`, `invalidSuites`, `testSummary`) - see @te-cli-findings. + ### test init / spec / use / list / snapshot / compare `te test list` 也支持使用 `ls` 作为别名。 @@ -940,12 +982,14 @@ te connect # Show current active connection te connect my-workspace my-model # Remote (positional) te connect -s my-workspace -d my-model # Remote (named-flag form) te connect ./model # Local -te connect --local # Power BI Desktop (Windows) -te connect --local my-report # Filter by report name (multiple PBI Desktop instances) +te connect --local # Local Analysis Services instance (Windows) +te connect --local my-model # Match an instance (e.g. an open report's window title) or a database name te connect --profile prod # Activate a saved profile te connect --clear # Clear the active connection (and any workspace mirror) ``` +`te connect --local` lists every local Analysis Services instance - Power BI Desktop (Store and installer versions), Visual Studio workspaces, and standalone SSAS - with a two-step prompt (instance, then database) when an instance hosts several databases. Non-interactive mode fails with the candidate list instead of picking silently; narrow it with `te connect --local `. + #### 工作区模式(`-w` / `--workspace`) 将主源与次要目标配对,使后续每次执行 `--save` 都会在两者之间同步镜像模型。 适合保留远程 Workspace 的本地工作副本,或在保存时将本地修改推送到 Workspace。 @@ -975,23 +1019,56 @@ te connect ./revenue-model -w Finance "Revenue Model" # Mirror local → remo ### config list / paths / init / set -查看和管理 CLI 配置以及 TE3 PATH 覆盖设置。 (`te config list` 的别名是 `ls`。) 参见 @te-cli-config。 +View and manage CLI configuration. (`te config list` 的别名是 `ls`。) 参见 @te-cli-config。 + +`te config set` takes a positional `key value` pair or the equivalent `-p key=value`. ```bash te config list # Display all settings -te config paths # Resolved TE3 file paths +te config paths # Resolved macros and BPA rules file paths te config init # Create default config te config set autoFormat true +te config set -p spinner=false # -p form ``` -### migrate +## Utilities + +Model-free helpers. `te util` subcommands never touch a model - `--model`, `-s`/`-d`, `--local`, `--recent`, and `--auth` are rejected. + +### util format-dax + +Format a loose DAX expression. + +- `` - the expression to format; `-` reads it from stdin. +- `--semicolons` - format DAX written with semicolons as list separators (European locale). The flag selects the semicolon dialect for the expression that is read as well as for the output, so it is for DAX you authored with semicolons - comma-separated DAX fails with a syntax error under it. It is accepted only here: `te set --format` refuses it, because an expression stored in a model is always comma-separated. +- `--long` - long format with fewer line breaks. 默认为短格式。 +- `--no-space-after-function` - 省略函数名称后的空格。 + +```bash +te util format-dax "SUM ( Sales[Amount] )" +cat query.dax | te util format-dax - +te util format-dax "CALCULATE(SUM(Sales[Amt]); Sales[Region] = \"EU\")" --semicolons # Semicolon-authored DAX +``` + +JSON output carries `success`, `formatted`, and `errors`. For expressions already in the model, use `te set --format ` instead; for a whole-model sweep, `te script --inline "Model.AllMeasures.FormatDax();" --save`. + +### util format-m + +Format a loose M/Power Query expression. `-` reads from stdin; no language-specific options. A malformed expression - an unterminated string, for example - is reported as a failure with a non-zero exit code and the original text returned unchanged, never a silently shortened result. + +```bash +te util format-m "let x = 1 in x" +cat partition.m | te util format-m - +``` + +### util migrate 说明旧版 Tabular Editor 2 CLI 参数如何映射到新 CLI 的参考指南。 在迁移基于 TE2 的管道时,可作为实时速查参考。 完整迁移指南参见 @te-cli-migrate。 ```bash -te migrate # Full flag mapping table -te migrate -A # Look up a single TE2 flag -te migrate --output-format json # Machine-readable mapping +te util migrate # Full flag mapping table +te util migrate -A # Look up a single TE2 flag +te util migrate --output-format json # Machine-readable mapping ``` ## Shell @@ -1005,7 +1082,6 @@ te migrate --output-format json # Machine-readable mapping `te interactive` 接受以下选项: -- `` - 可选位置参数:启动会话时加载本地模型、`.bim` 文件或 `.SemanticModel` 文件夹。 - `--no-banner` - 启动时跳过欢迎横幅。 从脚本驱动 REPL 时很有用。 - `--echo` - 在输出结果之前,将每条已执行命令回显到 stdout。 当通过 stdin 管道传入命令时很有帮助,这样日志会显示实际运行了什么。 - `--batch` - 非交互式批处理模式:逐行从 stdin 读取命令,执行每条命令,并在 EOF 时退出。 当 stdin 被重定向时会自动启用。 @@ -1013,11 +1089,13 @@ te migrate --output-format json # Machine-readable mapping ```bash te interactive # Connect later -te interactive ./model # Start with a local model +te interactive --model ./model # Start with a local model te interactive -s MyWorkspace -d MyModel # Start with a remote model -printf "list Measures\nexit\n" | te interactive ./model # Pipe commands via stdin +printf "list Measures\nexit\n" | te interactive --model ./model # Pipe commands via stdin ``` +Inside the session, mutating commands stage in memory: `save` (no arguments) commits the staged edits and `revert` discards them, while `save-as` re-serializes to a format or location. Closing a session that still holds staged edits asks for confirmation (or, when nobody can answer, warns and exits non-zero); `exit --force` throws them away deliberately - see @te-cli-interactive. + 引号和 DAX 风格的引用在会话内外的用法一致——有关 REPL 中支持括号感知的 argv 拆分的详细信息,请参见上文的[对象路径](#object-paths)一节以及 @te-cli-interactive。 ### 会话 @@ -1059,11 +1137,11 @@ te completion fish ## 退出代码 -| 退出代码 | 含义 | -| ---- | ------------------------------------------------------------------------------ | -| `0` | 成功。 | -| `1` | 通用失败(参数无效、命令执行失败、验证错误、身份验证失败,或 BPA 关卡在严重性级别 >= error 时未通过)。 用于 `te diff`:发现差异。 | -| `2` | 仅适用于 `te diff`:比较时发生错误,因此差异状态未知。 | +| 退出代码 | 含义 | +| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `0` | 成功。 | +| `1` | Generic failure (invalid arguments, command failed, validation errors, auth failure, BPA gate failed at severity >= error, a `te script` run in which a script reported an error, a `te deploy` the server accepted with object errors). 用于 `te diff`:发现差异。 | +| `2` | 仅适用于 `te diff`:比较时发生错误,因此差异状态未知。 | 如需在 CI 管道中进行更细致的控制,可将退出代码与 `--ci ` 注释以及 `--trx` 结果文件结合使用——参见 @te-cli-cicd。 @@ -1073,4 +1151,5 @@ te completion fish - @te-cli-install - 安装并设置 CLI。 - @te-cli-auth - 进行身份验证并管理连接。 - @te-cli-config - 配置文件、BPA 门禁和变更后行为。 +- @te-cli-findings - the findings JSON shared by validate, bpa run, test run, and query. - @te-cli-migrate - TE2 → TE3 标志映射。 From 537a8c313b0f3ec89735924853c8881a1dd467a8 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:18 +0200 Subject: [PATCH 18/48] New translations te-cli-config.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-config.md | 93 +++++++++++-------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-config.md b/localizedContent/zh/content/features/te-cli/te-cli-config.md index 06d0743a3..9acefc17e 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-config.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-config.md @@ -2,7 +2,7 @@ uid: te-cli-config title: 自定义配置 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -19,7 +19,7 @@ applies_to: Tabular Editor CLI 可从 JSON 文件读取可选配置。 配置控制三类内容: -- **文件路径** — CLI 在何处读取宏、BPA 规则和(可选)TE3 Desktop 可执行文件,以及在何处写入查询日志。 +- **File paths** - where the CLI reads macros and BPA rules, and where to write the query log. - **行为默认设置** — BPA 门禁、自动格式化、校验。 - **已保存的连接配置文件** — 你可切换的已命名配置文件列表。 @@ -64,9 +64,10 @@ te config set autoFormat true te config set bpa.onDeploy false te config set hidePreviewNotice true te config set macros null # Clear a path override +te config set -p spinner=false # -p key=value works too ``` -如果键未知,命令将以退出码 `1` 失败,并返回一条列出有效键的错误信息。 +Keys can be passed positionally (`te config set `) or as `-p key=value`. 如果键未知,命令将以退出码 `1` 失败,并返回一条列出有效键的错误信息。 如果配置文件不存在,`te config set` 会先在解析后的路径自动创建一个配置文件 (若设置了则为 `$TE_CONFIG`,否则为 `~/.config/te/config.json`),然后再应用更改。 @@ -84,6 +85,7 @@ te config set macros null # Clear a path override "autoFormat": false, "validateOnMutation": true, "vertipaqOnRefresh": false, + "mutationOutput": "diff", "bpa": { "rules": null, @@ -98,7 +100,6 @@ te config set macros null # Clear a path override "launchInteractiveMode": "auto", "formatOptions": { - "useSemicolons": false, "shortFormat": false, "skipSpaceAfterFunction": false, "useSqlBiDaxFormatter": false @@ -110,7 +111,6 @@ te config set macros null # Clear a path override "disableTelemetry": false, "queryLog": null, - "te3ExePath": null, "profiles": {} } @@ -120,12 +120,11 @@ te config set macros null # Clear a path override 在配置中设置这些路径,以避免每次执行命令都传入相同的路径。 每个命令的标志和环境变量都会覆盖配置值;请参阅下方的[路径解析优先级](#path-resolution-priority)。 -| 键 | 含义 | -| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `macros` | 宏 JSON 文件的显式路径 (通常为 `MacroActions.json`)。 每个 `te macro` 命令都会解析它。 可将其指向共享文件(网络共享、仓库内文件,甚至 TE3 Desktop 的文件),以便在不同计算机之间以及在 CLI 与 TE3 Desktop 之间复用同一组宏。 | -| `bpa.rules` | 指向 BPA 规则文件的路径或 URL 的有序列表。 `te bpa run` 和 deploy/save gate 会加载**所有**现有条目;`te bpa rules list` 和 `te config paths` 使用第一个现有条目。 在 `te config set bpa.rules ...` 中使用逗号分隔的值时,会将其拆分为数组。 | -| `te3ExePath` | Tabular Editor 3 Desktop 可执行文件 (`TabularEditor.exe`) 的显式路径。 **仅** `te open` 在启动桌面应用时才会用到;在 Linux/macOS 上,或不使用 `te open` 时,可安全留空。 如果未设置,`te open` 会回退到在 `PATH` 中查找。 | -| `queryLog` | 日志文件路径,每次调用 `te query` 时都会将其查询文本和执行元数据追加到该文件中。 可用于审计追踪,或分析随时间变化的查询模式。 支持使用 `~` 表示主目录(例如 `~/.config/te/queries.log`)。 | +| 键 | 含义 | +| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `macros` | 宏 JSON 文件的显式路径 (通常为 `MacroActions.json`)。 每个 `te macro` 命令都会解析它。 可将其指向共享文件(网络共享、仓库内文件,甚至 TE3 Desktop 的文件),以便在不同计算机之间以及在 CLI 与 TE3 Desktop 之间复用同一组宏。 | +| `bpa.rules` | 指向 BPA 规则文件的路径或 URL 的有序列表。 `te bpa run` 和 deploy/save gate 会加载**所有**现有条目;`te bpa rules list` 和 `te config paths` 使用第一个现有条目。 在 `te config set bpa.rules ...` 中使用逗号分隔的值时,会将其拆分为数组。 | +| `queryLog` | 日志文件路径,每次调用 `te query` 时都会将其查询文本和执行元数据追加到该文件中。 可用于审计追踪,或分析随时间变化的查询模式。 支持使用 `~` 表示主目录(例如 `~/.config/te/queries.log`)。 | ### 路径解析优先级 @@ -143,19 +142,20 @@ CLI 不会自动检测 TE3 的任何安装位置——请显式配置这些项 所有与 BPA 相关的设置都位于 `bpa` 对象下,并可在 `te config set` 中使用点号分隔的键进行设置。 -| 键名 | 默认值 | 说明 | -| ---------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoFormat` | `false` | 在执行 `te add` / `te set` / `te move` / `te macro run` 之后,对修改过的表达式运行 DAX Formatter。 默认使用内置格式化程序;可通过 `formatOptions.useSqlBiDaxFormatter` 改用 SQL BI Web 服务。 | -| `validateOnMutation` | `true` | 在执行更改命令(`add`、`set`、`mv`、`replace --save`、`macro run`)后,检查模型中的每个 `Table[Column]` 引用是否仍可解析。 可在部署前捕获因重命名或删除而引入的悬空引用。 | -| `bpa.onMutation` | `false` | 在每次更改命令(`set`、`add`、`mv`、`rm`、`macro run`)后,运行一次限定范围的 BPA 分析。 只检查受影响表中的对象,而不是整个模型——这对于迭代编辑时获得快速反馈很有用。 | -| `bpa.onDeploy` | `true` | 在执行 `te deploy` 之前运行 BPA 关卡检查。 如果有任何规则以严重级别 >= error 触发,部署将中止。 可通过 `--skip-bpa` 在单次调用中跳过,或通过 `--fix-bpa` 自动修复。 | -| `bpa.onSave` | `true` | 在 `te save -o` 写入磁盘之前运行 BPA 关卡检查。 可通过 `--skip-bpa` 或 `--force` 在单次调用中跳过。 | -| `bpa.builtInRules` | `true` | 每次运行关卡检查时,都包含精选的内置 BPA 规则集。 设为 `false` 可完全忽略内置规则;此时关卡检查只运行通过 `bpa.rules` 配置的规则以及嵌入模型中的规则。 | -| `bpa.disabledBuiltInRuleIds` | `null` | 要从门禁中排除的各个内置规则的 ID。 可通过 `te bpa rules disable ` / `te bpa rules enable ` 修改——优先使用这些命令,而不是直接编辑该数组。 | -| `vertipaqOnRefresh` | `false` | 成功刷新后(`full`、`dataonly`、`automatic` 或 `add`),自动运行 VertiPaq 分析,以显示已刷新表的存储统计信息。 有助于立即发现意外的基数变化或内存回归。 | -| `interactiveEditMode` | `stage` | 在 `te interactive` 中对内存中变更的默认处理方式。 `stage` 会将变更保留在内存中,直到调用 `save`(最安全);`save` 会在每次产生变更的命令后写回源(对远程源请谨慎使用——每次 `set` 都会触发一次 XMLA 写入);`revert` 会在每条命令后丢弃变更,除非传入了 `--save` 或 `--stage`。 每个命令上的 `--save` / `--revert` / `--stage` 标志始终会覆盖此设置。 | -| `launchInteractiveMode` | `auto` | 控制在终端中不带任何参数运行 `te` 时,是否启动交互式 REPL。 `auto` (默认) 仅在三个流(stdin、stdout、stderr)都连接到 TTY 时才会启动 REPL,因此脚本和 CI 流水线会按常规方式解析,不会进入 REPL。 `always` 会在无论是否重定向的情况下都启动 REPL。 `never` 会完全禁用自动启动,恢复传统的空参数显示帮助行为。 全局 `--non-interactive` 标志会在单次调用中强制设为 `never`。 也可通过 `TE_INTERACTIVE` 环境变量为单次调用设置该值。 | -| `disableTelemetry` | `false` | 选择不参与匿名使用遥测数据收集。 CLI 会收集粗粒度的命令使用数据(命令名称、退出代码、持续时间),用于确定功能优先级。 CLI 绝不会收集模型内容、PATH 或查询文本。 | +| 键名 | 默认值 | 说明 | +| ---------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `autoFormat` | `false` | Automatically format the DAX expressions changed by a mutating command. Formatting is scoped to the objects the command touched but covers every DAX expression property they hold (expressions, format string expressions, detail rows, KPI target/status/trend, calculation group and table permission expressions, etc.). Power Query (M) and SQL partition queries are never reformatted. Always uses the built-in offline formatter in the comma dialect; the `formatOptions` layout keys apply. | +| `validateOnMutation` | `true` | After a mutating command (`add`, `set`, `mv`, `macro run`), check that every `Table[Column]` reference in the model still resolves. 可在部署前捕获因重命名或删除而引入的悬空引用。 | +| `mutationOutput` | `diff` | How mutating commands (`add`, `set`, `move`, `remove`, `script`, `bpa run --fix`) render the resulting change set in text output: `diff` (full before/after diff), `stat` (per-object change counts), `name-only` (changed object paths), or `none` (suppress the change set; config-only - there is no `--none` flag). The per-command `--diff` / `--stat` / `--name-only` flags override for one invocation. JSON output always carries the full `changes` array regardless. | +| `bpa.onMutation` | `false` | 在每次更改命令(`set`、`add`、`mv`、`rm`、`macro run`)后,运行一次限定范围的 BPA 分析。 只检查受影响表中的对象,而不是整个模型——这对于迭代编辑时获得快速反馈很有用。 | +| `bpa.onDeploy` | `true` | 在执行 `te deploy` 之前运行 BPA 关卡检查。 如果有任何规则以严重级别 >= error 触发,部署将中止。 可通过 `--skip-bpa` 在单次调用中跳过,或通过 `--fix-bpa` 自动修复。 | +| `bpa.onSave` | `true` | Run the BPA gate before `te save-as` writes to disk. 可通过 `--skip-bpa` 或 `--force` 在单次调用中跳过。 | +| `bpa.builtInRules` | `true` | 每次运行关卡检查时,都包含精选的内置 BPA 规则集。 设为 `false` 可完全忽略内置规则;此时关卡检查只运行通过 `bpa.rules` 配置的规则以及嵌入模型中的规则。 | +| `bpa.disabledBuiltInRuleIds` | `null` | 要从门禁中排除的各个内置规则的 ID。 可通过 `te bpa rules disable ` / `te bpa rules enable ` 修改——优先使用这些命令,而不是直接编辑该数组。 | +| `vertipaqOnRefresh` | `false` | 成功刷新后(`full`、`dataonly`、`automatic` 或 `add`),自动运行 VertiPaq 分析,以显示已刷新表的存储统计信息。 有助于立即发现意外的基数变化或内存回归。 | +| `interactiveEditMode` | `stage` | 在 `te interactive` 中对内存中变更的默认处理方式。 `stage` 会将变更保留在内存中,直到调用 `save`(最安全);`save` 会在每次产生变更的命令后写回源(对远程源请谨慎使用——每次 `set` 都会触发一次 XMLA 写入);`revert` 会在每条命令后丢弃变更,除非传入了 `--save` 或 `--stage`。 每个命令上的 `--save` / `--revert` / `--stage` 标志始终会覆盖此设置。 | +| `launchInteractiveMode` | `auto` | 控制在终端中不带任何参数运行 `te` 时,是否启动交互式 REPL。 `auto` (默认) 仅在三个流(stdin、stdout、stderr)都连接到 TTY 时才会启动 REPL,因此脚本和 CI 流水线会按常规方式解析,不会进入 REPL。 `always` 会在无论是否重定向的情况下都启动 REPL。 `never` 会完全禁用自动启动,恢复传统的空参数显示帮助行为。 全局 `--non-interactive` 标志会在单次调用中强制设为 `never`。 也可通过 `TE_INTERACTIVE` 环境变量为单次调用设置该值。 | +| `disableTelemetry` | `false` | 选择不参与匿名使用遥测数据收集。 CLI 会收集粗粒度的命令使用数据(命令名称、退出代码、持续时间),用于确定功能优先级。 CLI 绝不会收集模型内容、PATH 或查询文本。 | ```bash te config set bpa.rules "/etc/te/team.json,/etc/te/strict.json" @@ -166,14 +166,13 @@ te config set bpa.disabledBuiltInRuleIds "TE3_BUILT_IN_DATE_TABLE_EXISTS,TE3_BUI ### 格式选项 -每当 CLI 调用 DAX 格式化程序时都会应用(用于 `te format`,以及在启用 `autoFormat` 时对变更进行格式化)。 CLI 附带一个可完全离线工作的自研格式化器;如果你需要那种风格,或希望在启用 "Use daxformatter.com..." 时与 TE2 或 TE3 的行为一致,可通过 `formatOptions.useSqlBiDaxFormatter` 选择使用 SQL BI 的 [daxformatter.com](https://www.daxformatter.com) Web 服务。 +Applied whenever the CLI formats DAX. The CLI ships a formatter that works fully offline. The layout keys (`shortFormat`, `skipSpaceAfterFunction`) apply when `autoFormat` reformats mutated expressions and when `te query` renders query text; explicit formatting via `te set --format ` and `te util format-dax` takes the equivalent per-invocation flags (`--long`, `--no-space-after-function`) instead. There is deliberately no list-separator key: DAX stored in a model or sent to Analysis Services is always comma-separated, so every config-driven formatting pass uses commas. The one place the semicolon dialect applies is the `--semicolons` flag on `te util format-dax`, for DAX you have typed with semicolons yourself. `formatOptions.useSqlBiDaxFormatter` routes explicit formatting and `te query`'s rendering through the SQL BI [daxformatter.com](https://www.daxformatter.com) web service (requires internet access) if you need that style; `autoFormat` always uses the built-in formatter regardless. -| 键 | 默认值 | 说明 | -| -------------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `formatOptions.useSemicolons` | `false` | 使用 `;` 作为列表分隔符(欧洲/欧盟区域设置惯例)。 默认的 `,` 与 en-US 区域设置一致。 | -| `formatOptions.shortFormat` | `false` | 尽可能优先使用简短的单行格式,而不是默认的多行布局。 | -| `formatOptions.skipSpaceAfterFunction` | `false` | 省略函数名称与左括号之间的空格(例如使用 `SUM(x)`,而不是 `SUM (x)`)。 | -| `formatOptions.useSqlBiDaxFormatter` | `false` | 通过 [SQL BI daxformatter.com](https://www.daxformatter.com) Web 服务格式化 DAX,而不是使用内部格式化程序。 需要联网。 内置格式化器(默认)可离线使用,其效果与 Tabular Editor 3 Desktop 的默认格式化一致。 | +| 键 | 默认值 | 说明 | +| -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `formatOptions.shortFormat` | `false` | 尽可能优先使用简短的单行格式,而不是默认的多行布局。 | +| `formatOptions.skipSpaceAfterFunction` | `false` | 省略函数名称与左括号之间的空格(例如使用 `SUM(x)`,而不是 `SUM (x)`)。 | +| `formatOptions.useSqlBiDaxFormatter` | `false` | Format DAX via the [SQL BI daxformatter.com](https://www.daxformatter.com) web service instead of the built-in formatter. 需要联网。 The built-in formatter (default) works offline and matches the Tabular Editor 3 Desktop default. | ### 显示 @@ -189,20 +188,22 @@ te config set bpa.disabledBuiltInRuleIds "TE3_BUILT_IN_DATE_TABLE_EXISTS,TE3_BUI 已保存的连接配置文件存放在 `profiles` 键下。 不要手动编辑——请使用 `te profile set / remove / list`。 配置文件管理见 @te-cli-auth。 -配置文件可以包含 **覆盖项**,在配置文件处于启用状态时,用来覆盖上述默认行为。 这样一来,开发配置文件可以放宽验证和 BPA,而生产配置文件则保持严格: +配置文件可以包含 **覆盖项**,在配置文件处于启用状态时,用来覆盖上述默认行为。 The keys a profile can override are `autoFormat`, `validateOnMutation`, `mutationOutput`, `bpa.onMutation`, `bpa.onDeploy`, `bpa.onSave`, `vertipaqOnRefresh`, `spinner`, and `interactiveEditMode`. 这样一来,开发配置文件可以放宽验证和 BPA,而生产配置文件则保持严格: ```bash te profile set dev --validate-on-mutation false --bpa-on-deploy false te profile set prod --auto-format true ``` +`te profile set` exposes flags for the common ones (`--auto-format`, `--validate-on-mutation`, `--bpa-on-mutation`, `--bpa-on-deploy`, `--vertipaq-on-refresh`, `--spinner`); each accepts `true`, `false`, or `null` to clear the override. + ## BPA 闸门 BPA 闸门是一道安全防线,用于防止存在规则违规的模型被保存或部署。 执行以下命令时,它会自动运行: - `te deploy` 会触发闸门检查,除非传入 `--skip-bpa` 或 `bpa.onDeploy` 为 `false`。 -- `te save` 会触发闸门检查,除非传入 `--skip-bpa`(或 `--force`)或 `bpa.onSave` 为 `false`。 -- `te add`、`te set`、`te move`、`te macro run` 仅在 `bpa.onMutation` 为 `true` 时才会运行门禁检查。 +- `te save-as` runs the gate unless `--skip-bpa` (or `--force`) is passed or `bpa.onSave` is `false`. +- `te add`, `te set`, `te move`, `te remove`, `te macro run` run the gate only when `bpa.onMutation` is `true`. 闸门检查会从 `bpa.rules` 加载 BPA 规则,并且默认还会加载内置规则集(由 `bpa.builtInRules` 控制)。 可通过 `bpa.disabledBuiltInRuleIds` 单独排除内置规则——可使用 `te bpa rules disable ` / `te bpa rules enable ` 管理。 @@ -210,13 +211,13 @@ BPA 闸门是一道安全防线,用于防止存在规则违规的模型被保 - `--fix-bpa` - 在内存中将规则的 `fixExpression` 应用于部署/保存产物;不会修改源文件。 - `--skip-bpa` - 仅对本次命令禁用闸门检查。 -- `--bpa-rules ` - 可重复指定;仅在本次调用 `te deploy` 或 `te save` 时覆盖 `bpa.rules`。 除非 `bpa.builtInRules` 为 `false`,否则内置规则仍会生效。 +- `--bpa-rules ` - repeatable; override `bpa.rules` for this single `te deploy` or `te save-as` invocation. 除非 `bpa.builtInRules` 为 `false`,否则内置规则仍会生效。 可单独运行 `te bpa run`,在不部署的情况下预览闸门检查的行为: ```bash -te bpa run ./model --fail-on error -te bpa run ./model --fix --save # Apply fixes to the source +te bpa run --model ./model --fail-on error +te bpa run --model ./model --fix --save # Apply fixes to the source ``` ### 内置 BPA 规则 @@ -227,7 +228,7 @@ CLI 随附一套权威的内置 BPA 规则集,并以 JSON 资源的形式嵌 ## 变更后行为 -运行会产生变更的命令(`te add`、`te set`、`te move`、`te replace --save`、`te macro run`)时,CLI 会自动执行以下检查: +When you run a mutating command (`te add`, `te set`, `te move`, `te macro run`), the CLI performs these checks automatically: 1. **TOM 错误**始终会被提示。 度量值、列、分区或计算项中的无效 DAX 或 M 始终会导致命令失败。 2. **架构验证** (`validateOnMutation`,默认值为 `true`) 会验证 DAX 中的 `Table[Column]` 引用是否仍可解析,并交叉检查元数据一致性。 @@ -236,17 +237,29 @@ CLI 随附一套权威的内置 BPA 规则集,并以 JSON 资源的形式嵌 可使用 `te config set false` 禁用某项检查,或通过配置文件将放宽范围限定到特定环境。 +## Administrator policies + +On Windows, `te` honors the same administrator policies as Tabular Editor 3. Policies are read from the registry under `Software\Policies\Tabular Editor ApS` - with an optional `TECLI` subkey for values that should apply to the CLI only, and a `TE3` subkey for the desktop - and from the earlier `Software\Policies\Kapacity\Tabular Editor` key, which keeps working unchanged. A machine-wide value (`HKEY_LOCAL_MACHINE`) takes precedence over a per-user one (`HKEY_CURRENT_USER`), and within a hive a product-specific value takes precedence over a shared one. Where a policy turns a feature off, the command names the policy responsible, does nothing, and exits with a failure - so a pipeline that depends on something an administrator has since turned off fails visibly rather than reporting success for work it never did. + +| Policy | Effect on the CLI | +| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `DisableCSharpScripts` | Refuses `te script` and the automatic fixes of `te bpa run --fix`. | +| `DisableMacros` | Refuses every `te macro` command. | +| `DisableBpaDownload` | Refuses Best Practice Analyzer rules given as a URL. Rule files on disk and the built-in rules are unaffected. | +| `DisableTelemetry` | Turns anonymous usage statistics off, whatever `disableTelemetry` in config says. | + +Policies that govern features the CLI does not have - update checks, error reports, DAX Optimizer, the DAX Package Manager, the AI assistant, and the MCP server - have no effect on it. See @policies for the full list of policies and how to deploy them. + ## 环境变量 使用以下 CLI 专用环境变量来设置路径、行为和诊断。 有关 Azure 身份验证变量(`AZURE_CLIENT_ID`、`AZURE_TENANT_ID`、`AZURE_CLIENT_CERTIFICATE_PATH` 等),见 @te-cli-auth。 | 变量 | 用途 | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `TE_CONFIG` | 替代配置文件的路径。 所有 `te config` 操作(`show`、`set`、`init`、`paths`)都会遵循该变量的设置。 | +| `TE_CONFIG` | 替代配置文件的路径。 Honored by every `te config` operation (`list`, `set`, `init`, `paths`). | | `TE_MACROS_PATH` | 覆盖宏文件路径(在解析顺序中排第二,见上文)。 由 `te macro` 命令读取。 | | `TE_BPA_RULES` | 覆盖 `te bpa run` 和 `te bpa rules` 子命令使用的 BPA 规则文件/URL 列表。 | | `TE_BPA_CONFIG` | 覆盖 deploy/save 门禁读取的 BPA 门禁配置 (`.te-bpa.json`) 的路径。 | -| `TE3_EXE_PATH` | Tabular Editor 3 桌面版二进制文件的路径。 此项 **仅** 用于 `te open`;在 Linux/macOS 上或不使用 `te open` 时,可安全留空。 会回退到 `PATH` 查找。 | | `TE_DEBUG` | 设为 `1` 可全局启用调试日志(等同于 `--debug` 或配置中的 `debug: true`)。 | | `NO_SPINNER` | 设为 `1` 或 `true` 可禁用动画进度指示器(可替代配置中的 `spinner: false`)。 | | `CI` | 自动检测。 当设为 `1` 或 `true` 时,CLI 会禁用动画进度指示器,并切换为纯文本输出。 大多数 CI 运行器都会自动设置此项。 | From 77ec09b11779e220d0624f2166f4dd7ed4d2d57a Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:21 +0200 Subject: [PATCH 19/48] New translations te-cli-limitations.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-limitations.md | 76 ++++++++++--------- 1 file changed, 40 insertions(+), 36 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-limitations.md b/localizedContent/zh/content/features/te-cli/te-cli-limitations.md index eeae28785..d4534f124 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-limitations.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-limitations.md @@ -1,8 +1,8 @@ --- uid: te-cli-limitations -title: 已知限制 +title: Behavior Differences and Known Limitations author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -13,40 +13,40 @@ applies_to: full: true --- -# 已知限制 +# Behavior Differences and Known Limitations [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -本页列出了 Tabular Editor CLI(`te`)的已知限制,帮助你提前规划并避开常见陷阱。 本页会随每次发布而更新;如果你发现此处未列出的问题,请在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository 中提交 issue。 +This page collects the places where the Tabular Editor CLI (`te`) behaves differently from Tabular Editor 2 and 3, together with the things it cannot do yet, so you can plan around both and avoid common pitfalls. 本页会随每次发布而更新;如果你发现此处未列出的问题,请在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository 中提交 issue。 > [!NOTE] -> 这些限制按领域分类。 每个条目都会说明具体限制,并在适用时提供变通方法或推荐的 CLI 友好替代方案。 +> Entries are grouped by area. Each one describes the difference or constraint and, where one exists, a workaround or the recommended CLI-friendly alternative. ## 脚本 CLI 会针对你在 Tabular Editor 2 和 3 中使用的同一个 `Model` 对象运行 C# Script(`te script`),但它是无界面的控制台宿主程序。 任何依赖 Windows Forms UI、TOM Explorer 的选择内容,或实时的 UI 端服务(宏注册表、在线 DAX Formatter、实时 VertiPaq分析器)的功能,其行为都会不同——通常表现为空、无操作,或直接报错。 -| 限制 | 说明 / 变通方法 | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **未加载 `System.Windows.Forms`** | CLI 使用的是跨平台 `TOMWrapper` 版本,其中剥离了所有与 WinForms 耦合的代码;WinForms 程序集不会被加载到 AppDomain 中。 引用 `System.Windows.Forms` 类型(`MessageBox`、`Form`、文件选择器、自定义对话框等)的脚本 将无法编译。 将所有 UI 交互重构为通过环境变量或 stdin 提供输入。 | -| **`Selected.` 返回空的可枚举对象** | 在 CLI 中,`Selected.Tables`、`Selected.Measures`、`Selected.Columns`、`Selected.Hierarchies` 等的枚举结果都为空——不会出现编译或运行时错误,只是不会返回任何项。 改用显式查找:`Model.AllMeasures.Where(...)`、`Model.Tables["Sales"].Measures`;或通过环境变量或 stdin 将对象路径传入脚本。 | -| **`Selected.` 会在运行时抛出错误** | `Selected.Table`、`Selected.Measure`、`Selected.Column`、`Selected.Hierarchy` 等都会报错,因为它们要求恰好选中一个该类型的对象,而 CLI 中的选择始终为空。 直接引用该对象,例如 `Model.Tables["Sales"]`。 | -| **`Selected.ActivePerspectives` 和 `Selected.ActiveCulture`**:分别为活动透视和活动区域设置 | 它们分别始终返回空集合和 `null`。 如果需要,就在脚本中显式设置透视或区域设置。 | -| **`Select` 对话框会抛出 `NotSupportedException`** | `SelectTable`、`SelectColumn`、`SelectMeasure`、`SelectObject`、`SelectObjects`(以及所有重载)都会返回以下错误:_"对象选择对话框… 在 CLI 脚本中不可用。 在编写脚本前,先按名称或路径预先选定对象。_ 通过环境变量、配置或查询模型,提前解析目标。 | -| **`Info` / `Warning` / `Error` / `Output` 会写入控制台** | 这些仍然可用,但会输出到 stdout/stderr,而不是打开对话框。 它们不会阻塞,也不会提供“忽略后续弹窗”的提示。 可安全用于 CI。 | -| **`ShowPrompt(...)` 始终返回 `Cancel`** | 无法进行交互式确认。 通过环境变量或配置预先确定答案。 | -| **`SuspendWaitForm` / `WaitFormVisible` 都是空操作** | “请稍候”加载指示器是 TE3 的一个 UI 元素。 `WaitFormVisible` 是一个可设置的标志位,但没有任何 Visual 效果;`SuspendWaitForm` 会被静默忽略——现有脚本仍可继续编译。 | -| **`host.Macro(...)` / `CustomAction(...)` 会抛出错误** | CLI 不会加载 `%APPDATA%/TabularEditor3/MacroActions.json`,因此在脚本内部调用宏会报错。 把宏逻辑直接写进脚本里,或直接调用该宏底层的脚本文件。 | -| **`table.GetCardinality()` / `column.GetTotalSize()` 返回 0** | CLI 主机中没有实时 VPA,因此脚本内的 VertiPaq 基数辅助函数无法使用。 如果要查看 VPA 统计信息,显式加载 VPAX 并使用 `host.Vpa.*`,或运行 [`te vertipaq`](xref:te-cli-commands#vertipaq)。 | +| 限制 | 说明 / 变通方法 | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **未加载 `System.Windows.Forms`** | CLI 使用的是跨平台 `TOMWrapper` 版本,其中剥离了所有与 WinForms 耦合的代码;WinForms 程序集不会被加载到 AppDomain 中。 引用 `System.Windows.Forms` 类型(`MessageBox`、`Form`、文件选择器、自定义对话框等)的脚本 将无法编译。 将所有 UI 交互重构为通过环境变量或 stdin 提供输入。 | +| **`Selected.` 返回空的可枚举对象** | 在 CLI 中,`Selected.Tables`、`Selected.Measures`、`Selected.Columns`、`Selected.Hierarchies` 等的枚举结果都为空——不会出现编译或运行时错误,只是不会返回任何项。 改用显式查找:`Model.AllMeasures.Where(...)`、`Model.Tables["Sales"].Measures`;或通过环境变量或 stdin 将对象路径传入脚本。 | +| **`Selected.` 会在运行时抛出错误** | `Selected.Table`、`Selected.Measure`、`Selected.Column`、`Selected.Hierarchy` 等都会报错,因为它们要求恰好选中一个该类型的对象,而 CLI 中的选择始终为空。 直接引用该对象,例如 `Model.Tables["Sales"]`。 | +| **`Selected.ActivePerspectives` 和 `Selected.ActiveCulture`**:分别为活动透视和活动区域设置 | 它们分别始终返回空集合和 `null`。 如果需要,就在脚本中显式设置透视或区域设置。 | +| **`Select` 对话框会抛出 `NotSupportedException`** | `SelectTable`、`SelectColumn`、`SelectMeasure`、`SelectObject`、`SelectObjects`(以及所有重载)都会返回以下错误:_"对象选择对话框… 在 CLI 脚本中不可用。 在编写脚本前,先按名称或路径预先选定对象。_ 通过环境变量、配置或查询模型,提前解析目标。 | +| **`Info` / `Warning` / `Error` / `Output` 会写入控制台** | 这些仍然可用,但会输出到 stdout/stderr,而不是打开对话框。 它们不会阻塞,也不会提供“忽略后续弹窗”的提示。 可安全用于 CI。 A script that calls `Error(...)` makes `te script` exit non-zero (changes are still saved with `--save`); `Warning` and `Info` do not. | +| **`ShowPrompt(...)` 始终返回 `Cancel`** | 无法进行交互式确认。 通过环境变量或配置预先确定答案。 | +| **`SuspendWaitForm` / `WaitFormVisible` 都是空操作** | “请稍候”加载指示器是 TE3 的一个 UI 元素。 `WaitFormVisible` 是一个可设置的标志位,但没有任何 Visual 效果;`SuspendWaitForm` 会被静默忽略——现有脚本仍可继续编译。 | +| **`host.Macro(...)` / `CustomAction(...)` throws an error** | CLI 不会加载 `%APPDATA%/TabularEditor3/MacroActions.json`,因此在脚本内部调用宏会报错。 Inline the macro logic, call the macro's underlying script file directly, or invoke the macro through `te macro run ` with a CLI macros file (`--macros` / `TE_MACROS_PATH` / the `macros` config key). | +| **`table.GetCardinality()` / `column.GetTotalSize()` 返回 0** | CLI 主机中没有实时 VPA,因此脚本内的 VertiPaq 基数辅助函数无法使用。 如果要查看 VPA 统计信息,显式加载 VPAX 并使用 `host.Vpa.*`,或运行 [`te vertipaq`](xref:te-cli-commands#vertipaq)。 | ## Best Practice Analyzer -| 限制 | 说明 / 变通方法 | -| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **BPA 规则源必须是 HTTPS URL 或本地文件路径** | 只接受 `https://` URL 和不带协议的本地文件路径。 系统能识别 `http://`,但会在加载时故意拒绝,并给出清晰的错误信息——BPA 规则是可执行的规则表达式,通过未经过身份验证的通道获取会有被篡改的风险。 其他 URL 方案(`file://`、`ftp://`、…) 不受支持。 这既适用于 `te bpa run --rules`,也适用于通过 [`te config set`](xref:te-cli-commands#config-list--paths--init--set) 配置的规则列表。 | -| **规则 URL 的验证在运行阶段进行,而不是在 `te config set` 时** | 像 `http://` 这样的拼写错误会被 `te config set` 接受,只有在 BPA 实际运行时才会暴露出来。 编辑已配置的规则源后,运行一次 `te bpa run`(或 `te validate`),以验证每个 URL 都能成功加载。 | -| **`--rules` 不会禁用内置规则** | 当传入 `te bpa run --rules ` 时,本次运行将使用提供的规则覆盖 [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) 和 `TE_BPA_RULES` 中的条目,但仍会同时加载内置默认规则。 若只想运行显式指定的规则文件,还需传入 `--no-defaults`。 | -| **没有可在单次调用中跳过 `bpa.rules` 配置的标志** | 配置了 `bpa.rules` 后,每次执行 `te bpa run` 都会在加载内置规则的同时加载这些规则。 目前没有可在单次运行中跳过已配置规则文件的标志。 变通方法:显式传入 `--rules `——该标志会在本次调用中完全替换 `bpa.rules` 和 `TE_BPA_RULES`。 | +| 限制 | 说明 / 变通方法 | +| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **BPA 规则源必须是 HTTPS URL 或本地文件路径** | 只接受 `https://` URL 和不带协议的本地文件路径。 系统能识别 `http://`,但会在加载时故意拒绝,并给出清晰的错误信息——BPA 规则是可执行的规则表达式,通过未经过身份验证的通道获取会有被篡改的风险。 其他 URL 方案(`file://`、`ftp://`、…) 不受支持。 这既适用于 `te bpa run --rules`,也适用于通过 [`te config set`](xref:te-cli-commands#config-list--paths--init--set) 配置的规则列表。 | +| **规则 URL 的验证在运行阶段进行,而不是在 `te config set` 时** | 像 `http://` 这样的拼写错误会被 `te config set` 接受,只有在 BPA 实际运行时才会暴露出来。 编辑已配置的规则源后,运行一次 `te bpa run`(或 `te validate`),以验证每个 URL 都能成功加载。 | +| **`--rules` 不会禁用内置规则** | 当传入 `te bpa run --rules ` 时,本次运行将使用提供的规则覆盖 [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) 和 `TE_BPA_RULES` 中的条目,但仍会同时加载内置默认规则。 若只想运行显式指定的规则文件,还需传入 `--no-defaults`。 When a supplied rule file defines the same rule ID as a built-in rule, the rule is evaluated once - the definition from the explicit `--rules` file wins for that `te bpa run` invocation (in the deploy/save gate, the built-in definition wins). | +| **没有可在单次调用中跳过 `bpa.rules` 配置的标志** | 配置了 `bpa.rules` 后,每次执行 `te bpa run` 都会在加载内置规则的同时加载这些规则。 目前没有可在单次运行中跳过已配置规则文件的标志。 变通方法:显式传入 `--rules `——该标志会在本次调用中完全替换 `bpa.rules` 和 `TE_BPA_RULES`。 | ## 验证 @@ -54,11 +54,19 @@ CLI 会针对你在 Tabular Editor 2 和 3 中使用的同一个 `Model` 对象 | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | **`te validate` 无法自动修复 Code Action 违规项** | `te validate` 会生成 Report 来指出 Code Action 违规项,但不提供用于应用建议修复的 CLI 参数。 在 Tabular Editor 3 中应用修复;或者对与 BPA 规则重叠的那部分 Code Action,使用 `te bpa run --fix`。 | -## 模型 I/O +## Model initialization and save -| 限制 | 说明 / 变通方法 | -| ------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`--serialization` 不能将序列化格式与 PBIP 容器组合使用** | 在 [`te save`](xref:te-cli-commands#save) 中,`--serialization` 选项会将 `bim`、`tmdl`、`Database.json` 和 `pbip` 视为互斥,因此目前无法将采用 TMSL 序列化(`.bim`)的模型打包生成 PBIP 容器。 将 TMDL 保存到 PBIP 中,或将 `.bim` 保存在 PBIP 容器之外。 | +| 限制 | 说明 / 变通方法 | +| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`--serialization` 不能将序列化格式与 PBIP 容器组合使用** | The `--serialization` option on [`te save-as`](xref:te-cli-commands#save-as) treats `bim`, `tmdl`, `database.json`, and `pbip` as mutually exclusive, so you cannot produce a full PBIP container around a TMSL-serialized (`.bim`) model. To wrap a `tmdl` or `bim` output in a `{modelName}.SemanticModel/` folder with `.platform` and `definition.pbism` files, pass `--supporting-files`; for a complete PBIP (including the report artifact), use `--serialization pbip`. | + +## 模型编辑 + +| 限制 | 说明 / 变通方法 | +| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Calculated sets cannot be created, removed, or moved from the CLI** | Sets are addressable for inspection (`te list Sets`, `te get "Sales/Sets/"`), but `te add`, `te remove`, and `te move` do not support set objects. Use `te script` for set mutations. | +| **No whole-model Power Query formatting sweep** | `te set --format ` formats named expression properties on one object and `te util format-m` formats a single loose expression, but there is no command to format every M expression in a model in one pass. (Whole-model DAX formatting is available via `te script --inline "Model.AllMeasures.FormatDax();" --save`.) | +| **Schema sync treats renamed source columns as removed + added** | `te set
--update-schema` cannot detect a rename; a renamed source column shows up as one removed and one new column. Remap manually with `te set
/ -p SourceColumn=` before syncing. `--update-schema` is refused on calculated tables and calculation groups. | ## 身份验证 @@ -68,15 +76,11 @@ CLI 会针对你在 Tabular Editor 2 和 3 中使用的同一个 `Model` 对象 ## 命令行输入 -| 限制 | 说明 / 变通方法 | -| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **包含空格的 DAX 对象路径必须用 shell 引号括起来** | 当表名或列名包含空格时,必须在终端中用 shell 引号将整个 DAX 对象引用括起来:`te get "'My Table'[My Column]"`。 如果没有外层引号,shell 会将该路径拆分为多个参数,导致解析失败。 在 [`te interactive`](xref:te-cli-interactive) 中不需要 shell 引号,因为 REPL 会在 shell 将输入拆分为参数之前接收原始输入。 | - -## TE2 功能对等性 - -| 限制 | 说明 / 变通方法 | -| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | -| **`te schemacheck` 目前尚未实现** | TE2 的 `-SC` / `-SCHEMACHECK` 标志目前在 `te` 中还没有对应项;针对源数据源的架构漂移检测计划在未来版本中推出。 有关完整的 TE2 到 `te` 的标志映射表,请参见 @te-cli-migrate。 | +| 限制 | 说明 / 变通方法 | +| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **包含空格的 DAX 对象路径必须用 shell 引号括起来** | 当表名或列名包含空格时,必须在终端中用 shell 引号将整个 DAX 对象引用括起来:`te get "'My Table'[My Column]"`。 如果没有外层引号,shell 会将该路径拆分为多个参数,导致解析失败。 在 [`te interactive`](xref:te-cli-interactive) 中不需要 shell 引号,因为 REPL 会在 shell 将输入拆分为参数之前接收原始输入。 | +| **Object names containing reserved path characters must be quoted** | `/ [ ] ' " * ? { }` are reserved in object and filter paths. A name containing one must be quoted with the segment quoting rules, e.g. `te get "Tables/'{foo}'"` or `te get 'Sales/"my*name"'`. `?` is reserved but has no wildcard meaning. The Windows `cmd.exe` shell cannot express the mixed-quote forms - use PowerShell or a POSIX shell for such names (or `te interactive`, which takes the raw line). | +| **`-` (read from stdin) is not available inside `te interactive`** | The shell rejects it with _'-' (stdin) is not available inside the interactive shell._ Pass the value inline, or run the command from your OS shell where piping works. | ## Report 缺失的限制 From f27b74c9e7f2a1606c44004461691192d5269e5d Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:24 +0200 Subject: [PATCH 20/48] New translations te-cli-skill.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-skill.md | 60 +++++++++---------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-skill.md b/localizedContent/zh/content/features/te-cli/te-cli-skill.md index 7ba6fbe9b..012fbdc3e 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-skill.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-skill.md @@ -2,7 +2,7 @@ uid: te-cli-skill title: AI 智能体技能 author: Morten Lønskov -updated: 2026-06-04 +updated: 2026-09-04 applies_to: products: - product: Tabular Editor 2 @@ -17,39 +17,38 @@ applies_to: [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -Tabular Editor CLI 自带一个开箱即用的**智能体技能**,让 AI 编码智能体学会如何驱动 `te` 命令行界面。 它是一个独立的 Markdown 文件,[`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli),其中包含 CLI 的惯例、命令参考、工作流程以及常见的坑点。 安装后,如果你说“部署这个模型”或“添加一个计算利润率的度量值”,智能体会给出符合 `te` 用法的命令,而不是靠猜测或臆造选项。 +Tabular Editor CLI 自带一个开箱即用的**智能体技能**,让 AI 编码智能体学会如何驱动 `te` 命令行界面。 It's a skill folder - a [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) entry point plus a `references/` set of on-demand deep-dive files - packed with the CLI's conventions, command reference, workflows, and gotchas. 安装后,如果你说“部署这个模型”或“添加一个计算利润率的度量值”,智能体会给出符合 `te` 用法的命令,而不是靠猜测或臆造选项。 该技能在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) repository 中维护,并会随着 CLI 预览功能的演进同步更新。 ## 什么是技能 -技能是 AI 智能体根据你的提示按需加载的 Markdown 文件。 它的 YAML frontmatter(`name`、`description`、`version`)会告诉智能体**何时**加载它,以及它涵盖**哪些**内容。 Markdown 正文则教会智能体**如何**完成这项工作。 +A skill is a folder with a `SKILL.md` entry point that the agent loads on demand, based on your prompt. 它的 YAML frontmatter(`name`、`description`、`version`)会告诉智能体**何时**加载它,以及它涵盖**哪些**内容。 The Markdown body teaches the agent **how** to do the job, and larger skills - like this one - bundle extra reference files under `references/` that the agent reads only when needed. ## 技能涵盖的内容 该技能会向智能体讲解 `te` 的完整功能: -- 所有系列的 `te` 命令——涵盖 load、save、init、deploy、refresh、bpa、validate、query、script、format 等 +- every `te` command across all families - save-as, init, deploy, refresh, bpa, validate, query, script, util, and more - 身份验证模式——交互式、使用机密或证书的服务主体、环境变量、托管标识 - 对象路径语法——斜杠形式、DAX 形式和通配符 -- 暂存模型——`--save`、`--stage` 和 `--revert` 的行为 +- the save model - dry run by default, `--save` to persist, and the interactive shell's `--stage`/`--revert` - TE2 到 CLI 的迁移映射 - 适用于 GitHub Actions 和 Azure DevOps 的 CI/CD 实践方案 - 输出格式、退出代码、环境变量和配置键 -- 常用 `-q` 属性速查表 +- a cheatsheet of common property names for `-p Name=Value` - 实践中容易让智能体出错的常见坑点 这些内容与本节其余部分面向人类读者的说明是同一套内容。 命令参考请参见 @te-cli-commands,身份验证请参见 @te-cli-auth,流水线模式请参见 @te-cli-cicd。 -## 下载技能文件 +## Download the skill -这个技能只有一个文件:[`SKILL.md`](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/SKILL.md)。 +The skill lives in the [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder of the CLI repository - `SKILL.md` plus its `references/` subfolder. -1. 在 GitHub 上打开 [`SKILL.md`](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/SKILL.md)。 -2. 点击**下载原始文件**(位于文件查看器右上角)。 -3. 将文件保存到一个方便的位置。 +1. Clone the [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository, or download the repository ZIP (**Code > Download ZIP**) and extract it. +2. Copy the whole `skills/te-cli/` folder somewhere convenient, keeping the `references/` subfolder next to `SKILL.md`. -在下面的安装步骤中,你需要将此文件移动到工具专用的位置。 在下载较新版本之前,如果你想先看看版本之间有哪些变更,可以查看 [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md)。 +You'll move this folder to a tool-specific location in the install steps below. 在下载较新版本之前,如果你想先看看版本之间有哪些变更,可以查看 [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md)。 ## 选择安装范围 @@ -65,16 +64,16 @@ Claude Code 会从 `.claude/skills/` 下的命名文件夹中加载技能。 `de **项目范围** - 技能只会在这个项目中加载: 1. 在项目根目录中,创建文件夹 `.claude/skills/te-cli/`。 -2. 将下载的 `SKILL.md` 放入该文件夹中。 +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. -最终路径为 `/.claude/skills/te-cli/SKILL.md`。 +The final path is `/.claude/skills/te-cli/SKILL.md`, with `references/` alongside it. **用户范围** - 技能会在当前用户的所有项目中加载: 1. 在你的用户级 Claude 技能目录中创建 `te-cli` 文件夹: - **macOS / Linux:** `~/.claude/skills/te-cli/` - **Windows:** `%USERPROFILE%\\.claude\\skills\\te-cli\\`(通常为 `C:\\Users\\\\.claude\\skills\\te-cli\\`) -2. 将下载的 `SKILL.md` 放入该文件夹中。 +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. > [!NOTE] > Claude Code 会监视技能目录,并在当前会话中识别新增或已编辑的技能,无需重启。 例外情况是:如果 `.claude/skills/` 目录在会话开始时并不存在,而你后来才创建它,则需要重启一次 Claude Code,让它开始监视这个新目录。 @@ -92,17 +91,17 @@ Claude Code 会从 `.claude/skills/` 下的命名文件夹中加载技能。 `de 要进行功能性冒烟测试,可以这样提问: ``` -what does `te deploy --xmla` do? +what does `te deploy` do without `--execute`? ``` -Claude 会按文档所述的行为作答——它会将 TMSL/XMLA 脚本输出到 stdout,而不是直接部署——这就表明该技能已加载并在使用中。 +Claude answers with the documented behavior - it's a dry run that prints the TMSL deployment script to stdout without deploying anything - which confirms the skill is loaded and in use. ## 在 Claude.ai 和 Claude Desktop 中安装 Claude.ai(网页和桌面版)内置了 **Skills** 功能。 Skills 需要启用代码执行,并且上传时应使用技能文件夹打包成的 ZIP,而不是单独的 `SKILL.md` 文件。 1. 启用代码执行:前往 **Settings > Capabilities**,并开启 **Code execution and file creation**。 在 Team 和 Enterprise 计划中,所有者需要在组织设置里启用这个功能。 -2. 将下载的 `SKILL.md` 放入名为 `te-cli` 的文件夹中,然后将该文件夹压缩为 `te-cli.zip`。 +2. Compress the whole downloaded `te-cli` folder (including `references/`) into `te-cli.zip`. 3. 前往 **Settings > Capabilities > Skills**(也可通过 **Customize > Skills** 进入)。 4. 点击 **+**,选择 **Upload skill**,然后选中 `te-cli.zip`。 Claude 会读取里面的 `SKILL.md`,并显示这个技能的摘要。 5. 开启这个技能。 当你提到 `te` 或相关概念时,它会自动加载。 @@ -113,11 +112,11 @@ Claude.ai(网页和桌面版)内置了 **Skills** 功能。 Skills 需要启 ## 在 GitHub Copilot 中安装 -VS Code 中的 GitHub Copilot 原生支持 Agent Skills 开放标准——也就是 Claude Code 和 Codex 使用的同一种 `SKILL.md` 格式。 这是推荐的方式,因为技能只会在相关时加载。 如果你的 Copilot 配置早于 Agent Skills 推出,请改用下方这个始终启用的自定义说明文件。 +VS Code 中的 GitHub Copilot 原生支持 Agent Skills 开放标准——也就是 Claude Code 和 Codex 使用的同一种 `SKILL.md` 格式。 这是推荐的方式,因为技能只会在相关时加载。 For Copilot setups that predate Agent Skills, fall back to the generic `AGENTS.md` install below. ### Agent Skills(VS Code) -把技能放到 skills 目录下一个单独命名的文件夹里。 文件夹名称必须与 frontmatter 中的 `name` 字段一致,因此请使用 `te-cli`,并保持 YAML frontmatter 完整不变。 +Place the skill folder contents (`SKILL.md` and `references/`) in a named folder under a skills directory. 文件夹名称必须与 frontmatter 中的 `name` 字段一致,因此请使用 `te-cli`,并保持 YAML frontmatter 完整不变。 - **Workspace 作用域:** `.github/skills/te-cli/SKILL.md`(Copilot 也会读取 `.claude/skills/` 和 `.agents/skills/`)。 - **用户范围:** `~/.copilot/skills/te-cli/SKILL.md`(Copilot 也会读取 `~/.claude/skills/` 和 `~/.agents/skills/`)。 @@ -131,14 +130,14 @@ Codex CLI 会直接从 `.agents/skills/` 下的命名文件夹中加载技能, **项目范围**——该技能只会在这个项目中加载: 1. 在项目根目录中创建文件夹 `.agents/skills/te-cli/`。 -2. 将下载的 `SKILL.md` 放入该文件夹中。 +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. Codex 会从你的工作目录向上扫描,因此提交在 repository 根目录(`$REPO_ROOT/.agents/skills/te-cli/`)的技能,会在该 repository 中的所有协作者之间共享。 **个人范围**——该技能会在你的每个项目中加载: 1. 在你的个人 Codex 技能目录中创建 `te-cli` 文件夹:`~/.agents/skills/te-cli/`。 -2. 将下载的 `SKILL.md` 放入该文件夹中。 +2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. 在 Codex CLI 或 IDE 中运行 `/skills`,确认列表中有 `te-cli`,并输入 `te-cli` 以显式指定该技能。 @@ -146,20 +145,21 @@ Codex 会从你的工作目录向上扫描,因此提交在 repository 根目 对于遵循 [`AGENTS.md` convention](https://agents.md) 或支持使用任意说明文件的工具——Aider、Continue、自定义内部 Agent: -1. 下载 `SKILL.md`。 -2. 删除顶部的 YAML frontmatter 块(也就是第一处和第二处 `---` 之间的所有内容,包括这两行本身)。 -3. 将文件重命名为 `AGENTS.md`,并放到项目根目录,或该工具预期的说明文件位置。 -4. 这个项目中下一次运行 Agent 时,就会读取这些说明。 +1. Download the skill folder. +2. In a copy of `SKILL.md`, remove the YAML frontmatter block at the top (everything between the first and second `---` lines, including those lines). +3. Rename that file to `AGENTS.md` and place it at your project root, or wherever the tool expects its instructions file. +4. Copy the `references/` folder next to your `AGENTS.md` so its relative links keep working. +5. 这个项目中下一次运行 Agent 时,就会读取这些说明。 ## 更新技能 要获取更新版本: -1. 在 GitHub 上打开 [`SKILL.md`](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/SKILL.md),然后使用 **Download raw file** 下载最新副本。 -2. 替换你之前安装的文件: - - **原生技能(Claude Code、Codex、Copilot Agent Skills):** 覆盖技能文件夹中的 `SKILL.md`。 +1. Grab the latest [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder from GitHub (re-clone, pull, or re-download the repository ZIP). +2. Replace what you previously installed: + - **Native skills (Claude Code, Codex, Copilot Agent Skills):** replace the whole skill folder contents (`SKILL.md` and `references/`). - **Claude.ai / Desktop:** 重新将 `te-cli` 文件夹打包成 ZIP 文件,再通过 Skills UI 重新上传。 - - \*\*通过说明文件安装(Copilot 自定义指令、AGENTS.md):\*\*请将正文重新粘贴到 `.github/copilot-instructions.md` 或 `AGENTS.md`。 + - **Instruction-file installs (AGENTS.md):** re-paste the body into `AGENTS.md` and refresh the copied `references/` folder. 查看 [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md) 了解各版本之间的变更。 From 8cbebd8584c9e2dd95445ac0f5e679b8c5e26239 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:27 +0200 Subject: [PATCH 21/48] New translations te-cli-preview-notice.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/includes/te-cli-preview-notice.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localizedContent/zh/content/features/te-cli/includes/te-cli-preview-notice.md b/localizedContent/zh/content/features/te-cli/includes/te-cli-preview-notice.md index df39c7c39..ff888c36c 100644 --- a/localizedContent/zh/content/features/te-cli/includes/te-cli-preview-notice.md +++ b/localizedContent/zh/content/features/te-cli/includes/te-cli-preview-notice.md @@ -1,2 +1,2 @@ > [!IMPORTANT] -> Tabular Editor CLI 目前为 **有限公开预览版**。 可使用 Tabular Editor 账户进行评估;预览期间无需许可证。 在正式发布之前,命令、标志位和输出都可能会发生变化。 **该预览版本将在 2026-09-30 后停止运行。** 我们不建议在预览期间将该 CLI 用于生产环境的 CI/CD 流水线。 +> Tabular Editor CLI 目前为 **有限公开预览版**。 可使用 Tabular Editor 账户进行评估;预览期间无需许可证。 在正式发布之前,命令、标志位和输出都可能会发生变化。 **预览版本将在 2026-10-31 之后停止工作。** 在预览阶段,我们不建议在生产环境的 CI/CD 流水线中使用 CLI。 From c82986cd9aece6765b3ab7f3578bad3df5b50f16 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:29 +0200 Subject: [PATCH 22/48] New translations te-cli-auth.md (Chinese Simplified) [ci skip] --- .../zh/content/features/te-cli/te-cli-auth.md | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-auth.md b/localizedContent/zh/content/features/te-cli/te-cli-auth.md index 10b24d2b8..e94b21209 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-auth.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-auth.md @@ -2,7 +2,7 @@ uid: te-cli-auth title: 身份验证与连接 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -37,6 +37,9 @@ Tabular Editor CLI 使用与 Tabular Editor 3 相同的 Power BI Desktop 客户 对于无界面、SSH、WSL 或 devcontainer 场景,可使用服务主体:`te auth login -u -p -t `(或 `--certificate`)。 登录会被缓存,因此后续命令可通过 `--auth auto` 静默获取令牌。 +> [!NOTE] +> `te add -t Table` 和 `te set --update-schema` 中用于架构检测的标志(`--source sql`、`--endpoint`)在连接 Azure 系列 SQL 端点(`*.database.windows.net`、`*.datawarehouse.fabric.microsoft.com`、`*.sql.azuresynapse.net`)时会使用 Entra ID 登录,并遵循 `--auth` 设置。 本地部署服务器使用 Windows 集成身份验证;`--connection-string` 会按原样生效。 + ## `te auth login` 进行身份验证并缓存结果,供后续命令使用: @@ -108,11 +111,12 @@ te connect my-workspace my-model # Local TMDL folder, .bim file, or .SemanticModel container te connect ./my-model -# Connect to a running Power BI Desktop instance (Windows only) +# Connect to a locally running Analysis Services instance +# (Power BI Desktop, Visual Studio workspace, standalone SSAS - Windows only) te connect --local -# Filter by report name when multiple Power BI Desktop instances are running -te connect --local my-report +# Match an instance (e.g. an open report's window title) or a database name +te connect --local my-model # Show the active connection te connect @@ -121,7 +125,9 @@ te connect te connect --clear ``` -活动连接状态按终端会话分别保存:打开新的终端会话后将重新开始。 通过 [`te session`](xref:te-cli-commands#session) 查看或清理会话状态。 +找到多个本地实例或数据库时,CLI 会分两步提示(先选实例,再选数据库);使用 `--non-interactive` 时,命令会直接失败并列出候选项,而不会静默选择其一。 + +活动连接状态按终端会话分别保存:打开新的终端会话后将重新开始。 通过 [`te session`](xref:te-cli-commands#session) 查看或清理会话状态。 对于 `te deploy`,如果模型源位于本地,当前活动连接也会用作默认的 `--target-server`/`--target-database`。 ### 工作区模式(Workspace,`-w` / `--workspace`) @@ -171,7 +177,7 @@ te profile show prod te connect --profile prod # One-shot use without changing the active connection -te deploy ./model --profile staging --force +te deploy --model ./model --profile staging --execute --force ``` 配置文件还可以包含行为覆盖项,并在配置文件激活时生效: @@ -193,6 +199,8 @@ te profile set prod --auto-format true - `--non-interactive` 全局标志(不会提示,而是立即失败)。 - 以下任一非交互式身份验证方法:`env`、`managed-identity`,或显式提供的服务主体凭据。 +在使用 `--non-interactive` 且没有任何可用于登录的方式——没有缓存的登录信息、没有 `AZURE_CLIENT_*` 变量、也没有托管身份——时,任何连接到 Workspace 或服务器的命令都会立即停止,不会打开浏览器,并报告没有可用凭据,同时列出提供凭据的所有方式:`te auth login`、通过 `te auth login -u -p -t ` 缓存的服务主体、`--auth env` 或 `--auth managed-identity`。 缓存的服务主体会被静默使用,因此只有在确实没有任何可用于登录的方式时,才会以这种方式失败。 + 适用于管道的基于环境变量的示例: ```bash @@ -200,9 +208,11 @@ export AZURE_CLIENT_ID="your-app-id" export AZURE_CLIENT_SECRET="your-client-secret" export AZURE_TENANT_ID="your-tenant-id" -te deploy ./model -s my-workspace -d my-model \ +te deploy --model ./model \ + --target-server my-workspace --target-database my-model \ --auth env \ --non-interactive \ + --execute \ --force \ --ci github ``` From 2ad6a70592001eaec630b9bb2262df1e05b50870 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:32 +0200 Subject: [PATCH 23/48] New translations te-cli-automation.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-automation.md | 69 +++++++++++-------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-automation.md b/localizedContent/zh/content/features/te-cli/te-cli-automation.md index da2d6ea5f..129d00cf2 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-automation.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-automation.md @@ -2,7 +2,7 @@ uid: te-cli-automation title: 自动化和脚本 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -23,13 +23,13 @@ Tabular Editor CLI 具备可组合性;每个命令都支持结构化输出, 使用 `--output-format` 可将任意命令在文本(供人阅读)和机器可读格式之间切换: -| 格式 | 用途 | 说明 | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------- | -| `text`(默认) | 人工阅读 | 无论是连接到 TTY 还是通过管道传输,stdout 都输出纯文本。 | -| `json` | 机器可读 | 始终向 stdout 输出有效的 JSON。 如果还需要在 stderr 上输出机器可读的错误信息,请使用 `--error-format json`。 | -| `csv` | 表格结果(`query`、`bpa run`、`bpa rules`、`vertipaq`、`validate`、`test`、`refresh`、`profile list`、`session list`、`find`、`replace`、`get`、`ls`) | 采用 RFC 4180 转义。 | -| `tmsl`(别名 `bim`) | 整个对象的 TMSL/BIM 序列化 | 此格式被 `te get` 和 `te list` 支持。 | -| `tmdl` | 整个对象的 TMDL 序列化 | 仅 `te get` 支持(单个对象)。 | +| 格式 | 用途 | 说明 | +| ---------------- | -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `text`(默认) | 人工阅读 | 无论是连接到 TTY 还是通过管道传输,stdout 都输出纯文本。 | +| `json` | 机器可读 | 始终向 stdout 输出有效的 JSON。 如果还需要在 stderr 上输出机器可读的错误信息,请使用 `--error-format json`。 | +| `csv` | 表格结果(`query`、`bpa run`、`bpa rules`、`vertipaq`、`validate`、`test`、`refresh`、`profile list`、`session list`、`find`、`get`、`ls`) | 采用 RFC 4180 转义。 | +| `tmsl`(别名 `bim`) | 整个对象的 TMSL/BIM 序列化 | 此格式被 `te get` 和 `te list` 支持。 | +| `tmdl` | 整个对象的 TMDL 序列化 | 仅 `te get` 支持(单个对象)。 | ```bash te list --output-format json @@ -37,6 +37,8 @@ te query -q "EVALUATE VALUES('Date'[Year])" --output-format csv te bpa run --output-format json ``` +在 `--output-format json` 下,`te validate`、`te bpa run`、`te test run` 和 `te query` 共用同一种 JSON 文档结构,包含 `summary`、扁平的 `findings[]` 数组和 `durationMs`——解析时请参见 @te-cli-findings 中的结构定义。 + > [!NOTE] > `--output-format` 和 `--error-format` 相互独立。 设置 `--output-format json` _不会_ 将 stderr 切换为 JSON;若要这样做,请传入 `--error-format json`。 重定向 stdout 时不会自动切换格式;除非你另行指定,否则默认始终为 `text`。 @@ -44,25 +46,28 @@ te bpa run --output-format json 为任意命令添加 `--non-interactive`,以禁用确认提示、凭据选择列表和引导式向导。 如果命令需要的输入无法通过参数、环境变量或配置确定,它会以非零状态退出,并返回可操作的错误信息,而不是一直挂起。 +`te deploy` 和 `te refresh` 默认也会以 dry-run 方式运行——它们会打印将要发送的 TMSL,且不会改动任何内容。 `--execute` 会执行实际操作;在管道或 CI 运行中,`--execute` 还要求使用 `--force`(因为无法响应确认提示)。 + ```bash -te deploy ./model --non-interactive --force --ci github +te deploy --model ./model --target-server my-workspace --target-database my-model \ + --non-interactive --execute --force --ci github ``` ## 退出代码 每个 `te` 命令都会使用可预测的状态代码退出,因此调用方无需解析 stdout,就能根据成功或失败执行分支逻辑。 -| 退出代码 | 含义 | -| ---- | ----------------------------------------------------------------------------------------------- | -| `0` | 成功。 | -| `1` | 通用失败:参数无效、命令失败、验证错误、身份验证失败,或 BPA 检查在严重级别 >= error 时未通过。 针对 `te diff`:发现差异(遵循 `diff`/`cmp` 的惯例)。 | -| `2` | 仅适用于 `te diff`:比较过程中出错,因此差异状态未知。 | +| 退出代码 | 含义 | +| ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `0` | 成功。 | +| `1` | 通用失败——参数无效、命令失败、验证错误、身份验证失败、BPA 质量门在严重性 >= error 时未通过、某次 `te script` 运行中脚本调用了 `Error(...)`,或某次 `te deploy` 已被服务器接受但包含对象错误。 针对 `te diff`:发现差异(遵循 `diff`/`cmp` 的惯例)。 | +| `2` | 仅适用于 `te diff`:比较过程中出错,因此差异状态未知。 | 将退出代码与 `--ci ` 注释以及 `--trx ` 结合使用,可在 CI 中展示更丰富的失败信息——请参阅 @te-cli-cicd。 ## 在 stderr 上的错误 -错误、警告和预览横幅会写入 **stderr**;结构化数据会写入 **stdout**。 这意味着你可以安全地通过管道传递 JSON,而不用担心其中混入进度指示或诊断信息: +错误、警告、进度和状态提示(旋转指示器、`Using active connection:`)、参数错误后的用法提示以及预览横幅都会写入 **stderr**;stdout 只输出结果。 因此,被拒绝的命令会使 stdout 为空,所以捕获到的 dry-run 要么是有效输出,要么什么都没有;你也可以安全地通过管道传递 JSON,而不会被进度指示器或诊断信息污染: ```bash te list --output-format json | jq '.[] | .name' @@ -89,7 +94,7 @@ def query(server: str, database: str, dax: str) -> list[dict]: capture_output=True, text=True, ) - return json.loads(result.stdout) + return json.loads(result.stdout)["rows"] rows = query("Finance", "Revenue Model", "EVALUATE TOPN(10, 'Sales')") for row in rows: @@ -103,9 +108,10 @@ import json import subprocess result = subprocess.run( - ["te", "deploy", "./model", - "-s", "Finance", "-d", "Revenue", - "--output-format", "json", "--non-interactive", "--force"], + ["te", "deploy", "--model", "./model", + "--target-server", "Finance", "--target-database", "Revenue", + "--output-format", "json", "--error-format", "json", + "--non-interactive", "--execute", "--force"], capture_output=True, text=True, ) @@ -122,10 +128,10 @@ if result.returncode != 0: PowerShell 原生支持 JSON。 `te` 是一个普通的控制台可执行文件,可直接在 PowerShell 管道中使用(如果你正从较旧的 `TabularEditor.exe` CLI 迁移,请参阅 @te-cli-migrate): ```powershell -$rows = te query -s Finance -d Revenue -q "EVALUATE TOPN(10, 'Sales')" --output-format json --non-interactive +$result = te query -s Finance -d Revenue -q "EVALUATE TOPN(10, 'Sales')" --output-format json --non-interactive | ConvertFrom-Json -$rows | Format-Table +$result.rows | Format-Table # Check exit code after the pipeline if ($LASTEXITCODE -ne 0) { @@ -141,9 +147,9 @@ $env:AZURE_CLIENT_ID = "your-app-id" $env:AZURE_CLIENT_SECRET = "your-client-secret" $env:AZURE_TENANT_ID = "your-tenant-id" -te deploy ./model ` - -s my-workspace -d my-model ` - --auth env --non-interactive --force --ci vsts +te deploy --model ./model ` + --target-server my-workspace --target-database my-model ` + --auth env --non-interactive --execute --force --ci vsts ``` ## Bash @@ -169,22 +175,25 @@ te bpa run --fail-on error --output-format json > bpa.json \ ```bash te connect MyWorkspace MyModel -te refresh --type full --dry-run > refresh.tmsl +te refresh --type full > refresh.tmsl cat refresh.tmsl ``` -生成的 TMSL 可在 Pull Request 中审查、提交到版本库、由 CLI 执行(`te refresh --type full`)、交给 DBA,或用任何兼容 XMLA 的工具应用。 CLI 不再是黑盒,而是可组合的组件。 +生成的 TMSL 可在 Pull Request 中审查、提交到版本库、由 CLI 执行(`te refresh --type full --execute`)、交给 DBA,或用任何兼容 XMLA 的工具应用。 CLI 不再是黑盒,而是可组合的组件。 ## 常用模式 下面这些小技巧,是在脚本或管道中组合 `te` 命令时经常会用到的: -- **幂等的创建与删除。** `te add Sales/Marker -t Measure -i "0" --if-not-exists --save` 和 `te remove Sales/OldMeasure --if-exists --save` 无论对象是否存在,都会以 `0` 退出——可在 CI 中安全地重复运行。 -- **试运行查看差异。** `te replace` 默认会先试运行;只有在你对预览结果满意时才添加 `--save`。 -- **输出供审查的 TMSL。** `te deploy ./model --xmla deploy.tmsl` 会生成部署脚本,而不会更改服务器——适合 DBA 审查或手动应用。 +- **幂等的创建与删除。** `te add Sales/Marker -t Measure -p Expression="0" --if-not-exists --save` 用于创建度量值,`te remove Sales/OldMeasure --if-exists --save` 用于删除度量值;无论对象是否存在,两者都会以 `0` 退出——可在 CI 中安全地重复运行。 +- **没有 `--save` 就不会持久化任何更改。** 会修改内容的命令(`te add`、`te set`、`te move`、`te remove`、`te script`、`te macro run`)会在内存中应用更改,输出 Report 说明它们执行了哪些操作,然后打印 `Dry run - nothing saved.`。 添加 --save 以持久化保存。`先不带`--save`运行一次,确认它解析到的是你期望的对象,然后再加上`--save`重新运行。`te remove --dry-run\` 还会更进一步:在不实际应用任何更改的情况下,输出 Report 说明将会删除哪些内容。 +- **输出供审查的 TMSL。** `te deploy --model ./model --target-server my-workspace --target-database my-model > deploy.tmsl`——`deploy` 默认以 dry-run 方式运行,并将精确、已针对目标环境生成的 TMSL 打印到 stdout,因此将其重定向即可生成部署脚本,而不会触及服务器。 适合供 DBA 审查或手动应用。 +- **通过 `-` 传入管道值。** 所有接受值的选项都可以通过 `-` 读取管道传入的 stdin(会移除末尾换行、剥离字节顺序标记;如果没有管道输入则立即报错):`cat query.dax | te query -q -`(直接通过管道传入 stdin 而不加 `-q` 也可用)、`te set Sales/Amount -p Expression=- < expr.dax --save`、`cat fix.csx | te script --inline - --save`、`cat messy.dax | te util format-dax -`。 管道传入的值会按原样处理——如果管道传入文本 `null`,存储的就是单词 `null`;而 `-p Name=null` 或 `--unset Name` 则会清除该属性。 +- **查找属性名。** `te get --properties --output-format json` 会返回该对象上 `-p` 可接受的每个名称及其类型、是否可写和允许值——在生成 `te set` 调用前,应先查阅这份列表。 +- **可解析的变更集。** 变更类命令(`set`、`add`、`remove`、`move`、`script`、`bpa run --fix`)默认会输出 diff;`--stat` 和 `--name-only` 提供更紧凑的文本替代形式,而 `te config set mutationOutput diff|stat|name-only|none` 可设置固定默认值。 无论是否使用这些标志,JSON 输出始终都会包含完整的 `changes` 数组(每个已更改对象一项,带有 `objectPath`、`objectType`、`changeKind` 以及属性变更前/后的配对值)——这是脚本中可稳定解析的结构。 `te diff` 也会以同样的结构输出 Report 来呈现差异。 - **仅输出路径。** `te list --paths-only` 和 `te find --paths-only` 每行输出一个对象路径,非常适合通过管道传给 `xargs`、`te get` 或 `te set`。 模型级容器(`te list Measures`、`te list Columns`)与此配合良好,可用于对整个模型进行全面扫描。 - **查询基准测试。** `te query --trace --cold --runs 5` 会在冷缓存下运行 DAX 查询,迭代五次,并捕获 FE/SE 跟踪事件。 -- **CI 日志中的步骤耗时。** 长时间运行的命令(`te deploy`、`te refresh`、`te script`、`te validate`)会在 JSON 输出中包含 `durationMs` 字段——便于在管道摘要中展示各步骤耗时。 +- **CI 日志中的步骤耗时。** 长时间运行的命令(`te deploy`、`te refresh`、`te script`、`te validate`、`te query`)会在 JSON 输出中包含 `durationMs` 字段——便于在管道摘要中展示各步骤耗时。 ## 相关页面 From 41609c23580868fa39e45ad52cabe3c4c41b75bf Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:36 +0200 Subject: [PATCH 24/48] New translations te-cli-cicd.md (Chinese Simplified) [ci skip] --- .../zh/content/features/te-cli/te-cli-cicd.md | 70 +++++++++++-------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-cicd.md b/localizedContent/zh/content/features/te-cli/te-cli-cicd.md index 4152c73b6..d1e2b49a1 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-cicd.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-cicd.md @@ -2,7 +2,7 @@ uid: te-cli-cicd title: CI/CD 集成 author: Peer Grønnerup -updated: 2026-05-06 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -22,7 +22,7 @@ Tabular Editor CLI 专为在持续集成和持续交付管道中进行无人值 > [!WARNING] > **在有限公开预览期间,不要在生产管道中使用 CLI。** 管道所有者需要注意以下两项预览版特有风险: > -> - **硬性到期。** 预览版二进制文件会在 **2026-09-30** 停止运行——任何依赖它的管道都会在当天失败,无论你的发布日程如何安排。 +> - **硬性到期。** 预览版二进制文件将于 **2026-10-31** 失效——任何依赖它的管道都会在当天失败,无论你的发布日程如何安排。 > - **不保证向后兼容。** 命令、选项、输出结构和退出代码可能会在不同预览版本之间变更,因此当你更新随仓库一并提交的二进制文件时,可能需要同步调整管道步骤。 > > 在非生产管道中构建和评估,并在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository 中分享反馈,以便 GA 版本更符合你的需求。 @@ -31,10 +31,12 @@ Tabular Editor CLI 专为在持续集成和持续交付管道中进行无人值 - **单个自包含二进制文件。** 无需安装运行时,不需要 `TabularEditor.exe`,也不需要 `start /wait`。 - **`--non-interactive` 全局标志。** 禁用所有提示;出现错误时会快速失败,并给出可操作的错误信息。 -- 在会更改状态的命令(`te deploy`、`te refresh`)上使用 **`--force`** 可跳过确认提示。 -- **`--ci vsts` / `--ci github`。** 将原生管道注解输出到 stderr。 +- **默认试运行。** `te deploy` 和 `te refresh` 会打印它们将发送的完整 TMSL;添加 `--execute` 才会真正执行。 两者都会在终端中要求确认,因此在无法响应提示的 CI 环境中,必须使用 `--execute --force`。 +- **失败就是失败。** 当服务器接受元数据但将含错误的对象搁置时,`te deploy` 会以非零退出码退出;当脚本 Report 报告错误时,`te script` 也会以非零退出码退出——基于退出码的关卡不可能让一次失败的运行通过。 +- **`--ci vsts` / `--ci github`。** 向 stderr 输出原生管道注释,并携带发现项的代码(在 Azure DevOps 中为 `code=`,在 GitHub 中为 `title=`)。 `azdo` / `azure-devops` 和 `gh` 是可接受的别名,`none` 表示不输出注释,而拼写错误的值会在命令运行前被拒绝,而不是悄无声息地什么都不输出。 - **`--trx `。** 生成可供 Azure DevOps 测试发布使用的 VSTEST 结果。 -- **结构化错误。** `--output-format json` 会向 stderr 输出 `{"error": "...", "hint": "..."}`,以便管道步骤在失败时显示有用的信息。 +- **结构化错误。** `--error-format json` 会向 stderr 输出 `{"error": "...", "hint": "..."}`,以便管道步骤在失败时显示有用的信息。 +- **统一的 findings JSON。** 在 `--output-format json` 下,`te validate`、`te bpa run`、`te test run` 和 `te query` 共用一份机器可读的 JSON 文档——包含 `summary`、一个扁平的 `findings[]` 数组,带有 `severity`/`source`/`code`/`message`,以及在可解析的情况下可回传给 `te get` 的 `objectPath`。 见 @te-cli-findings。 ## 将 CLI 添加到你的仓库 @@ -53,7 +55,7 @@ your-repo/ 请把**解压后的**二进制文件放到位——不是压缩包——这样管道就能直接调用。 选择与 runner 的 OS/架构匹配的构建;文件名对照表见 @te-cli-install。 自包含的二进制文件约为 70 MB;如果你的仓库对体积比较敏感,可以考虑使用 Git LFS。 > [!NOTE] -> 提交这个二进制文件也会把 CLI 版本固定为你提交的那个版本,这有利于 CI 的可重现性。 要升级时,替换 `tools/te/` 中的二进制文件并提交——提交信息就是你的版本日志。 请注意:预览版二进制文件无论你何时提交,都会在 **2026-09-30** 到期。因此,随仓库提交的副本并非永久依赖——请按预览版构建的发布节奏更新它(并在新的 API 接口面上重新验证你的管道)。 +> 提交这个二进制文件也会把 CLI 版本固定为你提交的那个版本,这有利于 CI 的可重现性。 要升级时,替换 `tools/te/` 中的二进制文件并提交——提交信息就是你的版本日志。 请注意,无论你何时将其提交到仓库,预览版二进制文件都会在 **2026-10-31** 失效,因此随仓库提交的副本并不是永久依赖——请按预览版的发布节奏更新它(并针对新的 API 面重新验证你的管道)。 ## GitHub Actions @@ -82,18 +84,19 @@ jobs: echo "$GITHUB_WORKSPACE/tools/te" >> $GITHUB_PATH - name: Validate - run: te validate ./model --ci github --trx validate.trx + run: te validate --model ./model --ci github --trx validate.trx - name: Best Practice Analyzer (gate) - run: te bpa run ./model --fail-on error --ci github --trx bpa.trx + run: te bpa run --model ./model --fail-on error --ci github --trx bpa.trx - name: Deploy run: | - te deploy ./model \ - -s "${{ vars.WORKSPACE }}" \ - -d "${{ vars.MODEL }}" \ + te deploy --model ./model \ + --target-server "${{ vars.WORKSPACE }}" \ + --target-database "${{ vars.MODEL }}" \ --auth env \ --non-interactive \ + --execute \ --force \ --ci github @@ -133,16 +136,16 @@ steps: - powershell: Write-Host "##vso[task.prependpath]$(Build.SourcesDirectory)\tools\te" displayName: 'Set up Tabular Editor CLI' - - script: te validate ./model --ci vsts --trx validate.trx + - script: te validate --model ./model --ci vsts --trx validate.trx displayName: 'Validate' - - script: te bpa run ./model --fail-on error --ci vsts --trx bpa.trx + - script: te bpa run --model ./model --fail-on error --ci vsts --trx bpa.trx displayName: 'BPA gate' - script: | - te deploy ./model ^ - -s "$(WORKSPACE)" -d "$(MODEL)" ^ - --auth env --non-interactive --force --ci vsts + te deploy --model ./model ^ + --target-server "$(WORKSPACE)" --target-database "$(MODEL)" ^ + --auth env --non-interactive --execute --force --ci vsts displayName: 'Deploy' env: AZURE_CLIENT_ID: $(AZURE_CLIENT_ID) @@ -165,7 +168,7 @@ steps: ## BPA 门禁模式 -默认情况下,`te deploy` 和 `te save` 会先运行 Best Practice Analyzer 作为预检门禁。 有三种行为值得提前确定: +默认情况下,`te deploy` 和 `te save-as` 会在执行前运行 Best Practice Analyzer 作为预检关卡。 有三种行为值得提前确定: - **强制执行**——默认行为。 如果 BPA 发现严重级别 >= error 的违规项,流水线将失败。 如果你也希望警告导致失败,可在独立的 `te bpa run` 步骤中配合 `--fail-on warning` 使用。 - **自动修复**——`--fix-bpa` 会在内存中对部署产物应用 `fixExpression`。 不会修改源文件。 当模型是唯一可信来源,而你希望部署在无需开发者干预的情况下规范化样式时,这很有用。 @@ -173,44 +176,53 @@ steps: ```bash # Treat warnings as failures in PR validation -te bpa run ./model --fail-on warning --ci github --trx bpa.trx +te bpa run --model ./model --fail-on warning --ci github --trx bpa.trx # Auto-fix during deploy (source unchanged) -te deploy ./model -s my-ws -d my-model --fix-bpa --force --ci github +te deploy --model ./model --target-server my-ws --target-database my-model --fix-bpa --execute --force --ci github # Emergency bypass -te deploy ./model -s my-ws -d my-model --skip-bpa --force --ci github +te deploy --model ./model --target-server my-ws --target-database my-model --skip-bpa --execute --force --ci github ``` 要通过 `bpa.onDeploy` / `bpa.onSave` 配置键全局控制 BPA 门禁,参见 @te-cli-config。 +## 脚本验证 + +C# Script 无需加载任何模型即可进行编译检查——可作为用于 PR 验证的离线 lint 步骤: + +```bash +# Compile-check C# scripts without a model (offline lint) +te script --file ./scripts/fix.csx --validate +``` + ## 刷新模式 -在流水线中,刷新通常是部署之后的后续步骤。 使用 `--non-interactive`,并选择一个确定性的 `--type`: +在流水线中,刷新通常是部署之后的后续步骤。 添加 `--execute --force`(没有 `--execute` 时,命令只会打印它将运行的 TMSL;没有 `--force` 时,它会停下来要求确认,而此时没人能作答),使用 `--non-interactive`,并选择一个确定性的 `--type`: ```bash # Full refresh of the whole model after deploy -te refresh -s my-ws -d my-model --type full --non-interactive +te refresh -s my-ws -d my-model --type full --execute --force --non-interactive # Refresh a single fact table (e.g., daily incremental pipeline) -te refresh -s my-ws -d my-model --table Sales --type full --non-interactive +te refresh -s my-ws -d my-model --table Sales --type full --execute --force --non-interactive # Recalculate only (useful after calculation-group changes) -te refresh -s my-ws -d my-model --type calculate --non-interactive +te refresh -s my-ws -d my-model --type calculate --execute --force --non-interactive ``` -对于增量刷新工作流,请组合使用 `--apply-refresh-policy`、`--effective-date ` 和用于分区的 `--partition ` 标志。 更多信息见 @te-cli-commands。 +对于增量刷新工作流,请结合 `--effective-date ` 和 `--execute --force` 使用 `--apply-refresh-policy`(传入 `true`、`false` 或表名,以将刷新范围限定到该表)。 更多信息见 @te-cli-commands。 ## 工件模式 无需部署,直接将 TMSL 或 XMLA 输出为工件,这样 DBA 或后续作业就可以查看或应用它: ```bash -# Produce the XMLA/TMSL script that would deploy - do not deploy -te deploy ./model -s my-ws -d my-model --xmla deploy.tmsl --force +# Produce the TMSL script that a deploy would send - do not deploy (dry run is the default) +te deploy --model ./model --target-server my-ws --target-database my-model > deploy.tmsl -# Produce the TMSL refresh command - do not execute -te refresh -s my-ws -d my-model --type full --dry-run > refresh.tmsl +# Produce the TMSL refresh command - do not execute (dry run is the default) +te refresh -s my-ws -d my-model --type full > refresh.tmsl ``` 你可以将这些工件提交到 Git、上传到流水线的工件存储,或在作业之间传递。 它们都是纯文本,在拉取请求中也能清晰地显示差异。 From af67aaa79961283b45e39dd10f6300dfec132b29 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:38 +0200 Subject: [PATCH 25/48] New translations te-cli-install.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-install.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-install.md b/localizedContent/zh/content/features/te-cli/te-cli-install.md index 4f7b7e06e..f6baaad91 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-install.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-install.md @@ -2,7 +2,7 @@ uid: te-cli-install title: 安装与设置 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-04 applies_to: products: - product: Tabular Editor 2 @@ -128,7 +128,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> 无论是否设置 `hidePreviewNotice`,在预览结束日期(2026-09-30)**前 14 天内**,每次执行命令都会再次显示该横幅。 这样可确保在 CLI 停止工作前,你能看到明确的警告。 +> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. 这样可确保在 CLI 停止工作前,你能看到明确的警告。 ## Shell 自动补全 @@ -169,16 +169,16 @@ te completion fish > ~/.config/fish/completions/te.fish 大多数功能在各个平台上都相同。 少数功能依赖仅 Windows 支持的传输机制: -| 功能 | Windows | macOS / Linux | -| ----------------------------------------------- | ------- | ------------- | -| 加载/保存 BIM 和 TMDL | 是的 | 是 | -| 部署到 Power BI / Fabric / Azure Analysis Services | 是的 | 是 | -| Best Practice Analyzer 和 VertiPaq分析器 | 是的 | 是 | -| C# Script 脚本编写 | 是的 | 是 | -| 针对云端模型的 DAX 查询 | 是的 | 是 | -| 身份验证:浏览器、设备代码、服务主体、环境变量、托管身份 | 是的 | 是 | -| 连接到本地 SSAS 实例(TCP 传输) | 是 | **否** | -| 连接到 Power BI Desktop(命名管道传输) | 是 | **否** | +| 功能 | Windows | macOS / Linux | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------- | ------------- | +| Work with local TMDL and BIM model files | 是的 | 是 | +| 部署到 Power BI / Fabric / Azure Analysis Services | 是的 | 是 | +| Best Practice Analyzer 和 VertiPaq分析器 | 是的 | 是 | +| C# Script 脚本编写 | 是的 | 是 | +| 针对云端模型的 DAX 查询 | 是的 | 是 | +| Authentication: browser (interactive), service principal, environment variables, managed identity | 是的 | 是 | +| 连接到本地 SSAS 实例(TCP 传输) | 是 | **否** | +| 连接到 Power BI Desktop(命名管道传输) | 是 | **否** | > [!IMPORTANT] > 本地 SSAS 和 Power BI Desktop 连接依赖于仅限 Windows 的传输协议。 所有基于云的工作流(Power BI Service、Fabric、Azure Analysis Services)均可在所有平台上运行。 From cf0620b957f157c04244fbf34fd9d4bbd6dd08d2 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:41 +0200 Subject: [PATCH 26/48] New translations te-cli-interactive.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-interactive.md | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-interactive.md b/localizedContent/zh/content/features/te-cli/te-cli-interactive.md index bdde16e8b..0f7f2e804 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-interactive.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-interactive.md @@ -2,7 +2,7 @@ uid: te-cli-interactive title: 交互模式 author: Peer Grønnerup -updated: 2026-06-26 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -25,7 +25,7 @@ applies_to: ```bash te interactive # Start and connect to a model later -te interactive ./model # Start with a local model +te interactive --model ./model # Start with a local model te interactive -s MyWorkspace -d MyModel # Start with a remote model ``` @@ -48,7 +48,7 @@ REPL 启动后,所有 `te` 子命令都可用,**且无需加上 `te` 前缀* ``` ls tables -get "Sales/Revenue" -q expression +get Sales/Revenue -p expression query -q "EVALUATE TOPN(5, 'Sales')" bpa run --fail-on error ``` @@ -78,32 +78,59 @@ ls 'Net Sales'/'Sales Amount' # Quoted segments with a slash separator 这些由 REPL 自身处理,而不是常规命令树: -| 命令 | 用途 | -| ------------------- | ------------- | -| `help` 或 `?` | 列出可用命令。 | -| `status` 或 `pwd` | 显示当前活动的模型/连接。 | -| `clear` 或 `cls` | 清空屏幕。 | -| `exit`、`quit` 或 `q` | 退出交互模式。 | +| 命令 | 用途 | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `help` 或 `?` | 列出可用命令。 | +| `status` 或 `pwd` | 显示当前活动的模型/连接。 | +| `save` | Commit all staged in-memory edits back to the model source. | +| `revert` | Discard all staged edits made since the last save. | +| `clear` 或 `cls` | 清空屏幕。 | +| `exit`、`quit` 或 `q` | 退出交互模式。 If staged edits are unsaved you are asked to confirm (`n` is the default); `exit --force` discards them without asking. | + +`save` inside the session takes no arguments - re-serializing the model to another format or location is `save-as` (e.g. `save-as -o ./out --serialization bim`), exactly as outside the session. + +## Staged edits + +Inside the session, mutating commands (`set`, `add`, `remove`, `move`, `script`, `macro run`, ...) stage their changes in memory instead of writing to the source, and the prompt shows an indicator while unsaved staged edits exist. The built-in `save` command commits everything staged; `revert` discards everything staged. + +Each mutating command can also decide for itself: `--save` persists that one command's change immediately, `--stage` keeps it in memory (the default), and `--revert` rolls the command's change back after showing its effect - useful for a "what would this do?" probe. The three are mutually exclusive, and `--stage`/`--revert` exist only inside the session. + +The default per-command behavior is the `interactiveEditMode` config key (`stage` | `save` | `revert`) - see @te-cli-config. + +Staged edits are never thrown away silently. Closing a session that still holds them - with `exit`, **Ctrl+D**, or by reaching the end of piped input - first checks for unsaved changes. If unsaved changes exist and a terminal is active, you are asked to confirm, with "no" as the default, and declining returns you to the prompt with the edits intact. Where nobody can answer (stdin piped or redirected, or `--non-interactive`), the session writes a warning naming the unsaved changes and exits with a failure code instead of a success one. Nothing is saved on the way out either way: run `save` first, or `exit --force` to discard the edits deliberately. + +## Line editing and keys + +The prompt offers single-line editing: + +- **Left/Right** move the caret; **Home/End** (also **Ctrl+A**/**Ctrl+E**) jump to the ends; **Backspace/Delete** edit in place. +- **Up/Down** browse the command history, which persists across sessions. +- **Ctrl+C** cancels the current command without leaving the session and abandons the half-typed line for good - it is never run, Up does not bring it back, and it is not added to the history. +- **Ctrl+D** on an empty prompt exits (**Ctrl+Z** then **Enter** on Windows). + +There is no tab completion inside the session - shell completion via `te completion` applies to the outer shell only. ## 引导式提示 -启用交互模式后,需要补全输入的命令会提示你输入,而不是直接失败。 不带子命令运行 `auth` 时,会打开一个选择界面,让你在 Login / Status / Logout 之间选择;不带 `--force` 运行 `deploy` 时,会显示摘要并要求确认(安全的默认值为 `n`)。 +启用交互模式后,需要补全输入的命令会提示你输入,而不是直接失败。 Running `auth` without a subcommand opens a picker for Login / Status / Logout; running `deploy --execute` or `refresh --execute` without `--force` shows a summary and asks for confirmation (`n` is the safe default). A `deploy` or `refresh` without `--execute` is a dry run that prints the TMSL it would send, so it never prompts. 如果想在当前会话中为单个命令禁用提示,传入 `--non-interactive`。 ## 管道与重定向输入 -交互模式也支持通过管道传入或重定向的 stdin,因此你可以用脚本驱动同一个 REPL,而不必手动逐条输入。 每一行输入都会作为一条命令执行,就像你在提示符处输入它一样;当输入耗尽时,会话将退出(或者在读到 `exit` 这一行时退出)。 +交互模式也支持通过管道传入或重定向的 stdin,因此你可以用脚本驱动同一个 REPL,而不必手动逐条输入。 每一行输入都会作为一条命令执行,就像你在提示符处输入它一样;当输入耗尽时,会话将退出(或者在读到 `exit` 这一行时退出)。 If staged edits are still unsaved at that point, the session warns and exits non-zero - end a mutating script with `save` (or `exit --force` to discard on purpose). ```bash -printf "ls\nexit\n" | te interactive ./model # bash / git-bash -te interactive ./model < script.te # redirected file +printf "ls\nexit\n" | te interactive --model ./model # bash / git-bash +te interactive --model ./model < script.te # redirected file ``` ```bat -(echo ls & echo exit) | te interactive .\model :: Windows cmd.exe +(echo ls & echo exit) | te interactive --model .\model :: Windows cmd.exe ``` +The `-` stdin convention (`set -p Expression=-`, `query -q -`, and so on) is refused inside the interactive session, because the session itself owns stdin - use it from the outer shell instead. + 以 `#` 开头的行会被视为注释并跳过,因此你可以为脚本文件添加注释: ``` @@ -119,10 +146,10 @@ exit ```bash # Default when piped: stop at the first failing command, exit non-zero -printf "bpa run --fail-on error\ndeploy --force\nexit\n" | te interactive ./model +printf "bpa run --fail-on error\ndeploy --execute --force\nexit\n" | te interactive --model ./model # Run every line regardless of failures -printf "bpa run --fail-on error\ndeploy --force\nexit\n" | te interactive ./model --no-batch +printf "bpa run --fail-on error\ndeploy --execute --force\nexit\n" | te interactive --model ./model --no-batch ``` ### 便于阅读的执行记录 @@ -130,7 +157,7 @@ printf "bpa run --fail-on error\ndeploy --force\nexit\n" | te interactive ./mode `--echo` 会在对应输出之前将每一行输入写入 stdout,这在捕获管道运行的执行记录时很方便。 注释行不会被回显。 ```bash -printf "ls tables\nexit\n" | te interactive ./model --echo +printf "ls tables\nexit\n" | te interactive --model ./model --echo ``` ### 选项 @@ -155,11 +182,11 @@ printf "ls tables\nexit\n" | te interactive ./model --echo 此行为由 `launchInteractiveMode` 配置项控制,提供三个取值: -| 值 | 效果 | -| ---------- | ----------------------------------------------------------------------------- | -| `auto`(默认) | 仅当三个流都连接到 TTY 时才启动 REPL。 否则回退到常规解析流程。 | -| `always` | 无论流是否被重定向,都启动 REPL。 适合始终需要交互式会话的情况。 | -| `never` | 从不自动启动 REPL。 单独运行 `te` 会打印帮助,与 0.6.0 之前的行为一致。 | +| 值 | 效果 | +| ---------- | --------------------------------------------------------- | +| `auto`(默认) | 仅当三个流都连接到 TTY 时才启动 REPL。 否则回退到常规解析流程。 | +| `always` | 无论流是否被重定向,都启动 REPL。 适合始终需要交互式会话的情况。 | +| `never` | 从不自动启动 REPL。 `te` on its own prints help. | 可通过以下方式全局更改: From 2c3c538cf3ed847f4e272a41e274344662f4b08b Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:44 +0200 Subject: [PATCH 27/48] New translations te-cli-migrate.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-migrate.md | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-migrate.md b/localizedContent/zh/content/features/te-cli/te-cli-migrate.md index 77506c23b..3de9044ac 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-migrate.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-migrate.md @@ -2,7 +2,7 @@ uid: te-cli-migrate title: 从 TE2 命令行迁移 author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -27,7 +27,7 @@ applies_to: 1. **二进制名称。** 将 `te` 重命名为 `te2`(或为其创建符号链接),CLI 就会以与 TE2 完全一致的模式运行。 这是直接替换的做法:在现有管道中把 `TabularEditor.exe` 换成 `te2`,原来的参数照样可用。 2. **环境变量。** 在调用 `te` 之前设置 `TE_COMPAT=te2`,即可强制启用 TE2 模式。 -3. **自动检测。** 如果第一个参数不是 `te` 子命令(`load`、`deploy` 等), 并且只要在参数列表的任意位置出现了至少一个可识别的 TE2 标志,CLI 就会自动切换到 TE2 模式。 这意味着大多数现有的 TE2 调用无需任何更改即可运行。 +3. **Auto-detection.** If the first argument isn't a `te` subcommand (`deploy`, `validate`, …) 并且只要在参数列表的任意位置出现了至少一个可识别的 TE2 标志,CLI 就会自动切换到 TE2 模式。 这意味着大多数现有的 TE2 调用无需任何更改即可运行。 ```bash # All three are equivalent - each runs in TE2 mode @@ -41,48 +41,48 @@ te Model.bim -S fix.csx -D "localhost\tabular" MyDB -O ## Migrate 命令 -可将 `te migrate` 作为实时参考,用来了解 TE2 标志如何映射到新的 CLI。 它会输出一张彩色表格,列出每个已知 TE2 标志、其状态(受支持、已重命名、计划支持)以及对应的 `te` 命令。 +Use `te util migrate` as a live reference for how TE2 flags map to the new CLI. 它会输出一张彩色表格,列出每个已知 TE2 标志、其状态(受支持、已重命名、计划支持)以及对应的 `te` 命令。 ```bash -te migrate # Full flag mapping table -te migrate -A # Look up a single flag -te migrate --output-format json # Machine-readable mapping +te util migrate # Full flag mapping table +te util migrate -A # Look up a single flag +te util migrate --output-format json # Machine-readable mapping ``` -请参考 `te migrate` 命令的输出,查看与您已安装的 CLI 版本相对应的当前映射。 +Refer to the output of the `te util migrate` command for the current mapping that reflects the CLI version you have installed. ## 标志映射(整理的子集) -以下是最常用标志的简要汇总,并非完整列表。 运行 `te migrate` 查看完整列表。 - -| TE2 标志 | 新 CLI 等效参数 | 说明 | -| ----------------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `file`(位置参数) | `te ` 或使用全局参数 `--model` | 在大多数命令中,这是第一个位置参数。 | -| `server`、`database` | `te connect ` 或 `te deploy -s -d ` | `server` 不再是全局位置参数;`te deploy` 仅将 `` 作为位置参数,`server` 和 `database` 需通过命名标志指定。 | -| `-L` / `-LOCAL` | `te connect --local` | 仅限 Windows。 | -| `-S` / `-SCRIPT` | `te script -S ` 或 `-e "code"` | 支持多个脚本、内联代码和 stdin。 注意:请使用大写 `-S`;小写 `-s` 是全局 `--server` 选项。 | -| `-A` / `-ANALYZE` | `te bpa run --rules ` | 支持 `--fail-on`、`--fix` 和多个规则文件。 | -| `-AX` / `-ANALYZEX` | `te bpa run --rules `(不带 `--model-rules`) | 现在默认会排除嵌入模型的规则。 | -| `-B` / `-BIM` | `te save -o --serialization bim` | | -| `-F` / `-FOLDER` | `te save -o --serialization Database.json` | 在 `-D` 之后,TE2 的 `-F` 表示 `-FULL`;参见 `--deploy-full`。 | -| `-TMDL` | `te save -o --serialization tmdl` | TMDL 是默认保存格式。 | -| `-D` / `-DEPLOY` | `te deploy -s -d ` | 已拆分为带命名选项的独立命令;只有 `` 作为位置参数。 | -| `-O` / `-OVERWRITE` | (默认)或使用 `--create-only` 选择不覆盖 | 在新的 CLI 中,覆盖是默认行为。 | -| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | -| `-P` / `-PARTITIONS` 分区 | `te deploy --deploy-partitions` 部署分区 | | -| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` 部署分区并跳过刷新策略 | 需要 `--deploy-partitions`。 | -| `-SHARED` | `te deploy --deploy-shared-expressions` | 在 `-D` 之后,TE2 的 `-S` 表示 `-SHARED`。 | -| `-R` / `-ROLES` 角色 | `te deploy --deploy-roles` | | -| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | -| `-FULL`(在 `-D` 之后) | `te deploy --deploy-full` | 等同于:覆盖 + 连接 + 分区 + 共享 + 角色 + 角色成员。 | -| `-X` / `-XMLA ` | `te deploy ... --xmla ` | 输出到 stdout 时使用 `-`。 | -| `-V` / `-VSTS` | 在 `validate`、`bpa run` 和 `deploy` 命令中使用 `--ci vsts` | 会向 stderr 输出 `##vso[...]` 注释。 | -| `-G` / `-GITHUB` | `--ci github` | 会输出 `::error::` / `::warning::` 注释。 | -| `-T` / `-TRX ` | 在 `validate`、`bpa run` 和 `test run` 命令中使用 `--trx ` | 用于 Azure DevOps 测试发布的 VSTEST `.trx` 文件。 | -| `-W` / `-WARN` | (默认) | 部署结果中始终会 Report 警告。 | -| `-E` / `-ERR` | (默认) | 出现 DAX 错误时,部署会返回非零退出代码。 | -| `-SC` / `-SCHEMACHECK` | _尚未实现。_ | TE2 架构检查会连接到真实的数据源。 这不同于 `te validate`(DAX 语义验证,不连接数据源)。 | -| `-L` / `-LOGIN `(位于 `-D` 之后) | `te auth login -u -p -t ` | 使用服务主体或基于环境变量的凭据。 登录状态会被缓存,因此后续命令会静默获取令牌——见 @te-cli-auth。 | +Below is a non-exhaustive summary of the most commonly used flags. Run `te util migrate` for the full list. + +| TE2 标志 | 新 CLI 等效参数 | 说明 | +| ----------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file`(位置参数) | `--model ` (global option) | Always the global `--model` option; no command takes the model as a positional argument. Or set an active model once with `te connect `. | +| `server`、`database` | `te connect ` or global `-s -d ` | `-s`/`-d` always identify the model source; deploy destinations use `--target-server` / `--target-database`. | +| `-L` / `-LOCAL` | `te connect --local` | 仅限 Windows。 | +| `-S` / `-SCRIPT` | `te script --file ` or `--inline "code"` | A bare `.csx` path also works (`te script fix.csx`). Supports multiple scripts (`--file a.csx --file b.csx`), inline code, and stdin (`--inline -`); files and inline code run in the order given. | +| `-A` / `-ANALYZE` | `te bpa run --rules ` | 支持 `--fail-on`、`--fix` 和多个规则文件。 | +| `-AX` / `-ANALYZEX` | `te bpa run --rules --no-model-rules` | Model-embedded rules are included by default; `--no-model-rules` excludes them, matching what `-AX` did. | +| `-B` / `-BIM` | `te save-as --model -o --serialization bim` | | +| `-F` / `-FOLDER` | `te save-as --model -o --serialization database.json` | 在 `-D` 之后,TE2 的 `-F` 表示 `-FULL`;参见 `--deploy-full`。 | +| `-TMDL` | `te save-as --model -o --serialization tmdl` | `--serialization` can be omitted - the format is inferred from the output path. | +| `-D` / `-DEPLOY` | `te deploy --model --target-server --target-database --execute` | 这是一个独立的命令,使用具名选项。 Without `--execute`, `te deploy` is a dry run that prints the TMSL it would send. | +| `-O` / `-OVERWRITE` | (默认)或使用 `--create-only` 选择不覆盖 | 在新的 CLI 中,覆盖是默认行为。 | +| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | +| `-P` / `-PARTITIONS` 分区 | `te deploy --deploy-partitions` 部署分区 | | +| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` 部署分区并跳过刷新策略 | 需要 `--deploy-partitions`。 | +| `-SHARED` | `te deploy --deploy-shared-expressions` | 在 `-D` 之后,TE2 的 `-S` 表示 `-SHARED`。 | +| `-R` / `-ROLES` 角色 | `te deploy --deploy-roles` | | +| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | +| `-FULL`(在 `-D` 之后) | `te deploy --deploy-full` | 等同于:覆盖 + 连接 + 分区 + 共享 + 角色 + 角色成员。 | +| `-X` / `-XMLA ` | `te deploy ... > ` (omit `--execute`) | Script emission is the default: without `--execute`, deploy connects read-only and prints the TMSL to stdout - redirect it to a file. | +| `-V` / `-VSTS` | `--ci vsts` on `validate`, `bpa run`, `deploy`, `test run` | 会向 stderr 输出 `##vso[...]` 注释。 `azdo` and `azure-devops` are accepted aliases. | +| `-G` / `-GITHUB` | `--ci github` (alias `gh`) | Emits `::error::` / `::warning::` / `::notice::` annotations. | +| `-T` / `-TRX ` | 在 `validate`、`bpa run` 和 `test run` 命令中使用 `--trx ` | 用于 Azure DevOps 测试发布的 VSTEST `.trx` 文件。 | +| `-W` / `-WARN` | (默认) | 部署结果中始终会 Report 警告。 | +| `-E` / `-ERR` | (默认) | 出现 DAX 错误时,部署会返回非零退出代码。 | +| `-SC` / `-SCHEMACHECK` | _尚未实现。_ | TE2 架构检查会连接到真实的数据源。 这不同于 `te validate`(DAX 语义验证,不连接数据源)。 | +| `-L` / `-LOGIN `(位于 `-D` 之后) | `te auth login -u -p -t ` | 使用服务主体或基于环境变量的凭据。 登录状态会被缓存,因此后续命令会静默获取令牌——见 @te-cli-auth。 | ## 迁移指南 @@ -93,13 +93,13 @@ te migrate --output-format json # Machine-readable mapping - 先从 `-A` / `-AX` → `te bpa run` 开始,以获得更丰富的 BPA 输出(`--fail-on`、`--fix`、`--trx`)。 - 然后把 `-D` 替换为 `te deploy`,以获得更细粒度的部署控制。 - 最后:`-V` / `-G` → `--ci vsts` / `--ci github`。 -3. **切换为非交互式 CI 参数。** 给每个 `te` 命令加上 `--non-interactive --ci `,并去掉任何 `start /wait` 包装命令——新的 CLI 是标准控制台可执行文件,不需要它们。 +3. **Switch to non-interactive CI flags.** Add `--non-interactive` to every `te` command (and `--ci ` on `validate`, `bpa run`, `deploy`, and `test run`), pass `--execute --force` on `deploy`/`refresh` steps that must act, and remove any `start /wait` wrappers - the new CLI is a regular console binary and doesn't need them. 4. **采用服务主体身份验证。** 将 `-D -L ` 替换为 `te auth login -u …… -p …… -t ...`,或在管道中使用基于环境变量凭据的步骤。 见 @te-cli-auth。 ## 重要差异 - **部署时的 BPA 检查。** `te deploy` 现在默认会在部署前运行 BPA,作为前置检查。 使用 `--skip-bpa` 可保留旧行为,或使用 `--fix-bpa` 在部署前自动修复违规项。 见 @te-cli-config。 -- **部署时的交互式确认。** 默认情况下,`te deploy` 会提示确认(为安全起见,默认回答为 `n`)。 CI 管道必须指定 `--force`。 +- **Dry run by default.** `te deploy` and `te refresh` print the exact TMSL they would send and change nothing; pass `--execute` to act. `--execute` asks for confirmation at a terminal (with `n` as the safe default); CI pipelines must pass `--execute --force`. - **结构化输出。** 每个命令都支持 `--output-format json`,以生成机器可读输出——参见 @te-cli-automation。 - **无需 `start /wait`。** 新 CLI 是普通的控制台可执行文件;你可以在 shell 脚本、PowerShell 和 CI 任务中直接调用它。 - **跨平台。** CLI 可在 Windows、macOS 和 Linux 上运行。 本地 SSAS 和 Power BI Desktop 连接仍仅支持 Windows。 From ecf34296ec1063442ba8ffdbc868c58fdec49537 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:47 +0200 Subject: [PATCH 28/48] New translations te-cli.md (Chinese Simplified) [ci skip] --- .../zh/content/features/te-cli/te-cli.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli.md b/localizedContent/zh/content/features/te-cli/te-cli.md index 1e3214f96..6d78ca432 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli.md +++ b/localizedContent/zh/content/features/te-cli/te-cli.md @@ -2,7 +2,7 @@ uid: te-cli title: Tabular Editor CLI(有限公开预览) author: Peer Grønnerup -updated: 2026-06-11 +updated: 2026-09-11 applies_to: products: - product: Tabular Editor 2 @@ -23,12 +23,13 @@ Tabular Editor CLI (`te`) 是适用于 Power BI 和 Analysis Services 语义模 [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -## 面向三类受众打造 +## Design pillars and target audiences -每个命令都围绕三大设计支柱构建: +Four design pillars shape every command: - **结构化输出** — 除默认的易读文本外,还可输出 JSON、CSV、TMDL 和 TMSL。 - **非交互模式** — 全局 `--non-interactive` 标志会禁用交互提示,并在出错时快速失败。 +- **Safe by default** - editing commands such as `te set`, `te add` and `te remove` show their change as a diff and write nothing until you add `--save`; adding `--force` saves even when the change introduces validation errors. `te deploy` and `te refresh` print the exact TMSL they would send until you add `--execute`, and then ask for confirmation first unless you add `--force`. - **清晰的错误信息** — 写入 stderr,并返回可预测的退出码。 这三者结合起来,让同一个二进制文件能够很好地服务于三类截然不同的用户: @@ -42,22 +43,22 @@ Tabular Editor CLI (`te`) 是适用于 Power BI 和 Analysis Services 语义模 ## CLI 可以做什么 -CLI 将 50 多个命令划分为 10 个类别。 每个命令族都对应语义模型生命周期中的一个具体阶段。 +The CLI organizes its commands into 10 families. 每个命令族都对应语义模型生命周期中的一个具体阶段。 有关每个命令的语法、选项和示例的完整命令参考,请参阅 @te-cli-commands。 点击表中的任意示例命令,直接跳转到对应的参考条目。 -| 命令族 | 功能 | 示例命令 | -| ------------------------------------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [模型 I/O](xref:te-cli-commands#model-io) | 加载、保存、转换和初始化模型 | [`te load`](xref:te-cli-commands#load)、[`te save`](xref:te-cli-commands#save)、[`te init`](xref:te-cli-commands#init) | -| [模型编辑](xref:te-cli-commands#model-editing) | 获取/设置属性,添加/删除/移动对象 | [`te set`](xref:te-cli-commands#set)、[`te add`](xref:te-cli-commands#add)、[`te remove`](xref:te-cli-commands#remove)、[`te move`](xref:te-cli-commands#move) | -| [检视](xref:te-cli-commands#inspection) | 列出对象、搜索、比较差异、分析依赖关系 | [`te list`](xref:te-cli-commands#list)、[`te find`](xref:te-cli-commands#find)、[`te diff`](xref:te-cli-commands#diff)、[`te deps`](xref:te-cli-commands#deps) | -| [分析与质量](xref:te-cli-commands#analysis-and-quality) | 验证、运行 BPA、格式化 DAX、分析存储 | [`te validate`](xref:te-cli-commands#validate)、[`te bpa run`](xref:te-cli-commands#bpa-run)、[`te format`](xref:te-cli-commands#format)、[`te vertipaq`](xref:te-cli-commands#vertipaq) | -| [执行](xref:te-cli-commands#execution) | 运行 DAX 查询、C# Script 和宏 | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te 宏`](xref:te-cli-commands#macro) | -| [部署与刷新](xref:te-cli-commands#deployment-and-refresh) | 部署到 Workspace、触发刷新、执行增量刷新 | [`te deploy`](xref:te-cli-commands#deploy)、[`te refresh`](xref:te-cli-commands#refresh)、[`te incremental-refresh`](xref:te-cli-commands#incremental-refresh) | -| [测试](xref:te-cli-commands#testing) | 断言测试、快照、A/B 比较 | [`te test run`](xref:te-cli-commands#test-run) | -| [连接与身份验证](xref:te-cli-commands#connection-and-authentication) | 连接到 Workspace,管理身份验证和配置文件 | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | -| [配置](xref:te-cli-commands#configuration) | 设置与许可 | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | -| [Shell](xref:te-cli-commands#shell) | 交互模式、会话状态、Shell 自动补全 | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | +| 命令族 | 功能 | 示例命令 | +| ----------------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Model initialization and save](xref:te-cli-commands#model-initialization-and-save) | Save, convert, initialize models | [`te save-as`](xref:te-cli-commands#save-as), [`te init`](xref:te-cli-commands#init) | +| [模型编辑](xref:te-cli-commands#model-editing) | 获取/设置属性,添加/删除/移动对象 | [`te set`](xref:te-cli-commands#set)、[`te add`](xref:te-cli-commands#add)、[`te remove`](xref:te-cli-commands#remove)、[`te move`](xref:te-cli-commands#move) | +| [检视](xref:te-cli-commands#inspection) | 列出对象、搜索、比较差异、分析依赖关系 | [`te list`](xref:te-cli-commands#list)、[`te find`](xref:te-cli-commands#find)、[`te diff`](xref:te-cli-commands#diff)、[`te deps`](xref:te-cli-commands#deps) | +| [分析与质量](xref:te-cli-commands#analysis-and-quality) | Validate, run BPA, format DAX and M, analyze storage | [`te validate`](xref:te-cli-commands#validate), [`te bpa run`](xref:te-cli-commands#bpa-run), [`te util`](xref:te-cli-commands#utilities), [`te vertipaq`](xref:te-cli-commands#vertipaq) | +| [执行](xref:te-cli-commands#execution) | 运行 DAX 查询、C# Script 和宏 | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te 宏`](xref:te-cli-commands#macro) | +| [部署与刷新](xref:te-cli-commands#deployment-and-refresh) | Deploy to workspace, trigger refresh, apply refresh policies | [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh) | +| [测试](xref:te-cli-commands#testing) | 断言测试、快照、A/B 比较 | [`te test run`](xref:te-cli-commands#test-run) | +| [连接与身份验证](xref:te-cli-commands#connection-and-authentication) | 连接到 Workspace,管理身份验证和配置文件 | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | +| [配置](xref:te-cli-commands#configuration) | CLI settings and defaults | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | +| [Shell](xref:te-cli-commands#shell) | 交互模式、会话状态、Shell 自动补全 | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | > [!TIP] > 文档中使用规范的长形式动词(`list`、`remove`、`move`),但传统的短形式仍可作为别名使用(`ls`、`rm`、`mv`、`rename`)。 这既适用于顶层命令,也适用于 `te bpa rules`、`te macro`、`te config`、`te profile`、`te session` 和 `te test` 等命令组下的 `remove` / `list` 子命令。 完整映射请参见 @te-cli-commands#command-aliases。 @@ -91,7 +92,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> 在预览结束日期(2026-09-30)前 14 天内,无论 `hidePreviewNotice` 如何设置,每次执行命令时该横幅都会再次出现。 这可确保在 CLI 停止运行之前,你能提前看到醒目的警告。 +> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. 这可确保在 CLI 停止运行之前,你能提前看到醒目的警告。 ## 许可概览 From b1a2cf575e49a309fdd05d446a8386a870de9bb4 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:50 +0200 Subject: [PATCH 29/48] New translations github-flow.md (Chinese Simplified) [ci skip] --- localizedContent/zh/content/getting-started/github-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localizedContent/zh/content/getting-started/github-flow.md b/localizedContent/zh/content/getting-started/github-flow.md index 978522983..f0e653b1d 100644 --- a/localizedContent/zh/content/getting-started/github-flow.md +++ b/localizedContent/zh/content/getting-started/github-flow.md @@ -79,7 +79,7 @@ flowchart LR ``` > [!NOTE] -> Tabular Editor 现已提供跨平台 CLI(`te`),目前处于有限公开预览阶段,专为 CI/CD 场景打造——支持非交互模式、原生 GitHub Actions/Azure DevOps 注解、VSTEST 输出,以及用于在管道中运行回归测试的 `te test run` 命令。 它与下文描述的这类管道天然契合,值得关注。 在撰写本文时,Tabular Editor 自身的文档仍建议不要在预览期间将其用于生产管道(文档说明该预览版本会于 2026-09-30 过期),因此本文中的参考实现改用已成熟的 `TabularEditor.exe` CLI。 有关这个新 CLI 当前具备的能力和示例,可以查看 [CI/CD 集成](xref:te-cli-cicd)。 +> Tabular Editor 现已提供跨平台 CLI(`te`),目前处于有限公开预览阶段,专为 CI/CD 场景打造——支持非交互模式、原生 GitHub Actions/Azure DevOps 注解、VSTEST 输出,以及用于在管道中运行回归测试的 `te test run` 命令。 它与下文描述的这类管道天然契合,值得关注。 As of this writing, Tabular Editor's own documentation advises against using it in production pipelines during preview (the preview build is stated to expire 2026-10-31), so the reference implementation in this article uses the established `TabularEditor.exe` CLI instead. 有关这个新 CLI 当前具备的能力和示例,可以查看 [CI/CD 集成](xref:te-cli-cicd)。 From 183d7810d5903b87a79c3a87274454eb38a011df Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 18:03:53 +0200 Subject: [PATCH 30/48] New translations te-cli-findings.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-findings.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 localizedContent/zh/content/features/te-cli/te-cli-findings.md diff --git a/localizedContent/zh/content/features/te-cli/te-cli-findings.md b/localizedContent/zh/content/features/te-cli/te-cli-findings.md new file mode 100644 index 000000000..95da52748 --- /dev/null +++ b/localizedContent/zh/content/features/te-cli/te-cli-findings.md @@ -0,0 +1,106 @@ +--- +uid: te-cli-findings +title: 机器可读结果(JSON) +author: Peer Grønnerup +updated: 2026-09-11 +applies_to: + products: + - product: Tabular Editor 2 + none: true + - product: Tabular Editor 3 + none: true + - product: Tabular Editor CLI + full: true +--- + +# 机器可读结果(JSON) + +[!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] + +`te validate`、`te bpa run`、`te test run` 和 `te query` 会使用统一的 JSON 结构来 Report 问题。 使用 `--output-format json` 时,这些命令都会输出 **单个文档**,不会出现没有任何内容可供解析的情况。 + +> [!NOTE] +> `te query` 仅在执行前的 DAX 验证产生至少一个错误时,才会使用此 JSON 结构。 查询成功时,会改为输出查询结果:`{columns, rows, rowCount, truncated, durationMs, trace?}`。 + +## JSON 文档 + +```json +{ + "command": "validate", + "durationMs": 412, + "summary": { "errors": 1, "warnings": 2, "info": 0, "total": 3 }, + "findings": [ + { + "severity": "error", + "source": "validate", + "code": "TE0001", + "message": "Unknown column 'Sales'[Amt]", + "object": "Revenue", + "objectType": "Measure", + "objectPath": "Sales/Revenue", + "expressionPosition": { "property": "Expression", "lineNumber": 3, "column": 9 }, + "fixable": false + } + ], + "valid": false +} +``` + +- `command`:生成该文档的命令。 +- `durationMs`:总运行时长。 +- `summary`:严重性统计:`errors`、`warnings`、`info`、`total`。 +- `findings`:一个扁平数组,通过 `severity` 区分。 + +## 每个发现项的键名 + +每个发现项都包含: + +| 键 | 值/含义 | +| ------------ | ------------------------------------------------------------------------------- | +| `severity` | `error`、`warning` 或 `info`。 | +| `source` | `validate`、`bpa`、`test` 或 `query`。 | +| `code` | 稳定的发现代码(验证信息 ID、BPA 规则 ID、`TEST_FAIL` / `TEST_ERROR` / `TEST_SUITE_INVALID` 等)。 | +| `信息` | 便于理解的描述。 | +| `object` | 该发现所涉及对象的基本名称。 | +| `objectType` | 预定义值之一——见下文。 | +| `fixable` | 仅当 BPA 违规项的规则定义了修复表达式时,值才为 `true`。 | + +**仅在 CLI 已知这些值时**才会出现——未设置时,这些键会_缺失_,而不是 `null`: + +| 键 | 填充自 | 含义 | +| ---------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `objectPath` | 仅适用于 `validate` 和 `bpa` 的违规项 | 规范对象路径,可由 `te get` 或 `te set` 直接按原样解析。 测试发现项、查询发现项以及 BPA 规则错误中没有此字段。 | +| `expressionPosition` | 仅限 `validate` 和 `query` | Named Expression 属性中的 `{property, lineNumber, column}`。 **在所有来源中,包括 validate 和 query,都是可选的** - 只要分析器未报告任何可用位置,此字段就不存在;并且要么完整提供,要么完全不提供(绝不会只提供部分位置信息)。 | +| `ruleName`, `category` | 仅限 `bpa` | 所违反规则的名称和类别。 | + +### objectType 取值表 + +`objectType` 的取值是一个封闭集合(使用路径语法中各容器的单数形式,而不是 TOM 枚举): + +`Measure`, `Column`, `Hierarchy`, `Level`, `Partition`, `CalculationItem`, `Table`, `Role`, `TablePermission`, `Perspective`, `Culture`, `DataSource`, `Expression`, `Function`, `Relationship`, `KPI`, `RefreshPolicy`, `Member`, `Calendar`, `Variation`, `Model`, `BpaRule`, `Test`, `TestSuite`, `Query`。 + +## 各命令专有字段 + +每个命令都会在文档顶层带有少量自身专有的键: + +| 命令 | 额外键 | +| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `te validate` | `valid`(布尔值)。 | +| `te bpa run` | `model`、`rulesEvaluated`、`violations`、`ruleErrors`、`ignoredRules`。 规则评估错误会以严重性 `error`、`objectType: "BpaRule"` 的形式出现在 `findings` 中;`violations` 和 `ruleErrors` 分别统计这两类数量。 | +| `te bpa run --fix` | 在同一个文档内新增一个 `fix` 键:`changes`、`fixed`、`fixErrors`、`skipped`、`fixedItems`、`fixErrorItems`。 如果修复步骤本身失败,仍会生成文档,并将原因写入 `fix.error`。 不带 `--fix` 时不会出现。 | +| `te test run` | `suites`、`invalidSuites`、`testSummary`(按状态汇总测试数量;`summary` 仍为共享的严重性汇总)。 | +| `te query` | 没有——而且只会在验证错误时出现;见上文说明。 | + +## CI 注释 + +这四个命令共用同一个注释写入器,用于 `--ci vsts` / `--ci github`(接受 `azdo`、`azure-devops` 和 `gh` 作为别名;`none` 会禁用注释;其他任何值都会在命令运行前被拒绝)。 注释会输出到 stderr;stdout 保持可解析: + +- 注释会带上发现项的代码:在 Azure DevOps 中使用 `code=`,在 GitHub 中使用 `title=`。 +- 信息级 Info 发现项不是警告:在 GitHub 上会输出 `::notice::`,在 Azure DevOps 上则是一条普通日志行。 如果某次 Azure DevOps 运行的发现项只有信息类 Report,则该运行会显示为 **Succeeded**。 +- 多行信息会被转义为单行注释,因此规则说明不会破坏日志格式。 + +## 相关页面 + +- @te-cli-commands#exit-codes - 退出代码不受输出格式影响。 +- @te-cli-cicd - 使用这种输出结构的管道模式。 +- @te-cli-automation - 在脚本中解析结构化输出。 From 1d0363da869435409b7058bdbe4ff073501d5ab3 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:09 +0200 Subject: [PATCH 31/48] New translations te-cli-commands.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-commands.md | 260 +++++++++--------- 1 file changed, 130 insertions(+), 130 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-commands.md b/localizedContent/es/content/features/te-cli/te-cli-commands.md index 7f5f243f0..6d884abc0 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-commands.md +++ b/localizedContent/es/content/features/te-cli/te-cli-commands.md @@ -31,8 +31,8 @@ te bpa run --help # Help for a command with subcommands El direccionamiento de objetos en la CLI usa una única gramática compartida por todos los comandos. En la referencia siguiente aparecen dos tipos de ruta: -- **``**: identifica **exactamente un** objeto o contenedor. Used by commands that change the model or need a single target: `te set`, `te add`, `te remove`, `te move`, `te deps`, `te macro run --on`, and `te get` with `-p`, `--deps`, or `--properties`. -- **``**: identifica **cero o más** objetos y admite comodines. Used by commands that operate on a set: `te list`, plain `te get` (a wildcard or container path lists every match), `te bpa run --path`, and other inspection-style commands. +- **``**: identifica **exactamente un** objeto o contenedor. Lo usan los comandos que cambian el modelo o necesitan un único destino: `te set`, `te add`, `te remove`, `te move`, `te deps`, `te macro run --on` y `te get` con `-p`, `--deps` o `--properties`. +- **``**: identifica **cero o más** objetos y admite comodines. Lo usan los comandos que operan sobre un conjunto: `te list`, `te get` a secas (una ruta con comodines o de contenedor enumera todas las coincidencias), `te bpa run --path` y otros comandos de tipo inspección. Ambas formas de ruta comparten las mismas reglas de sintaxis; solo se diferencian en dos puntos: @@ -61,7 +61,7 @@ La mayoría de los nombres de segmentos funcionan tal cual. Pon un segmento entr Dentro de los segmentos entre comillas, `*` se trata como un carácter literal, no como un comodín. Por tanto, `'Sa*'` coincide con una tabla cuyo nombre es exactamente `Sa*`. -The reserved characters in paths are `/ [ ] ' " * ? { }`. A segment containing any of `* ? { }` must be quoted (`te get "Tables/'{foo}'"`, `te get 'Sales/"my*name"'`); unquoted use is rejected with an error naming the character and showing the quoted form. `?` is reserved and has no wildcard meaning. Every path the CLI prints - in errors, hints, `--paths-only` output, and the `objectPath` field in JSON - is canonically quoted and can be pasted straight back into `te get`. The mixed-quote forms require PowerShell or bash; cmd.exe cannot express them. +Los caracteres reservados en las rutas son `/ [ ] ' " * ? { }`. Un segmento que contenga cualquiera de `* ? { }` debe ir entre comillas (`te get "Tables/'{foo}'"`, `te get 'Sales/"my*name"'`); si se usa sin comillas, se rechaza con un error que indica el carácter y muestra la forma entrecomillada. `?` es un carácter reservado y no tiene significado de comodín. Toda ruta que la CLI imprima —en errores, sugerencias, la salida de `--paths-only` y el campo `objectPath` del JSON— se cita de forma canónica y se puede pegar tal cual en `te get`. Las formas con comillas mixtas requieren PowerShell o bash; cmd.exe no puede expresarlas. ### Referencias al estilo DAX (solo rutas de objeto) @@ -82,13 +82,13 @@ Varios nombres funcionan como palabras clave de contenedor. Una palabra clave pu | Palabra clave | Ámbito | Significado | | -------------------------------------------------------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------- | -| `Tables`, `Measures`, `Columns`, `Hierarchies`, `Partitions`, `KPIs`, `Sets` | Modelo | Todos los objetos de ese tipo en todo el modelo. | +| `Tables`, `Medidas`, `Columns`, `Hierarchies`, `Particiones`, `KPIs`, `Sets` | Modelo | Todos los objetos de ese tipo en todo el modelo. | | `Relaciones`, `Roles`, `Perspectives`, `Cultures`, `DataSources`, `Expressions`, `CalculationGroups`, `Functions`, `Annotations` | Modelo | Contenedores a nivel de modelo. | -| `Measures`, `Columns`, `Hierarchies`, `Partitions`, `Calendars`, `CalculationItems`, `KPIs`, `Sets` | Tabla | Subcontenedores dentro de una tabla. | +| `Medidas`, `Columns`, `Hierarchies`, `Particiones`, `Calendars`, `CalculationItems`, `KPIs`, `Sets` | Tabla | Subcontenedores dentro de una tabla. | | `Levels` | Jerarquía | Niveles de una jerarquía. | | `Members`, `TablePermissions` (alias `Permissions`) | Rol | Elementos hijos de un rol. | -Calculated sets are addressable in container form only (`
/Sets/`); an individual KPI is `
//KPI`; calendars resolve at `
/Calendars/`; relationships resolve at `Relationships/` (the relationship's own name in the model: a GUID, or a label such as `Relationship 1`; `--paths-only` prints it, and the display name is also accepted). +Los conjuntos calculados solo se pueden referenciar en forma de contenedor (`
/Sets/`); un KPI individual es `
//KPI`; los calendarios se resuelven en `
/Calendars/`; las relaciones se resuelven en `Relationships/` (el propio nombre de la relación en el modelo: un GUID o una etiqueta como `Relationship 1`; `--paths-only` lo imprime y también se acepta el nombre para mostrar). Algunos ejemplos muestran en qué se diferencian las rutas simples y las rutas con ámbito de contenedor: @@ -101,7 +101,7 @@ te get Sales/refreshPolicy # Refresh-policy sub-object on a tabl te get Sales/Revenue/KPI # KPI sub-object of a measure ``` -Pon un segmento entre comillas para forzar la coincidencia literal del nombre cuando el nombre real de un objeto coincide con una palabra clave. La tabla cuyo nombre literal es `Tables` es `'Tables'` y se accede con `te get "'Tables'"`. The same applies to tables named `KPIs` or `Sets`. +Pon un segmento entre comillas para forzar la coincidencia literal del nombre cuando el nombre real de un objeto coincide con una palabra clave. La tabla cuyo nombre literal es `Tables` es `'Tables'` y se accede con `te get "'Tables'"`. Lo mismo se aplica a las tablas llamadas `KPIs` o `Sets`. ### Comodines en rutas de filtro @@ -120,7 +120,7 @@ El sufijo entre corchetes de DAX se rechaza en las rutas de filtro; pon entre co ### Errores y sugerencias -Los segmentos mal escritos generan un error contextual con una sugerencia de "quizás quisiste decir" cuando la CLI puede deducir lo que querías decir. The list offers tables, measures, columns, and hierarchies, each as a full `Table/Object` path that pastes straight back into the next command. A name written in single quotes is a table reference (`te deps 'Revenue'` looks for a table named Revenue), and the error points at the `Table/Object` and `"[Object]"` forms for anything that is not a table. Las rutas a las que les falta el elemento padre fallan antes de la comprobación del elemento hoja, así que los mensajes señalan el segmento que realmente está mal. Every path an error or hint prints is taken from your model and quoted so it resolves as printed - a refusal never suggests a path that does not exist. Empty containers (e.g., `te list Hierarchies` on a model without hierarchies) emit a simple "nothing here" hint rather than an error. +Los segmentos mal escritos generan un error contextual con una sugerencia de "quizás quisiste decir" cuando la CLI puede deducir lo que querías decir. La lista ofrece tablas, medidas, columnas y jerarquías, cada una como una ruta completa `Table/Object` que puedes pegar directamente en el siguiente comando. Un nombre escrito entre comillas simples es una referencia a una tabla (`te deps 'Revenue'` busca una tabla llamada Revenue), y el error te indica las formas `Table/Object` y `"[Object]"` para todo lo que no sea una tabla. Las rutas a las que les falta el elemento padre fallan antes de la comprobación del elemento hoja, así que los mensajes señalan el segmento que realmente está mal. Toda ruta que aparezca en un error o sugerencia se toma de tu modelo y se entrecomilla para que se resuelva tal como se muestra; si algo se rechaza, nunca se sugiere una ruta que no exista. Los contenedores vacíos (por ejemplo, `te list Hierarchies` en un modelo sin jerarquías) muestran un simple mensaje de "no hay nada aquí" en lugar de un error. ## Alias de comandos @@ -151,7 +151,7 @@ Estas opciones están disponibles en todos los comandos y se pueden usar antes o | `-m, --model ` | Ruta al modelo semántico (carpeta TMDL, archivo `.bim`, carpeta `Database.json` o carpeta `.SemanticModel`). | | `-s, --server ` | Punto de conexión de Analysis Services o un Workspace de Power BI. Un nombre de servidor/FQDN (`MY.SERVER.COM`), una dirección IP (`192.168.1.1`), `host:port`, `localhost`, `SERVER\INSTANCE`, `asazure://...` o una cadena de conexión de MSOLAP se conecta directamente a Analysis Services/AAS. Un nombre sencillo de un solo token (`MyWorkspace`), una ruta de Fabric `Name.Workspace[/Model.SemanticModel]` o una URL `powerbi://...` apunta a un Workspace de Power BI. Un nombre de Workspace que contiene un punto no se puede distinguir de un nombre de servidor, por lo que se trata como un servidor y la CLI muestra una advertencia; usa su forma `.Workspace` o la URL completa `powerbi://` para dirigirte a Power BI. | | `-d, --database ` | Nombre del modelo semántico en el Workspace. | -| `--local` | Connect to a locally running Analysis Services instance - Power BI Desktop, Visual Studio workspaces, or standalone SSAS (Windows only). | +| `--local` | Conéctate a una instancia de Analysis Services en ejecución en tu equipo: Power BI Desktop, Workspaces de Visual Studio o SSAS independiente (solo Windows). | | `--auth ` | Método de autenticación: `auto`, `interactive`, `spn`, `env`, `managed-identity` (predeterminado: `auto`). | | `--output-format ` | Formato de Stdout: `text` (predeterminado), `json`, `csv`, `tmsl` (alias `bim`), `tmdl`. `csv` se respeta en los comandos que emiten datos tabulares; `tmsl`/`tmdl` solo se respetan en `te get` y `te list` para la serialización de objetos completos. Los comandos rechazan los formatos que no admiten. | | `--error-format ` | Formato de stderr para errores, advertencias y sugerencias: `text` (predeterminado) o `json`. Para cualquier otro valor, se usa `text`. Es independiente de `--output-format`, así que puedes combinar stdout en JSON con errores en texto sin formato (o viceversa). | @@ -163,9 +163,9 @@ Estas opciones están disponibles en todos los comandos y se pueden usar antes o En los comandos que leen un modelo, el orden de resolución es: -`--recent` → `--local` → `--server`/`--database` (remote) → `--model` → active connection from `te connect`. +`--recent` → `--local` → `--server`/`--database` (remoto) → `--model` → conexión activa de `te connect`. -The model is never a positional argument - a stray path on the command line is rejected with an "unrecognized command or argument" error. (Positional arguments on `te connect`, `te init`, `te diff`, and `te query` are those commands' own subjects, not the model.) +El modelo nunca es un argumento posicional: una ruta suelta en la línea de comandos se rechaza con un error de "unrecognized command or argument". (Los argumentos posicionales de `te connect`, `te init`, `te diff` y `te query` corresponden a esos comandos, no al modelo.) > [!NOTE] > **Las opciones mal escritas se rechazan de entrada.** Si pasas un `--flag` que no se reconoce en el comando que invocaste, la CLI finaliza con un error claro en lugar de interpretarlo silenciosamente como un argumento posicional. Esto detecta errores tipográficos como, por ejemplo, que `--force ` se convierta accidentalmente en `--forec` en scripts de CI. @@ -173,16 +173,16 @@ The model is never a positional argument - a stray path on the command line is r > [!NOTE] > **Nombres de servidor con puntos.** `-s`/`--server` trata un nombre con puntos (por ejemplo, `Sales.2026`) como el nombre de host de un servidor de Analysis Services, no como un Workspace de Power BI. Se muestra una advertencia cuando la CLI tiene que hacer esta interpretación, con una sugerencia para agregar `.Workspace` (por ejemplo, `Sales.2026.Workspace`) o usar una URL `powerbi://` completa si en realidad te referías al Workspace de Power BI. Se aplica a `te connect`, `te deploy`, `te refresh`, `te query`, `te vertipaq` y `te test run`. -## Model initialization and save +## Inicialización y guardado del modelo ### save-as -Re-serialize a model to a different format or location. Úsalo para escribir en archivos locales un modelo de un Workspace remoto, convertir formatos o guardar de nuevo las ediciones en el origen. (Alias: `save`.) +Re-serializa un modelo en un formato o una ubicación diferentes. Úsalo para escribir en archivos locales un modelo de un Workspace remoto, convertir formatos o guardar de nuevo las ediciones en el origen. (Alias: `save`.) -`te save-as` accepts: +`te save-as` acepta: -- `-o, --output-path ` - archivo o carpeta de destino. **Optional** - when omitted, `te save-as` writes back to the source location, preserving the original format. -- `--serialization ` - `tmdl`, `bim` (alias `tmsl`), `Database.json`, `pbip`. When omitted, the format is the loaded model's format; with `-o`, it is inferred from the output path (`.bim` writes a single-file BIM, `.json` a `database.json` folder). +- `-o, --output-path ` - archivo o carpeta de destino. **Opcional** - si se omite, `te save-as` vuelve a escribir en la ubicación de origen y conserva el formato original. +- `--serialization ` - `tmdl`, `bim` (alias `tmsl`), `Database.json`, `pbip`. Si se omite, el formato es el del modelo cargado; con `-o`, se infiere a partir de la ruta de salida (`.bim` escribe un BIM de un solo archivo y `.json`, una carpeta `Database.json`). - `--force` - omite la validación y sobrescribe la salida existente. Algunos rechazos (contenedores ambiguos, raíces de proyecto con varios `SemanticModel`) siguen ocurriendo incluso con `--force`. - `--skip-bpa` - omite por completo el control de BPA. - `--fix-bpa` - corrige automáticamente las infracciones de BPA cuando las reglas definen una expresión de corrección. @@ -197,22 +197,22 @@ te save-as -o ./project --serialization pbip # Save as a PBIP project te save-as -o ./out -s my-workspace -d my-model --skip-validation # Fast download ``` -`--serialization pbip` output opens directly in Power BI Desktop and is named after the source model (`SpaceParts.pbip`, not `Model.pbip`). Saving into a folder that already holds a project adds only the files that are missing and leaves everything already there - the report's pages, theme, connection, and item identity - exactly as it was, so a save that changes nothing leaves the project unchanged under source control. +La salida de `--serialization pbip` se abre directamente en Power BI Desktop y toma el nombre del modelo de origen (`SpaceParts.pbip`, no `Model.pbip`). Guardar en una carpeta que ya contiene un proyecto agrega solo los archivos que faltan y deja intacto todo lo que ya está allí —las páginas del Report, el tema, la conexión y la identidad del elemento— exactamente como estaba, de modo que un guardado que no cambia nada deja el proyecto sin cambios en el control de código fuente. -Validation guards saving: a model with a name collision Analysis Services would refuse (`TE0012` / `TE0013`, see [validate](#validate)) is not written unless `--force` or `--skip-validation` is passed. +La validación impide el guardado: un modelo con una colisión de nombres que Analysis Services rechazaría (`TE0012` / `TE0013`, ver [validate](#validate)) no se escribe a menos que se pase `--force` o `--skip-validation`. > [!TIP] -> Use `te save-as -o -s -d ` to download a remote model to disk. Combínalo con `--skip-validation` para obtener el passthrough más rápido cuando solo necesites los bytes (sin análisis semántico de DAX). +> Use `te save-as -o -s -d ` para descargar un modelo remoto en disco. Combínalo con `--skip-validation` para obtener el passthrough más rápido cuando solo necesites los bytes (sin análisis semántico de DAX). ### init -Crea un nuevo modelo semántico vacío en la ruta especificada. Defaults to a TMDL model in `PowerBI` compatibility mode at compatibility level 1705. +Crea un nuevo modelo semántico vacío en la ruta especificada. De forma predeterminada, usa un modelo TMDL en modo de compatibilidad `PowerBI` con nivel de compatibilidad 1705. `te init` acepta: - `` - argumento posicional: directorio donde se creará el modelo (omítelo para usar la ruta global `--model`). - `--compatibility-mode ` - `PowerBI` (predeterminado) o `AnalysisServices`. -- `--compatibility-level ` (alias `--compat`) - nivel de compatibilidad. Defaults to `1705` when the mode is `PowerBI`, `1500` otherwise. Consulta @update-compatibility-level. +- `--compatibility-level ` (alias `--compat`) - nivel de compatibilidad. El valor predeterminado es `1705` cuando el modo es `PowerBI`; en caso contrario, `1500`. Consulta @update-compatibility-level. - `--name ` - nombre del modelo o de la base de datos (predeterminado: el nombre del directorio). - `--serialization ` - `tmdl` (predeterminado), `bim` (alias `tmsl`), `Database.json`, `pbip`. - `--force` - reemplaza cualquier archivo o directorio existente en la ruta de destino. @@ -224,25 +224,25 @@ te init ./as-model --compatibility-mode AnalysisServices # AS model, compat 150 te init ./existing-dir --force # Overwrite non-empty directory ``` -`te init` is idempotent: re-running it over a model it already created prints `Already exists` and exits `0` (under `--output-format json`: `{"created": false, "reason": "already_exists", ...}`). Real conflicts still exit `1`; `--force` re-creates from scratch. +`te init` es idempotente: volver a ejecutarlo sobre un modelo que ya creó muestra `Already exists` y termina con `0` (con `--output-format json`: `{"created": false, "reason": "already_exists", ...}`). Los conflictos reales siguen devolviendo `1`; `--force` lo vuelve a crear desde cero. ## Edición del modelo -Mutating commands (`set`, `add`, `remove`, `move`, and also `script`, `macro run`, `bpa run --fix`) are **dry runs by default**: without `--save` the command reports what would change and discards it (`Dry run - nothing saved. Add --save to persist.`). Add `--save` to persist to the source, or `--save-to ` to write elsewhere. On `set`, `add`, `remove`, `move`, `script`, and `bpa run`, the change output renders as a unified diff per changed object; switch it with `--stat` or `--name-only` (mutually exclusive with `--diff`, the default), or set a standing default with `te config set mutationOutput diff|stat|name-only|none`. JSON output always carries the full changes array. A save is refused when the mutation introduces new DAX validation errors, unless `--force`. +Los comandos que modifican (`set`, `add`, `remove`, `move` y también `script`, `macro run`, `bpa run --fix`) son **ejecuciones de prueba de forma predeterminada**: sin `--save`, el comando informa de lo que cambiaría y lo descarta (`Dry run - nothing saved. Agrega --save para conservar los cambios.`). Agrega `--save` para guardar en la ubicación de origen, o `--save-to ` para escribir en otra ubicación. En `set`, `add`, `remove`, `move`, `script` y `bpa run`, la salida de cambios se muestra como un diff unificado por cada objeto modificado; cámbiala con `--stat` o `--name-only` (mutuamente excluyentes con `--diff`, la opción predeterminada), o establece un valor predeterminado permanente con `te config set mutationOutput diff|stat|name-only|none`. La salida JSON siempre incluye el array completo de cambios. Se rechaza el guardado cuando la modificación introduce nuevos errores de validación de DAX, salvo que se use `--force`. ### set -Set properties on a model object, format its expressions, or sync a table with its source schema. Acepta un argumento ``. +Establece propiedades en un objeto del modelo, da formato a sus expresiones o sincroniza una tabla con su esquema de origen. Acepta un argumento ``. `te set` acepta: -- `-p, --property ` - property assignment (e.g., `-p expression="SUM(Sales[Amt])"`, `-p isHidden=true`). **Repeatable** - everything after the first `=` is the value. Bare positional assignments work too: `te set Sales/Amount formatString="#,0" --save`. Property names are case-insensitive, accept both spellings where the grid label and the TOM name differ (`Hidden` and `IsHidden`), and accept dotted paths and indexers: `-p KPI.StatusGraphic=...`, `-p "Annotations[Tabular Editor]=..."`, `-p "TranslatedNames[fr-FR]=..."`. Run `te get --properties` to list every name an object accepts - see [get](#get). A partition's expression is `-p Expression` whatever kind of partition it is (`MExpression` and `Query` still work). Use `-p Name=-` to read the value from stdin (one assignment per stream; a piped value is taken verbatim, so piping the text `null` stores the word `null`). `-p Name=` assigns an empty string. -- `--unset ` - clear a property; repeatable (`--unset description --unset displayFolder`). `-p Name=null` is the shorthand. Works on every property that can hold nothing - text properties included - and on object-valued ones (`SortByColumn`, `RefreshPolicy`); `-p "Annotations[key]=null"` removes an annotation. Numbers, booleans, and fixed-choice properties cannot be cleared and are refused. -- `--format ` - format that expression property (repeatable; DAX or M is detected from the property). The formatter tweaks `--long` (fewer line breaks) and `--no-space-after-function` require `--format` on a DAX property. `--semicolons` is refused together with `--format`: an expression stored in a model is always comma-separated, so the semicolon dialect can never parse it - format semicolon-authored DAX with [`te util format-dax --semicolons`](#util-format-dax) instead. -- `--update-schema` - sync a table's columns with its source schema: adds new source columns with detected types, retypes drifted ones, and preserves everything else about every existing column (name, description, format string, display folder, sort-by column, visibility, annotations, translations, perspective membership). Removed source columns only warn unless `--drop-removed-columns` (destructive). A renamed source column looks like remove + add - remap it first with `-p SourceColumn=`. Refused on calculated tables and calculation groups; cannot combine with `-p` or `--format`. With no connection flags, the connection is read from the model itself - the data source the table's partitions are bound to, the connection written into the table's own query, or the model's single usable data source - and the source table from the partition's binding, falling back to the model table's name; `--data-source ` chooses when the model has several usable sources. Naming a connection explicitly with the schema-detection flags shared with `te add` (`--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`) always wins. When no source can be worked out, or the source table cannot be found, the error says which case you are in and names the table it looked for. +- `-p, --property ` - asignación de propiedades (p. ej., `-p expression="SUM(Sales[Amt])"`, `-p isHidden=true`). **Repetible** - todo lo que va después del primer `=` es el valor. Las asignaciones posicionales sin prefijo también funcionan: `te set Sales/Amount formatString="#,0" --save`. Los nombres de las propiedades no distinguen entre mayúsculas y minúsculas, aceptan ambas grafías cuando la etiqueta de la cuadrícula y el nombre de TOM difieren (`Hidden` e `IsHidden`), y aceptan rutas con puntos e indexadores: `-p KPI.StatusGraphic=...`, `-p "Annotations[Tabular Editor]=..."`, `-p "TranslatedNames[fr-FR]=..."`. Ejecuta `te get --properties` para enumerar todos los nombres que acepta un objeto; consulta [get](#get). La expresión de una partición es `-p Expression`, sea cual sea el tipo de partición (`MExpression` y `Query` siguen funcionando). Usa `-p Name=-` para leer el valor desde la entrada estándar, stdin (una asignación por flujo; un valor canalizado se toma literalmente, así que canalizar el texto `null` almacena la palabra `null`). `-p Name=` asigna una cadena vacía. +- `--unset `: limpia el valor de una propiedad; se puede repetir (`--unset description --unset displayFolder`). `-p Name=null` es la forma abreviada. Funciona con cualquier propiedad que pueda quedar sin valor —incluidas las propiedades de texto— y también con las que tienen valores de objeto (`SortByColumn`, `RefreshPolicy`); `-p "Annotations[key]=null"` elimina una anotación. Las propiedades numéricas, booleanas y de opción fija no se pueden limpiar y se rechazan. +- `--format `: da formato a esa propiedad de expresión (se puede repetir; DAX o M se detecta a partir de la propiedad). Las opciones `--long` (menos saltos de línea) y `--no-space-after-function` son ajustes del formateador y requieren usar `--format` con una propiedad DAX. `--semicolons` no se admite junto con `--format`: una expresión almacenada en un modelo siempre va separada por comas, así que la variante con punto y coma nunca podrá analizarla; en su lugar, da formato al DAX escrito con punto y coma con [`te util format-dax --semicolons`](#util-format-dax). +- `--update-schema`: sincroniza las columnas de una tabla con su esquema de origen: añade nuevas columnas del origen con los tipos detectados, corrige el tipo de las que hayan cambiado y conserva todo lo demás de cada columna existente (nombre, descripción, cadena de formato, carpeta de visualización, columna de ordenación, visibilidad, anotaciones, traducciones, pertenencia a perspectivas). Las columnas de origen eliminadas solo generan una advertencia, salvo que uses `--drop-removed-columns` (destructivo). Una columna de origen renombrada parece una eliminación + una adición; remapéala primero con `-p SourceColumn=`. No se admite en tablas calculadas ni grupos de cálculo; no se puede combinar con `-p` ni con `--format`. Si no se especifica ninguna opción de conexión, la conexión se toma del propio modelo: el Data source al que están vinculadas las particiones de la tabla, la conexión escrita en la consulta de la propia tabla o el único Data source utilizable del modelo; y la tabla de origen se toma de la vinculación de la partición, recurriendo al nombre de la tabla del modelo si hace falta. `--data-source ` te permite elegir cuando el modelo tiene varios Data source utilizables. Si nombras una conexión explícitamente con las opciones de detección de esquema compartidas con `te add` (`--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`), eso siempre prevalece. Cuando no se puede determinar ningún origen, o no se puede encontrar la tabla de origen, el error indica cuál de los dos casos se aplica y qué tabla buscó. - `-t, --type ` - desambiguación cuando la misma ruta podría referirse a varios tipos de objeto (`medida`, `Column`, `CalculatedColumn`, `Hierarchy`, `Calendar`, `partición`, `CalculationItem`). - `--save` / `--save-to ` - guarda los cambios. -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the note above). +- `--diff` / `--stat` / `--name-only`: cambian cómo se representa la salida de cambios (consulta la nota anterior). - `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). - `--force` - guarda incluso si la modificación introduce errores de validación de DAX. @@ -257,9 +257,9 @@ te set Sales --update-schema --save # Sync c te set Sales --update-schema --data-source "Sales DW" --save # Pick the data source when the model has several ``` -#### Incremental refresh policies +#### Políticas de actualización incremental -Refresh policies are plain properties on a table's `RefreshPolicy` sub-object, so `te get` and `te set` manage them like anything else. Property names: `Mode`, `RollingWindowPeriods`/`RollingWindowGranularity`, `IncrementalPeriods`/`IncrementalGranularity`, `IncrementalPeriodsOffset`, `SourceExpression`, `PollingExpression` (file input: `-p SourceExpression=- < src.m`). +Las políticas de actualización son propiedades normales del subobjeto `RefreshPolicy` de una tabla, así que `te get` y `te set` las gestionan como cualquier otra propiedad. Nombres de propiedad: `Mode`, `RollingWindowPeriods`/`RollingWindowGranularity`, `IncrementalPeriods`/`IncrementalGranularity`, `IncrementalPeriodsOffset`, `SourceExpression`, `PollingExpression` (entrada desde archivo: `-p SourceExpression=- < src.m`). ```bash te get Sales/RefreshPolicy # Inspect a table's refresh policy @@ -267,39 +267,39 @@ te set Sales/RefreshPolicy -p RollingWindowPeriods=5 -p RollingWindowGranularity te set Sales -p RefreshPolicy=null --save # Remove the policy ``` -The policy is created implicitly on the first `set`. Removing one leaves policy-generated partitions in place, and is refused when they are the table's only partitions. To apply a policy on the server, see [`te refresh --apply-refresh-policy`](#refresh); to apply it metadata-only, use `te script --inline "Model.Tables[\"Sales\"].ApplyRefreshPolicy();" --save`. +La política se crea implícitamente en el primer `set`. Eliminar una política deja las particiones generadas por la política en su sitio y no se permite cuando son las únicas particiones de la tabla. Para aplicar una política en el servidor, consulta [`te refresh --apply-refresh-policy`](#refresh); para aplicarla solo a nivel de metadatos, usa `te script --inline "Model.Tables[\"Sales\"].ApplyRefreshPolicy();" --save`. ### add -Agrega un objeto al modelo. Especifica un `` para el nuevo objeto (el elemento padre ya debe existir; el segmento final es el nuevo nombre) y el tipo mediante `-t` / `--type`. Las relaciones mantienen su sintaxis abreviada (`Sales[Key]->Dim[Key]`). Container-form paths are valid add targets (`Sales/Measures/Margin`, `Sales/Partitions/Q1`, `Sales/Calendars/Fiscal`, `Roles/Admin/TablePermissions/Sales`, `Roles/Admin/Members/user@x.com`) - any path the CLI prints can be fed back to `te add`. +Agrega un objeto al modelo. Especifica un `` para el nuevo objeto (el elemento padre ya debe existir; el segmento final es el nuevo nombre) y el tipo mediante `-t` / `--type`. Las relaciones mantienen su sintaxis abreviada (`Sales[Key]->Dim[Key]`). Las rutas en formato de contenedor son objetivos válidos para `add` (`Sales/Measures/Margin`, `Sales/Partitions/Q1`, `Sales/Calendars/Fiscal`, `Roles/Admin/TablePermissions/Sales`, `Roles/Admin/Members/user@x.com`) - cualquier ruta que muestre la CLI puede volver a pasarse a `te add`. `te add` acepta: -- `-t, --type `: tipo de objeto. Common values: `Table`, `CalculatedTable`, `CalcGroup`, `Measure`, `CalculatedColumn`, `DataColumn`, `Hierarchy`, `Level`, `Calendar`, `CalcItem`, `KPI`, `Partition`, `Expression`, `Function`, `Perspective`, `Culture`, `Role`, `TablePermission`, `Member`. Se admite el autocompletado con la tecla Tab; la lista completa se puede obtener ejecutando `te add --help`. -- `-p, --property ` - property assignment on the new object (repeatable). The expression goes in `-p Expression="..."`, or use `--file`, or `-p Expression=-` to read it from stdin. -- `--file ` - read the expression from a file instead of inline. -- `--mode ` - storage mode for new tables: `import` (default), `directquery` (alias `dq`), `dual`, `directlake` (alias `dl`). +- `-t, --type `: tipo de objeto. Valores habituales: `Table`, `CalculatedTable`, `CalcGroup`, `medida`, `CalculatedColumn`, `DataColumn`, `Hierarchy`, `Level`, `Calendar`, `CalcItem`, `KPI`, `partición`, `Expression`, `Function`, `perspectiva`, `Culture`, `rol`, `TablePermission`, `Member`. Se admite el autocompletado con la tecla Tab; la lista completa se puede obtener ejecutando `te add --help`. +- `-p, --property ` - asignación de propiedades al nuevo objeto (repetible). La expresión va en `-p Expression="..."`, o usa `--file`, o `-p Expression=-` para leerla desde stdin. +- `--file ` - lee la expresión de un archivo en lugar de incluirla en línea. +- `--mode ` - modo de almacenamiento para tablas nuevas: `import` (predeterminado), `directquery` (alias `dq`), `dual`, `directlake` (alias `dl`). - `--if-not-exists` - sale con código `0` sin error si el objeto ya existe. Úsalo en canalizaciones de CI/CD idempotentes. - `--save` / `--save-to ` - guarda los cambios. -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). -- `--serialization ` - override the serialization when saving (`tmdl`, `bim` (alias `tmsl`), `database.json`, `pbip`). -- `--source-type ` - tipo de origen inicial de la partición en una tabla nueva: `m`, `query` o `calculated`. Anula la detección heurística. `query` builds a legacy SQL `SELECT` partition bound to the model's provider data source and is refused with lakehouse/warehouse sources or when no provider source exists; `calculated` is only valid with `-t CalculatedTable`. -- `--partition-expression ` - raw M expression for the new table's initial partition. +- `--diff` / `--stat` / `--name-only` - formato de la salida de cambios (consulta la nota sobre [edición del modelo](#model-editing)). +- `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`, `pbip`). +- `--source-type ` - tipo de origen inicial de la partición en una tabla nueva: `m`, `query` o `calculated`. Anula la detección heurística. `query` crea una partición heredada de SQL `SELECT`, vinculada al origen de datos del proveedor del modelo, y se rechaza con orígenes Lakehouse/Warehouse o cuando no existe ningún origen de proveedor; `calculated` solo es válido con `-t CalculatedTable`. +- `--partition-expression ` - expresión M sin procesar para la partición inicial de la tabla nueva. - `--force` - guarda incluso si la modificación introduce errores de validación de DAX. -Adding a single data column to an existing table takes `-t DataColumn` with both `SourceColumn` and `DataType` required (refused on calculated tables and calculation groups): +Para agregar una sola columna de datos a una tabla existente se usa `-t DataColumn`, con `SourceColumn` y `DataType` obligatorios (se rechaza en tablas calculadas y grupos de cálculo): ```bash te add Sales/Quantity -t DataColumn -p SourceColumn=Qty -p DataType=Int64 --save ``` -Tables can be created in one shot from the model's **own** data source - no connection flags needed. The CLI reads the connection off the model's data source, discovers the source table's columns and their types, and creates the table with a partition already bound to that source. Over a legacy (provider) data source the partition is a legacy SQL query holding the generated `SELECT`, matching what the desktop **Import Tables** wizard writes; pass `--source-type m` for a Power Query (M) partition instead. Over a structured (Power Query) data source the partition is always M. Refusals are clean and create nothing: several usable data sources and no `--data-source`, no data source the CLI can read (SQL Server, Azure SQL, and Fabric SQL sources are covered), a source whose password the model does not store, or a source table the connection cannot find - the error names the table it looked for and where that name came from. +Las tablas pueden crearse de una sola vez a partir del **propio** Data source del modelo; no hacen falta opciones de conexión. La CLI toma la conexión del Data source del modelo, detecta las columnas de la tabla de origen y sus tipos, y crea la tabla con una partición ya vinculada a ese Data source. Con un Data source heredado (basado en proveedor), la partición es una consulta SQL heredada que contiene el `SELECT` generado, igual que el que genera el asistente de escritorio **Importar tablas**; pasa `--source-type m` para usar en su lugar una partición de Power Query (M). Con un Data source estructurado (Power Query), la partición siempre es M. Los rechazos son claros y no se crea nada: varios Data sources utilizables y sin `--data-source`; ningún Data source que la CLI pueda leer (se admiten orígenes de SQL Server, Azure SQL y Fabric SQL); un Data source cuya contraseña el modelo no almacena; o una tabla de origen que la conexión no puede encontrar. El error indica la tabla que buscó y de dónde salió ese nombre. -- `--source-table ` - create the table from this source table. -- `--query "SELECT ..."` - create the table from a query instead: the query is described against the connection without being run, the new table gets exactly the columns it returns, and the query is kept as the partition's content. Works with an inferred connection and with one named explicitly. `--source-type query` places the SQL in a legacy Query partition bound to the model's legacy data source. Refused together with `--mode directlake` (a Direct Lake partition holds no query), with `--columns`, and with an expression of its own (`-p Expression=` or `--file`). -- `--data-source ""` - disambiguate when the model has several data sources. +- `--source-table ` - crea la tabla a partir de esta tabla de origen. +- `--query "SELECT ..."` - crea la tabla a partir de una consulta: la consulta se analiza sobre la conexión sin ejecutarse, la tabla nueva recibe exactamente las columnas que devuelve y la consulta se conserva como contenido de la partición. Funciona tanto con una conexión inferida como con una indicada explícitamente. `--source-type query` coloca el SQL en una partición Query heredada vinculada al Data source heredado del modelo. Se rechaza si se usa junto con `--mode directlake` (una partición Direct Lake no contiene ninguna consulta), con `--columns` y con una expresión propia (`-p Expression=` o `--file`). +- `--data-source ""` - elimina la ambigüedad cuando el modelo tiene varios Data sources. -Schema detection against an explicit source also works, and always wins over inference: `--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`, or a manual column spec `--columns "Id:Int64,Name:String"`. `te add "
" -t Table` with no source at all still creates an empty table to fill in yourself. +La detección de esquema sobre un origen explícito también funciona, y siempre prevalece sobre la inferencia: `--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`, o una especificación manual de columnas `--columns "Id:Int64,Name:String"`. `te add "
" -t Table` sin ningún origen sigue creando una tabla vacía para que la completes tú mismo. ```bash te add Sales/Revenue -t Measure -p Expression="SUM(Sales[Amount])" --save @@ -324,7 +324,7 @@ Elimina un objeto. De forma predeterminada, comprueba las dependencias para evit - `--if-exists` - sale con código `0` sin error si el objeto no existe. Úsalo en canalizaciones de CI/CD idempotentes. - `--dry-run` - muestra una vista previa de la eliminación sin aplicarla. - `--save` / `--save-to ` - guarda el cambio. -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--diff` / `--stat` / `--name-only` - formato de la salida de cambios (consulta la nota sobre [edición del modelo](#model-editing)). - `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). ```bash @@ -342,11 +342,11 @@ Mueve o renombra un objeto del modelo. Tanto el origen como el destino son argum - `-t, --type ` - desambigua cuando la ruta de origen coincide con varios tipos de objeto (p. ej., una columna y una jerarquía con el mismo nombre). - `--save` / `--save-to ` - guarda el cambio. -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--diff` / `--stat` / `--name-only` - formato de la salida de cambios (consulta la nota sobre [edición del modelo](#model-editing)). - `--serialization ` - sobrescribe la serialización al guardar (`tmdl`, `bim` (alias `tmsl`), `database.json`). - `--force` - guarda incluso si la mutación introduce errores de validación de DAX. -Renaming an object whose name is not yours to set is refused with a non-zero exit code rather than reported as `No changes.` - a relationship (its name always describes the columns it joins), a measure's KPI, a role's table permission. +Se rechaza cambiar el nombre de un objeto cuyo nombre no tienes permiso para establecer, devolviendo un código de salida distinto de cero en lugar de informar `No changes.`: una relación (su nombre siempre describe las columnas que une), el KPI de una medida o el permiso de tabla de un rol. ```bash te move Sales/Revenue Finance/Revenue --save # Move measure to another table @@ -363,7 +363,7 @@ Enumera objetos con una navegación similar a la del sistema de archivos. Acepta `te list` acepta: -- `--type ` - narrow to one object kind (`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`, `calculationitem`, `kpi`, `set`, `function`). Sin ``, esto equivale a escribir la palabra clave del contenedor correspondiente. +- `--type ` - limita a un tipo de objeto (`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`, `calculationitem`, `kpi`, `set`, `function`). Sin ``, esto equivale a escribir la palabra clave del contenedor correspondiente. - `--paths-only` - emite una ruta de objeto por línea, ideal para pasarlo a `xargs`, `te get` o `te set`. - `--no-multiline` - contrae las celdas multilínea (normalmente expresiones DAX o M) a una sola línea y las trunca para que las filas sigan siendo fáciles de recorrer en tablas anchas. Solo afecta a la salida de texto; la salida JSON/CSV/TMSL no se ve afectada. - `--output-format tmsl` (alias `bim`) - genera los objetos coincidentes como un script TMSL/BIM. Útil para `te list Tables --output-format bim > tables.json`. `--output-format tmdl` no es compatible con `ls` (TMDL solo admite un único objeto; usa `te get`). @@ -388,29 +388,29 @@ te list Measures --no-multiline # Wide table with column dividers, s te list Tables --output-format bim > tables.json # All tables emitted as TMSL/BIM ``` -In JSON output, every listed object leads with its `objectPath` - a canonical path that resolves with `te get`. +En la salida JSON, cada objeto listado empieza con su `objectPath`: una ruta canónica que se resuelve con `te get`. ### get -Get properties of a model object, filter and list sets of objects, and analyze dependencies - `get` is the CLI's one read pipeline (`te list` and `te deps` remain as shortcuts). Takes a ``; omit it to list the model (same as `te list`), or pass `.` for the model root. A wildcard path (`te get "Sa*"`) or a container path (`te get Sales/Measures`) lists every match without needing `--ls`; `-p`, `--deps`, and `--properties` need exactly one object, so on a wildcard path they say so and suggest dropping the flag. +Obtén propiedades de un objeto del modelo, filtra y lista conjuntos de objetos, y analiza dependencias: `get` es el único pipeline de lectura de la CLI (`te list` y `te deps` se mantienen como accesos directos). Acepta un ``; omítelo para listar el modelo (igual que `te list`) o pasa `.` para la raíz del modelo. Una ruta con comodines (`te get "Sa*"`) o una ruta de contenedor (`te get Sales/Measures`) lista todas las coincidencias sin necesidad de `--ls`; `-p`, `--deps` y `--properties` requieren exactamente un objeto, así que en una ruta con comodines lo indican y sugieren quitar la opción. `te get` acepta: -- `-p, --property ` - project a single property (e.g. `expression`, `formatString`). -- `--where ` - filter the result set; repeatable (AND), case-insensitive. A value with no `*` is an exact match; `*` is a wildcard, so a contains-search is `--where Name=*margin*`. With no path, `--where` filters the model's **top-level tables** - pass a container to search other kinds (`te get Measures --where Name=*margin*`). An empty result names what was searched and how the pattern was matched, and offers commands that widen the search. -- `--properties` - list the property names `-p` accepts on the resolved object, with each property's type, whether it can be written, what it holds, and - where a property takes a fixed set of values - the values it accepts. Both spellings are shown where they differ (`Hidden` / `IsHidden`), and annotations and translations appear in the bracket form they have to be written in. Internal bookkeeping properties are left out; `--all` adds them. Text and JSON output only; needs a single-object path and cannot combine with `-p`, `--ls`, `--where`, `--deps`, or `--unused`. -- `--ls` - compact table layout (the same rendering as `te list`). -- `--deps [upstream|downstream]` - dependency analysis (default: both directions); `--deep` for the recursive tree, `--max-depth ` (default `10`). -- `--unused` / `--hidden` - surface unused objects, as on `te deps`. -- `--paths-only` - one canonical object path per line, for piping. -- `--no-multiline` - collapse multi-line cells (with `--ls`/`--where`). Solo para la salida de texto. +- `-p, --property ` - proyecta una única propiedad (p. ej., `expression`, `formatString`). +- `--where ` - filtra el conjunto de resultados; se puede repetir (AND), sin distinguir mayúsculas de minúsculas. Un valor sin `*` es una coincidencia exacta; `*` es un comodín, así que para buscar por contenido se usa `--where Name=*margin*`. Sin ruta, `--where` filtra las **tablas de nivel superior** del modelo; pasa un contenedor para buscar otros tipos (`te get Measures --where Name=*margin*`). Un resultado vacío indica qué se buscó y cómo se hizo coincidir el patrón, y ofrece comandos para ampliar la búsqueda. +- `--properties` - lista los nombres de propiedad que `-p` acepta en el objeto resuelto, con el tipo de cada propiedad, si se puede escribir, qué contiene y, cuando una propiedad admite un conjunto fijo de valores, los valores que acepta. Se muestran ambas grafías cuando difieren (`Hidden` / `IsHidden`), y las anotaciones y las traducciones aparecen en el formato entre corchetes en el que deben escribirse. Se omiten las propiedades internas de control; `--all` las agrega. Solo salida de texto y JSON; requiere una ruta de un solo objeto y no se puede combinar con `-p`, `--ls`, `--where`, `--deps` ni `--unused`. +- `--ls` - disposición compacta en tabla (la misma representación que `te list`). +- `--deps [upstream|downstream]` - análisis de dependencias (predeterminado: ambas direcciones); `--deep` para el árbol recursivo, `--max-depth ` (valor predeterminado `10`). +- `--unused` / `--hidden` - muestra los objetos no usados, como en `te deps`. +- `--paths-only` - una ruta canónica de objeto por línea, para usar en canalizaciones. +- `--no-multiline` - contrae las celdas multilínea (con `--ls`/`--where`). Solo para la salida de texto. - `-t, --type ` - desambigua cuando la ruta coincide con varios elementos secundarios de una tabla (p. ej., una columna y una jerarquía con el mismo nombre). Valores: `Measure`, `Column`, `CalculatedColumn`, `Hierarchy`, `Calendar`, `Partition`, `CalculationItem`. - `--output-format tmsl` (alias `bim`) - genera el objeto resuelto como JSON TMSL/BIM. - `--output-format tmdl` - genera el objeto resuelto como TMDL (solo objetos con nombre). `te get` y `te list` comparten un único catálogo de descriptores, de modo que todas las propiedades se muestran igual en todos los formatos: la tabla de texto, JSON y CSV ven el mismo conjunto, y al agregar una propiedad nueva al modelo, esta queda expuesta en todos ellos. -The `Settable:` line under a `te get ` result lists the properties `te set` accepts on that object (`SortByColumn` among them) and ends with a pointer to `--properties` for the full list; an unknown property name on `te get -p` or `te set -p` points at the same listing. `te get -p` syntax-highlights every expression-valued property, detail rows and format string expressions included. In JSON output, a single object leads with `objectPath` (the canonical path, resolvable as-is by `te get`, `te set`, or `te remove`), followed by `type` and `properties`; a listing that matches nothing prints an empty array. +La línea `Settable:` debajo del resultado de `te get ` enumera las propiedades que `te set` acepta en ese objeto (`SortByColumn` entre ellas) y termina con una referencia a `--properties` para la lista completa; un nombre de propiedad desconocido en `te get -p` o `te set -p` remite al mismo listado. `te get -p` resalta la sintaxis de todas las propiedades con valor de expresión, incluidas las filas de detalle y las expresiones de cadena de formato dinámicas. En la salida JSON, un solo objeto empieza con `objectPath` (la ruta canónica, que puede resolverse tal cual con `te get`, `te set` o `te remove`), seguido de `type` y `properties`; un listado que no coincide con nada imprime un array vacío. ```bash te get Sales/Amount -p expression # Print DAX @@ -430,7 +430,7 @@ te get Sales/Revenue --deps downstream --deep # Recursive dependents ### find -Search string properties for text and report each match site. The pattern is a **literal, case-insensitive substring** by default - `te find "Gross*"` looks for a literal asterisk - so pass `--regex` for pattern matching. Use `te get --where Name=*Gross*` when you want to filter objects by a property value rather than search text. An empty result names the scope that was searched and the matching mode used, and offers commands that widen the search; a `--regex` pattern that is not a valid regular expression is refused with an error naming the flag and the pattern. +Busca texto en propiedades de cadena y muestra cada ubicación donde haya una coincidencia. De forma predeterminada, el patrón es una **subcadena literal sin distinción entre mayúsculas y minúsculas**; `te find "Gross*"` busca un asterisco literal, así que pasa `--regex` para la coincidencia de patrones. Usa `te get --where Name=*Gross*` cuando quieras filtrar objetos por el valor de una propiedad en lugar de hacer una búsqueda de texto. Un resultado vacío indica el ámbito en el que se buscó y el modo de coincidencia utilizado, y ofrece comandos para ampliar la búsqueda; si el patrón `--regex` no es una expresión regular válida, se rechaza con un error que indica la opción y el patrón. `te find` acepta: @@ -447,13 +447,13 @@ te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -p expr te find "Gross.*Margin" --in names --regex ``` -Under `--output-format json`, `te find` reports the scope it searched and the matching mode it used alongside the matches. +Con `--output-format json`, `te find` emite un Report del ámbito que buscó y del modo de coincidencia que usó junto con las coincidencias. ### diff Compara dos modelos para detectar diferencias estructurales. Devuelve los siguientes códigos de salida: `0` = idéntico, `1` = diferencias encontradas, `2` = error. -Changes are reported the same way the mutating commands report theirs: one consolidated entry per changed object, with `-`/`+` lines per property in text output. In JSON, the `changes` array entries carry `objectPath` (the canonical path, pipeable into `te get`), `objectType` (the same closed vocabulary as the findings JSON - `KPI`, `Member`, ...), `changeKind` (`created`, `deleted`, `modified`, or `moved` - a renamed object that carries a lineage tag is a single `moved` entry with `movedFromObjectPath`), and a `properties` array of `{property, before, after}` with PascalCase property names. An object that exists in only one of the two models is listed together with its contents - a new role's row-level security filters, a new table's columns, measures, and partitions, a new hierarchy's levels - each as its own entry, and the summary counts include them. +Los cambios se incluyen en el Report del mismo modo que los comandos que realizan modificaciones: una entrada consolidada por cada objeto cambiado, con líneas `-`/`+` por propiedad en la salida de texto. En JSON, las entradas del array `changes` incluyen `objectPath` (la ruta canónica, que puede pasarse por una tubería a `te get`), `objectType` (el mismo vocabulario cerrado que el JSON de hallazgos: `KPI`, `Member`, ...), `changeKind` (`created`, `deleted`, `modified` o `moved`; un objeto renombrado que lleva una etiqueta de linaje es una única entrada `moved` con `movedFromObjectPath`) y un array `properties` de `{property, before, after}` con nombres de propiedad en PascalCase. Un objeto que existe solo en uno de los dos modelos se lista junto con su contenido —los filtros de seguridad a nivel de filas de un rol nuevo, las columnas, medidas y particiones de una tabla nueva, los niveles de una jerarquía nueva—, cada elemento como una entrada independiente, y los recuentos del resumen los incluyen. ```bash te diff ./model-v1 ./model-v2 @@ -468,7 +468,7 @@ te diff ./a ./b; switch ($LASTEXITCODE) { 0 { 'same' } 1 { 'different' } default ### deps -Analiza las dependencias ascendentes y descendentes de un objeto, o detecta objetos sin usar en todo el modelo. A shortcut for `te get --deps` / `te get --unused`. La forma de un solo objeto acepta un ``. +Analiza las dependencias ascendentes y descendentes de un objeto, o detecta objetos sin usar en todo el modelo. Un atajo para `te get --deps` / `te get --unused`. La forma de un solo objeto acepta un ``. `te deps` admite: @@ -480,7 +480,7 @@ Analiza las dependencias ascendentes y descendentes de un objeto, o detecta obje - `--unused` - enumera las medidas, las columnas calculadas y **todas las columnas de datos** a las que no hace referencia ninguna expresión DAX y que no se usan en ninguna relación, nivel de jerarquía, ordenación por columna, variación, base de AlternateOf ni rol de tiempo de calendario. Cada resultado muestra `(hidden)` en modo de texto y un campo `isHidden` en JSON. - `--hidden` - limita `--unused` a solo los objetos ocultos. Los objetos ocultos y sin usar son los candidatos más seguros para eliminar, porque ningún elemento visible para el usuario depende de ellos. -In JSON output, every entry - and every `upstream`, `downstream`, and `--deep` tree node - is named the way the rest of the CLI names objects: `objectPath` (canonical path, pipeable into `te get`), `object` (bare name), and `objectType`. +En la salida JSON, cada entrada —y cada nodo de árbol `upstream`, `downstream` y `--deep`— se nombra igual que el resto de la CLI nombra los objetos: `objectPath` (ruta canónica, que se puede canalizar a `te get`), `object` (nombre simple) y `objectType`. ```bash te deps Sales/Revenue # Upstream + downstream for one object @@ -498,7 +498,7 @@ Valida las expresiones del modelo, la integridad del esquema y los errores de TO `te validate` admite: -- `--ci ` - emit CI annotations to stderr: `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`). `none` or an empty value means no annotations; any other value is rejected before the command runs. +- `--ci ` - emite anotaciones de CI a stderr: `vsts` (alias `azdo`, `azure-devops`) o `github` (alias `gh`). `none` o un valor vacío indican que no hay anotaciones; cualquier otro valor se rechaza antes de ejecutar el comando. - `--trx ` - escribe los resultados en un archivo `.trx` de VSTEST. - `--errors-only` - forma abreviada de `--no-warnings --no-antipatterns`: muestra solo errores. - `--no-warnings` - oculta las advertencias del analizador semántico. @@ -512,9 +512,9 @@ te validate --ci github --trx results.trx te validate --errors-only # Hide warnings and anti-pattern hints ``` -Every finding carries a stable code, shown in the **Code** column of the Errors, Warnings, and Anti-patterns tables as well as in JSON, `--ci` annotations, and `--trx`. Three codes are worth knowing when a hand-written model is involved: `TE0012` (a column and a measure, or two columns, share a name within one table) and `TE0013` (a measure name is repeated across tables) are errors - Analysis Services refuses to load such a model, and `te save-as` refuses to write one unless `--force` or `--skip-validation` is passed; `TE0014` is a warning that a TMDL folder has no `database.tmdl`, so the compatibility level in effect is a substitute for the one the model declared. The folder still loads and `te validate` still exits `0` for `TE0014`; hide it like any other warning with `--no-warnings` or `--errors-only`. +Cada hallazgo lleva un código estable, que se muestra en la columna **Código** de las tablas de Errores, Advertencias y Antipatrones, así como en JSON, en las anotaciones `--ci` y en `--trx`. Hay tres códigos que conviene conocer cuando se trabaja con un modelo escrito a mano: `TE0012` (una columna y una medida, o dos columnas, comparten nombre dentro de una misma tabla) y `TE0013` (el nombre de una medida se repite entre tablas) son errores: Analysis Services se niega a cargar ese modelo y `te save-as` se niega a escribirlo, salvo que se pase `--force` o `--skip-validation`; `TE0014` es una advertencia de que una carpeta TMDL no tiene `database.tmdl`, de modo que el nivel de compatibilidad en vigor sustituye al que declaró el modelo. La carpeta sigue cargándose y `te validate` sigue terminando con `0` para `TE0014`; oculta esta advertencia como cualquier otra con `--no-warnings` o `--errors-only`. -Under `--output-format json`, `te validate` emits the shared findings JSON document (`summary` plus a flat `findings[]` array) shared with `te bpa run`, `te test run`, and `te query` - see @te-cli-findings. +Con `--output-format json`, `te validate` emite el documento JSON compartido de hallazgos (`summary` más una matriz plana `findings[]`), el mismo que usan `te bpa run`, `te test run` y `te query`; consulta @te-cli-findings. > [!NOTE] > `te validate` no admite `--output-format csv`: CSV se rechaza desde el principio con un error claro, en lugar de producir un resultado parcial. Usa `text` o `json` para la salida de validación. @@ -535,10 +535,10 @@ Ejecuta reglas de Best Practice Analyzer contra un modelo. - `--fix` - aplicar expresiones de corrección para corregir automáticamente las infracciones cuando sea posible. - `--save` - volver a guardar el modelo en el origen después de aplicar las correcciones. - `--save-to ` - guardar el modelo en una ruta diferente después de aplicar las correcciones. -- `--diff` / `--stat` / `--name-only` - change-output rendering for the fix pass (see the [Model editing](#model-editing) note). +- `--diff` / `--stat` / `--name-only` - controlan cómo se representa la salida de cambios en la pasada de corrección (consulta la nota [Edición del modelo](#model-editing)). - `--serialization ` - serialización del modelo: `tmdl`, `bim` (alias `tmsl`), `database.json`. - `--fail-on ` - umbral de fallo: `error` (predeterminado) o `warning`. Sale con el código `1` cuando las infracciones alcanzan el umbral. Los errores al cargar o evaluar reglas (expresiones no válidas, archivos de reglas ilegibles) también provocan un código de salida distinto de cero, independientemente de `--fail-on`. -- `--ci ` - emit CI logging commands to stderr: `vsts` (Azure DevOps; aliases `azdo`, `azure-devops`), `github` (GitHub Actions; alias `gh`). Unrecognised values are rejected up front. +- `--ci ` - emite comandos de registro de CI a stderr: `vsts` (Azure DevOps; alias `azdo`, `azure-devops`), `github` (GitHub Actions; alias `gh`). Los valores no reconocidos se rechazan de entrada. - `--trx ` - escribir los resultados como un archivo `.trx` de VSTEST en la PATH especificada. - `--no-multiline` - contraer el contenido de varias líneas de las celdas de la tabla de infracciones en una sola línea. Solo para la salida de texto. @@ -551,7 +551,7 @@ te bpa run --path 'Sa*' # Wildcard - every table starting with Sa te bpa run --path Sales/Measures # Path filter applied to the matched tables ``` -Under `--output-format json`, `te bpa run` emits the shared findings JSON document (see @te-cli-findings); with `--fix`, the JSON is a single document that also includes the `fix` change set. +Con `--output-format json`, `te bpa run` emite el documento JSON compartido de hallazgos (consulta @te-cli-findings); con `--fix`, el JSON es un único documento que también incluye el conjunto de cambios `fix`. #### Orígenes de las reglas y su resolución @@ -564,9 +564,9 @@ Cada invocación de `te bpa run` reúne reglas de tres capas independientes: 2. **Reglas integradas predeterminadas** - se cargan a menos que se pase `--no-defaults` o que [`bpa.builtInRules`](xref:te-cli-config#built-in-bpa-rules) sea `false` en la configuración. Se omiten las reglas integradas individuales incluidas en `bpa.disabledBuiltInRuleIds`. 3. **Reglas integradas en el modelo** - reglas en la anotación `BestPracticeAnalyzer_Rules` del modelo; se cargan a menos que se pase `--no-model-rules`. Se omiten las anotaciones de URL externas, a menos que también pases `--allow-external-rules`. -The built-in defaults are exactly Tabular Editor 3's documented [built-in rule set](xref:built-in-bpa-rules) (the `TE3_BUILT_IN_*` IDs), so `te bpa run` and TE3 Desktop agree on what the built-ins flag. The six VertiPaq Analyzer rules (`VPA_*`) that earlier previews presented as built-in are not part of that set, and the `--vpa-rules` flag no longer exists; if a pipeline gates on one of them, copy its definition into your own rules file and point at it with `--rules`, `bpa.rules`, or `TE_BPA_RULES`. `--vpax` is unchanged and still supplies the statistics a VPA-aware rule of your own reads. C# scripts (`te script`, `te macro run`) see the same rule set through `Bpa.Rules` and `Bpa.Analyze()`. +Los valores predeterminados integrados son exactamente el [conjunto de reglas integrado](xref:built-in-bpa-rules) documentado de Tabular Editor 3 (los identificadores `TE3_BUILT_IN_*`), por lo que `te bpa run` y TE3 Desktop coinciden en lo que marcan las reglas integradas. Las seis reglas del Analizador VertiPaq (`VPA_*`) que las versiones preliminares anteriores presentaban como integradas no forman parte de ese conjunto, y la opción `--vpa-rules` ya no existe; si una canalización depende de alguna de ellas para bloquearse, copia su definición en tu propio archivo de reglas y haz referencia a él con `--rules`, `bpa.rules` o `TE_BPA_RULES`. `--vpax` no cambia y sigue proporcionando las estadísticas que lee una regla propia compatible con VPA. Los C# Scripts y las macros (`te script`, `te macro run`) ven el mismo conjunto de reglas a través de `Bpa.Rules` y `Bpa.Analyze()`. -Each rule ID is evaluated once. When the same ID appears in more than one layer, an explicit `--rules` file's definition wins in `te bpa run`, while the built-in definition wins in the deploy/save gates. Después se eliminan los ID de reglas de la anotación `BestPracticeAnalyzer_IgnoreRules` del modelo. +Cada identificador de regla se evalúa una vez. Cuando el mismo ID aparece en más de una capa, en `te bpa run` prevalece la definición de un archivo `--rules` explícito, mientras que en los controles de implementación y guardado prevalece la definición integrada. Después se eliminan los ID de reglas de la anotación `BestPracticeAnalyzer_IgnoreRules` del modelo. La línea `Rules loaded:` de la salida atribuye cada capa que contribuye, por ejemplo: @@ -654,7 +654,7 @@ Modifica el archivo de reglas (`add`, `set`, `remove` (alias `rm`)) o la lista d - `--severity <1|2|3>` - `1` (información), `2` (advertencia, valor predeterminado), `3` (error). - `--description ` - descripción orientada al usuario que se muestra cuando se activa la regla. - `--fix-expression ` - expresión de Dynamic LINQ que utiliza `te bpa run --fix` para corregir automáticamente. -- `te bpa rules set ` - actualiza las propiedades de una regla existente. Uses `-p, --property ` (repeatable; `-` reads the value from stdin). Nombres de propiedades: `name`, `expression`, `scope`, `category`, `severity`, `description`, `fixExpression`. +- `te bpa rules set ` - actualiza las propiedades de una regla existente. Usa `-p, --property ` (se puede repetir; `-` lee el valor desde stdin). Nombres de propiedades: `name`, `expression`, `scope`, `category`, `severity`, `description`, `fixExpression`. - `te bpa rules remove ` - elimina una regla. - `te bpa rules ignore ` - añade un ID de regla a la anotación `BestPracticeAnalyzer_IgnoreRules` del modelo. - `te bpa rules unignore ` - elimina un ID de regla de la lista de reglas ignoradas del modelo. @@ -717,15 +717,15 @@ te vertipaq --export stats.vpax te vertipaq --import stats.vpax # Analyze offline ``` -### Formatting expressions +### Formato de expresiones -Expression formatting lives in three places, depending on what you are formatting: +El formato de expresiones está en tres lugares, según lo que estés formateando: -- **An expression in the model**: `te set --format --save` - see [set](#set). -- **A loose expression** (not in any model): `te util format-dax` / `te util format-m` - see [Utilities](#utilities). -- **A whole-model sweep**: `te script --inline "Model.AllMeasures.FormatDax();" --save`. +- **Una expresión del modelo**: `te set --format --save` - consulta [set](#set). +- **Una expresión independiente** (que no está en ningún modelo): `te util format-dax` / `te util format-m` - consulta [Utilidades](#utilities). +- **Un barrido de todas las medidas del modelo**: `te script --inline "Model.AllMeasures.FormatDax();" --save`. -DAX in a model is always comma-separated, so `--semicolons` exists only on `te util format-dax`, for DAX you have typed with semicolons yourself. +El DAX en un modelo siempre va separado por comas, así que `--semicolons` solo existe en `te util format-dax`, para el DAX que hayas escrito tú mismo con punto y coma. ## Ejecución @@ -736,7 +736,7 @@ Ejecuta una consulta DAX contra un modelo implementado. `te query` admite: - `` - argumento posicional: la consulta DAX que se va a ejecutar. Equivale a pasar `-q`. Utiliza la forma que se lea mejor; el `-q` explícito tiene prioridad si se proporcionan ambas. -- `-q, --query ` - consulta en línea (variante con opción con nombre del argumento posicional anterior). `-q -` reads the query from stdin; with input piped and no query given at all, stdin is read implicitly. +- `-q, --query ` - consulta en línea (variante con opción con nombre del argumento posicional anterior). `-q -` lee la consulta desde stdin; si hay entrada redirigida y no se proporciona ninguna consulta, stdin se lee implícitamente. - `--file ` - consulta desde un archivo. - `--limit ` - valor predeterminado: 100. - `-o, --output-file ` - escribe los resultados en un archivo (`.csv`, `.tsv`, `.json`, `.dax`). @@ -755,14 +755,14 @@ Ejecuta uno o varios C# Scripts contra un modelo semántico. La CLI usa el mismo `te script` admite: -- `--file ` - `.cs` / `.csx` file (repeatable). Bare positional `.cs`/`.csx` arguments are also accepted. -- `--inline ` - inline C# (repeatable; use `-` for stdin). -- `--validate` - compile the script(s) and report errors without executing them. Needs no model at all, so it works offline as a CI lint. +- `--file ` - archivo `.cs` / `.csx` (repetible). También se aceptan argumentos posicionales `.cs`/`.csx` sin prefijo. +- `--inline ` - C# en línea (repetible; usa `-` para stdin). +- `--validate` - compila el/los script(s) e informa de los errores sin ejecutarlos. No necesita ningún modelo, así que funciona sin conexión como linter de CI. - `--save` / `--save-to` / `--serialization`. -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). -- `--force` - save even if the mutation introduces DAX validation errors. +- `--diff` / `--stat` / `--name-only` - representación de la salida de cambios (consulta la nota [Edición del modelo](#model-editing)). +- `--force` - guarda incluso si la mutación introduce errores de validación de DAX. -Files and inline snippets run in the order they are written on the command line. +Los archivos y los fragmentos en línea se ejecutan en el orden en que se escriben en la línea de comandos. ```bash te script --file fix.cs --save @@ -772,7 +772,7 @@ echo "Info(Model.Name);" | te script --inline - te script --file fix.cs --validate # Compile-only, no model needed ``` -A run in which any script calls `Error(...)` exits non-zero, reports `"success": false` in JSON, and closes by saying the run completed with errors; changes the script already made are still saved when `--save` is given. `Warning(...)` and `Info(...)` never fail a run. On Windows, the `DisableCSharpScripts` administrator policy refuses `te script` outright - see [Administrator policies](xref:te-cli-config#administrator-policies). +Una ejecución en la que cualquier script llama a `Error(...)` finaliza con un código distinto de cero, indica `"success": false` en JSON y termina indicando que la ejecución se completó con errores; los cambios que el script ya haya hecho se siguen guardando cuando se usa `--save`. `Warning(...)` e `Info(...)` nunca hacen que falle una ejecución. En Windows, la directiva administrativa `DisableCSharpScripts` rechaza `te script` de plano; consulta [Directivas de administrador](xref:te-cli-config#administrator-policies). > [!IMPORTANT] > Dos detalles de comportamiento que conviene conocer si vas a portar un script antiguo: @@ -804,7 +804,7 @@ A run in which any script calls `Error(...)` exits non-zero, reports `"success": ### macro -Administra y ejecuta macros desde un archivo JSON de macros (normalmente `MacroActions.json`). El archivo de macros se determina en este orden: `--macros ` → la variable de entorno `TE_MACROS_PATH` → `macros` en la configuración de la CLI → `./MacroActions.json`. On Windows, the `DisableMacros` administrator policy refuses every `te macro` command - see [Administrator policies](xref:te-cli-config#administrator-policies). +Administra y ejecuta macros desde un archivo JSON de macros (normalmente `MacroActions.json`). El archivo de macros se determina en este orden: `--macros ` → la variable de entorno `TE_MACROS_PATH` → `macros` en la configuración de la CLI → `./MacroActions.json`. En Windows, la directiva administrativa `DisableMacros` rechaza todos los comandos `te macro`; consulta [Directivas de administrador](xref:te-cli-config#administrator-policies). Subcomandos: @@ -823,7 +823,7 @@ Subcomandos: Modifica el archivo de macros (`add`, `set`, `remove` (alias `rm`)). Los tres operan sobre `--macros ` (o el archivo de macros resultante). - `te macro add ` - crea una nueva macro. Indica el cuerpo del script mediante `-e ""` (en línea) o `-s ` (archivo de script). Opcional: `--tooltip `, `--contexts ` (donde se aplica la macro; por ejemplo, `Table,Medida`), `--enabled true|false`. -- `te macro set `: actualiza las propiedades de la macro. Use `-p, --property ` (repeatable; `-` reads the value from stdin). Nombres de las propiedades: `name`, `execute`, `enabled`, `tooltip`, `validContexts`. +- `te macro set `: actualiza las propiedades de la macro. Usa `-p, --property ` (se puede repetir; `-` lee el valor desde stdin). Nombres de las propiedades: `name`, `execute`, `enabled`, `tooltip`, `validContexts`. - `te macro remove `: elimina una macro. ```bash @@ -854,8 +854,8 @@ Ejecuta una macro. Las macros que emiten tablas mediante `dataTable.Output()` mu `te macro run` acepta: - `--on ` - establece el contexto de selección de la macro en un único objeto con nombre (una tabla, una medida, una columna, …). Equivale a hacer clic con el botón derecho en ese objeto en TE3 e invocar la macro desde el menú contextual. -- `--save` / `--save-to` - guarda cualquier cambio que realice la macro. Like every mutating command, `te macro run` is a dry run without `--save`. -- `--serialization ` / `--force` - as on the other mutating commands. +- `--save` / `--save-to` - guarda cualquier cambio que realice la macro. Como todos los comandos que modifican el estado, `te macro run` realiza una simulación si no se usa `--save`. +- `--serialization ` / `--force` - igual que en los demás comandos que modifican el estado. ```bash te macro run "Hide all measures" @@ -869,13 +869,13 @@ te macro run "Format DAX" --on "'Net Sales'[Sales Amount]" --save # DAX form w Implementa un modelo semántico en Power BI, Fabric, Azure Analysis Services o en SQL Server Analysis Services en local. -**Dry run by default**: `te deploy` connects read-only and prints the exact TMSL it would send to stdout. Add `--execute` to actually deploy. +**Simulación por defecto**: `te deploy` se conecta en modo de solo lectura e imprime en stdout el TMSL exacto que enviaría. Añade `--execute` para realizar el despliegue. `te deploy` acepta: -- `-s, --server` / `-d, --database` - the model **source**, exactly as on every other command. -- `--target-server ` / `--target-database ` - the deploy **destination**: a workspace name, endpoint, or server, and the semantic model name to create or overwrite. Un nombre de servidor, FQDN, dirección IP o una cadena de conexión de MSOLAP implementa en Analysis Services (autenticación integrada de Windows para entornos locales); un nombre de Workspace o una URL `powerbi://...` implementa en Power BI. For local model sources, the target falls back to the active `te connect` connection; when the source is remote, the target flags are required. Deploying a model onto itself is refused. -- `--execute` - actually deploy. In interactive mode this shows a summary + confirmation prompt with **`n` as the safe default**; `--execute --force` skips the prompt (required in CI, where a prompt without `--force` is an error). +- `-s, --server` / `-d, --database` - el **origen** del modelo, exactamente igual que en cualquier otro comando. +- `--target-server ` / `--target-database ` - el **destino** del despliegue: el nombre de un Workspace, un endpoint o un servidor, y el nombre del modelo semántico que se va a crear o sobrescribir. Un nombre de servidor, FQDN, dirección IP o una cadena de conexión de MSOLAP implementa en Analysis Services (autenticación integrada de Windows para entornos locales); un nombre de Workspace o una URL `powerbi://...` implementa en Power BI. Si el origen del modelo es local, el destino usa como valor predeterminado la conexión activa de `te connect`; cuando el origen es remoto, las opciones de destino son obligatorias. No se permite desplegar un modelo sobre sí mismo. +- `--execute` - hace el despliegue de verdad. En modo interactivo, esto muestra un resumen y pide confirmación, con **`n` como opción segura predeterminada**; `--execute --force` omite el aviso (obligatorio en CI, donde un aviso sin `--force` es un error). - `--deploy-full` - sobrescribir + conexiones + particiones + expresiones compartidas + roles + miembros de roles. - `--deploy-connections` - `--deploy-partitions` @@ -887,11 +887,11 @@ Implementa un modelo semántico en Power BI, Fabric, Azure Analysis Services o e - `--skip-bpa` - omite por completo el control de BPA. - `--fix-bpa` - corrige automáticamente las infracciones de BPA cuando las reglas definan una expresión de corrección. - `--bpa-rules ` - se puede repetir; anula `bpa.rules` de la configuración de tu CLI solo para este despliegue. Las reglas integradas siguen aplicándose a menos que `bpa.builtInRules` sea `false`. -- `--force` - skip the interactive confirmation. -- `--ci ` - `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`); unrecognised values are rejected up front. +- `--force` - omite la confirmación interactiva. +- `--ci ` - `vsts` (alias `azdo`, `azure-devops`) o `github` (alias `gh`); los valores no reconocidos se rechazan de entrada. - `-p, --profile ` - uso puntual de un perfil de @te-cli-auth guardado. -`--output-format bim|tmdl` is rejected on deploy. To capture the deployment script for review, redirect the dry-run output: `te deploy ... > deploy.tmsl`. +`--output-format bim|tmdl` no se admite con `te deploy`. Para capturar el script de despliegue y revisarlo, redirige la salida de la simulación: `te deploy ... > deploy.tmsl`. ```bash te deploy -m ./model --target-server my-workspace --target-database my-model --execute --force --ci github @@ -904,30 +904,30 @@ te deploy --local --target-server my-workspace --target-database my-model --exec > [!IMPORTANT] > `te deploy` ejecuta el Best Practice Analyzer como control previo antes de realizar el despliegue. Consulta @te-cli-config para la configuración del control de BPA. -A deploy **fails** when the server reports errors on one or more objects, even though the metadata has been written: the exit code is non-zero, JSON reports `"success": false` with the reason in `error`, the headline says the deploy landed with errors, and `--ci` reports the object errors as errors. Unprocessed objects are not a failure - a metadata-only deploy legitimately leaves objects holding no data. The workspace mirror set up with `te connect -w` applies the same rule. +Un despliegue **falla** cuando el servidor informa de errores en uno o más objetos, aunque se hayan escrito los metadatos: el código de salida no es cero, el JSON indica `"success": false` con el motivo en `error`, el encabezado indica que el despliegue terminó con errores y `--ci` reporta los errores de los objetos como errores. Los objetos sin procesar no constituyen un fallo: un despliegue solo de metadatos puede dejar legítimamente objetos sin datos. La réplica del Workspace configurada con `te connect -w` aplica la misma regla. > [!NOTE] -> Cuando se establece `--output-format json`, la carga JSON de `te deploy` siempre incluye los valores resueltos de `server` y `database`, incluso cuando se han resuelto a partir de la conexión activa o de un perfil, en lugar de pasarse explícitamente. Las canalizaciones pueden usar estos campos para confirmar el destino del despliegue sin volver a analizar la línea de comandos. `te deploy` also exits non-zero on failure under `--output-format json`, matching its text-mode behavior - the JSON payload is the failure record, not a success signal. +> Cuando se establece `--output-format json`, la carga JSON de `te deploy` siempre incluye los valores resueltos de `server` y `database`, incluso cuando se han resuelto a partir de la conexión activa o de un perfil, en lugar de pasarse explícitamente. Las canalizaciones pueden usar estos campos para confirmar el destino del despliegue sin volver a analizar la línea de comandos. `te deploy` también devuelve un código distinto de cero cuando falla con `--output-format json`, igual que en modo texto: la carga JSON es el registro del fallo, no una señal de éxito. ### refresh Inicia una actualización de datos en un modelo implementado. -**Dry run by default**: `te refresh` prints the TMSL a refresh would send to stdout. Add `--execute` to run it. +**Simulación por defecto**: `te refresh` imprime en stdout el TMSL que enviaría la actualización. Añade `--execute` para ejecutarla. `te refresh` admite: - `--type ` - `full`, `dataonly` (alias `data-only`, `data`), `automatic` (alias `auto`), `calculate` (alias `calc`), `clearvalues` (alias `clear`), `defragment` (alias `defrag`), `add` (predeterminado: `automatic`). - `--table ` - actualiza tabla(s) específicas; se puede repetir. - `--partition ` - actualiza partición(es) específicas. -- `--execute` - actually run the refresh. At a terminal it asks for confirmation with **`n` as the safe default**; add `--force` to skip the question. An unattended run (redirected output, `--output-format json`, or `--non-interactive`) stops with an error unless `--force` is given, so `te refresh --type full --execute --force` is the CI form. -- `--force` - skip the confirmation prompt. -- `--apply-refresh-policy ` - apply incremental refresh policies to determine which partitions are refreshed; pass a table name to scope the refresh to that table. Policies apply by default when the refresh type and scope are compatible, except for models hosted in Power BI Desktop. An explicit value wins (with warnings when it cannot take effect). -- `--effective-date ` - set the effective date used by the refresh policy (ignored, with a warning, when no policy applies). +- `--execute` - ejecuta realmente la actualización. En un terminal pide confirmación, con **`n` como opción segura predeterminada**; añade `--force` para omitir la pregunta. Una ejecución desatendida (salida redirigida, `--output-format json` o `--non-interactive`) se detiene con un error si no se indica `--force`, así que `te refresh --type full --execute --force` es la forma que se usa en CI. +- `--force` - omite el aviso de confirmación. +- `--apply-refresh-policy ` - aplica las políticas de actualización incremental para determinar qué particiones se actualizan; indica el nombre de una tabla para limitar la actualización a esa tabla. Las políticas se aplican de forma predeterminada cuando el tipo y el ámbito de la actualización son compatibles, excepto en los modelos alojados en Power BI Desktop. Un valor explícito prevalece (con advertencias cuando no puede surtir efecto). +- `--effective-date ` - establece la fecha efectiva que usa la política de actualización (se omite, con una advertencia, cuando no se aplica ninguna política). - `--max-parallelism ` - establece el número máximo de particiones que se pueden actualizar en paralelo. Encapsula la actualización en un comando TMSL `sequence`. -- `--no-progress`, `--trace [path]`. `--trace` without `--execute` warns and prints the TMSL. Trace timing comes from the server's clock, the log is kept until the server has finished delivering buffered events, and `te-refresh-*` traces older than an hour that interrupted runs left behind are stopped and dropped at the start of a traced refresh (traces from other tools are never touched). +- `--no-progress`, `--trace [path]`. `--trace` sin `--execute` muestra una advertencia e imprime el TMSL. Las marcas de tiempo de la traza provienen del reloj del servidor; el registro se conserva hasta que el servidor termina de entregar los eventos almacenados en búfer, y las trazas `te-refresh-*` de más de una hora que hayan quedado de ejecuciones interrumpidas se detienen y se descartan al inicio de una actualización con traza (las trazas de otras herramientas nunca se modifican). -Executed refreshes under `--output-format json` always include a `progress` array; with the `vertipaqOnRefresh` config key enabled, a per-table `vertipaq` array (rows, size, columns) is included too - no `--trace` needed. +Las actualizaciones ejecutadas con `--output-format json` siempre incluyen una matriz `progress`; con la clave de configuración `vertipaqOnRefresh` habilitada, también se incluye una matriz `vertipaq` por tabla (filas, tamaño, columnas); no hace falta `--trace`. ```bash te refresh --type full --execute # Full refresh (asks for confirmation at a terminal) @@ -937,7 +937,7 @@ te refresh --type full > refresh.tmsl # Dry run: emit TMSL onl te refresh --apply-refresh-policy Sales --execute # Apply Sales' incremental refresh policy ``` -Incremental refresh policies are authored with [`te set`](#incremental-refresh-policies) on a table's `RefreshPolicy` sub-object. +Las políticas de actualización incremental se definen con [`te set`](#incremental-refresh-policies) en el subobjeto `RefreshPolicy` de una tabla. ## Pruebas @@ -957,7 +957,7 @@ te test run --ci github --trx results.trx te test run --tag revenue ``` -Suites are validated before any connection is made; a suite that fails validation (for example, a missing `query_file`) exits `1` without running anything. Under `--output-format json`, `te test run` emits the shared findings JSON document with test-specific extras (`suites`, `invalidSuites`, `testSummary`) - see @te-cli-findings. +Las suites se validan antes de establecer cualquier conexión; una suite que no supera la validación (por ejemplo, si falta `query_file`) finaliza con `1` sin ejecutar nada. Con `--output-format json`, `te test run` emite el documento JSON compartido de hallazgos con campos adicionales específicos de las pruebas (`suites`, `invalidSuites`, `testSummary`); consulta @te-cli-findings. ### test init / spec / use / list / snapshot / compare @@ -988,7 +988,7 @@ te connect --profile prod # Activate a saved profile te connect --clear # Clear the active connection (and any workspace mirror) ``` -`te connect --local` lists every local Analysis Services instance - Power BI Desktop (Store and installer versions), Visual Studio workspaces, and standalone SSAS - with a two-step prompt (instance, then database) when an instance hosts several databases. Non-interactive mode fails with the candidate list instead of picking silently; narrow it with `te connect --local `. +`te connect --local` enumera todas las instancias locales de Analysis Services: Power BI Desktop (versiones de Store y del instalador), Workspaces de Visual Studio y SSAS independiente; cuando una instancia aloja varias bases de datos, muestra un mensaje en dos pasos (primero la instancia y luego la base de datos). El modo no interactivo falla con la lista de candidatos en lugar de elegir en silencio; acótala con `te connect --local `. #### Modo del área de trabajo (`-w` / `--workspace`) @@ -1019,9 +1019,9 @@ Administra perfiles de conexión con nombre. (`te profile list` tiene como alias ### config list / paths / init / set -View and manage CLI configuration. (`te config list`, alias: `ls`.) Consulta @te-cli-config. +Ver y administrar la configuración de la CLI. (`te config list`, alias: `ls`.) Consulta @te-cli-config. -`te config set` takes a positional `key value` pair or the equivalent `-p key=value`. +`te config set` acepta un par posicional `key value` o el equivalente `-p key=value`. ```bash te config list # Display all settings @@ -1031,17 +1031,17 @@ te config set autoFormat true te config set -p spinner=false # -p form ``` -## Utilities +## Utilidades -Model-free helpers. `te util` subcommands never touch a model - `--model`, `-s`/`-d`, `--local`, `--recent`, and `--auth` are rejected. +Herramientas auxiliares que no requieren modelo. Los subcomandos de `te util` nunca actúan sobre un modelo: `--model`, `-s`/`-d`, `--local`, `--recent` y `--auth` se rechazan. ### util format-dax -Format a loose DAX expression. +Dar formato a una expresión DAX aislada. -- `` - the expression to format; `-` reads it from stdin. -- `--semicolons` - format DAX written with semicolons as list separators (European locale). The flag selects the semicolon dialect for the expression that is read as well as for the output, so it is for DAX you authored with semicolons - comma-separated DAX fails with a syntax error under it. It is accepted only here: `te set --format` refuses it, because an expression stored in a model is always comma-separated. -- `--long` - long format with fewer line breaks. De forma predeterminada se usa el formato corto. +- `` - la expresión que se va a formatear; `-` la lee de stdin. +- `--semicolons` - da formato a DAX escrito con punto y coma como separador de listas (configuración regional europea). La opción selecciona el dialecto con punto y coma tanto para la expresión que se lee como para la salida, así que está pensada para DAX que hayas escrito con punto y coma; el DAX separado por comas da un error de sintaxis si la usas. Solo se acepta aquí: `te set --format` lo rechaza, porque una expresión almacenada en un modelo siempre va separada por comas. +- `--long` - formato largo con menos saltos de línea. De forma predeterminada se usa el formato corto. - `--no-space-after-function` - omite el espacio después de los nombres de función. ```bash @@ -1050,11 +1050,11 @@ cat query.dax | te util format-dax - te util format-dax "CALCULATE(SUM(Sales[Amt]); Sales[Region] = \"EU\")" --semicolons # Semicolon-authored DAX ``` -JSON output carries `success`, `formatted`, and `errors`. For expressions already in the model, use `te set --format ` instead; for a whole-model sweep, `te script --inline "Model.AllMeasures.FormatDax();" --save`. +La salida JSON incluye `success`, `formatted` y `errors`. Para las expresiones que ya estén en el modelo, usa `te set --format `; para un barrido de todas las medidas del modelo, `te script --inline "Model.AllMeasures.FormatDax();" --save`. ### util format-m -Format a loose M/Power Query expression. `-` reads from stdin; no language-specific options. A malformed expression - an unterminated string, for example - is reported as a failure with a non-zero exit code and the original text returned unchanged, never a silently shortened result. +Da formato a una expresión M/Power Query independiente. `-` lee desde stdin; no hay opciones específicas del lenguaje. Una expresión mal formada —por ejemplo, una cadena sin cerrar— se reporta como un fallo con un código de salida distinto de cero y se devuelve el texto original sin cambios; nunca se devuelve en silencio un resultado truncado. ```bash te util format-m "let x = 1 in x" @@ -1094,7 +1094,7 @@ te interactive -s MyWorkspace -d MyModel # Start with a remote model printf "list Measures\nexit\n" | te interactive --model ./model # Pipe commands via stdin ``` -Inside the session, mutating commands stage in memory: `save` (no arguments) commits the staged edits and `revert` discards them, while `save-as` re-serializes to a format or location. Closing a session that still holds staged edits asks for confirmation (or, when nobody can answer, warns and exits non-zero); `exit --force` throws them away deliberately - see @te-cli-interactive. +Dentro de la sesión, los comandos que modifican dejan los cambios en preparación en memoria: `save` (sin argumentos) confirma las ediciones preparadas y `revert` las descarta, mientras que `save-as` vuelve a serializar en un formato o una ubicación. Al cerrar una sesión que aún tiene cambios pendientes, se pide confirmación (o, cuando nadie puede responder, se muestra una advertencia y se sale con un código distinto de cero); `exit --force` los descarta de forma deliberada; consulta @te-cli-interactive. Las comillas y las referencias de estilo DAX funcionan igual que fuera de la sesión - consulta la sección [Rutas de objetos](#object-paths) de arriba y @te-cli-interactive para más detalles sobre la división de argv con reconocimiento de corchetes dentro del REPL. @@ -1137,11 +1137,11 @@ te completion fish ## Códigos de salida -| Código de salida | Significado | -| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `0` | Éxito. | -| `1` | Generic failure (invalid arguments, command failed, validation errors, auth failure, BPA gate failed at severity >= error, a `te script` run in which a script reported an error, a `te deploy` the server accepted with object errors). Para `te diff`: se encontraron diferencias. | -| `2` | Solo en `te diff`: se produjo un error durante la comparación, por lo que se desconoce el estado de las diferencias. | +| Código de salida | Significado | +| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `0` | Éxito. | +| `1` | Error genérico (argumentos no válidos, fallo del comando, errores de validación, error de autenticación, control de BPA fallido con gravedad >= error, una ejecución de `te script` en la que un script reportó un error, un `te deploy` que el servidor aceptó con errores de objeto). Para `te diff`: se encontraron diferencias. | +| `2` | Solo en `te diff`: se produjo un error durante la comparación, por lo que se desconoce el estado de las diferencias. | Para un control detallado en las canalizaciones de CI, combina los códigos de salida con las anotaciones `--ci ` y los archivos de resultados `--trx`; consulta @te-cli-cicd. @@ -1151,5 +1151,5 @@ Para un control detallado en las canalizaciones de CI, combina los códigos de s - @te-cli-install - instalación y configuración de la CLI. - @te-cli-auth - autenticación y administración de conexiones. - @te-cli-config - archivo de configuración, BPA gate y comportamiento tras la mutación. -- @te-cli-findings - the findings JSON shared by validate, bpa run, test run, and query. +- @te-cli-findings - el JSON de hallazgos compartido por validate, bpa run, test run y query. - @te-cli-migrate - mapeo de opciones TE2 → TE3. From cf9a638eb3ab244710432620ae1878b005b279d1 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:13 +0200 Subject: [PATCH 32/48] New translations te-cli-config.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-config.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-config.md b/localizedContent/es/content/features/te-cli/te-cli-config.md index 59625f10a..1efb2a0e2 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-config.md +++ b/localizedContent/es/content/features/te-cli/te-cli-config.md @@ -19,7 +19,7 @@ applies_to: La CLI de Tabular Editor lee una configuración opcional desde un archivo JSON. La configuración controla tres cosas: -- **File paths** - where the CLI reads macros and BPA rules, and where to write the query log. +- **Rutas de archivo**: dónde lee la CLI las macros y las reglas de BPA, y dónde escribe el registro de consultas. - **Valores predeterminados de comportamiento** — controles de BPA, formato automático y validación. - **Perfiles de conexión guardados** — la lista de perfiles con nombre entre los que puedes alternar. @@ -67,7 +67,7 @@ te config set macros null # Clear a path override te config set -p spinner=false # -p key=value works too ``` -Keys can be passed positionally (`te config set `) or as `-p key=value`. Las claves desconocidas provocan que el comando finalice con el código de salida `1` y un error que enumera las claves válidas. +Las claves pueden pasarse por posición (`te config set `) o como `-p key=value`. Las claves desconocidas provocan que el comando finalice con el código de salida `1` y un error que enumera las claves válidas. Si no existe ningún archivo de configuración, `te config set` crea uno automáticamente en la ruta resuelta (`$TE_CONFIG` si está establecido; de lo contrario, `~/.config/te/config.json`) antes de aplicar el cambio. @@ -144,12 +144,12 @@ Toda la configuración relacionada con BPA está en el objeto `bpa` y se referen | Clave | Predeterminado | Descripción | | ---------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoFormat` | `false` | Automatically format the DAX expressions changed by a mutating command. Formatting is scoped to the objects the command touched but covers every DAX expression property they hold (expressions, format string expressions, detail rows, KPI target/status/trend, calculation group and table permission expressions, etc.). Power Query (M) and SQL partition queries are never reformatted. Always uses the built-in offline formatter in the comma dialect; the `formatOptions` layout keys apply. | -| `validateOnMutation` | `true` | After a mutating command (`add`, `set`, `mv`, `macro run`), check that every `Table[Column]` reference in the model still resolves. Detecta referencias huérfanas introducidas por cambios de nombre o eliminaciones antes de llegar al despliegue. | -| `mutationOutput` | `diff` | How mutating commands (`add`, `set`, `move`, `remove`, `script`, `bpa run --fix`) render the resulting change set in text output: `diff` (full before/after diff), `stat` (per-object change counts), `name-only` (changed object paths), or `none` (suppress the change set; config-only - there is no `--none` flag). The per-command `--diff` / `--stat` / `--name-only` flags override for one invocation. JSON output always carries the full `changes` array regardless. | +| `autoFormat` | `false` | Formatea automáticamente las expresiones DAX modificadas por un comando de modificación. El formato se limita a los objetos que tocó el comando, pero abarca todas las propiedades que contienen expresiones DAX (expresiones, expresiones de cadena de formato dinámica, filas de detalle, objetivo/estado/tendencia de KPI, expresiones de grupos de cálculo y de permisos de tabla, etc.). Las consultas de partición de Power Query (M) y SQL nunca se reformatean. Siempre usa el formateador interno sin conexión con el dialecto de comas; se aplican las claves de diseño de `formatOptions`. | +| `validateOnMutation` | `true` | Después de un comando de modificación (`add`, `set`, `mv`, `macro run`), comprueba que todas las referencias `Table[Column]` del modelo se sigan resolviendo. Detecta referencias huérfanas introducidas por cambios de nombre o eliminaciones antes de llegar al despliegue. | +| `mutationOutput` | `diff` | Cómo presentan los comandos de modificación (`add`, `set`, `move`, `remove`, `script`, `bpa run --fix`) el conjunto de cambios resultante en la salida de texto: `diff` (diff completo de antes/después), `stat` (recuentos de cambios por objeto), `name-only` (rutas de los objetos modificados) o `none` (suprime el conjunto de cambios; solo de configuración: no existe el indicador `--none`). Las opciones `--diff` / `--stat` / `--name-only` de cada comando anulan esta configuración para una sola ejecución. La salida JSON siempre incluye la matriz `changes` completa en cualquier caso. | | `bpa.onMutation` | `false` | Ejecuta un análisis de BPA acotado después de cada comando de modificación (`set`, `add`, `mv`, `rm`, `macro run`). Solo se comprueban los objetos de la tabla afectada, no los de todo el modelo; útil para obtener retroalimentación rápida durante ediciones iterativas. | | `bpa.onDeploy` | `true` | Ejecuta el control de BPA antes de que se ejecute `te deploy`. El despliegue se aborta si se dispara alguna regla con una gravedad >= error. Omítelo en una invocación concreta con `--skip-bpa`, o corrígelo automáticamente con `--fix-bpa`. | -| `bpa.onSave` | `true` | Run the BPA gate before `te save-as` writes to disk. Omítelo en una invocación concreta con `--skip-bpa` o `--force`. | +| `bpa.onSave` | `true` | Ejecuta el control de BPA antes de que `te save-as` escriba en disco. Omítelo en una invocación concreta con `--skip-bpa` o `--force`. | | `bpa.builtInRules` | `true` | Incluye el conjunto depurado de reglas integradas de BPA cada vez que se ejecute el control. Configúralo en `false` para ignorar por completo las reglas integradas; entonces el control ejecutará solo las reglas configuradas mediante `bpa.rules` y cualquier regla incrustada en el modelo. | | `bpa.disabledBuiltInRuleIds` | `null` | ID de reglas integradas individuales que se excluirán de la puerta de calidad. Este valor se modifica mediante `te bpa rules disable ` / `te bpa rules enable `; es preferible usar esos comandos en lugar de editar el arreglo directamente. | | `vertipaqOnRefresh` | `false` | Tras una actualización correcta (`full`, `dataonly`, `automatic` o `add`), ejecuta automáticamente el análisis de VertiPaq para mostrar estadísticas de almacenamiento de las tablas actualizadas. Útil para detectar de inmediato regresiones inesperadas de cardinalidad o memoria. | @@ -166,13 +166,13 @@ te config set bpa.disabledBuiltInRuleIds "TE3_BUILT_IN_DATE_TABLE_EXISTS,TE3_BUI ### Opciones de formato -Applied whenever the CLI formats DAX. The CLI ships a formatter that works fully offline. The layout keys (`shortFormat`, `skipSpaceAfterFunction`) apply when `autoFormat` reformats mutated expressions and when `te query` renders query text; explicit formatting via `te set --format ` and `te util format-dax` takes the equivalent per-invocation flags (`--long`, `--no-space-after-function`) instead. There is deliberately no list-separator key: DAX stored in a model or sent to Analysis Services is always comma-separated, so every config-driven formatting pass uses commas. The one place the semicolon dialect applies is the `--semicolons` flag on `te util format-dax`, for DAX you have typed with semicolons yourself. `formatOptions.useSqlBiDaxFormatter` routes explicit formatting and `te query`'s rendering through the SQL BI [daxformatter.com](https://www.daxformatter.com) web service (requires internet access) if you need that style; `autoFormat` always uses the built-in formatter regardless. +Se aplica cada vez que la CLI formatea DAX. La CLI incluye un formateador que funciona totalmente sin conexión. Las claves de diseño (`shortFormat`, `skipSpaceAfterFunction`) se aplican cuando `autoFormat` reformatea expresiones modificadas y cuando `te query` genera el texto de la consulta; en cambio, el formato explícito mediante `te set --format ` y `te util format-dax` usa las marcas equivalentes por invocación (`--long`, `--no-space-after-function`). No existe deliberadamente ninguna clave de separador de listas: el DAX almacenado en un modelo o enviado a Analysis Services siempre se separa con comas, así que todo formateo controlado por la configuración usa comas. El único caso en que se aplica el dialecto de punto y coma es la opción `--semicolons` de `te util format-dax`, para el DAX que hayas escrito con punto y coma. `formatOptions.useSqlBiDaxFormatter` hace que el formato explícito y la salida de `te query` pasen por el servicio web SQL BI [daxformatter.com](https://www.daxformatter.com) (requiere acceso a Internet) si necesitas ese estilo; `autoFormat` siempre usa el formateador interno, independientemente de ello. -| Clave | Predeterminado | Descripción | -| -------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `formatOptions.shortFormat` | `false` | Prefiere un formato corto, de una sola línea, cuando sea posible, en lugar del diseño predeterminado de varias líneas. | -| `formatOptions.skipSpaceAfterFunction` | `false` | Omite el espacio entre el nombre de una función y su paréntesis de apertura (por ejemplo, `SUM(x)` en lugar de `SUM (x)`). | -| `formatOptions.useSqlBiDaxFormatter` | `false` | Format DAX via the [SQL BI daxformatter.com](https://www.daxformatter.com) web service instead of the built-in formatter. Requiere acceso a Internet. The built-in formatter (default) works offline and matches the Tabular Editor 3 Desktop default. | +| Clave | Predeterminado | Descripción | +| -------------------------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `formatOptions.shortFormat` | `false` | Prefiere un formato corto, de una sola línea, cuando sea posible, en lugar del diseño predeterminado de varias líneas. | +| `formatOptions.skipSpaceAfterFunction` | `false` | Omite el espacio entre el nombre de una función y su paréntesis de apertura (por ejemplo, `SUM(x)` en lugar de `SUM (x)`). | +| `formatOptions.useSqlBiDaxFormatter` | `false` | Formatea DAX con el servicio web [SQL BI daxformatter.com](https://www.daxformatter.com) en lugar del formateador interno. Requiere acceso a Internet. El formateador interno (predeterminado) funciona sin conexión y coincide con la configuración predeterminada de Tabular Editor 3 Desktop. | ### Visualización @@ -188,22 +188,22 @@ Ajustes que controlan la salida del terminal de la CLI y el nivel de detalle de Los perfiles de conexión guardados se almacenan bajo la clave `profiles`. No los edites a mano; usa `te profile set / remove / list`. Consulta @te-cli-auth para la gestión de perfiles. -Los perfiles pueden incluir **anulaciones** que sustituyen los valores predeterminados de comportamiento anteriores siempre que el perfil esté activo. The keys a profile can override are `autoFormat`, `validateOnMutation`, `mutationOutput`, `bpa.onMutation`, `bpa.onDeploy`, `bpa.onSave`, `vertipaqOnRefresh`, `spinner`, and `interactiveEditMode`. Así, un perfil de desarrollo puede relajar la validación y el BPA, mientras que uno de producción los mantiene estrictos: +Los perfiles pueden incluir **anulaciones** que sustituyen los valores predeterminados de comportamiento anteriores siempre que el perfil esté activo. Las claves que un perfil puede sobrescribir son `autoFormat`, `validateOnMutation`, `mutationOutput`, `bpa.onMutation`, `bpa.onDeploy`, `bpa.onSave`, `vertipaqOnRefresh`, `spinner` e `interactiveEditMode`. Así, un perfil de desarrollo puede relajar la validación y el BPA, mientras que uno de producción los mantiene estrictos: ```bash te profile set dev --validate-on-mutation false --bpa-on-deploy false te profile set prod --auto-format true ``` -`te profile set` exposes flags for the common ones (`--auto-format`, `--validate-on-mutation`, `--bpa-on-mutation`, `--bpa-on-deploy`, `--vertipaq-on-refresh`, `--spinner`); each accepts `true`, `false`, or `null` to clear the override. +`te profile set` expone opciones para las más comunes (`--auto-format`, `--validate-on-mutation`, `--bpa-on-mutation`, `--bpa-on-deploy`, `--vertipaq-on-refresh`, `--spinner`); cada una acepta `true`, `false` o `null` para eliminar la anulación. ## Control BPA El control BPA es la red de seguridad que impide que se guarde o se despliegue un modelo con infracciones de reglas. Se ejecuta automáticamente con los siguientes comandos: - `te deploy` ejecuta el control, a menos que se pase `--skip-bpa` o que `bpa.onDeploy` sea `false`. -- `te save-as` runs the gate unless `--skip-bpa` (or `--force`) is passed or `bpa.onSave` is `false`. -- `te add`, `te set`, `te move`, `te remove`, `te macro run` run the gate only when `bpa.onMutation` is `true`. +- `te save-as` ejecuta el control, a menos que se pase `--skip-bpa` (o `--force`) o que `bpa.onSave` sea `false`. +- `te add`, `te set`, `te move`, `te remove`, `te macro run` solo ejecutan la validación cuando `bpa.onMutation` es `true`. El control carga las reglas de BPA desde `bpa.rules` y, de forma predeterminada, el conjunto de reglas integrado (controlado por `bpa.builtInRules`). Las reglas integradas pueden excluirse individualmente mediante `bpa.disabledBuiltInRuleIds`; se administran con `te bpa rules disable ` / `te bpa rules enable `. @@ -211,7 +211,7 @@ Cuando el control se activa y detecta incumplimientos con gravedad >= `error`, e - `--fix-bpa` - aplica en memoria la `fixExpression` de la regla al artefacto que se va a desplegar o guardar; los archivos fuente no se modifican. - `--skip-bpa` - desactiva el control solo para este comando. -- `--bpa-rules ` - repeatable; override `bpa.rules` for this single `te deploy` or `te save-as` invocation. Las reglas integradas siguen aplicándose salvo que `bpa.builtInRules` sea `false`. +- `--bpa-rules ` - repetible; sustituye `bpa.rules` en esta única ejecución de `te deploy` o `te save-as`. Las reglas integradas siguen aplicándose salvo que `bpa.builtInRules` sea `false`. Ejecuta `te bpa run` de forma independiente para previsualizar el comportamiento del control sin desplegar: @@ -228,7 +228,7 @@ Tanto `bpa.builtInRules` como `bpa.disabledBuiltInRuleIds` se aplican de forma c ## Comportamiento tras la mutación -When you run a mutating command (`te add`, `te set`, `te move`, `te macro run`), the CLI performs these checks automatically: +Cuando ejecutas un comando que modifica (`te add`, `te set`, `te move`, `te macro run`), la CLI realiza estas comprobaciones automáticamente: 1. **Los errores de TOM** siempre se muestran. Un DAX o M no válidos en medidas, columnas, particiones o elementos de cálculo siempre hacen que el comando falle. 2. **La validación del esquema** (`validateOnMutation`, valor predeterminado `true`) comprueba que las referencias `Table[Column]` en DAX sigan resolviéndose y verifica la consistencia de los metadatos. @@ -237,18 +237,18 @@ When you run a mutating command (`te add`, `te set`, `te move`, `te macro run`), Deshabilita una comprobación con `te config set false`, o limita esa relajación a un entorno concreto mediante un perfil. -## Administrator policies +## Directivas de administración -On Windows, `te` honors the same administrator policies as Tabular Editor 3. Policies are read from the registry under `Software\Policies\Tabular Editor ApS` - with an optional `TECLI` subkey for values that should apply to the CLI only, and a `TE3` subkey for the desktop - and from the earlier `Software\Policies\Kapacity\Tabular Editor` key, which keeps working unchanged. A machine-wide value (`HKEY_LOCAL_MACHINE`) takes precedence over a per-user one (`HKEY_CURRENT_USER`), and within a hive a product-specific value takes precedence over a shared one. Where a policy turns a feature off, the command names the policy responsible, does nothing, and exits with a failure - so a pipeline that depends on something an administrator has since turned off fails visibly rather than reporting success for work it never did. +En Windows, `te` respeta las mismas directivas de administrador que Tabular Editor 3. Las directivas se leen del registro en `Software\Policies\Tabular Editor ApS`, con una subclave opcional `TECLI` para los valores que deben aplicarse solo a la CLI y una subclave `TE3` para la aplicación de escritorio; y también de la clave anterior `Software\Policies\Kapacity\Tabular Editor`, que sigue funcionando sin cambios. Un valor de ámbito de máquina (`HKEY_LOCAL_MACHINE`) tiene prioridad sobre uno por usuario (`HKEY_CURRENT_USER`), y dentro de una colmena, un valor específico del producto tiene prioridad sobre uno compartido. Cuando una directiva desactiva una función, el comando indica qué directiva es la responsable, no hace nada y finaliza con error, de modo que una canalización que dependa de algo que un administrador haya desactivado más tarde falle de forma visible en lugar de indicar que tuvo éxito con un trabajo que nunca hizo. -| Policy | Effect on the CLI | -| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `DisableCSharpScripts` | Refuses `te script` and the automatic fixes of `te bpa run --fix`. | -| `DisableMacros` | Refuses every `te macro` command. | -| `DisableBpaDownload` | Refuses Best Practice Analyzer rules given as a URL. Rule files on disk and the built-in rules are unaffected. | -| `DisableTelemetry` | Turns anonymous usage statistics off, whatever `disableTelemetry` in config says. | +| Directiva | Efecto en la CLI | +| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `DisableCSharpScripts` | Rechaza `te script` y las correcciones automáticas de `te bpa run --fix`. | +| `DisableMacros` | Rechaza cualquier comando `te macro`. | +| `DisableBpaDownload` | Rechaza las reglas de Best Practice Analyzer indicadas mediante una URL. Los archivos de reglas en disco y las reglas integradas no se ven afectados. | +| `DisableTelemetry` | Desactiva las estadísticas de uso anónimas, independientemente de lo que diga `disableTelemetry` en la configuración. | -Policies that govern features the CLI does not have - update checks, error reports, DAX Optimizer, the DAX Package Manager, the AI assistant, and the MCP server - have no effect on it. See @policies for the full list of policies and how to deploy them. +Las directivas que controlan funciones que la CLI no tiene —la comprobación de actualizaciones, los Reports de errores, el Optimizador de DAX, el Administrador de paquetes de DAX, el asistente de IA y el servidor MCP— no tienen ningún efecto sobre ella. Consulta @policies para ver la lista completa de directivas y cómo implementarlas. ## Variables de entorno @@ -256,7 +256,7 @@ Usa las siguientes variables de entorno específicas de la CLI para PATH, compor | Variable | Propósito | | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `TE_CONFIG` | Ruta de acceso a un archivo de configuración alternativo. Honored by every `te config` operation (`list`, `set`, `init`, `paths`). | +| `TE_CONFIG` | Ruta de acceso a un archivo de configuración alternativo. Se respeta en todas las operaciones de `te config` (`list`, `set`, `init`, `paths`). | | `TE_MACROS_PATH` | Anula la ruta del archivo de macros (segundo en el orden de resolución; ver arriba). La leen los comandos `te macro`. | | `TE_BPA_RULES` | Anula la lista de archivos/URL de reglas de BPA utilizada por los subcomandos `te bpa run` y `te bpa rules`. | | `TE_BPA_CONFIG` | Anula la ruta de acceso a la configuración del gate de BPA (`.te-bpa.json`) que lee el gate de despliegue/guardado. | From 27841b975c6fcacee86d9cc34df342653a0b2a10 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:16 +0200 Subject: [PATCH 33/48] New translations te-cli-limitations.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-limitations.md | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-limitations.md b/localizedContent/es/content/features/te-cli/te-cli-limitations.md index fa6f7b219..7ca6dc0b0 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-limitations.md +++ b/localizedContent/es/content/features/te-cli/te-cli-limitations.md @@ -1,6 +1,6 @@ --- uid: te-cli-limitations -title: Behavior Differences and Known Limitations +title: Diferencias de comportamiento y limitaciones conocidas author: Peer Grønnerup updated: 2026-09-11 applies_to: @@ -13,14 +13,14 @@ applies_to: full: true --- -# Behavior Differences and Known Limitations +# Diferencias de comportamiento y limitaciones conocidas [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -This page collects the places where the Tabular Editor CLI (`te`) behaves differently from Tabular Editor 2 and 3, together with the things it cannot do yet, so you can plan around both and avoid common pitfalls. Se actualiza con cada versión; si encuentras un problema que no figura aquí, abre una incidencia en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI). +Esta página recopila los casos en los que la CLI de Tabular Editor (`te`) se comporta de forma distinta a Tabular Editor 2 y 3, junto con las cosas que todavía no puede hacer, para que puedas planificar teniendo en cuenta ambos aspectos y evitar errores habituales. Se actualiza con cada versión; si encuentras un problema que no figura aquí, abre una incidencia en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI). > [!NOTE] -> Entries are grouped by area. Each one describes the difference or constraint and, where one exists, a workaround or the recommended CLI-friendly alternative. +> Las entradas se agrupan por área. Cada entrada describe la diferencia o restricción y, cuando existe, una solución alternativa o la alternativa recomendada compatible con la CLI. ## Scripts @@ -33,20 +33,20 @@ La CLI ejecuta C# Scripts (`te script`) sobre el mismo objeto `Model` que usas e | **`Selected.` genera un error en tiempo de ejecución** | `Selected.Table`, `Selected.Measure`, `Selected.Column`, `Selected.Hierarchy`, etc. devuelven un error porque requieren exactamente un objeto seleccionado de ese tipo y la selección de la CLI siempre está vacía. Haz referencia al objeto directamente, por ejemplo, `Model.Tables["Sales"]`. | | **`Selected.ActivePerspectives` y `Selected.ActiveCulture`** | Siempre devuelven una colección vacía y `null`, respectivamente. Establece la perspectiva o la configuración regional explícitamente en el script si es necesario. | | **Los cuadros de diálogo `Select` lanzan `NotSupportedException`** | `SelectTable`, `SelectColumn`, `SelectMeasure`, `SelectObject`, `SelectObjects` (y todas las sobrecargas) devuelven el siguiente error: _"Los cuadros de diálogo de selección de objetos … no están disponibles en los scripts de la CLI. Preselecciona el objeto por nombre o ruta antes de ejecutar el script."_ Resuelve los objetivos de antemano a partir de variables de entorno, la configuración o consultando el modelo. | -| **`Info` / `Warning` / `Error` / `Output` escriben en la consola** | Estos siguen funcionando, pero se envían a stdout/stderr en lugar de abrir un cuadro de diálogo. Nunca bloquean ni muestran un aviso para "ignorar más ventanas emergentes". Se pueden usar con seguridad en CI. A script that calls `Error(...)` makes `te script` exit non-zero (changes are still saved with `--save`); `Warning` and `Info` do not. | +| **`Info` / `Warning` / `Error` / `Output` escriben en la consola** | Estos siguen funcionando, pero se envían a stdout/stderr en lugar de abrir un cuadro de diálogo. Nunca bloquean ni muestran un aviso para "ignorar más ventanas emergentes". Se pueden usar con seguridad en CI. Un script que llama a `Error(...)` hace que `te script` finalice con un código distinto de cero (los cambios se siguen guardando con `--save`); `Warning` e `Info` no. | | **`ShowPrompt(...)` siempre devuelve `Cancel`** | No es posible realizar una confirmación interactiva. Decide la respuesta de antemano mediante variables de entorno o configuración. | | **`SuspendWaitForm` / `WaitFormVisible` no hacen nada** | El indicador giratorio de "Please wait" es un elemento de la interfaz de TE3. `WaitFormVisible` es una bandera configurable sin efecto Visual, y `SuspendWaitForm` se ignora silenciosamente; los scripts existentes siguen compilando. | -| **`host.Macro(...)` / `CustomAction(...)` throws an error** | La CLI no carga `%APPDATA%/TabularEditor3/MacroActions.json`, por lo que invocar una macro desde dentro de un script devuelve un error. Inline the macro logic, call the macro's underlying script file directly, or invoke the macro through `te macro run ` with a CLI macros file (`--macros` / `TE_MACROS_PATH` / the `macros` config key). | +| **`host.Macro(...)` / `CustomAction(...)` provocan un error** | La CLI no carga `%APPDATA%/TabularEditor3/MacroActions.json`, por lo que invocar una macro desde dentro de un script devuelve un error. Integra la lógica de la macro, llama directamente al archivo de script subyacente de la macro o invócala mediante `te macro run ` con un archivo de macros para la CLI (`--macros` / `TE_MACROS_PATH` / la clave de configuración `macros`). | | **`table.GetCardinality()` / `column.GetTotalSize()` devuelven 0** | Los auxiliares de cardinalidad de VertiPaq dentro del script no tienen un VPA en vivo en el host de la CLI. Para obtener estadísticas de VPA, carga explícitamente un VPAX y usa `host.Vpa.*`, o ejecuta [`te vertipaq`](xref:te-cli-commands#vertipaq). | ## Best Practice Analyzer -| Limitación | Notas / Solución alternativa | -| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Las fuentes de reglas de BPA deben ser URL HTTPS o rutas de archivos locales** | Solo se aceptan las URL `https://` y las rutas de archivo locales sin esquema. `http://` se reconoce, pero se rechaza deliberadamente en tiempo de carga con un error claro; como las reglas de BPA son expresiones de reglas ejecutables, obtenerlas a través de un canal no autenticado supondría un riesgo de manipulación. Otros esquemas de URL (`file://`, `ftp://`, …) no se admiten. Se aplica tanto a `te bpa run --rules` como a la lista de reglas configurada mediante [`te config set`](xref:te-cli-commands#config-list--paths--init--set). | -| **La validación de las URL de las reglas se realiza en el gate, no en `te config set`** | Un error tipográfico como `http://` lo acepta `te config set` y solo sale a la luz cuando BPA se ejecuta realmente. Después de editar las fuentes de reglas configuradas, ejecuta `te bpa run` (o `te validate`) una vez para comprobar que cada URL se carga correctamente. | -| **`--rules` no desactiva las reglas integradas** | Cuando se pasa `te bpa run --rules `, las reglas proporcionadas sustituyen las entradas de [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) y `TE_BPA_RULES` para esa invocación, pero los valores predeterminados integrados se cargan igualmente. Para ejecutar solo el archivo de reglas explícito, pasa también `--no-defaults`. When a supplied rule file defines the same rule ID as a built-in rule, the rule is evaluated once - the definition from the explicit `--rules` file wins for that `te bpa run` invocation (in the deploy/save gate, the built-in definition wins). | -| **No hay ninguna opción por invocación para omitir la configuración de `bpa.rules`** | Una vez configurado `bpa.rules`, cada `te bpa run` carga esas reglas además de las integradas. Actualmente no hay ninguna opción para omitir los archivos de reglas configurados en una sola ejecución. Solución alternativa: pasa `--rules ` explícitamente; esta opción sustituye por completo `bpa.rules` y `TE_BPA_RULES` para esa invocación. | +| Limitación | Notas / Solución alternativa | +| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Las fuentes de reglas de BPA deben ser URL HTTPS o rutas de archivos locales** | Solo se aceptan las URL `https://` y las rutas de archivo locales sin esquema. `http://` se reconoce, pero se rechaza deliberadamente en tiempo de carga con un error claro; como las reglas de BPA son expresiones de reglas ejecutables, obtenerlas a través de un canal no autenticado supondría un riesgo de manipulación. Otros esquemas de URL (`file://`, `ftp://`, …) no se admiten. Se aplica tanto a `te bpa run --rules` como a la lista de reglas configurada mediante [`te config set`](xref:te-cli-commands#config-list--paths--init--set). | +| **La validación de las URL de las reglas se realiza en el gate, no en `te config set`** | Un error tipográfico como `http://` lo acepta `te config set` y solo sale a la luz cuando BPA se ejecuta realmente. Después de editar las fuentes de reglas configuradas, ejecuta `te bpa run` (o `te validate`) una vez para comprobar que cada URL se carga correctamente. | +| **`--rules` no desactiva las reglas integradas** | Cuando se pasa `te bpa run --rules `, las reglas proporcionadas sustituyen las entradas de [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) y `TE_BPA_RULES` para esa invocación, pero los valores predeterminados integrados se cargan igualmente. Para ejecutar solo el archivo de reglas explícito, pasa también `--no-defaults`. Si un archivo de reglas proporcionado define el mismo identificador de regla que una regla integrada, la regla se evalúa una sola vez: la definición del archivo `--rules` explícito prevalece en esa invocación de `te bpa run` (en la comprobación de despliegue/guardado, prevalece la definición integrada). | +| **No hay ninguna opción por invocación para omitir la configuración de `bpa.rules`** | Una vez configurado `bpa.rules`, cada `te bpa run` carga esas reglas además de las integradas. Actualmente no hay ninguna opción para omitir los archivos de reglas configurados en una sola ejecución. Solución alternativa: pasa `--rules ` explícitamente; esta opción sustituye por completo `bpa.rules` y `TE_BPA_RULES` para esa invocación. | ## Validación @@ -54,19 +54,19 @@ La CLI ejecuta C# Scripts (`te script`) sobre el mismo objeto `Model` que usas e | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`te validate` no puede corregir automáticamente las infracciones de Code Action** | `te validate` genera un Report de infracciones de Code Action, pero no ofrece ningún parámetro de la CLI para aplicar la corrección sugerida. Aplica la corrección en Tabular Editor 3, o usa `te bpa run --fix` para el subconjunto de Code Actions que se solapan con las reglas de BPA. | -## Model initialization and save +## Inicialización y guardado del modelo -| Limitación | Notas / Solución alternativa | -| -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`--serialization` no puede combinar una serialización con un contenedor PBIP** | The `--serialization` option on [`te save-as`](xref:te-cli-commands#save-as) treats `bim`, `tmdl`, `database.json`, and `pbip` as mutually exclusive, so you cannot produce a full PBIP container around a TMSL-serialized (`.bim`) model. To wrap a `tmdl` or `bim` output in a `{modelName}.SemanticModel/` folder with `.platform` and `definition.pbism` files, pass `--supporting-files`; for a complete PBIP (including the report artifact), use `--serialization pbip`. | +| Limitación | Notas / Solución alternativa | +| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`--serialization` no puede combinar una serialización con un contenedor PBIP** | La opción `--serialization` de [`te save-as`](xref:te-cli-commands#save-as) trata `bim`, `tmdl`, `Database.json` y `pbip` como mutuamente excluyentes, por lo que no se puede generar un contenedor PBIP completo alrededor de un modelo serializado con TMSL (`.bim`). Para encapsular una salida `tmdl` o `bim` en una carpeta `{modelName}.SemanticModel/` con los archivos `.platform` y `definition.pbism`, pasa `--supporting-files`; para un PBIP completo (incluido el artefacto del Report), usa `--serialization pbip`. | ## Edición del modelo -| Limitación | Notas / Solución alternativa | -| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Calculated sets cannot be created, removed, or moved from the CLI** | Sets are addressable for inspection (`te list Sets`, `te get "Sales/Sets/"`), but `te add`, `te remove`, and `te move` do not support set objects. Use `te script` for set mutations. | -| **No whole-model Power Query formatting sweep** | `te set --format ` formats named expression properties on one object and `te util format-m` formats a single loose expression, but there is no command to format every M expression in a model in one pass. (Whole-model DAX formatting is available via `te script --inline "Model.AllMeasures.FormatDax();" --save`.) | -| **Schema sync treats renamed source columns as removed + added** | `te set
--update-schema` cannot detect a rename; a renamed source column shows up as one removed and one new column. Remap manually with `te set
/ -p SourceColumn=` before syncing. `--update-schema` is refused on calculated tables and calculation groups. | +| Limitación | Notas / Solución alternativa | +| ----------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **Los conjuntos calculados no se pueden crear, eliminar ni mover desde la CLI** | Se puede acceder a los conjuntos para inspeccionarlos (`te list Sets`, `te get "Sales/Sets/"`), pero `te add`, `te remove` y `te move` no admiten objetos de tipo conjunto. Usa `te script` para modificar conjuntos. | +| **No existe un formateo de Power Query para todo el modelo** | `te set --format ` da formato a las propiedades de las Named Expression en un objeto y `te util format-m` da formato a una única expresión independiente, pero no hay ningún comando para dar formato a todas las expresiones M de un modelo en una sola pasada. (El formato DAX para todo el modelo está disponible mediante `te script --inline "Model.AllMeasures.FormatDax();" --save`.) | +| **La sincronización del esquema trata las columnas de origen renombradas como eliminadas y añadidas** | `te set
--update-schema` no puede detectar un cambio de nombre; una columna de origen renombrada aparece como una columna eliminada y otra nueva. Reasigna manualmente con `te set
/ -p SourceColumn=` antes de sincronizar. `--update-schema` no se admite en tablas calculadas y grupos de cálculo. | ## Autenticación @@ -76,11 +76,11 @@ La CLI ejecuta C# Scripts (`te script`) sobre el mismo objeto `Model` que usas e ## Entrada en la línea de comandos -| Limitación | Notas / Solución alternativa | -| ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Las rutas de objetos DAX con espacios deben ir entre comillas del shell** | Cuando el nombre de una tabla o columna contiene espacios, toda la referencia al objeto DAX debe ir entre comillas del shell desde el terminal: `te get "'My Table'[My Column]"`. Sin las comillas externas, el shell divide la ruta en varios argumentos y el análisis sintáctico falla. Dentro de [`te interactive`](xref:te-cli-interactive) no se necesitan comillas del shell porque el REPL recibe la entrada sin procesar antes de que el shell la divida en argumentos. | -| **Object names containing reserved path characters must be quoted** | `/ [ ] ' " * ? { }` are reserved in object and filter paths. A name containing one must be quoted with the segment quoting rules, e.g. `te get "Tables/'{foo}'"` or `te get 'Sales/"my*name"'`. `?` is reserved but has no wildcard meaning. The Windows `cmd.exe` shell cannot express the mixed-quote forms - use PowerShell or a POSIX shell for such names (or `te interactive`, which takes the raw line). | -| **`-` (read from stdin) is not available inside `te interactive`** | The shell rejects it with _'-' (stdin) is not available inside the interactive shell._ Pass the value inline, or run the command from your OS shell where piping works. | +| Limitación | Notas / Solución alternativa | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **Las rutas de objetos DAX con espacios deben ir entre comillas del shell** | Cuando el nombre de una tabla o columna contiene espacios, toda la referencia al objeto DAX debe ir entre comillas del shell desde el terminal: `te get "'My Table'[My Column]"`. Sin las comillas externas, el shell divide la ruta en varios argumentos y el análisis sintáctico falla. Dentro de [`te interactive`](xref:te-cli-interactive) no se necesitan comillas del shell porque el REPL recibe la entrada sin procesar antes de que el shell la divida en argumentos. | +| **Los nombres de objeto que contienen caracteres reservados de la ruta deben ir entre comillas** | `/ [ ] ' " * ? Los caracteres { }` están reservados en las rutas de objetos y filtros. Un nombre que contenga uno de ellos debe ir entrecomillado siguiendo las reglas de entrecomillado de segmentos; p. ej., `te get "Tables/'{foo}'"` o `te get 'Sales/"my*name"'`. `?` está reservado, pero no tiene significado de comodín. La consola `cmd.exe` de Windows no admite las formas con comillas mixtas; utiliza PowerShell o una shell POSIX para esos nombres (o `te interactive`, que toma la línea sin procesar). | +| **`-` (leer desde stdin) no está disponible en `te interactive`** | La shell lo rechaza con _'-' (stdin) no está disponible dentro de la shell interactiva._ Pasa el valor en la misma línea o ejecuta el comando desde la shell de tu sistema operativo, donde funcionan las tuberías. | ## Enviar un Report de una limitación no documentada From a364f5cdb8a0455b6863c2739e444b222563bba2 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:20 +0200 Subject: [PATCH 34/48] New translations te-cli-skill.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-skill.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-skill.md b/localizedContent/es/content/features/te-cli/te-cli-skill.md index 92c067f10..00ce1634b 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-skill.md +++ b/localizedContent/es/content/features/te-cli/te-cli-skill.md @@ -17,38 +17,38 @@ applies_to: [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -Tabular Editor CLI incluye un **skill de agente** listo para usar que enseña a los agentes de programación con IA a manejar la interfaz de línea de comandos `te`. It's a skill folder - a [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) entry point plus a `references/` set of on-demand deep-dive files - packed with the CLI's conventions, command reference, workflows, and gotchas. Una vez instalado, un agente responde a «despliega este modelo» o «añade una medida que calcule el margen» con invocaciones idiomáticas de `te`, en lugar de adivinar o inventarse parámetros. +Tabular Editor CLI incluye un **skill de agente** listo para usar que enseña a los agentes de programación con IA a manejar la interfaz de línea de comandos `te`. Es una carpeta de skill: un punto de entrada en [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) y un conjunto de archivos de consulta en profundidad bajo demanda en `references/`, repleta de las convenciones de la CLI, la referencia de comandos, los flujos de trabajo y los escollos habituales. Una vez instalado, un agente responde a «despliega este modelo» o «añade una medida que calcule el margen» con invocaciones idiomáticas de `te`, en lugar de adivinar o inventarse parámetros. El skill se mantiene en el repositorio público [TabularEditor/CLI](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) y hace un seguimiento de las funcionalidades en versión preliminar de la CLI a medida que evoluciona. ## Qué es un skill -A skill is a folder with a `SKILL.md` entry point that the agent loads on demand, based on your prompt. Su frontmatter YAML (`name`, `description`, `version`) le indica al agente **cuándo** cargarlo y **qué** cubre. The Markdown body teaches the agent **how** to do the job, and larger skills - like this one - bundle extra reference files under `references/` that the agent reads only when needed. +Un skill es una carpeta con un punto de entrada `SKILL.md` que el agente carga bajo demanda, en función de tu prompt. Su frontmatter YAML (`name`, `description`, `version`) le indica al agente **cuándo** cargarlo y **qué** cubre. El cuerpo en Markdown enseña al agente **cómo** hacer el trabajo, y los skills más grandes, como este, agrupan archivos de referencia adicionales en `references/`, que el agente solo lee cuando los necesita. ## Qué cubre el skill El skill enseña al agente toda la superficie de `te`: -- every `te` command across all families - save-as, init, deploy, refresh, bpa, validate, query, script, util, and more +- todos los comandos de `te` en todas sus familias: save-as, init, deploy, refresh, bpa, validate, query, script, util y más - patrones de autenticación: interactiva, entidad de servicio con secreto o certificado, variables de entorno, identidad administrada - gramática de rutas de objeto: forma con barras, forma DAX y comodines -- the save model - dry run by default, `--save` to persist, and the interactive shell's `--stage`/`--revert` +- el modelo de guardado: `dry run` por defecto, `--save` para guardar de forma permanente y `--stage`/`--revert` del shell interactivo - Correspondencias de migración de TE2 a CLI - Recetas de CI/CD para GitHub Actions y Azure DevOps - formatos de salida, códigos de salida, variables de entorno y claves de configuración -- a cheatsheet of common property names for `-p Name=Value` +- una guía rápida de nombres de propiedades habituales para `-p Name=Value` - los escollos que hacen tropezar a los agentes en la práctica Esto cubre lo mismo que el resto de esta sección documenta para humanos. Consulta @te-cli-commands para la referencia de comandos, @te-cli-auth para la autenticación y @te-cli-cicd para patrones de canalización. -## Download the skill +## Descargar el skill -The skill lives in the [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder of the CLI repository - `SKILL.md` plus its `references/` subfolder. +El skill se encuentra en la carpeta [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) del repositorio de la CLI: `SKILL.md` más su subcarpeta `references/`. -1. Clone the [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository, or download the repository ZIP (**Code > Download ZIP**) and extract it. -2. Copy the whole `skills/te-cli/` folder somewhere convenient, keeping the `references/` subfolder next to `SKILL.md`. +1. Clona el repositorio [TabularEditor/CLI](https://github.com/TabularEditor/CLI), o descarga el ZIP del repositorio (**Code > Download ZIP**) y extráelo. +2. Copia toda la carpeta `skills/te-cli/` en un lugar práctico, manteniendo la subcarpeta `references/` junto a `SKILL.md`. -You'll move this folder to a tool-specific location in the install steps below. Para ver qué cambió entre versiones antes de descargar una copia más reciente, consulta el [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md). +Moverás esta carpeta a una ubicación específica de la herramienta en los pasos de instalación que se indican a continuación. Para ver qué cambió entre versiones antes de descargar una copia más reciente, consulta el [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md). ## Elige un ámbito de instalación @@ -64,16 +64,16 @@ Claude Code carga las habilidades desde una carpeta con un nombre específico de **Ámbito de proyecto** - la habilidad solo se carga dentro de este proyecto: 1. En la raíz de tu proyecto, crea la carpeta `.claude/skills/te-cli/`. -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. Copia el contenido de la carpeta `te-cli` descargada (`SKILL.md` y `references/`) en esa carpeta. -The final path is `/.claude/skills/te-cli/SKILL.md`, with `references/` alongside it. +La ruta final es `/.claude/skills/te-cli/SKILL.md`, con `references/` junto a él. **Ámbito de usuario** - la habilidad se carga en todos los proyectos del usuario actual: 1. Crea una carpeta `te-cli` dentro de tu directorio de habilidades de Claude a nivel de usuario: - **macOS / Linux:** `~/.claude/skills/te-cli/` - **Windows:** `%USERPROFILE%\.claude\skills\te-cli\` (normalmente `C:\Users\\.claude\skills\te-cli\`) -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. Copia el contenido de la carpeta `te-cli` descargada (`SKILL.md` y `references/`) en esa carpeta. > [!NOTE] > Claude Code vigila los directorios de habilidades y detecta habilidades nuevas o editadas durante la sesión actual; no necesitas reiniciar. La excepción es crear un directorio `.claude/skills/` que no existía al iniciar la sesión: reinicia Claude Code una vez para que empiece a vigilar el nuevo directorio. @@ -94,14 +94,14 @@ Para hacer una prueba de humo funcional, pregunta: what does `te deploy` do without `--execute`? ``` -Claude answers with the documented behavior - it's a dry run that prints the TMSL deployment script to stdout without deploying anything - which confirms the skill is loaded and in use. +Claude responde con el comportamiento documentado: es un `dry run` que imprime el script de despliegue TMSL en stdout sin desplegar nada; esto confirma que el skill está cargado y en uso. ## Instalación para Claude.ai y Claude Desktop Claude.ai (web y escritorio) incluye una función integrada de **Skills**. Las Skills requieren ejecución de código, y debes subirlas como un archivo ZIP de la carpeta de la skill, en lugar del `SKILL.md` suelto. 1. Activa la ejecución de código: ve a **Configuración > Capacidades** y habilita **Ejecución de código y creación de archivos**. En los planes Team y Enterprise, un propietario lo habilita en la configuración de la organización. -2. Compress the whole downloaded `te-cli` folder (including `references/`) into `te-cli.zip`. +2. Comprime toda la carpeta `te-cli` descargada (incluida la carpeta `references/`) en `te-cli.zip`. 3. Ve a **Configuración > Capacidades > Skills** (también accesible desde **Personalizar > Skills**). 4. Haz clic en **+**, elige **Subir una skill** y selecciona `te-cli.zip`. Claude lee el `SKILL.md` incluido y muestra un resumen de la skill. 5. Activa la skill. Se carga automáticamente cuando mencionas `te` o un concepto relacionado. @@ -112,11 +112,11 @@ Consulta el [artículo de ayuda sobre Skills de Anthropic](https://support.claud ## Instalación para GitHub Copilot -GitHub Copilot en VS Code es compatible de forma nativa con el estándar abierto Agent Skills: el mismo formato `SKILL.md` que usan Claude Code y Codex. Este es el enfoque recomendado porque la skill solo se carga cuando es relevante. For Copilot setups that predate Agent Skills, fall back to the generic `AGENTS.md` install below. +GitHub Copilot en VS Code es compatible de forma nativa con el estándar abierto Agent Skills: el mismo formato `SKILL.md` que usan Claude Code y Codex. Este es el enfoque recomendado porque la skill solo se carga cuando es relevante. En configuraciones de Copilot anteriores a Agent Skills, usa la instalación genérica con `AGENTS.md` que se indica más abajo. ### Agent Skills (VS Code) -Place the skill folder contents (`SKILL.md` and `references/`) in a named folder under a skills directory. El nombre de la carpeta debe coincidir con el campo `name` del frontmatter, así que usa `te-cli` y mantén intacto el frontmatter YAML. +Coloca el contenido de la carpeta del skill (`SKILL.md` y `references/`) en una carpeta con nombre dentro de un directorio de skills. El nombre de la carpeta debe coincidir con el campo `name` del frontmatter, así que usa `te-cli` y mantén intacto el frontmatter YAML. - **Alcance del Workspace:** `.github/skills/te-cli/SKILL.md` (Copilot también lee `.claude/skills/` y `.agents/skills/`). - **Ámbito de usuario:** `~/.copilot/skills/te-cli/SKILL.md` (Copilot también lee `~/.claude/skills/` y `~/.agents/skills/`). @@ -130,14 +130,14 @@ Codex CLI carga skills de forma nativa desde una carpeta con nombre dentro de `. **Ámbito de proyecto**: la skill se carga solo dentro de este proyecto: 1. En la raíz del proyecto, crea la carpeta `.agents/skills/te-cli/`. -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. Copia el contenido de la carpeta `te-cli` descargada (`SKILL.md` y `references/`) en esa carpeta. Codex busca hacia arriba desde tu directorio de trabajo, así que una skill incluida en la raíz del repositorio (`$REPO_ROOT/.agents/skills/te-cli/`) se comparte con todos los que trabajan en el repositorio. **Ámbito personal**: la skill se carga en todos los proyectos del usuario actual: 1. Crea la carpeta `te-cli` dentro de tu directorio personal de skills de Codex: `~/.agents/skills/te-cli/`. -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. Copia el contenido de la carpeta `te-cli` descargada (`SKILL.md` y `references/`) en esa carpeta. Ejecuta `/skills` en la CLI de Codex o en el IDE para confirmar que `te-cli` aparece en la lista, y escribe `te-cli` para mencionar una skill explícitamente. @@ -145,21 +145,21 @@ Ejecuta `/skills` en la CLI de Codex o en el IDE para confirmar que `te-cli` apa Para herramientas que siguen la [convención `AGENTS.md`](https://agents.md) o aceptan un archivo de instrucciones arbitrario —Aider, Continue, agentes internos personalizados—: -1. Download the skill folder. -2. In a copy of `SKILL.md`, remove the YAML frontmatter block at the top (everything between the first and second `---` lines, including those lines). -3. Rename that file to `AGENTS.md` and place it at your project root, or wherever the tool expects its instructions file. -4. Copy the `references/` folder next to your `AGENTS.md` so its relative links keep working. +1. Descarga la carpeta del skill. +2. En una copia de `SKILL.md`, elimina el bloque de frontmatter YAML de la parte superior (todo lo que haya entre la primera y la segunda línea `---`, incluidas esas líneas). +3. Cambia el nombre del archivo a `AGENTS.md` y colócalo en la raíz del proyecto, o donde la herramienta espere su archivo de instrucciones. +4. Copia la carpeta `references/` junto a `AGENTS.md` para que sus enlaces relativos sigan funcionando. 5. La siguiente invocación del agente en ese proyecto detectará las instrucciones. ## Actualizar la skill Para obtener una versión más reciente: -1. Grab the latest [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder from GitHub (re-clone, pull, or re-download the repository ZIP). -2. Replace what you previously installed: - - **Native skills (Claude Code, Codex, Copilot Agent Skills):** replace the whole skill folder contents (`SKILL.md` and `references/`). +1. Obtén la carpeta [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) más reciente desde GitHub (vuelve a clonar el repositorio, haz pull o vuelve a descargar el ZIP del repositorio). +2. Reemplaza lo que instalaste anteriormente: + - **Skills nativas (Claude Code, Codex, Copilot Agent Skills):** reemplaza todo el contenido de la carpeta de la skill (`SKILL.md` y `references/`). - **Claude.ai / Desktop:** vuelve a comprimir en ZIP la carpeta `te-cli` y vuelve a subirla desde la interfaz de Skills. - - **Instruction-file installs (AGENTS.md):** re-paste the body into `AGENTS.md` and refresh the copied `references/` folder. + - **Instalaciones con archivo de instrucciones (AGENTS.md):** vuelve a pegar el contenido en `AGENTS.md` y actualiza la carpeta `references/` que copiaste. Consulta el [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md) para ver qué cambió entre versiones. From 5e505e01cf5eb1844413fa8606bc9c998b267162 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:30 +0200 Subject: [PATCH 35/48] New translations te-cli-install.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-install.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-install.md b/localizedContent/es/content/features/te-cli/te-cli-install.md index 2cceb9d40..5d29c5a94 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-install.md +++ b/localizedContent/es/content/features/te-cli/te-cli-install.md @@ -128,7 +128,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. Esto garantiza que tengas una advertencia visible antes de que la CLI deje de funcionar. +> El banner vuelve a mostrarse en cada comando durante los **14 días anteriores a la fecha de finalización de la versión preliminar** (2026-10-31), independientemente de `hidePreviewNotice`. Esto garantiza que tengas una advertencia visible antes de que la CLI deje de funcionar. ## Autocompletado del shell @@ -169,16 +169,16 @@ El autocompletado abarca subcomandos, opciones globales y rutas de modelos (cuan La mayoría de las funcionalidades son idénticas en todas las plataformas. Unas pocas dependen de transportes exclusivos de Windows: -| Funcionalidad | Windows | macOS / Linux | -| ------------------------------------------------------------------------------------------------------------------------------------ | ------- | ------------- | -| Work with local TMDL and BIM model files | Sí | Sí | -| Desplegar en Power BI / Fabric / Azure Analysis Services | Sí | Sí | -| Best Practice Analyzer y Analizador VertiPaq | Sí | Sí | -| C# Script | Sí | Sí | -| Consultas DAX en modelos en la nube | Sí | Sí | -| Authentication: browser (interactive), service principal, environment variables, managed identity | Sí | Sí | -| Conectarse a una instancia local de SSAS (transporte TCP) | Sí | **No** | -| Conectarse a Power BI Desktop (transporte por canalización con nombre) | Sí | **No** | +| Funcionalidad | Windows | macOS / Linux | +| ---------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------- | +| Trabajar con archivos locales de modelos TMDL y BIM | Sí | Sí | +| Desplegar en Power BI / Fabric / Azure Analysis Services | Sí | Sí | +| Best Practice Analyzer y Analizador VertiPaq | Sí | Sí | +| C# Script | Sí | Sí | +| Consultas DAX en modelos en la nube | Sí | Sí | +| Autenticación: navegador (interactivo), principal de servicio, variables de entorno, identidad administrada | Sí | Sí | +| Conectarse a una instancia local de SSAS (transporte TCP) | Sí | **No** | +| Conectarse a Power BI Desktop (transporte por canalización con nombre) | Sí | **No** | > [!IMPORTANT] > Las conexiones locales a SSAS y Power BI Desktop dependen de protocolos de transporte solo disponibles en Windows. Todos los flujos de trabajo basados en la nube (Power BI Service, Fabric y Azure Analysis Services) funcionan en cualquier plataforma. From cc38bc0fcd7831fd58bb7186b7c3bd8babca2550 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:33 +0200 Subject: [PATCH 36/48] New translations te-cli-interactive.md (Spanish) [ci skip] --- .../features/te-cli/te-cli-interactive.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-interactive.md b/localizedContent/es/content/features/te-cli/te-cli-interactive.md index f6b1a5d70..99415af51 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-interactive.md +++ b/localizedContent/es/content/features/te-cli/te-cli-interactive.md @@ -78,47 +78,47 @@ Los grupos sin cerrar abarcan hasta el final de la línea, por lo que una comill Estos comandos los gestiona el propio REPL, no el árbol de comandos habitual: -| Comando | Propósito | -| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `help` o `?` | Lista los comandos disponibles. | -| `status` o `pwd` | Muestra el modelo o la conexión en uso. | -| `save` | Commit all staged in-memory edits back to the model source. | -| `revert` | Discard all staged edits made since the last save. | -| `clear` o `cls` | Limpia la pantalla. | -| `exit`, `quit` o `q` | Sale del modo interactivo. If staged edits are unsaved you are asked to confirm (`n` is the default); `exit --force` discards them without asking. | +| Comando | Propósito | +| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `help` o `?` | Lista los comandos disponibles. | +| `status` o `pwd` | Muestra el modelo o la conexión en uso. | +| `save` | Aplica al origen del modelo todas las ediciones preparadas en memoria. | +| `revert` | Descarta todos los cambios preparados realizados desde el último guardado. | +| `clear` o `cls` | Limpia la pantalla. | +| `exit`, `quit` o `q` | Sale del modo interactivo. Si hay cambios preparados sin guardar, se te pedirá confirmación (`n` es el valor predeterminado); `exit --force` los descarta sin preguntar. | -`save` inside the session takes no arguments - re-serializing the model to another format or location is `save-as` (e.g. `save-as -o ./out --serialization bim`), exactly as outside the session. +`save` dentro de la sesión no acepta argumentos: para volver a serializar el modelo en otro formato o ubicación se usa `save-as` (por ejemplo, `save-as -o ./out --serialization bim`), exactamente igual que fuera de la sesión. -## Staged edits +## Cambios preparados -Inside the session, mutating commands (`set`, `add`, `remove`, `move`, `script`, `macro run`, ...) stage their changes in memory instead of writing to the source, and the prompt shows an indicator while unsaved staged edits exist. The built-in `save` command commits everything staged; `revert` discards everything staged. +Dentro de la sesión, los comandos que modifican el modelo (`set`, `add`, `remove`, `move`, `script`, `macro run`, ...) preparan sus cambios en memoria en lugar de escribirlos en el origen, y el prompt muestra un indicador mientras existan cambios preparados sin guardar. El comando integrado `save` confirma todo lo preparado; `revert` descarta todo lo preparado. -Each mutating command can also decide for itself: `--save` persists that one command's change immediately, `--stage` keeps it in memory (the default), and `--revert` rolls the command's change back after showing its effect - useful for a "what would this do?" probe. The three are mutually exclusive, and `--stage`/`--revert` exist only inside the session. +Cada comando que modifica el modelo también puede decidir por sí mismo: `--save` guarda de inmediato el cambio de ese comando, `--stage` lo mantiene en memoria (la opción predeterminada) y `--revert` revierte el cambio del comando después de mostrar su efecto; útil para una prueba de "¿qué haría esto?". Los tres son mutuamente excluyentes, y `--stage`/`--revert` solo existen dentro de la sesión. -The default per-command behavior is the `interactiveEditMode` config key (`stage` | `save` | `revert`) - see @te-cli-config. +El comportamiento predeterminado por comando lo define la clave de configuración `interactiveEditMode` (`stage` | `save` | `revert`); consulta @te-cli-config. -Staged edits are never thrown away silently. Closing a session that still holds them - with `exit`, **Ctrl+D**, or by reaching the end of piped input - first checks for unsaved changes. If unsaved changes exist and a terminal is active, you are asked to confirm, with "no" as the default, and declining returns you to the prompt with the edits intact. Where nobody can answer (stdin piped or redirected, or `--non-interactive`), the session writes a warning naming the unsaved changes and exits with a failure code instead of a success one. Nothing is saved on the way out either way: run `save` first, or `exit --force` to discard the edits deliberately. +Los cambios preparados nunca se descartan en silencio. Al cerrar una sesión que todavía los contiene —con `exit`, **Ctrl+D** o al llegar al final de la entrada por tubería—, primero se comprueba si hay cambios sin guardar. Si existen cambios sin guardar y hay un terminal activo, se te pedirá confirmación, con "no" como valor predeterminado; si respondes que no, volverás al prompt con las ediciones intactas. Cuando nadie puede responder (stdin por tubería o redirigida, o con `--non-interactive`), la sesión muestra una advertencia indicando qué cambios no se han guardado y sale con un código de error en lugar de uno de éxito. Al salir, en ningún caso se guarda nada: ejecuta `save` primero, o usa `exit --force` para descartar los cambios deliberadamente. -## Line editing and keys +## Edición de línea y teclas -The prompt offers single-line editing: +El prompt ofrece edición de una sola línea: -- **Left/Right** move the caret; **Home/End** (also **Ctrl+A**/**Ctrl+E**) jump to the ends; **Backspace/Delete** edit in place. -- **Up/Down** browse the command history, which persists across sessions. -- **Ctrl+C** cancels the current command without leaving the session and abandons the half-typed line for good - it is never run, Up does not bring it back, and it is not added to the history. -- **Ctrl+D** on an empty prompt exits (**Ctrl+Z** then **Enter** on Windows). +- **Izquierda/Derecha** mueven el cursor; **Inicio/Fin** (también **Ctrl+A**/**Ctrl+E**) saltan a los extremos; **Retroceso/Supr** editan en el mismo lugar. +- **Arriba/Abajo** recorren el historial de comandos, que se conserva entre sesiones. +- **Ctrl+C** cancela el comando actual sin salir de la sesión y descarta definitivamente la línea a medio escribir: nunca se ejecuta, **Arriba** no la recupera y no se añade al historial. +- **Ctrl+D** en un prompt vacío cierra la sesión (**Ctrl+Z** y luego **Enter** en Windows). -There is no tab completion inside the session - shell completion via `te completion` applies to the outer shell only. +Dentro de la sesión no hay autocompletado con la tecla Tab; el autocompletado de la shell mediante `te completion` solo se aplica a la shell externa. ## Indicaciones guiadas -Cuando el modo interactivo está activo, los comandos que necesitan información faltante la solicitan en lugar de fallar. Running `auth` without a subcommand opens a picker for Login / Status / Logout; running `deploy --execute` or `refresh --execute` without `--force` shows a summary and asks for confirmation (`n` is the safe default). A `deploy` or `refresh` without `--execute` is a dry run that prints the TMSL it would send, so it never prompts. +Cuando el modo interactivo está activo, los comandos que necesitan información faltante la solicitan en lugar de fallar. Al ejecutar `auth` sin subcomando, se abre un selector para Inicio de sesión / Estado / Cierre de sesión; al ejecutar `deploy --execute` o `refresh --execute` sin `--force`, se muestra un resumen y se pide confirmación (`n` es la opción predeterminada más segura). Un `deploy` o `refresh` sin `--execute` es una simulación que imprime el TMSL que enviaría, así que nunca solicita confirmación. Para desactivar las indicaciones en un único comando dentro de la sesión, pasa `--non-interactive`. ## Entrada canalizada y redirigida -El modo interactivo también acepta stdin canalizado o redirigido, de modo que puedes controlar la misma REPL desde un script en lugar de introducir los comandos a mano. Cada línea de entrada se ejecuta como un comando, exactamente igual que si la hubieras introducido en el prompt, y la sesión termina cuando se agota la entrada (o cuando llega a una línea `exit`). If staged edits are still unsaved at that point, the session warns and exits non-zero - end a mutating script with `save` (or `exit --force` to discard on purpose). +El modo interactivo también acepta stdin canalizado o redirigido, de modo que puedes controlar la misma REPL desde un script en lugar de introducir los comandos a mano. Cada línea de entrada se ejecuta como un comando, exactamente igual que si la hubieras introducido en el prompt, y la sesión termina cuando se agota la entrada (o cuando llega a una línea `exit`). Si en ese momento todavía hay cambios en fase de preparación sin guardar, la sesión avisa y termina con un código de salida distinto de cero; finaliza un script con cambios con `save` (o usa `exit --force` para descartarlos a propósito). ```bash printf "ls\nexit\n" | te interactive --model ./model # bash / git-bash @@ -129,7 +129,7 @@ te interactive --model ./model < script.te # redirected file (echo ls & echo exit) | te interactive --model .\model :: Windows cmd.exe ``` -The `-` stdin convention (`set -p Expression=-`, `query -q -`, and so on) is refused inside the interactive session, because the session itself owns stdin - use it from the outer shell instead. +La convención de stdin con `-` (`set -p Expression=-`, `query -q -`, etc.) se rechaza dentro de la sesión interactiva, porque la propia sesión es la dueña de stdin; úsala desde la shell externa. Las líneas que empiezan por `#` se tratan como comentarios y se omiten, así que puedes anotar un archivo de script: @@ -186,7 +186,7 @@ Este comportamiento se controla con la clave de configuración `launchInteractiv | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- | | `auto` (predeterminado) | Inicia el REPL solo cuando los tres flujos están adjuntos a un TTY. De lo contrario, pasa al análisis normal. | | `always` | Inicia el REPL aunque haya redirección de flujos. Útil si siempre quieres una sesión interactiva. | -| `never` | No inicia nunca el REPL automáticamente. `te` on its own prints help. | +| `never` | No inicia nunca el REPL automáticamente. `te` por sí solo muestra la ayuda. | Cámbialo globalmente con: From 33372a84abfe08c44c8e5b38a99c2af9565fbf92 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:36 +0200 Subject: [PATCH 37/48] New translations te-cli-migrate.md (Spanish) [ci skip] --- .../content/features/te-cli/te-cli-migrate.md | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli-migrate.md b/localizedContent/es/content/features/te-cli/te-cli-migrate.md index 07a697616..97304aaf3 100644 --- a/localizedContent/es/content/features/te-cli/te-cli-migrate.md +++ b/localizedContent/es/content/features/te-cli/te-cli-migrate.md @@ -27,7 +27,7 @@ El modo de compatibilidad con TE2 se activa de cualquiera de estas tres maneras: 1. **Nombre del binario.** Cambia el nombre de `te` a `te2` (o crea un enlace simbólico) y la CLI se ejecutará en el modo exacto de TE2. Esta es la vía de reemplazo directo: sustituye `TabularEditor.exe` por `te2` en tu canalización existente y los mismos argumentos funcionarán. 2. **Variable de entorno.** Establece `TE_COMPAT=te2` antes de invocar `te` para forzar el modo TE2. -3. **Auto-detection.** If the first argument isn't a `te` subcommand (`deploy`, `validate`, …) y aparece al menos una opción de TE2 reconocida en algún punto de la lista de argumentos, la CLI redirige automáticamente al modo TE2. Esto significa que la mayoría de las invocaciones existentes de TE2 funcionan sin ningún cambio. +3. **Detección automática.** Si el primer argumento no es un subcomando de `te` (`deploy`, `validate`, …) y aparece al menos una opción de TE2 reconocida en algún punto de la lista de argumentos, la CLI redirige automáticamente al modo TE2. Esto significa que la mayoría de las invocaciones existentes de TE2 funcionan sin ningún cambio. ```bash # All three are equivalent - each runs in TE2 mode @@ -41,7 +41,7 @@ te Model.bim -S fix.csx -D "localhost\tabular" MyDB -O ## El comando `migrate` -Use `te util migrate` as a live reference for how TE2 flags map to the new CLI. Muestra una tabla en color con todas las opciones conocidas de TE2, su estado (compatible, renombrada, prevista) y el comando `te` equivalente. +Usa `te util migrate` como referencia en vivo de cómo las opciones de TE2 se asignan a la nueva CLI. Muestra una tabla en color con todas las opciones conocidas de TE2, su estado (compatible, renombrada, prevista) y el comando `te` equivalente. ```bash te util migrate # Full flag mapping table @@ -49,40 +49,40 @@ te util migrate -A # Look up a single flag te util migrate --output-format json # Machine-readable mapping ``` -Refer to the output of the `te util migrate` command for the current mapping that reflects the CLI version you have installed. +Consulta la salida del comando `te util migrate` para ver el mapeo actual, que refleja la versión de la CLI que tienes instalada. ## Mapeo de flags (subconjunto seleccionado) -Below is a non-exhaustive summary of the most commonly used flags. Run `te util migrate` for the full list. - -| Flag de TE2 | Nuevo equivalente en la CLI | Notas | -| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` (posicional) | `--model ` (global option) | Always the global `--model` option; no command takes the model as a positional argument. Or set an active model once with `te connect `. | -| `server`, `database` | `te connect ` or global `-s -d ` | `-s`/`-d` always identify the model source; deploy destinations use `--target-server` / `--target-database`. | -| `-L` / `-LOCAL` | `te connect --local` | Solo para Windows. | -| `-S` / `-SCRIPT` | `te script --file ` or `--inline "code"` | A bare `.csx` path also works (`te script fix.csx`). Supports multiple scripts (`--file a.csx --file b.csx`), inline code, and stdin (`--inline -`); files and inline code run in the order given. | -| `-A` / `-ANALYZE` | `te bpa run --rules ` | Admite `--fail-on`, `--fix` y varios archivos de reglas. | -| `-AX` / `-ANALYZEX` | `te bpa run --rules --no-model-rules` | Model-embedded rules are included by default; `--no-model-rules` excludes them, matching what `-AX` did. | -| `-B` / `-BIM` | `te save-as --model -o --serialization bim` | | -| `-F` / `-FOLDER` | `te save-as --model -o --serialization database.json` | Tras `-D`, el `-F` de TE2 significa `-FULL`. Consulta `--deploy-full`. | -| `-TMDL` | `te save-as --model -o --serialization tmdl` | `--serialization` can be omitted - the format is inferred from the output path. | -| `-D` / `-DEPLOY` | `te deploy --model --target-server --target-database --execute` | Comando independiente con opciones con nombre. Without `--execute`, `te deploy` is a dry run that prints the TMSL it would send. | -| `-O` / `-OVERWRITE` | (predeterminado) o `--create-only` para no aplicarlo | La sobrescritura es el comportamiento predeterminado en la nueva CLI. | -| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | -| `-P` / `-PARTITIONS` | `te deploy --deploy-partitions` | | -| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` | Requiere `--deploy-partitions`. | -| `-SHARED` | `te deploy --deploy-shared-expressions` | Después de `-D`, `-S` en TE2 significa `-SHARED`. | -| `-R` / `-ROLES` | `te deploy --deploy-roles` | | -| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | -| `-FULL` (después de `-D`) | `te deploy --deploy-full` | Equivale a: sobrescritura + conexiones + particiones + elementos compartidos + roles + miembros de rol. | -| `-X` / `-XMLA ` | `te deploy ... > ` (omit `--execute`) | Script emission is the default: without `--execute`, deploy connects read-only and prints the TMSL to stdout - redirect it to a file. | -| `-V` / `-VSTS` | `--ci vsts` on `validate`, `bpa run`, `deploy`, `test run` | Emite anotaciones `##vso[...]` en stderr. `azdo` and `azure-devops` are accepted aliases. | -| `-G` / `-GITHUB` | `--ci github` (alias `gh`) | Emits `::error::` / `::warning::` / `::notice::` annotations. | -| `-T` / `-TRX ` | `--trx ` en `validate`, `bpa run`, `test run` | Archivo `.trx` de VSTEST para publicar pruebas en Azure DevOps. | -| `-W` / `-WARN` | (predeterminado) | Las advertencias siempre se incluyen en el Report de resultados de la implementación. | -| `-E` / `-ERR` | (predeterminado) | La implementación devuelve un código de salida distinto de cero cuando hay errores de DAX. | -| `-SC` / `-SCHEMACHECK` | _Aún no se ha implementado._ | La comprobación del esquema de TE2 se conecta a los Data source reales. A diferencia de `te validate` (validación semántica de DAX, sin conexión al Data source). | -| `-L` / `-LOGIN ` (después de `-D`) | `te auth login -u -p -t ` | Usa una entidad de servicio o credenciales basadas en variables de entorno. El inicio de sesión se guarda en caché, así que los comandos posteriores obtienen tokens de forma silenciosa; consulta @te-cli-auth. | +A continuación se muestra un resumen no exhaustivo de las opciones más usadas. Ejecuta `te util migrate` para ver la lista completa. + +| Flag de TE2 | Nuevo equivalente en la CLI | Notas | +| ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file` (posicional) | `--model ` (opción global) | Siempre es la opción global `--model`; ningún comando toma el modelo como argumento posicional. O establece un modelo activo una vez con `te connect `. | +| `server`, `database` | `te connect ` o las opciones globales `-s -d ` | `-s`/`-d` siempre identifican el origen del modelo; los destinos de despliegue usan `--target-server` / `--target-database`. | +| `-L` / `-LOCAL` | `te connect --local` | Solo para Windows. | +| `-S` / `-SCRIPT` | `te script --file ` o `--inline "code"` | También funciona una ruta `.csx` sin más (`te script fix.csx`). Admite varios scripts (`--file a.csx --file b.csx`), código en línea y la entrada estándar stdin (`--inline -`); los archivos y el código en línea se ejecutan en el orden indicado. | +| `-A` / `-ANALYZE` | `te bpa run --rules ` | Admite `--fail-on`, `--fix` y varios archivos de reglas. | +| `-AX` / `-ANALYZEX` | `te bpa run --rules --no-model-rules` | Las reglas integradas en el modelo se incluyen de forma predeterminada; `--no-model-rules` las excluye, igual que hacía `-AX`. | +| `-B` / `-BIM` | `te save-as --model -o --serialization bim` | | +| `-F` / `-FOLDER` | `te save-as --model -o --serialization Database.json` | Tras `-D`, el `-F` de TE2 significa `-FULL`. Consulta `--deploy-full`. | +| `-TMDL` | `te save-as --model -o --serialization tmdl` | `--serialization` puede omitirse: el formato se infiere a partir de la ruta de salida. | +| `-D` / `-DEPLOY` | `te deploy --model --target-server --target-database --execute` | Comando independiente con opciones con nombre. Sin `--execute`, `te deploy` realiza una simulación e imprime el TMSL que enviaría. | +| `-O` / `-OVERWRITE` | (predeterminado) o `--create-only` para no aplicarlo | La sobrescritura es el comportamiento predeterminado en la nueva CLI. | +| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | +| `-P` / `-PARTITIONS` | `te deploy --deploy-partitions` | | +| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` | Requiere `--deploy-partitions`. | +| `-SHARED` | `te deploy --deploy-shared-expressions` | Después de `-D`, `-S` en TE2 significa `-SHARED`. | +| `-R` / `-ROLES` | `te deploy --deploy-roles` | | +| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | +| `-FULL` (después de `-D`) | `te deploy --deploy-full` | Equivale a: sobrescritura + conexiones + particiones + elementos compartidos + roles + miembros de rol. | +| `-X` / `-XMLA ` | `te deploy ... > ` (omite `--execute`) | La generación del script es el comportamiento predeterminado: sin `--execute`, `te deploy` se conecta en modo de solo lectura e imprime el TMSL en stdout; redirígelo a un archivo. | +| `-V` / `-VSTS` | `--ci vsts` en `validate`, `bpa run`, `deploy`, `test run` | Emite anotaciones `##vso[...]` en stderr. `azdo` y `azure-devops` son alias aceptados. | +| `-G` / `-GITHUB` | `--ci github` (alias `gh`) | Emite anotaciones `::error::` / `::warning::` / `::notice::`. | +| `-T` / `-TRX ` | `--trx ` en `validate`, `bpa run`, `test run` | Archivo `.trx` de VSTEST para publicar pruebas en Azure DevOps. | +| `-W` / `-WARN` | (predeterminado) | Las advertencias siempre se incluyen en el Report de resultados de la implementación. | +| `-E` / `-ERR` | (predeterminado) | La implementación devuelve un código de salida distinto de cero cuando hay errores de DAX. | +| `-SC` / `-SCHEMACHECK` | _Aún no se ha implementado._ | La comprobación del esquema de TE2 se conecta a los Data source reales. A diferencia de `te validate` (validación semántica de DAX, sin conexión al Data source). | +| `-L` / `-LOGIN ` (después de `-D`) | `te auth login -u -p -t ` | Usa una entidad de servicio o credenciales basadas en variables de entorno. El inicio de sesión se guarda en caché, así que los comandos posteriores obtienen tokens de forma silenciosa; consulta @te-cli-auth. | ## Guía de migración @@ -93,13 +93,13 @@ La ruta recomendada para pasar de un pipeline basado en TE2 al nuevo CLI: - Empieza con `-A` / `-AX` → `te bpa run` para obtener una salida de BPA más completa (`--fail-on`, `--fix`, `--trx`). - Después, `-D` → `te deploy` para un control de despliegue más detallado. - Por último, `-V` / `-G` → `--ci vsts` / `--ci github`. -3. **Switch to non-interactive CI flags.** Add `--non-interactive` to every `te` command (and `--ci ` on `validate`, `bpa run`, `deploy`, and `test run`), pass `--execute --force` on `deploy`/`refresh` steps that must act, and remove any `start /wait` wrappers - the new CLI is a regular console binary and doesn't need them. +3. **Cambia a las opciones de CI no interactivas.** Añade `--non-interactive` a todos los comandos `te` (y `--ci ` en `validate`, `bpa run`, `deploy` y `test run`), pasa `--execute --force` en los pasos `deploy`/`refresh` que deban realizar cambios y elimina cualquier wrapper `start /wait`: la nueva CLI es un binario de consola normal y no lo necesita. 4. **Adopta la autenticación con entidad de servicio.** Sustituye `-D -L ` por `te auth login -u ... -p ... -t ...` o un paso del pipeline con credenciales de entorno. Consulta @te-cli-auth. ## Diferencias importantes - **BPA como control previo al despliegue.** `te deploy` ahora ejecuta BPA como comprobación previa de forma predeterminada. Usa `--skip-bpa` para mantener el comportamiento anterior, o `--fix-bpa` para corregir automáticamente los incumplimientos antes del despliegue. Consulta @te-cli-config. -- **Dry run by default.** `te deploy` and `te refresh` print the exact TMSL they would send and change nothing; pass `--execute` to act. `--execute` asks for confirmation at a terminal (with `n` as the safe default); CI pipelines must pass `--execute --force`. +- **Simulación de forma predeterminada.** `te deploy` y `te refresh` imprimen el TMSL exacto que enviarían y no cambian nada; usa `--execute` para realizar los cambios. `--execute` pide confirmación en la terminal (con `n` como opción segura predeterminada); los pipelines de CI deben pasar `--execute --force`. - **Salida estructurada.** Todos los comandos admiten `--output-format json` para una salida procesable por máquinas; consulta @te-cli-automation. - **No hace falta `start /wait`.** La nueva CLI es un binario de consola normal; ejecútalo directamente en scripts de shell, PowerShell y tareas de CI. - **Multiplataforma.** La CLI funciona en Windows, macOS y Linux. Las conexiones locales a SSAS y Power BI Desktop siguen estando disponibles solo en Windows. From b9df6020014f7f0fb8bc0d70821afcd39498cde0 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:39 +0200 Subject: [PATCH 38/48] New translations te-cli.md (Spanish) [ci skip] --- .../es/content/features/te-cli/te-cli.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/localizedContent/es/content/features/te-cli/te-cli.md b/localizedContent/es/content/features/te-cli/te-cli.md index fafdc9645..4fdace8bc 100644 --- a/localizedContent/es/content/features/te-cli/te-cli.md +++ b/localizedContent/es/content/features/te-cli/te-cli.md @@ -23,13 +23,13 @@ A diferencia de las opciones de línea de comandos de `TabularEditor.exe` exclus [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -## Design pillars and target audiences +## Pilares de diseño y audiencias objetivo -Four design pillars shape every command: +Cuatro pilares de diseño dan forma a cada comando: - **Salida estructurada** — JSON, CSV, TMDL y TMSL, junto con el texto predeterminado legible para humanos. - **Modo no interactivo** — una opción global `--non-interactive` que desactiva los avisos y hace que el comando falle inmediatamente. -- **Safe by default** - editing commands such as `te set`, `te add` and `te remove` show their change as a diff and write nothing until you add `--save`; adding `--force` saves even when the change introduces validation errors. `te deploy` and `te refresh` print the exact TMSL they would send until you add `--execute`, and then ask for confirmation first unless you add `--force`. +- **Seguro por defecto**: los comandos de edición como `te set`, `te add` y `te remove` muestran el cambio como un diff y no escriben nada hasta que agregues `--save`; si agregas `--force`, guardan incluso cuando el cambio introduce errores de validación. `te deploy` y `te refresh` imprimen el TMSL exacto que enviarían hasta que agregues `--execute`; después, piden confirmación primero, a menos que agregues `--force`. - **Errores claros** — se escriben en stderr con códigos de salida predecibles. En conjunto, hacen que el mismo binario funcione bien para tres perfiles muy distintos: @@ -43,22 +43,22 @@ En conjunto, hacen que el mismo binario funcione bien para tres perfiles muy dis ## Qué puede hacer la CLI -The CLI organizes its commands into 10 families. Cada familia se corresponde con una etapa concreta del ciclo de vida del modelo semántico. +La CLI organiza sus comandos en 10 familias. Cada familia se corresponde con una etapa concreta del ciclo de vida del modelo semántico. Consulta @te-cli-commands para ver una referencia completa de los comandos, con la sintaxis, las opciones y ejemplos de cada uno. Haz clic en cualquier comando de ejemplo de la tabla para ir directamente a su entrada de referencia. -| Familia | Qué hace | Comandos de ejemplo | -| ----------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Model initialization and save](xref:te-cli-commands#model-initialization-and-save) | Save, convert, initialize models | [`te save-as`](xref:te-cli-commands#save-as), [`te init`](xref:te-cli-commands#init) | -| [Edición del modelo](xref:te-cli-commands#model-editing) | Obtener y establecer propiedades; añadir, quitar y mover objetos | [`te set`](xref:te-cli-commands#set), [`te add`](xref:te-cli-commands#add), [`te remove`](xref:te-cli-commands#remove), [`te move`](xref:te-cli-commands#move) | -| [Inspección](xref:te-cli-commands#inspection) | Listar objetos, buscar, comparar y analizar dependencias | [`te list`](xref:te-cli-commands#list), [`te find`](xref:te-cli-commands#find), [`te diff`](xref:te-cli-commands#diff), [`te deps`](xref:te-cli-commands#deps) | -| [Análisis y calidad](xref:te-cli-commands#analysis-and-quality) | Validate, run BPA, format DAX and M, analyze storage | [`te validate`](xref:te-cli-commands#validate), [`te bpa run`](xref:te-cli-commands#bpa-run), [`te util`](xref:te-cli-commands#utilities), [`te vertipaq`](xref:te-cli-commands#vertipaq) | -| [Ejecución](xref:te-cli-commands#execution) | Ejecutar consultas DAX, C# Scripts y macros | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te macro`](xref:te-cli-commands#macro) | -| [Implementación y actualización](xref:te-cli-commands#deployment-and-refresh) | Deploy to workspace, trigger refresh, apply refresh policies | [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh) | -| [Pruebas](xref:te-cli-commands#testing) | Pruebas de aserciones, instantáneas, comparación A/B | [`te test run`](xref:te-cli-commands#test-run) | -| [Conexión y autenticación](xref:te-cli-commands#connection-and-authentication) | Conéctate a los Workspace y gestiona la autenticación y los perfiles | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | -| [Configuración](xref:te-cli-commands#configuration) | CLI settings and defaults | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | -| [Shell](xref:te-cli-commands#shell) | Modo interactivo, estado de la sesión, completado automático del shell | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | +| Familia | Qué hace | Comandos de ejemplo | +| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Inicialización y guardado de modelos](xref:te-cli-commands#model-initialization-and-save) | Guardar, convertir e inicializar modelos | [`te save-as`](xref:te-cli-commands#save-as), [`te init`](xref:te-cli-commands#init) | +| [Edición del modelo](xref:te-cli-commands#model-editing) | Obtener y establecer propiedades; añadir, quitar y mover objetos | [`te set`](xref:te-cli-commands#set), [`te add`](xref:te-cli-commands#add), [`te remove`](xref:te-cli-commands#remove), [`te move`](xref:te-cli-commands#move) | +| [Inspección](xref:te-cli-commands#inspection) | Listar objetos, buscar, comparar y analizar dependencias | [`te list`](xref:te-cli-commands#list), [`te find`](xref:te-cli-commands#find), [`te diff`](xref:te-cli-commands#diff), [`te deps`](xref:te-cli-commands#deps) | +| [Análisis y calidad](xref:te-cli-commands#analysis-and-quality) | Validar, ejecutar BPA, dar formato a DAX y M, analizar el almacenamiento | [`te validate`](xref:te-cli-commands#validate), [`te bpa run`](xref:te-cli-commands#bpa-run), [`te util`](xref:te-cli-commands#utilities), [`te vertipaq`](xref:te-cli-commands#vertipaq) | +| [Ejecución](xref:te-cli-commands#execution) | Ejecutar consultas DAX, C# Scripts y macros | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te macro`](xref:te-cli-commands#macro) | +| [Implementación y actualización](xref:te-cli-commands#deployment-and-refresh) | Desplegar en el Workspace, desencadenar una actualización, aplicar políticas de actualización | [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh) | +| [Pruebas](xref:te-cli-commands#testing) | Pruebas de aserciones, instantáneas, comparación A/B | [`te test run`](xref:te-cli-commands#test-run) | +| [Conexión y autenticación](xref:te-cli-commands#connection-and-authentication) | Conéctate a los Workspace y gestiona la autenticación y los perfiles | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | +| [Configuración](xref:te-cli-commands#configuration) | Configuración y valores predeterminados de la CLI | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | +| [Shell](xref:te-cli-commands#shell) | Modo interactivo, estado de la sesión, completado automático del shell | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | > [!TIP] > La documentación usa los verbos canónicos en formato largo (`list`, `remove`, `move`), pero las formas cortas clásicas siguen funcionando como alias (`ls`, `rm`, `mv`, `rename`). Esto se aplica a los comandos de nivel superior y a los subcomandos `remove` / `list` dentro de grupos como `te bpa rules`, `te macro`, `te config`, `te profile`, `te session` y `te test`. Consulta @te-cli-commands#command-aliases para ver el mapeo completo. @@ -92,7 +92,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. Esto garantiza que veas una advertencia antes de que la CLI deje de funcionar. +> El banner vuelve a aparecer en cada comando en los **14 días previos a la fecha de finalización de la versión preliminar** (2026-10-31), independientemente de `hidePreviewNotice`. Esto garantiza que veas una advertencia antes de que la CLI deje de funcionar. ## Perspectiva de licencias From c44d575d64eeb8e01cebb72a6e12af745b2b1d95 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:42 +0200 Subject: [PATCH 39/48] New translations github-flow.md (Spanish) [ci skip] --- localizedContent/es/content/getting-started/github-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localizedContent/es/content/getting-started/github-flow.md b/localizedContent/es/content/getting-started/github-flow.md index 493c7c1d0..9b847ecfb 100644 --- a/localizedContent/es/content/getting-started/github-flow.md +++ b/localizedContent/es/content/getting-started/github-flow.md @@ -79,7 +79,7 @@ flowchart LR ``` > [!NOTE] -> Tabular Editor ahora dispone de una CLI multiplataforma (`te`) en versión preliminar pública limitada, diseñada específicamente para CI/CD: modo no interactivo, anotaciones nativas de GitHub Actions/Azure DevOps, salida VSTEST y un comando `te test run` para ejecutar pruebas de regresión como parte de un pipeline. Encaja de forma natural con el tipo de pipeline descrito a continuación, y merece la pena seguirlo de cerca. As of this writing, Tabular Editor's own documentation advises against using it in production pipelines during preview (the preview build is stated to expire 2026-10-31), so the reference implementation in this article uses the established `TabularEditor.exe` CLI instead. Consulta [Integración de CI/CD](xref:te-cli-cicd) para conocer las capacidades actuales y ver ejemplos de la nueva CLI. +> Tabular Editor ahora dispone de una CLI multiplataforma (`te`) en versión preliminar pública limitada, diseñada específicamente para CI/CD: modo no interactivo, anotaciones nativas de GitHub Actions/Azure DevOps, salida VSTEST y un comando `te test run` para ejecutar pruebas de regresión como parte de un pipeline. Encaja de forma natural con el tipo de pipeline descrito a continuación, y merece la pena seguirlo de cerca. En el momento de escribir estas líneas, la propia documentación de Tabular Editor recomienda no usarlo en canalizaciones de producción mientras esté en vista previa (se indica que la versión preliminar caduca el 2026-10-31); por ello, la implementación de referencia de este artículo utiliza en su lugar la CLI ya consolidada `TabularEditor.exe`. Consulta [Integración de CI/CD](xref:te-cli-cicd) para conocer las capacidades actuales y ver ejemplos de la nueva CLI. From ada5266129efec20f1069d7095fd1202fbc7c5cd Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:50 +0200 Subject: [PATCH 40/48] New translations te-cli-commands.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-commands.md | 284 +++++++++--------- 1 file changed, 142 insertions(+), 142 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-commands.md b/localizedContent/zh/content/features/te-cli/te-cli-commands.md index 8df4393bc..710ae03b3 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-commands.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-commands.md @@ -31,8 +31,8 @@ te bpa run --help # Help for a command with subcommands CLI 中的对象定位在所有命令中都采用同一套语法。 以下参考中会出现两种路径形式: -- **``** - 解析为**恰好一个**对象或容器。 Used by commands that change the model or need a single target: `te set`, `te add`, `te remove`, `te move`, `te deps`, `te macro run --on`, and `te get` with `-p`, `--deps`, or `--properties`. -- **``** - 解析为**零个或多个**对象,并支持通配符。 Used by commands that operate on a set: `te list`, plain `te get` (a wildcard or container path lists every match), `te bpa run --path`, and other inspection-style commands. +- **``** - 解析为**恰好一个**对象或容器。 供更改模型或需要单个目标的命令使用:`te set`、`te add`、`te remove`、`te move`、`te deps`、`te macro run --on`,以及带 `-p`、`--deps` 或 `--properties` 的 `te get`。 +- **``** - 解析为**零个或多个**对象,并支持通配符。 供处理一组对象的命令使用:`te list`、普通 `te get`(通配符或容器路径会列出所有匹配项)、`te bpa run --path`,以及其他检查类命令。 两种路径形式共用同一套语法规则;仅有两处不同: @@ -61,7 +61,7 @@ CLI 中的对象定位在所有命令中都采用同一套语法。 以下参考 在带引号的分段内,`*` 会被视为字面字符,而不是通配符。 因此,`'Sa*'` 会匹配名称恰好为 `Sa*` 的表。 -The reserved characters in paths are `/ [ ] ' " * ? { }`. A segment containing any of `* ? { }` must be quoted (`te get "Tables/'{foo}'"`, `te get 'Sales/"my*name"'`); unquoted use is rejected with an error naming the character and showing the quoted form. `?` is reserved and has no wildcard meaning. Every path the CLI prints - in errors, hints, `--paths-only` output, and the `objectPath` field in JSON - is canonically quoted and can be pasted straight back into `te get`. The mixed-quote forms require PowerShell or bash; cmd.exe cannot express them. +路径中的保留字符包括 `/ [ ] ' \" * ?? { }`。 任何包含 `* ? 的分段? { }` 的分段必须加引号(`te get "Tables/'{foo}'"`、`te get 'Sales/"my*name"'`);未加引号会被拒绝并报错,错误会指出该字符并展示加引号后的写法。 `?` 为保留字符,不表示通配符。 CLI 输出的每个路径——无论是在错误、提示、`--paths-only` 输出,还是 JSON 的 `objectPath` 字段中——都会以规范化的加引号形式输出,可直接粘贴回 `te get`。 混合引号形式需要 PowerShell 或 bash;cmd.exe 无法表示。 ### DAX 风格的引用(仅对象路径) @@ -82,13 +82,13 @@ te get "[Total Sales]" # Model-wide measure-or-column lookup | 关键字 | 范围 | 含义 | | --------------------------------------------------------------------------------------------------------------------- | ---- | ------------ | -| `Tables`, `Measures`, `Columns`, `Hierarchies`, `Partitions`, `KPIs`, `Sets` | 模型 | 模型中该类型的所有对象。 | +| `Tables`, `度量值`, `Columns`, `Hierarchies`, `分区`, `KPI`, `Sets` | 模型 | 模型中该类型的所有对象。 | | `关系`, `角色`, `Perspectives`, `Cultures`, `DataSources`, `Expressions`, `CalculationGroups`, `Functions`, `Annotations` | 模型 | 模型级容器。 | -| `Measures`, `Columns`, `Hierarchies`, `Partitions`, `Calendars`, `CalculationItems`, `KPIs`, `Sets` | 表 | 表下的子容器。 | +| `度量值`, `Columns`, `Hierarchies`, `分区`, `Calendars`, `CalculationItems`, `KPI`, `Sets` | 表 | 表下的子容器。 | | `Levels` | 层次结构 | 层次结构的级别。 | | `Members`, `TablePermissions`(别名 `Permissions`) | 角色 | 角色的子级对象。 | -Calculated sets are addressable in container form only (`
/Sets/`); an individual KPI is `
//KPI`; calendars resolve at `
/Calendars/`; relationships resolve at `Relationships/` (the relationship's own name in the model: a GUID, or a label such as `Relationship 1`; `--paths-only` prints it, and the display name is also accepted). +计算集只能以容器形式寻址(`
/Sets/`);单个 KPI 为 `
//KPI`;日历可通过 `
/Calendars/` 解析;关系可通过 `Relationships/` 解析(即该关系在模型中的名称:GUID,或类似 `Relationship 1` 的标签;`--paths-only` 会输出它,同时也接受显示名称)。 以下示例展示普通路径与限定容器范围的路径之间的区别: @@ -101,7 +101,7 @@ te get Sales/refreshPolicy # Refresh-policy sub-object on a tabl te get Sales/Revenue/KPI # KPI sub-object of a measure ``` -当实际对象名称恰好与关键字同名时,可为该分段加上引号,以强制进行字面名称匹配。 字面名称为 `Tables` 的表需要写作 `'Tables'`,可通过 `te get "'Tables'"` 访问。 The same applies to tables named `KPIs` or `Sets`. +当实际对象名称恰好与关键字同名时,可为该分段加上引号,以强制进行字面名称匹配。 字面名称为 `Tables` 的表需要写作 `'Tables'`,可通过 `te get "'Tables'"` 访问。 名称为 `KPIs` 或 `Sets` 的表也是如此。 ### 筛选路径中的通配符 @@ -120,7 +120,7 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* ### 错误和提示 -分段拼写错误时会给出一条与上下文相关的错误;如果 CLI 能猜到你的意图,还会附带“你是不是想输入……”的提示。 The list offers tables, measures, columns, and hierarchies, each as a full `Table/Object` path that pastes straight back into the next command. A name written in single quotes is a table reference (`te deps 'Revenue'` looks for a table named Revenue), and the error points at the `Table/Object` and `"[Object]"` forms for anything that is not a table. 缺少父级的路径会在检查叶节点之前失败,因此信息会指向真正出错的分段。 Every path an error or hint prints is taken from your model and quoted so it resolves as printed - a refusal never suggests a path that does not exist. Empty containers (e.g., `te list Hierarchies` on a model without hierarchies) emit a simple "nothing here" hint rather than an error. +分段拼写错误时会给出一条与上下文相关的错误;如果 CLI 能猜到你的意图,还会附带“你是不是想输入……”的提示。 列表会提供表、度量值、列和层次结构,每项都以完整的 `Table/Object` 路径形式给出,可直接粘贴到下一条命令中。 用单引号写出的名称会被视为表引用(`te deps 'Revenue'` 会查找名为 Revenue 的表);如果目标不是表,错误信息会提示使用 `Table/Object` 和 `"[Object]"` 这两种形式。 缺少父级的路径会在检查叶节点之前失败,因此信息会指向真正出错的分段。 错误或提示中输出的每个路径都取自你的模型,并已正确加引号,按原样即可解析——被拒绝时绝不会建议一个不存在的路径。 空容器(例如在没有层次结构的模型上运行 `te list Hierarchies`)不会报错,而是给出简单的“这里没有内容”提示。 ## 命令别名 @@ -151,7 +151,7 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* | `-m, --model ` | 语义模型的路径(TMDL 文件夹、`.bim` 文件、`Database.json` 文件夹或 `.SemanticModel` 文件夹)。 | | `-s, --server ` | Analysis Services 端点或 Power BI Workspace。 服务器名称/FQDN(`MY.SERVER.COM`)、IP 地址(`192.168.1.1`)、`host:port`、`localhost`、`SERVER\\INSTANCE`、`asazure://...` 或 MSOLAP 连接字符串可用于直接连接到 Analysis Services / AAS。 单一标记名称(`MyWorkspace`)、Fabric `Name.Workspace[/Model.SemanticModel]` 路径或 `powerbi://...` URL 会指向 Power BI Workspace。 名称中包含点号的 Workspace 无法与服务器名称区分,因此会被视为服务器,CLI 会输出警告;如需指向 Power BI,请使用其 `.Workspace` 形式或完整的 `powerbi://` URL。 | | `-d, --database ` | Workspace 上的语义模型名称。 | -| `--local` | Connect to a locally running Analysis Services instance - Power BI Desktop, Visual Studio workspaces, or standalone SSAS (Windows only). | +| `--local` | 连接到本地运行的 Analysis Services 实例——Power BI Desktop、Visual Studio Workspace,或独立 SSAS(仅限 Windows)。 | | `--auth ` | 身份验证方法:`auto`、`interactive`、`spn`、`env`、`managed-identity`(默认值:`auto`)。 | | `--output-format ` | 标准输出格式:`text` (默认)、`json`、`csv`、`tmsl` (别名 `bim`)、`tmdl`。 输出表格数据的命令会识别 `csv`;`tmsl`/`tmdl` 仅由 `te get` 和 `te list` 用于整个对象的序列化。 命令会拒绝其不支持的格式。 | | `--error-format ` | 用于错误、警告和提示的 stderr 格式:`text`(默认)或 `json`。 其他值将回退为 `text`。 它独立于 `--output-format`,因此你可以将 JSON 格式的 stdout 与纯文本错误配合使用(反之亦然)。 | @@ -163,9 +163,9 @@ te list 'Roles/Re*/Members' # Members of every role matching Re* 对于读取模型的命令,解析顺序如下: -`--recent` → `--local` → `--server`/`--database` (remote) → `--model` → active connection from `te connect`. +`--recent` → `--local` → `--server`/`--database`(远程)→ `--model` → 来自 `te connect` 的活动连接。 -The model is never a positional argument - a stray path on the command line is rejected with an "unrecognized command or argument" error. (Positional arguments on `te connect`, `te init`, `te diff`, and `te query` are those commands' own subjects, not the model.) +模型绝不是位置参数——命令行中多写一个路径会被拒绝,并报出“无法识别的命令或参数”错误。 (`te connect`、`te init`、`te diff` 和 `te query` 中的位置参数是这些命令各自的操作对象,不是模型。) > [!NOTE] > **拼写错误的选项会被立即拒绝。** 如果你传入了当前命令无法识别的 `--flag`,CLI 会直接退出并给出可操作的错误信息,而不是悄悄把该标记当作位置参数吞掉。 这可以捕获 CI 脚本中把 `--force ` 误写成 `--forec` 之类的拼写错误。 @@ -173,16 +173,16 @@ The model is never a positional argument - a stray path on the command line is r > [!NOTE] > **带点号的服务器名称。** `-s`/`--server` 会将带点号的名称(例如 `Sales.2026`)视为 Analysis Services 服务器主机名,而不是 Power BI Workspace。 当 CLI 需要这样判断时,会发出警告,并提示:如果你指的是 Power BI Workspace,请在末尾追加 `.Workspace`(例如 `Sales.2026.Workspace`),或使用完整的 `powerbi://` URL。 适用于 `te connect`、`te deploy`、`te refresh`、`te query`、`te vertipaq` 和 `te test run`。 -## Model initialization and save +## 模型初始化与保存 ### save-as -Re-serialize a model to a different format or location. 可用于将远程 Workspace 中的模型写入本地文件、转换格式,或将编辑内容保存回源位置。 (Alias: `save`.) +将模型重新序列化为其他格式,或保存到其他位置。 可用于将远程 Workspace 中的模型写入本地文件、转换格式,或将编辑内容保存回源位置。 (别名:`save`。) -`te save-as` accepts: +`te save-as` 接受: -- `-o, --output-path ` - 目标文件或文件夹。 **Optional** - when omitted, `te save-as` writes back to the source location, preserving the original format. -- `--serialization ` - `tmdl`、`bim`(别名 `tmsl`)、`database.json`、`pbip`。 When omitted, the format is the loaded model's format; with `-o`, it is inferred from the output path (`.bim` writes a single-file BIM, `.json` a `database.json` folder). +- `-o, --output-path ` - 目标文件或文件夹。 **可选**:省略时,`te save-as` 会写回源位置,并保留原始格式。 +- `--serialization ` - `tmdl`、`bim`(别名 `tmsl`)、`database.json`、`pbip`。 省略时,格式默认为已加载模型的格式;使用 `-o` 时,会根据输出路径推断格式(`.bim` 会输出为单文件 BIM,`.json` 会输出为包含 `Database.json` 的文件夹)。 - `--force` - 跳过验证并覆盖现有输出。 某些拒绝情况(例如容器不明确、项目根目录中存在多个 `SemanticModel`)即使使用 `--force` 也会触发。 - `--skip-bpa` - 完全绕过 BPA 检查。 - `--fix-bpa` - 当规则定义了修复表达式时,自动修复 BPA 违规项。 @@ -197,22 +197,22 @@ te save-as -o ./project --serialization pbip # Save as a PBIP project te save-as -o ./out -s my-workspace -d my-model --skip-validation # Fast download ``` -`--serialization pbip` output opens directly in Power BI Desktop and is named after the source model (`SpaceParts.pbip`, not `Model.pbip`). Saving into a folder that already holds a project adds only the files that are missing and leaves everything already there - the report's pages, theme, connection, and item identity - exactly as it was, so a save that changes nothing leaves the project unchanged under source control. +使用 `--serialization pbip` 输出的内容可直接在 Power BI Desktop 中打开,且会以源模型命名(`SpaceParts.pbip`,而不是 `Model.pbip`)。 保存到已包含项目的文件夹时,只会补充缺失的文件,已存在的所有内容——Report 的页面、主题、连接以及项目标识——都会原样保留。因此,如果一次保存没有任何改动,在版本控制下项目也不会产生变化。 -Validation guards saving: a model with a name collision Analysis Services would refuse (`TE0012` / `TE0013`, see [validate](#validate)) is not written unless `--force` or `--skip-validation` is passed. +验证会保护保存操作:如果模型存在 Analysis Services 会拒绝的名称冲突(`TE0012` / `TE0013`,参见 [validate](#validate)),则不会写入,除非传入 `--force` 或 `--skip-validation`。 > [!TIP] -> Use `te save-as -o -s -d ` to download a remote model to disk. 如果你只需要原始字节数据(不做 DAX 语义分析),配合 `--skip-validation` 可实现最快的直通下载。 +> 使用 `te save-as -o -s -d ` 可将远程模型下载到磁盘。 如果你只需要原始字节数据(不做 DAX 语义分析),配合 `--skip-validation` 可实现最快的直通下载。 ### init -在指定路径创建一个新的空语义模型。 Defaults to a TMDL model in `PowerBI` compatibility mode at compatibility level 1705. +在指定路径创建一个新的空语义模型。 默认为 `PowerBI` 兼容模式下、兼容级别为 1705 的 TMDL 模型。 `te init` 接受以下参数: - `` - 位置参数:用于创建模型的目录(省略时使用全局 `--model` 路径)。 - `--compatibility-mode ` - `PowerBI`(默认)或 `AnalysisServices`。 -- `--compatibility-level `(别名 `--compat`)- 兼容级别。 Defaults to `1705` when the mode is `PowerBI`, `1500` otherwise. 参见 @update-compatibility-level。 +- `--compatibility-level `(别名 `--compat`)- 兼容级别。 模式为 `PowerBI` 时默认值为 `1705`,否则为 `1500`。 参见 @update-compatibility-level。 - `--name ` - 模型/数据库名称(默认:目录名称)。 - `--serialization ` - `tmdl`(默认)、`bim`(别名 `tmsl`)、`database.json`、`pbip`。 - `--force` - 覆盖目标路径下任何现有文件或目录。 @@ -224,25 +224,25 @@ te init ./as-model --compatibility-mode AnalysisServices # AS model, compat 150 te init ./existing-dir --force # Overwrite non-empty directory ``` -`te init` is idempotent: re-running it over a model it already created prints `Already exists` and exits `0` (under `--output-format json`: `{"created": false, "reason": "already_exists", ...}`). Real conflicts still exit `1`; `--force` re-creates from scratch. +`te init` 具有幂等性:在它已经创建过的模型上再次运行时,会输出 `Already exists` 并以退出码 `0` 结束(使用 `--output-format json` 时:`{"created": false, "reason": "already_exists", ...}`)。 真正的冲突仍会以 `1` 退出;`--force` 会从头重新创建。 ## 模型编辑 -Mutating commands (`set`, `add`, `remove`, `move`, and also `script`, `macro run`, `bpa run --fix`) are **dry runs by default**: without `--save` the command reports what would change and discards it (`Dry run - nothing saved. Add --save to persist.`). Add `--save` to persist to the source, or `--save-to ` to write elsewhere. On `set`, `add`, `remove`, `move`, `script`, and `bpa run`, the change output renders as a unified diff per changed object; switch it with `--stat` or `--name-only` (mutually exclusive with `--diff`, the default), or set a standing default with `te config set mutationOutput diff|stat|name-only|none`. JSON output always carries the full changes array. A save is refused when the mutation introduces new DAX validation errors, unless `--force`. +会修改内容的命令(`set`、`add`、`remove`、`move`,以及 `script`、`macro run`、`bpa run --fix`)**默认以干运行方式执行**:不带 `--save` 时,命令会报告将会发生哪些更改,并丢弃这些更改(`Dry run - nothing saved.`)。 Add --save to persist.`)。 添加 `--save`以保存到源位置,或使用`--save-to `写入其他位置。 对于`set`、`add`、`remove`、`move`、`script`和`bpa run`,更改输出会按每个发生更改的对象,以统一 diff 的形式呈现;可用 `--stat`或`--name-only`切换(与默认的`--diff`互斥),也可通过`te config set mutationOutput diff|stat|name-only|none`设置长期默认值。 JSON 输出始终包含完整的 changes 数组。 如果变更引入了新的 DAX 验证错误,则会拒绝保存,除非使用`--force\`。 ### set -Set properties on a model object, format its expressions, or sync a table with its source schema. 接受 `` 参数。 +设置模型对象的属性、格式化其表达式,或将表与其源架构同步。 接受 `` 参数。 `te set` 接受以下参数: -- `-p, --property ` - property assignment (e.g., `-p expression="SUM(Sales[Amt])"`, `-p isHidden=true`). **Repeatable** - everything after the first `=` is the value. Bare positional assignments work too: `te set Sales/Amount formatString="#,0" --save`. Property names are case-insensitive, accept both spellings where the grid label and the TOM name differ (`Hidden` and `IsHidden`), and accept dotted paths and indexers: `-p KPI.StatusGraphic=...`, `-p "Annotations[Tabular Editor]=..."`, `-p "TranslatedNames[fr-FR]=..."`. Run `te get --properties` to list every name an object accepts - see [get](#get). A partition's expression is `-p Expression` whatever kind of partition it is (`MExpression` and `Query` still work). Use `-p Name=-` to read the value from stdin (one assignment per stream; a piped value is taken verbatim, so piping the text `null` stores the word `null`). `-p Name=` assigns an empty string. -- `--unset ` - clear a property; repeatable (`--unset description --unset displayFolder`). `-p Name=null` is the shorthand. Works on every property that can hold nothing - text properties included - and on object-valued ones (`SortByColumn`, `RefreshPolicy`); `-p "Annotations[key]=null"` removes an annotation. Numbers, booleans, and fixed-choice properties cannot be cleared and are refused. -- `--format ` - format that expression property (repeatable; DAX or M is detected from the property). The formatter tweaks `--long` (fewer line breaks) and `--no-space-after-function` require `--format` on a DAX property. `--semicolons` is refused together with `--format`: an expression stored in a model is always comma-separated, so the semicolon dialect can never parse it - format semicolon-authored DAX with [`te util format-dax --semicolons`](#util-format-dax) instead. -- `--update-schema` - sync a table's columns with its source schema: adds new source columns with detected types, retypes drifted ones, and preserves everything else about every existing column (name, description, format string, display folder, sort-by column, visibility, annotations, translations, perspective membership). Removed source columns only warn unless `--drop-removed-columns` (destructive). A renamed source column looks like remove + add - remap it first with `-p SourceColumn=`. Refused on calculated tables and calculation groups; cannot combine with `-p` or `--format`. With no connection flags, the connection is read from the model itself - the data source the table's partitions are bound to, the connection written into the table's own query, or the model's single usable data source - and the source table from the partition's binding, falling back to the model table's name; `--data-source ` chooses when the model has several usable sources. Naming a connection explicitly with the schema-detection flags shared with `te add` (`--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`) always wins. When no source can be worked out, or the source table cannot be found, the error says which case you are in and names the table it looked for. +- `-p, --property ` - 属性赋值(例如 `-p expression="SUM(Sales[Amt])"`、`-p isHidden=true`)。 **可重复**:第一个 `=` 之后的所有内容都会被视为值。 也支持直接使用位置赋值:`te set Sales/Amount formatString="#,0" --save`。 属性名不区分大小写;当网格标签与 TOM 名称不一致时,两种拼写都可接受(`Hidden` 和 `IsHidden`);也支持点路径和索引器:`-p KPI.StatusGraphic=...`、`-p "Annotations[Tabular Editor]=..."`、`-p "TranslatedNames[fr-FR]=..."`。 运行 `te get --properties` 以列出对象接受的所有名称;参见 [get](#get)。 无论分区是哪种类型,其表达式都用 `-p Expression` 表示(`MExpression` 和 `Query` 仍然可用)。 使用 `-p Name=-` 从 stdin 读取值(每个流只能赋值一次;通过管道传入的值会按原样使用,因此管道传入文本 `null` 时,存储的是单词 `null`)。 `-p Name=` 会赋值为空字符串。 +- `--unset ` - 清除某个属性;可重复使用(`--unset description --unset displayFolder`)。 `-p Name=null` 是简写。 适用于所有可以为空的属性(包括文本属性),也适用于对象值属性(`SortByColumn`、`RefreshPolicy`); `-p "Annotations[key]=null"` 会移除一个注解。 数值、布尔值以及固定选项属性无法清空,尝试清空会被拒绝。 +- `--format ` - 格式化该表达式属性(可重复使用;会根据属性自动检测 DAX 或 M)。 格式化器会调整 `--long`(减少换行)的行为;而 `--no-space-after-function` 需要在 DAX 属性上配合 `--format` 使用。 `--semicolons` 不能与 `--format` 一起使用:存储在模型中的表达式始终使用逗号分隔,因此分号方言永远无法解析它;如需格式化以分号编写的 DAX,请改用 [`te util format-dax --semicolons`](#util-format-dax)。 +- `--update-schema` - 将表的列与其源架构同步:为源中新增加的列按检测到的类型创建列,对类型发生偏移的列重新设定类型,并保留每个现有列的其他所有信息(名称、说明、格式字符串、显示文件夹、排序依据列、可见性、注解、翻译、透视成员资格)。 已删除的源列默认只会发出警告,除非使用 `--drop-removed-columns`(破坏性操作)。 重命名后的源列会被视为“删除 + 新增”;请先用 `-p SourceColumn=` 重新映射它。 计算表格和计算组不支持此操作;也不能与 `-p` 或 `--format` 组合使用。 在未指定任何连接标志时,会从模型本身读取连接信息——即表分区绑定的数据源、写在表自身查询中的连接,或模型中唯一可用的数据源——而源表则取自分区绑定,找不到时回退到模型表名;当模型有多个可用源时,可用 `--data-source ` 进行选择。 使用与 `te add` 共享的架构检测标志(`--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`)显式命名连接时,总是以该显式命名为准。 当无法推断源,或找不到源表时,错误信息会说明属于哪种情况,并指出它尝试查找的表名。 - `-t, --type ` - 用于在同一路径可能解析为多种对象类型时消除歧义(`度量值`、`Column`、`CalculatedColumn`、`Hierarchy`、`Calendar`、`分区`、`CalculationItem`)。 - `--save` / `--save-to ` - 保存更改。 -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the note above). +- `--diff` / `--stat` / `--name-only` - 更改输出的呈现方式(参见上面的说明)。 - `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 - `--force` - 即使修改引入 DAX 验证错误,也会保存。 @@ -257,9 +257,9 @@ te set Sales --update-schema --save # Sync c te set Sales --update-schema --data-source "Sales DW" --save # Pick the data source when the model has several ``` -#### Incremental refresh policies +#### 增量刷新策略 -Refresh policies are plain properties on a table's `RefreshPolicy` sub-object, so `te get` and `te set` manage them like anything else. Property names: `Mode`, `RollingWindowPeriods`/`RollingWindowGranularity`, `IncrementalPeriods`/`IncrementalGranularity`, `IncrementalPeriodsOffset`, `SourceExpression`, `PollingExpression` (file input: `-p SourceExpression=- < src.m`). +刷新策略就是表的 `RefreshPolicy` 子对象上的普通属性,因此 `te get` 和 `te set` 可以像处理其他任何属性一样管理它们。 属性名:`Mode`、`RollingWindowPeriods`/`RollingWindowGranularity`、`IncrementalPeriods`/`IncrementalGranularity`、`IncrementalPeriodsOffset`、`SourceExpression`、`PollingExpression`(文件输入:`-p SourceExpression=- < src.m`)。 ```bash te get Sales/RefreshPolicy # Inspect a table's refresh policy @@ -267,39 +267,39 @@ te set Sales/RefreshPolicy -p RollingWindowPeriods=5 -p RollingWindowGranularity te set Sales -p RefreshPolicy=null --save # Remove the policy ``` -The policy is created implicitly on the first `set`. Removing one leaves policy-generated partitions in place, and is refused when they are the table's only partitions. To apply a policy on the server, see [`te refresh --apply-refresh-policy`](#refresh); to apply it metadata-only, use `te script --inline "Model.Tables[\"Sales\"].ApplyRefreshPolicy();" --save`. +首次执行 `set` 时会隐式创建该策略。 移除策略后,策略生成的分区会保留;如果它们是该表仅有的分区,则会拒绝移除。 要在服务器上应用该策略,请参见 [`te refresh --apply-refresh-policy`](#refresh);如果只想将其应用到元数据,请使用 `te script --inline "Model.Tables[\"Sales\"].ApplyRefreshPolicy();" --save`。 ### add -向模型添加对象。 为新对象传入 ``(父级必须已存在;最后一个分段就是新名称),并通过 `-t` / `--type` 指定类型。 关系仍使用其简写语法(`Sales[Key]->Dim[Key]`)。 Container-form paths are valid add targets (`Sales/Measures/Margin`, `Sales/Partitions/Q1`, `Sales/Calendars/Fiscal`, `Roles/Admin/TablePermissions/Sales`, `Roles/Admin/Members/user@x.com`) - any path the CLI prints can be fed back to `te add`. +向模型添加对象。 为新对象传入 ``(父级必须已存在;最后一个分段就是新名称),并通过 `-t` / `--type` 指定类型。 关系仍使用其简写语法(`Sales[Key]->Dim[Key]`)。 容器形式的路径可作为有效的添加目标(`Sales/Measures/Margin`、`Sales/Partitions/Q1`、`Sales/Calendars/Fiscal`、`Roles/Admin/TablePermissions/Sales`、`Roles/Admin/Members/user@x.com`)——CLI 输出的任何路径都可以直接再次用于 `te add`。 `te add` 支持以下选项: -- `-t, --type ` - 指定对象类型。 Common values: `Table`, `CalculatedTable`, `CalcGroup`, `Measure`, `CalculatedColumn`, `DataColumn`, `Hierarchy`, `Level`, `Calendar`, `CalcItem`, `KPI`, `Partition`, `Expression`, `Function`, `Perspective`, `Culture`, `Role`, `TablePermission`, `Member`. 支持 Tab 自动补全;可通过运行 `te add --help` 获取完整列表。 -- `-p, --property ` - property assignment on the new object (repeatable). The expression goes in `-p Expression="..."`, or use `--file`, or `-p Expression=-` to read it from stdin. -- `--file ` - read the expression from a file instead of inline. -- `--mode ` - storage mode for new tables: `import` (default), `directquery` (alias `dq`), `dual`, `directlake` (alias `dl`). +- `-t, --type ` - 指定对象类型。 常见值:`Table`、`CalculatedTable`、`CalcGroup`、`Measure`、`CalculatedColumn`、`DataColumn`、`Hierarchy`、`Level`、`Calendar`、`CalcItem`、`KPI`、`Partition`、`Expression`、`Function`、`Perspective`、`Culture`、`Role`、`TablePermission`、`Member`。 支持 Tab 自动补全;可通过运行 `te add --help` 获取完整列表。 +- `-p, --property ` - 对新对象进行属性赋值(可重复指定)。 表达式可以放在 `-p Expression="..."` 中,也可以使用 `--file`,或者用 `-p Expression=-` 从 stdin 读取。 +- `--file ` - 从文件读取表达式,而不是内联提供。 +- `--mode ` - 新表的存储模式:`import`(默认)、`directquery`(别名 `dq`)、`dual`、`directlake`(别名 `dl`)。 - `--if-not-exists` - 如果对象已存在,则直接以 `0` 退出且不报错。 可用于幂等的 CI/CD 管道。 - `--save` / `--save-to ` - 保存更改。 -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). -- `--serialization ` - override the serialization when saving (`tmdl`, `bim` (alias `tmsl`), `database.json`, `pbip`). -- `--source-type ` - 新表的初始分区源类型:`m`、`query` 或 `calculated`。 这会覆盖启发式检测结果。 `query` builds a legacy SQL `SELECT` partition bound to the model's provider data source and is refused with lakehouse/warehouse sources or when no provider source exists; `calculated` is only valid with `-t CalculatedTable`. -- `--partition-expression ` - raw M expression for the new table's initial partition. +- `--diff` / `--stat` / `--name-only` - 变更输出的呈现方式(参见 [模型编辑](#model-editing) 说明)。 +- `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`、`pbip`)。 +- `--source-type ` - 新表的初始分区源类型:`m`、`query` 或 `calculated`。 这会覆盖启发式检测结果。 `query` 会生成一个旧式 SQL `SELECT` 分区,并绑定到模型的 Provider数据源;在使用 Lakehouse/Warehouse 源,或不存在 Provider数据源时会被拒绝。`calculated` 仅在 `-t CalculatedTable` 下有效。 +- `--partition-expression ` - 新表初始分区的原始 M 表达式。 - `--force` - 即使修改引入 DAX 验证错误,也会保存。 -Adding a single data column to an existing table takes `-t DataColumn` with both `SourceColumn` and `DataType` required (refused on calculated tables and calculation groups): +向现有表添加单个数据列时,请使用 `-t DataColumn`,且必须同时提供 `SourceColumn` 和 `DataType`(在计算表格和计算组上会被拒绝): ```bash te add Sales/Quantity -t DataColumn -p SourceColumn=Qty -p DataType=Int64 --save ``` -Tables can be created in one shot from the model's **own** data source - no connection flags needed. The CLI reads the connection off the model's data source, discovers the source table's columns and their types, and creates the table with a partition already bound to that source. Over a legacy (provider) data source the partition is a legacy SQL query holding the generated `SELECT`, matching what the desktop **Import Tables** wizard writes; pass `--source-type m` for a Power Query (M) partition instead. Over a structured (Power Query) data source the partition is always M. Refusals are clean and create nothing: several usable data sources and no `--data-source`, no data source the CLI can read (SQL Server, Azure SQL, and Fabric SQL sources are covered), a source whose password the model does not store, or a source table the connection cannot find - the error names the table it looked for and where that name came from. +表可以直接从模型**自身**的数据源一次性创建,无需任何连接参数。 CLI 会从模型的数据源读取连接信息,发现源表的列及其类型,并创建该表,同时生成一个已绑定到该源的分区。 在旧式(Provider)数据源上,分区会是一个包含生成的 `SELECT` 的旧式 SQL 查询,与桌面版 **导入表** 向导写入的内容一致;如需改用 Power Query (M) 分区,请传入 `--source-type m`。 在结构化(Power Query)数据源上,分区始终为 M。拒绝时不会创建任何内容,常见原因包括:模型中有多个可用数据源但未提供 `--data-source`;没有 CLI 可读取的数据源(支持 SQL Server、Azure SQL 和 Fabric SQL 源);数据源的密码未存储在模型中;或连接找不到源表——错误会指出它查找的表名以及该名称的来源。 -- `--source-table ` - create the table from this source table. -- `--query "SELECT ..."` - create the table from a query instead: the query is described against the connection without being run, the new table gets exactly the columns it returns, and the query is kept as the partition's content. Works with an inferred connection and with one named explicitly. `--source-type query` places the SQL in a legacy Query partition bound to the model's legacy data source. Refused together with `--mode directlake` (a Direct Lake partition holds no query), with `--columns`, and with an expression of its own (`-p Expression=` or `--file`). -- `--data-source ""` - disambiguate when the model has several data sources. +- `--source-table ` - 从此源表创建该表。 +- `--query "SELECT ..."` - 改为通过查询创建表:系统会基于该连接分析该查询而不执行它,新表会获得它返回的全部且仅有的列,并将该查询保留为分区内容。 既适用于推断出的连接,也适用于显式命名的连接。 `--source-type query` 会把 SQL 放到一个旧式 Query 分区中,该分区绑定到模型的旧式数据源。 不能与 `--mode directlake`(Direct Lake 分区不保存查询)、`--columns` 以及其自身的表达式(`-p Expression=` 或 `--file`)同时使用。 +- `--data-source ""` - 当模型有多个数据源时,用于消除歧义。 -Schema detection against an explicit source also works, and always wins over inference: `--source sql|lakehouse|warehouse`, `--endpoint`, `--connection-string`, `--source-database`, `--source-table`, or a manual column spec `--columns "Id:Int64,Name:String"`. `te add "
" -t Table` with no source at all still creates an empty table to fill in yourself. +也支持针对显式指定的源进行架构检测,而且始终优先于推断:`--source sql|lakehouse|warehouse`、`--endpoint`、`--connection-string`、`--source-database`、`--source-table`,或手动列规范 `--columns "Id:Int64,Name:String"`。 完全不指定源时,`te add "
" -t Table` 仍会创建一个空表,供你自行填充。 ```bash te add Sales/Revenue -t Measure -p Expression="SUM(Sales[Amount])" --save @@ -324,7 +324,7 @@ te add TopCustomers -t Table --query "SELECT TOP 100 * FROM dbo.Customers" --sav - `--if-exists` - 如果对象不存在,则直接以 `0` 退出且不报错。 可用于幂等的 CI/CD 管道。 - `--dry-run` - 预览删除操作而不实际执行。 - `--save` / `--save-to ` - 保存更改。 -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--diff` / `--stat` / `--name-only` - 变更输出的呈现方式(参见 [模型编辑](#model-editing) 说明)。 - `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 ```bash @@ -342,11 +342,11 @@ te remove Sales/OldMeasure --if-exists --save # Idempotent - `-t, --type ` - 当源路径匹配到多种对象类型时,用于消除歧义(例如同名的列和层次结构)。 - `--save` / `--save-to ` - 保存更改。 -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). +- `--diff` / `--stat` / `--name-only` - 变更输出的呈现方式(参见 [模型编辑](#model-editing) 说明)。 - `--serialization ` - 保存时覆盖序列化格式(`tmdl`、`bim`(别名 `tmsl`)、`database.json`)。 - `--force` - 即使该变更会引入 DAX 验证错误,也仍会保存。 -Renaming an object whose name is not yours to set is refused with a non-zero exit code rather than reported as `No changes.` - a relationship (its name always describes the columns it joins), a measure's KPI, a role's table permission. +如果尝试重命名名称不由你设置的对象,将会被拒绝并以非零退出代码退出,而不是提示 `No changes.`——例如:关系(其名称始终描述它连接的列)、度量值的 KPI、角色的表格权限。 ```bash te move Sales/Revenue Finance/Revenue --save # Move measure to another table @@ -363,7 +363,7 @@ te move "Sales/Partitions/Old" "Sales/Partitions/New" --save # Container-form `te list` 支持: -- `--type ` - narrow to one object kind (`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`, `calculationitem`, `kpi`, `set`, `function`). 如果不提供 ``,这等同于输入匹配的容器关键字。 +- `--type ` - 限定为一种对象类型(`table`, `measure`, `column`, `hierarchy`, `partition`, `relationship`, `role`, `perspective`, `culture`, `calculationitem`, `kpi`, `set`, `function`)。 如果不提供 ``,这等同于输入匹配的容器关键字。 - `--paths-only` - 每行输出一个对象路径,适合通过管道传给 `xargs`、`te get` 或 `te set`。 - `--no-multiline` - 将多行单元格(通常是 DAX 或 M 表达式)折叠为单行并截断,让宽表中的各行仍便于浏览。 仅影响文本输出;JSON/CSV/TMSL 输出不受影响。 - `--output-format tmsl`(别名 `bim`)- 将匹配的对象输出为 TMSL/BIM 脚本。 适用于 `te list Tables --output-format bim > tables.json`。 `ls` 不支持 `--output-format tmdl`(TMDL 仅支持单对象输出——请使用 `te get`)。 @@ -388,29 +388,29 @@ te list Measures --no-multiline # Wide table with column dividers, s te list Tables --output-format bim > tables.json # All tables emitted as TMSL/BIM ``` -In JSON output, every listed object leads with its `objectPath` - a canonical path that resolves with `te get`. +在 JSON 输出中,每个列出的对象都以其 `objectPath` 开头——这是一个可由 `te get` 直接解析的规范路径。 ### get -Get properties of a model object, filter and list sets of objects, and analyze dependencies - `get` is the CLI's one read pipeline (`te list` and `te deps` remain as shortcuts). Takes a ``; omit it to list the model (same as `te list`), or pass `.` for the model root. A wildcard path (`te get "Sa*"`) or a container path (`te get Sales/Measures`) lists every match without needing `--ls`; `-p`, `--deps`, and `--properties` need exactly one object, so on a wildcard path they say so and suggest dropping the flag. +获取模型对象的属性、筛选并列出对象集,以及分析依赖关系——`get` 是 CLI 统一的读取管道(`te list` 和 `te deps` 仍保留为快捷方式)。 接受一个 ``;省略它即可列出模型(与 `te list` 相同),或者传入 `.` 表示模型根节点。 通配符路径(`te get "Sa*"`)或容器路径(`te get Sales/Measures`)会列出所有匹配项,无需 `--ls`;`-p`、`--deps` 和 `--properties` 都要求恰好对应一个对象,因此在通配符路径上会明确提示这一点,并建议去掉该标志。 `te get` 支持: -- `-p, --property ` - project a single property (e.g. `expression`, `formatString`). -- `--where ` - filter the result set; repeatable (AND), case-insensitive. A value with no `*` is an exact match; `*` is a wildcard, so a contains-search is `--where Name=*margin*`. With no path, `--where` filters the model's **top-level tables** - pass a container to search other kinds (`te get Measures --where Name=*margin*`). An empty result names what was searched and how the pattern was matched, and offers commands that widen the search. -- `--properties` - list the property names `-p` accepts on the resolved object, with each property's type, whether it can be written, what it holds, and - where a property takes a fixed set of values - the values it accepts. Both spellings are shown where they differ (`Hidden` / `IsHidden`), and annotations and translations appear in the bracket form they have to be written in. Internal bookkeeping properties are left out; `--all` adds them. Text and JSON output only; needs a single-object path and cannot combine with `-p`, `--ls`, `--where`, `--deps`, or `--unused`. -- `--ls` - compact table layout (the same rendering as `te list`). -- `--deps [upstream|downstream]` - dependency analysis (default: both directions); `--deep` for the recursive tree, `--max-depth ` (default `10`). -- `--unused` / `--hidden` - surface unused objects, as on `te deps`. -- `--paths-only` - one canonical object path per line, for piping. -- `--no-multiline` - collapse multi-line cells (with `--ls`/`--where`). 仅适用于文本输出。 +- `-p, --property ` - 仅输出单个属性(例如 `expression`、`formatString`)。 +- `--where ` - 筛选结果集;可重复使用(AND),不区分大小写。 不含 `*` 的值表示精确匹配;`*` 是通配符,因此包含搜索可写为 `--where Name=*margin*`。 不带路径时,`--where` 会筛选模型的 **顶级表**;传入容器可搜索其他类型(`te get Measures --where Name=*margin*`)。 空结果会说明搜索了什么、模式是如何匹配的,并提供扩大搜索范围的命令。 +- `--properties` - 列出已解析对象上 `-p` 可接受的属性名,以及每个属性的类型、是否可写、其内容,以及——当某个属性只接受固定值集合时——它可接受的值。 在两种写法不同时,会同时显示两者(`Hidden` / `IsHidden`);注释和翻译会按它们必须书写的方括号形式显示。 内部用途的属性默认省略;使用 `--all` 可将其包含在内。 仅支持文本和 JSON 输出;需要单对象路径,且不能与 `-p`、`--ls`、`--where`、`--deps` 或 `--unused` 组合使用。 +- `--ls` - 紧凑表格布局(与 `te list` 的渲染方式相同)。 +- `--deps [upstream|downstream]` - 依赖关系分析(默认:双向);`--deep` 用于递归树,`--max-depth `(默认 `10`)。 +- `--unused` / `--hidden` - 像在 `te deps` 中一样,显示未使用或隐藏的对象。 +- `--paths-only` - 每行输出一个规范对象路径,便于管道传递。 +- `--no-multiline` - 将多行单元格折叠为单行(与 `--ls`/`--where` 一起使用)。 仅适用于文本输出。 - `-t, --type ` - 当路径匹配到表下的多个子对象时,用于消除歧义(例如同名的列和层次结构)。 可选值:`Measure`、`Column`、`CalculatedColumn`、`Hierarchy`、`Calendar`、`Partition`、`CalculationItem`。 - `--output-format tmsl`(别名 `bim`)- 将解析后的对象输出为 TMSL/BIM JSON。 - `--output-format tmdl` - 将解析后的对象输出为 TMDL(仅限命名对象)。 `te get` 和 `te list` 共用同一个描述符目录,因此无论输出为哪种格式,属性的呈现方式都一致:文本表格、JSON 和 CSV 显示的都是同一组属性;给模型新增属性后,也会在所有格式中自动可见。 -The `Settable:` line under a `te get ` result lists the properties `te set` accepts on that object (`SortByColumn` among them) and ends with a pointer to `--properties` for the full list; an unknown property name on `te get -p` or `te set -p` points at the same listing. `te get -p` syntax-highlights every expression-valued property, detail rows and format string expressions included. In JSON output, a single object leads with `objectPath` (the canonical path, resolvable as-is by `te get`, `te set`, or `te remove`), followed by `type` and `properties`; a listing that matches nothing prints an empty array. +在 `te get ` 结果下方的 `Settable:` 行会列出 `te set` 可在该对象上接受的属性(其中包括 `SortByColumn`),并在末尾提示使用 `--properties` 查看完整列表;如果在 `te get -p` 或 `te set -p` 中使用未知属性名,也会指向同一列表。 `te get -p` 会对每个值为表达式的属性进行语法高亮,包括明细行和格式字符串表达式。 在 JSON 输出中,单个对象以 `objectPath` 开头(这是规范路径,可直接由 `te get`、`te set` 或 `te remove` 解析),后跟 `type` 和 `properties`;如果列表没有匹配项,则输出空数组。 ```bash te get Sales/Amount -p expression # Print DAX @@ -430,7 +430,7 @@ te get Sales/Revenue --deps downstream --deep # Recursive dependents ### find -Search string properties for text and report each match site. The pattern is a **literal, case-insensitive substring** by default - `te find "Gross*"` looks for a literal asterisk - so pass `--regex` for pattern matching. Use `te get --where Name=*Gross*` when you want to filter objects by a property value rather than search text. An empty result names the scope that was searched and the matching mode used, and offers commands that widen the search; a `--regex` pattern that is not a valid regular expression is refused with an error naming the flag and the pattern. +在字符串属性中搜索文本,并报告每处匹配的位置。 默认情况下,模式是**按字面匹配且不区分大小写的子字符串**——`te find "Gross*"` 会查找字面的星号——因此如需模式匹配,请传入 `--regex`。 需要按属性值筛选对象而不是搜索文本时,请使用 `te get --where Name=*Gross*`。 当结果为空时,会说明所搜索的范围和使用的匹配模式,并提供可扩大搜索范围的命令;如果 `--regex` 模式不是有效的正则表达式,则会被拒绝,并报错指明该参数及其模式。 `te find` 支持: @@ -447,13 +447,13 @@ te find "CALCULATE" --in expressions --paths-only | xargs -I{} te get {} -p expr te find "Gross.*Margin" --in names --regex ``` -Under `--output-format json`, `te find` reports the scope it searched and the matching mode it used alongside the matches. +在 `--output-format json` 下,`te find` 会在输出匹配结果的同时,报告其搜索范围以及所用的匹配模式。 ### diff 比较两个模型的结构差异。 返回以下退出码:`0` 表示相同,`1` 表示发现差异,`2` 表示错误。 -Changes are reported the same way the mutating commands report theirs: one consolidated entry per changed object, with `-`/`+` lines per property in text output. In JSON, the `changes` array entries carry `objectPath` (the canonical path, pipeable into `te get`), `objectType` (the same closed vocabulary as the findings JSON - `KPI`, `Member`, ...), `changeKind` (`created`, `deleted`, `modified`, or `moved` - a renamed object that carries a lineage tag is a single `moved` entry with `movedFromObjectPath`), and a `properties` array of `{property, before, after}` with PascalCase property names. An object that exists in only one of the two models is listed together with its contents - a new role's row-level security filters, a new table's columns, measures, and partitions, a new hierarchy's levels - each as its own entry, and the summary counts include them. +变更的报告方式与会修改内容的命令相同:每个已变更对象对应一条汇总条目,文本输出中每个属性各有 `-`/`+` 行。 在 JSON 中,`changes` 数组的条目包含 `objectPath` (规范路径,可通过管道传给 `te get`)、`objectType` (与 findings JSON 相同的固定枚举值 - `KPI`、`Member`、...)、`changeKind` (`created`、`deleted`、`modified` 或 `moved` - 带有 Lineage tag 的重命名对象会作为单个 `moved` 条目呈现,并包含 `movedFromObjectPath`),以及一个 `properties` 数组,其元素为使用 PascalCase 属性名的 `{property, before, after}`。 仅存在于两个模型之一中的对象会连同其内容一并列出:例如新角色的行级安全性筛选器、新表的列、度量值和分区、新层次结构的级别——每一项都会作为单独条目列出,汇总计数也会将其计入。 ```bash te diff ./model-v1 ./model-v2 @@ -468,7 +468,7 @@ te diff ./a ./b; switch ($LASTEXITCODE) { 0 { 'same' } 1 { 'different' } default ### deps -分析对象的上游和下游依赖关系,或找出整个模型中未使用的对象。 A shortcut for `te get --deps` / `te get --unused`. 单对象形式接受一个 ``。 +分析对象的上游和下游依赖关系,或找出整个模型中未使用的对象。 这是 `te get --deps` / `te get --unused` 的快捷方式。 单对象形式接受一个 ``。 `te deps` 接受以下选项: @@ -480,7 +480,7 @@ te diff ./a ./b; switch ($LASTEXITCODE) { 0 { 'same' } 1 { 'different' } default - `--unused` - 列出未被任何 DAX 引用,且未用于任何关系、层次结构级别、排序依据、变体、AlternateOf 基对象或日历时间角色的度量值、计算列以及**所有数据列**。 每条结果在文本模式下会显示 `(hidden)`,在 JSON 中则包含 `isHidden` 字段。 - `--hidden` - 将 `--unused` 限制为仅包含隐藏对象。 隐藏且未使用的对象是最安全的清理候选项,因为没有任何用户可见内容依赖它们。 -In JSON output, every entry - and every `upstream`, `downstream`, and `--deep` tree node - is named the way the rest of the CLI names objects: `objectPath` (canonical path, pipeable into `te get`), `object` (bare name), and `objectType`. +在 JSON 输出中,每个条目——以及每个 `upstream`、`downstream` 和 `--deep` 树节点——的命名方式都与 CLI 其余部分一致:`objectPath`(规范路径,可通过管道传给 `te get`)、`object`(不含路径的名称)和 `objectType`。 ```bash te deps Sales/Revenue # Upstream + downstream for one object @@ -498,7 +498,7 @@ te deps --unused --hidden # Only hidden, unused objects `te validate` 接受以下选项: -- `--ci ` - emit CI annotations to stderr: `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`). `none` or an empty value means no annotations; any other value is rejected before the command runs. +- `--ci ` - 向 stderr 输出 CI 注解:`vsts`(别名 `azdo`、`azure-devops`)或 `github`(别名 `gh`)。 `none` 或空值表示不输出注解;任何其他值都会在命令运行前被拒绝。 - `--trx ` - 将结果写入 VSTEST `.trx` 文件。 - `--errors-only` - `--no-warnings --no-antipatterns` 的简写:仅显示错误。 - `--no-warnings` - 隐藏语义分析器发出的警告。 @@ -512,9 +512,9 @@ te validate --ci github --trx results.trx te validate --errors-only # Hide warnings and anti-pattern hints ``` -Every finding carries a stable code, shown in the **Code** column of the Errors, Warnings, and Anti-patterns tables as well as in JSON, `--ci` annotations, and `--trx`. Three codes are worth knowing when a hand-written model is involved: `TE0012` (a column and a measure, or two columns, share a name within one table) and `TE0013` (a measure name is repeated across tables) are errors - Analysis Services refuses to load such a model, and `te save-as` refuses to write one unless `--force` or `--skip-validation` is passed; `TE0014` is a warning that a TMDL folder has no `database.tmdl`, so the compatibility level in effect is a substitute for the one the model declared. The folder still loads and `te validate` still exits `0` for `TE0014`; hide it like any other warning with `--no-warnings` or `--errors-only`. +每条发现项都有一个稳定的代码,会显示在“错误”“警告”和“反模式”表的 **Code** 列中,也会出现在 JSON、`--ci` 注解和 `--trx` 中。 当涉及手工编写的模型时,有三个代码值得了解:`TE0012`(同一表中的某列与某个度量值同名,或两列同名)和 `TE0013`(度量值名称跨表重复)都属于错误——Analysis Services 会拒绝加载此类模型,而 `te save-as` 也会拒绝写出此类模型,除非传入 `--force` 或 `--skip-validation`;`TE0014` 则是一个警告,表示某个 TMDL 文件夹缺少 `database.tmdl`,因此当前生效的兼容级别会替代模型所声明的兼容级别。 该文件夹仍可加载,而且对于 `TE0014`,`te validate` 仍会以 `0` 退出;可像隐藏其他警告一样,使用 `--no-warnings` 或 `--errors-only` 将其隐藏。 -Under `--output-format json`, `te validate` emits the shared findings JSON document (`summary` plus a flat `findings[]` array) shared with `te bpa run`, `te test run`, and `te query` - see @te-cli-findings. +在 `--output-format json` 下,`te validate` 会输出共享的 findings JSON 文档(`summary` 加上扁平的 `findings[]` 数组),该格式也被 `te bpa run`、`te test run` 和 `te query` 共用——参见 @te-cli-findings。 > [!NOTE] > `te validate` 不支持 `--output-format csv`——CSV 会在一开始就被拒绝,并给出可操作的错误提示,而不是生成不完整的结果。 验证输出使用 `text` 或 `json`。 @@ -535,12 +535,12 @@ Under `--output-format json`, `te validate` emits the shared findings JSON docum - `--fix` - 应用修复表达式,在可能的情况下自动修复违规项。 - `--save` - 应用修复后,将模型保存回原始位置。 - `--save-to ` - 应用修复后,将模型保存到其他路径。 -- `--diff` / `--stat` / `--name-only` - change-output rendering for the fix pass (see the [Model editing](#model-editing) note). +- `--diff` / `--stat` / `--name-only` - 用于修复阶段的变更输出呈现方式(参见[模型编辑](#model-editing)说明)。 - `--serialization ` - 模型序列化: `tmdl`、`bim` (别名 `tmsl`)、`database.json`。 - `--fail-on ` - 失败阈值:`error`(默认)或 `warning`。 当违规项达到该阈值时,将以退出代码 `1` 退出。 无论 `--fail-on` 如何设置,规则加载或求值错误(表达式无效、规则文件无法读取)也会导致命令以非零状态退出。 -- `--ci ` - emit CI logging commands to stderr: `vsts` (Azure DevOps; aliases `azdo`, `azure-devops`), `github` (GitHub Actions; alias `gh`). Unrecognised values are rejected up front. +- `--ci ` - 向 stderr 输出 CI 日志命令:`vsts`(Azure DevOps;别名 `azdo`、`azure-devops`)、`github`(GitHub Actions;别名 `gh`)。 无法识别的值会直接被拒绝。 - `--trx ` - 将结果作为 VSTEST `.trx` 文件写入指定路径。 -- `--no-multiline` - 将违规表中的多行单元格内容折叠为单行。 Text output only. +- `--no-multiline` - 将违规表中的多行单元格内容折叠为单行。 仅限文本输出。 ```bash te bpa run --fail-on error --ci github @@ -551,7 +551,7 @@ te bpa run --path 'Sa*' # Wildcard - every table starting with Sa te bpa run --path Sales/Measures # Path filter applied to the matched tables ``` -Under `--output-format json`, `te bpa run` emits the shared findings JSON document (see @te-cli-findings); with `--fix`, the JSON is a single document that also includes the `fix` change set. +在 `--output-format json` 下,`te bpa run` 会输出共享的 findings JSON 文档(见 @te-cli-findings);使用 `--fix` 时,JSON 会是单个文档,并额外包含 `fix` 变更集。 #### 规则来源与解析 @@ -564,9 +564,9 @@ Under `--output-format json`, `te bpa run` emits the shared findings JSON docume 2. **内置默认规则** - 除非传入 `--no-defaults`,或配置中的 [`bpa.builtInRules`](xref:te-cli-config#built-in-bpa-rules) 为 `false`,否则会加载。 `bpa.disabledBuiltInRuleIds` 中列出的单个内置规则会被跳过。 3. **模型嵌入规则** - 模型 `BestPracticeAnalyzer_Rules` 注释中的规则;除非传入 `--no-model-rules`,否则会加载。 除非同时传入 `--allow-external-rules` 参数,否则会跳过外部 URL 注释。 -The built-in defaults are exactly Tabular Editor 3's documented [built-in rule set](xref:built-in-bpa-rules) (the `TE3_BUILT_IN_*` IDs), so `te bpa run` and TE3 Desktop agree on what the built-ins flag. The six VertiPaq Analyzer rules (`VPA_*`) that earlier previews presented as built-in are not part of that set, and the `--vpa-rules` flag no longer exists; if a pipeline gates on one of them, copy its definition into your own rules file and point at it with `--rules`, `bpa.rules`, or `TE_BPA_RULES`. `--vpax` is unchanged and still supplies the statistics a VPA-aware rule of your own reads. C# scripts (`te script`, `te macro run`) see the same rule set through `Bpa.Rules` and `Bpa.Analyze()`. +内置默认规则与 Tabular Editor 3 文档中记录的[内置规则集](xref:built-in-bpa-rules)(`TE3_BUILT_IN_*` ID)完全一致,因此 `te bpa run` 与 TE3 Desktop 对内置规则会标记哪些问题的结果一致。 此前预览版中被当作内置规则提供的六条 VertiPaq分析器规则(`VPA_*`)不属于该规则集,`--vpa-rules` 标志也已不存在;如果某个管道依赖其中某条规则作为门禁条件,请把它的定义复制到你自己的规则文件中,并通过 `--rules`、`bpa.rules` 或 `TE_BPA_RULES` 指向该文件。 `--vpax` 保持不变,仍会提供可供你自己的支持 VPA 的规则读取的统计信息。 C# Script(`te script`、`te macro run`)也能通过 `Bpa.Rules` 和 `Bpa.Analyze()` 访问同一套规则集。 -Each rule ID is evaluated once. When the same ID appears in more than one layer, an explicit `--rules` file's definition wins in `te bpa run`, while the built-in definition wins in the deploy/save gates. 然后会移除模型 `BestPracticeAnalyzer_IgnoreRules` 注释中的规则 ID。 +每个规则 ID 只会评估一次。 当同一 ID 出现在多个层级时,在 `te bpa run` 中以显式 `--rules` 文件中的定义为准,而在部署/保存门禁中则以内置定义为准。 然后会移除模型 `BestPracticeAnalyzer_IgnoreRules` 注释中的规则 ID。 输出中的 `Rules loaded:` 行会列出每个提供规则的层级,例如: @@ -580,17 +580,17 @@ Rules loaded: 38 from 1 file(s) from bpa.rules config + built-in defaults + mode 子命令: -| 子命令 | 用途 | -| -------------------------------------------------- | ---------------------------- | -| `add ` | 添加新的 BPA 规则。 | -| [`disable`](#bpa-rules-disable) | 为当前用户禁用一条内置 BPA 规则。 | -| [`enable`](#bpa-rules-enable) | 重新启用先前已禁用的内置 BPA 规则。 | -| `ignore ` | 将规则添加到模型的忽略列表。 | -| [`init`](#bpa-rules-init) | 在解析后的 PATH 下创建一个空的 BPA 规则文件。 | -| [`list`](#bpa-rules-list)(别名 `ls`) | 列出来自所有来源的 BPA 规则及其状态。 | -| `remove ` (alias `rm`) | 删除一条 BPA 规则。 | -| `set ` | 更新 BPA 规则的属性。 | -| `unignore ` | 从模型的忽略列表中移除一条规则。 | +| 子命令 | 用途 | +| ---------------------------------- | ---------------------------- | +| `add ` | 添加新的 BPA 规则。 | +| [`disable`](#bpa-rules-disable) | 为当前用户禁用一条内置 BPA 规则。 | +| [`enable`](#bpa-rules-enable) | 重新启用先前已禁用的内置 BPA 规则。 | +| `ignore ` | 将规则添加到模型的忽略列表。 | +| [`init`](#bpa-rules-init) | 在解析后的 PATH 下创建一个空的 BPA 规则文件。 | +| [`list`](#bpa-rules-list)(别名 `ls`) | 列出来自所有来源的 BPA 规则及其状态。 | +| `remove `(别名 `rm`) | 删除一条 BPA 规则。 | +| `set ` | 更新 BPA 规则的属性。 | +| `unignore ` | 从模型的忽略列表中移除一条规则。 | `te bpa rules` 的所有子命令都接受以下选项: @@ -654,7 +654,7 @@ te bpa rules init --force - `--severity <1|2|3>` - `1`(信息)、`2`(警告,默认)、`3`(错误)。 - `--description ` - 规则触发时向用户显示的说明。 - `--fix-expression ` - `te bpa run --fix` 用于自动修复的 Dynamic LINQ 表达式。 -- `te bpa rules set ` - 更新现有规则的属性。 Uses `-p, --property ` (repeatable; `-` reads the value from stdin). 属性名称:`name`、`expression`、`scope`、`category`、`severity`、`description`、`fixExpression`。 +- `te bpa rules set ` - 更新现有规则的属性。 使用 `-p, --property `(可重复指定;`-` 表示从 stdin 读取值)。 属性名称:`name`、`expression`、`scope`、`category`、`severity`、`description`、`fixExpression`。 - `te bpa rules remove ` - 删除规则。 - `te bpa rules ignore ` - 将规则 ID 添加到模型的 `BestPracticeAnalyzer_IgnoreRules` 注解中。 - `te bpa rules unignore ` - 从模型的忽略列表中移除规则 ID。 @@ -717,15 +717,15 @@ te vertipaq --export stats.vpax te vertipaq --import stats.vpax # Analyze offline ``` -### Formatting expressions +### 格式化表达式 -Expression formatting lives in three places, depending on what you are formatting: +表达式格式化分布在三个地方,具体取决于你要格式化的内容: -- **An expression in the model**: `te set --format --save` - see [set](#set). -- **A loose expression** (not in any model): `te util format-dax` / `te util format-m` - see [Utilities](#utilities). -- **A whole-model sweep**: `te script --inline "Model.AllMeasures.FormatDax();" --save`. +- **模型中的表达式**:`te set --format --save`;参见 [set](#set)。 +- **独立表达式**(不在任何模型中):`te util format-dax` / `te util format-m`;参见 [实用工具](#utilities)。 +- **整个模型的批量处理**:`te script --inline "Model.AllMeasures.FormatDax();" --save`。 -DAX in a model is always comma-separated, so `--semicolons` exists only on `te util format-dax`, for DAX you have typed with semicolons yourself. +模型中的 DAX 始终使用逗号分隔,因此 `--semicolons` 只在 `te util format-dax` 上提供,用于处理你自己以分号输入的 DAX。 ## 执行 @@ -736,7 +736,7 @@ DAX in a model is always comma-separated, so `--semicolons` exists only on `te u `te query` 支持以下选项: - `` - 位置参数:要执行的 DAX 查询。 等同于传入 `-q`。 选择你觉得更易读的写法即可;如果两者都提供,以显式的 `-q` 为准。 -- `-q, --query ` - 内联查询(即上述位置参数的命名参数形式)。 `-q -` reads the query from stdin; with input piped and no query given at all, stdin is read implicitly. +- `-q, --query ` - 内联查询(即上述位置参数的命名参数形式)。 `-q -` 会从 stdin 读取查询;如果已通过管道传入输入且完全未提供查询,则会隐式读取 stdin。 - `--file ` - 从文件读取查询。 - `--limit ` - 默认为 100。 - `-o, --output-file ` - 将结果写入文件(`.csv`、`.tsv`、`.json`、`.dax`)。 @@ -755,14 +755,14 @@ te query --file query.dax --output-format json `te script` 支持以下选项: -- `--file ` - `.cs` / `.csx` file (repeatable). Bare positional `.cs`/`.csx` arguments are also accepted. -- `--inline ` - inline C# (repeatable; use `-` for stdin). -- `--validate` - compile the script(s) and report errors without executing them. Needs no model at all, so it works offline as a CI lint. +- `--file `:`.cs` / `.csx` 文件(可重复指定)。 也接受不带选项的 `.cs`/`.csx` 位置参数。 +- `--inline `:内联 C#(可重复指定;使用 `-` 表示从 stdin 读取)。 +- `--validate`:编译脚本并报告(Report)错误,但不执行。 完全不需要模型,因此可离线作为 CI 的 lint 检查使用。 - `--save` / `--save-to` / `--serialization`。 -- `--diff` / `--stat` / `--name-only` - change-output rendering (see the [Model editing](#model-editing) note). -- `--force` - save even if the mutation introduces DAX validation errors. +- `--diff` / `--stat` / `--name-only`:更改输出的呈现方式(参见 [模型编辑](#model-editing) 说明)。 +- `--force`:即使变更引入 DAX 验证错误,也会保存。 -Files and inline snippets run in the order they are written on the command line. +文件和内联代码片段会按它们在命令行中的书写顺序运行。 ```bash te script --file fix.cs --save @@ -772,7 +772,7 @@ echo "Info(Model.Name);" | te script --inline - te script --file fix.cs --validate # Compile-only, no model needed ``` -A run in which any script calls `Error(...)` exits non-zero, reports `"success": false` in JSON, and closes by saying the run completed with errors; changes the script already made are still saved when `--save` is given. `Warning(...)` and `Info(...)` never fail a run. On Windows, the `DisableCSharpScripts` administrator policy refuses `te script` outright - see [Administrator policies](xref:te-cli-config#administrator-policies). +如果有任何脚本调用 `Error(...)`,本次运行将以非零状态退出,在 JSON 中报告 `"success": false`,并在结束时提示本次运行已完成但存在错误;如果指定了 `--save`,脚本此前已做出的更改仍会保存。 `Warning(...)` 和 `Info(...)` 永远不会导致运行失败。 在 Windows 上,`DisableCSharpScripts` 管理员策略会直接拒绝执行 `te script`;参见 [管理员策略](xref:te-cli-config#administrator-policies)。 > [!IMPORTANT] > 如果你要迁移旧脚本,需要了解以下两个行为差异: @@ -804,7 +804,7 @@ A run in which any script calls `Error(...)` exits non-zero, reports `"success": ### macro -通过宏 JSON 文件(通常为 `MacroActions.json`)管理和运行宏。 宏文件的 PATH 按以下顺序解析:`--macros ` → 环境变量 `TE_MACROS_PATH` → CLI 配置中的 `macros` → `./MacroActions.json`。 On Windows, the `DisableMacros` administrator policy refuses every `te macro` command - see [Administrator policies](xref:te-cli-config#administrator-policies). +通过宏 JSON 文件(通常为 `MacroActions.json`)管理和运行宏。 宏文件的 PATH 按以下顺序解析:`--macros ` → 环境变量 `TE_MACROS_PATH` → CLI 配置中的 `macros` → `./MacroActions.json`。 在 Windows 上,`DisableMacros` 管理员策略会拒绝所有 `te macro` 命令;参见 [管理员策略](xref:te-cli-config#administrator-policies)。 子命令: @@ -823,7 +823,7 @@ A run in which any script calls `Error(...)` exits non-zero, reports `"success": 修改宏文件 (`add`、`set`、`remove` (别名 `rm`))。 这三个命令都操作 `--macros `(或解析得到的宏文件)。 - `te macro add ` - 创建新宏。 使用 `-e ""`(内联)或 `-s `(脚本文件)提供脚本主体。 可选:`--tooltip `、`--contexts `(宏适用的上下文,例如 `Table,Measure`,即“表、度量值”)、`--enabled true|false`。 -- `te macro set ` - 更新宏属性。 Use `-p, --property ` (repeatable; `-` reads the value from stdin). 属性名称:`name`、`execute`、`enabled`、`tooltip`、`validContexts`。 +- `te macro set ` - 更新宏属性。 使用 `-p, --property `(可重复指定;`-` 会从 stdin 读取值)。 属性名称:`name`、`execute`、`enabled`、`tooltip`、`validContexts`。 - `te macro remove ` - 删除宏。 ```bash @@ -854,8 +854,8 @@ te macro init --force `te macro run` 接受: - `--on ` - 将宏的选择上下文设置为单个已命名对象(如表、度量值、列等…)。 这相当于在 TE3 中右键单击该对象,并从上下文菜单调用宏。 -- `--save` / `--save-to` - 将宏所做的所有更改持久化保存。 Like every mutating command, `te macro run` is a dry run without `--save`. -- `--serialization ` / `--force` - as on the other mutating commands. +- `--save` / `--save-to` - 将宏所做的所有更改持久化保存。 与所有会修改内容的命令一样,未加 `--save` 时,`te macro run` 只会进行试运行。 +- `--serialization ` / `--force`:与其他会修改内容的命令相同。 ```bash te macro run "Hide all measures" @@ -869,13 +869,13 @@ te macro run "Format DAX" --on "'Net Sales'[Sales Amount]" --save # DAX form w 将语义模型部署到 Power BI、Fabric、Azure Analysis Services 或本地 SQL Server Analysis Services。 -**Dry run by default**: `te deploy` connects read-only and prints the exact TMSL it would send to stdout. Add `--execute` to actually deploy. +**默认先试运行**:`te deploy` 会以只读方式连接,并将实际会发送的精确 TMSL 输出到 stdout。 加上 `--execute` 才会实际部署。 `te deploy` 支持以下参数: -- `-s, --server` / `-d, --database` - the model **source**, exactly as on every other command. -- `--target-server ` / `--target-database ` - the deploy **destination**: a workspace name, endpoint, or server, and the semantic model name to create or overwrite. 使用服务器名称、FQDN、IP 地址或 MSOLAP 连接字符串时,会部署到 Analysis Services(本地环境使用 Windows 集成身份验证);使用 Workspace 名称或 `powerbi://...` URL 时,会部署到 Power BI。 For local model sources, the target falls back to the active `te connect` connection; when the source is remote, the target flags are required. Deploying a model onto itself is refused. -- `--execute` - actually deploy. In interactive mode this shows a summary + confirmation prompt with **`n` as the safe default**; `--execute --force` skips the prompt (required in CI, where a prompt without `--force` is an error). +- `-s, --server` / `-d, --database`:模型**源**,与其他所有命令完全一致。 +- `--target-server ` / `--target-database `:部署**目标**,即 Workspace 名称、端点或服务器,以及要创建或覆盖的语义模型名称。 使用服务器名称、FQDN、IP 地址或 MSOLAP 连接字符串时,会部署到 Analysis Services(本地环境使用 Windows 集成身份验证);使用 Workspace 名称或 `powerbi://...` URL 时,会部署到 Power BI。 对于本地模型源,目标会回退到当前活动的 `te connect` 连接;当源为远程时,则必须提供这些目标参数。 将模型部署到自身会被拒绝。 +- `--execute`:实际部署。 在交互模式下,会显示摘要和确认提示,且**默认安全选项为 `n`**;`--execute --force` 会跳过该提示(在 CI 中必须这样做,因为在没有 `--force` 的情况下出现提示会被视为错误)。 - `--deploy-full` - 覆盖现有内容,并同时部署连接、分区、共享表达式、角色及角色成员。 - `--deploy-connections` - `--deploy-partitions` @@ -887,11 +887,11 @@ te macro run "Format DAX" --on "'Net Sales'[Sales Amount]" --save # DAX form w - `--skip-bpa` - 完全跳过 BPA 门控检查。 - `--fix-bpa` - 如果规则定义了修复表达式,则自动修复 BPA 违规项。 - `--bpa-rules ` - 可重复指定;仅针对本次部署覆盖 CLI 配置中的 `bpa.rules`。 除非 `bpa.builtInRules` 为 `false`,否则内置规则仍会生效。 -- `--force` - skip the interactive confirmation. -- `--ci ` - `vsts` (aliases `azdo`, `azure-devops`) or `github` (alias `gh`); unrecognised values are rejected up front. +- `--force`:跳过交互式确认。 +- `--ci `:`vsts`(别名 `azdo`、`azure-devops`)或 `github`(别名 `gh`);无法识别的值会被直接拒绝。 - `-p, --profile ` - 一次性使用已保存的 @te-cli-auth 配置文件。 -`--output-format bim|tmdl` is rejected on deploy. To capture the deployment script for review, redirect the dry-run output: `te deploy ... > deploy.tmsl`. +部署时会拒绝 `--output-format bim|tmdl`。 如果要保存部署脚本供审查,请重定向试运行输出:`te deploy ... > deploy.tmsl`。 ```bash te deploy -m ./model --target-server my-workspace --target-database my-model --execute --force --ci github @@ -904,30 +904,30 @@ te deploy --local --target-server my-workspace --target-database my-model --exec > [!IMPORTANT] > `te deploy` 会在执行前运行 Best Practice Analyzer 作为门控检查。 BPA 门控配置请参见 @te-cli-config。 -A deploy **fails** when the server reports errors on one or more objects, even though the metadata has been written: the exit code is non-zero, JSON reports `"success": false` with the reason in `error`, the headline says the deploy landed with errors, and `--ci` reports the object errors as errors. Unprocessed objects are not a failure - a metadata-only deploy legitimately leaves objects holding no data. The workspace mirror set up with `te connect -w` applies the same rule. +即使元数据已经写入,只要服务器报告一个或多个对象存在错误,部署也会**失败**:退出代码为非零,JSON 会返回 `"success": false`,并在 `error` 中给出原因;标题会说明部署已完成但带有错误;`--ci` 也会将这些对象错误报告为错误。 未处理的对象不算失败——仅部署元数据时,本来就可能让对象不包含任何数据。 通过 `te connect -w` 设置的 Workspace 镜像也适用同样的规则。 > [!NOTE] -> 当设置 `--output-format json` 时,`te deploy` 的 JSON 输出始终包含解析后的 `server` 和 `database`,即使它们是从活动连接或配置文件中解析得到的,而不是显式传入的。 管道可使用这些字段来确认部署目标,而无需重新解析命令行。 `te deploy` also exits non-zero on failure under `--output-format json`, matching its text-mode behavior - the JSON payload is the failure record, not a success signal. +> 当设置 `--output-format json` 时,`te deploy` 的 JSON 输出始终包含解析后的 `server` 和 `database`,即使它们是从活动连接或配置文件中解析得到的,而不是显式传入的。 管道可使用这些字段来确认部署目标,而无需重新解析命令行。 在 `--output-format json` 下,`te deploy` 失败时也会以非零状态退出,这与其文本模式的行为一致——JSON 负载表示的是失败记录,不是成功信号。 ### refresh 在已部署的模型上触发数据刷新。 -**Dry run by default**: `te refresh` prints the TMSL a refresh would send to stdout. Add `--execute` to run it. +**默认先试运行**:`te refresh` 会将刷新时实际会发送的 TMSL 输出到 stdout。 加上 `--execute` 才会实际执行。 `te refresh` 支持: - `--type ` - `full`、`dataonly`(别名 `data-only`、`data`)、`automatic`(别名 `auto`)、`calculate`(别名 `calc`)、`clearvalues`(别名 `clear`)、`defragment`(别名 `defrag`)、`add`(默认值:`automatic`)。 - `--table ` - 刷新特定表(可为多个);可重复指定。 - `--partition ` - 刷新特定分区(可为多个)。 -- `--execute` - actually run the refresh. At a terminal it asks for confirmation with **`n` as the safe default**; add `--force` to skip the question. An unattended run (redirected output, `--output-format json`, or `--non-interactive`) stops with an error unless `--force` is given, so `te refresh --type full --execute --force` is the CI form. -- `--force` - skip the confirmation prompt. -- `--apply-refresh-policy ` - apply incremental refresh policies to determine which partitions are refreshed; pass a table name to scope the refresh to that table. Policies apply by default when the refresh type and scope are compatible, except for models hosted in Power BI Desktop. An explicit value wins (with warnings when it cannot take effect). -- `--effective-date ` - set the effective date used by the refresh policy (ignored, with a warning, when no policy applies). +- `--execute`:实际执行刷新。 在终端中,会请求确认,且**默认安全选项为 `n`**;加上 `--force` 可跳过此提示。 无人值守运行(输出被重定向、使用 `--output-format json` 或 `--non-interactive`)时,如果未提供 `--force`,就会报错并停止,因此 `te refresh --type full --execute --force` 是适用于 CI 的形式。 +- `--force` - 跳过确认提示。 +- `--apply-refresh-policy ` - 应用增量刷新的刷新策略,以确定要刷新的分区;传入表名可将刷新范围限定到该表。 当刷新类型和范围兼容时,默认会应用这些策略,但托管在 Power BI Desktop 中的模型除外。 显式指定的值优先(若无法生效,会发出警告)。 +- `--effective-date ` - 设置刷新策略使用的生效日期(未应用任何策略时,将忽略此值并发出警告)。 - `--max-parallelism ` - 设置可并行刷新的最大分区数。 将刷新封装在 TMSL `sequence` 命令中。 -- `--no-progress`, `--trace [path]`。 `--trace` without `--execute` warns and prints the TMSL. Trace timing comes from the server's clock, the log is kept until the server has finished delivering buffered events, and `te-refresh-*` traces older than an hour that interrupted runs left behind are stopped and dropped at the start of a traced refresh (traces from other tools are never touched). +- `--no-progress`, `--trace [path]`。 `--trace` 若未配合 `--execute` 使用,会发出警告并打印 TMSL。 跟踪时间以服务器时钟为准;日志会一直保留到服务器完成缓冲事件的传送;在启动带跟踪的刷新时,会停止并丢弃那些因运行中断而遗留、且已超过一小时的 `te-refresh-*` 跟踪(不会触碰其他工具的跟踪)。 -Executed refreshes under `--output-format json` always include a `progress` array; with the `vertipaqOnRefresh` config key enabled, a per-table `vertipaq` array (rows, size, columns) is included too - no `--trace` needed. +在 `--output-format json` 下执行的刷新始终包含 `progress` 数组;如果启用了 `vertipaqOnRefresh` 配置键,还会包含每个表的 `vertipaq` 数组(rows、size、columns)——无需 `--trace`。 ```bash te refresh --type full --execute # Full refresh (asks for confirmation at a terminal) @@ -937,7 +937,7 @@ te refresh --type full > refresh.tmsl # Dry run: emit TMSL onl te refresh --apply-refresh-policy Sales --execute # Apply Sales' incremental refresh policy ``` -Incremental refresh policies are authored with [`te set`](#incremental-refresh-policies) on a table's `RefreshPolicy` sub-object. +增量刷新的刷新策略是在表的 `RefreshPolicy` 子对象上通过 [`te set`](#incremental-refresh-policies) 定义的。 ## 测试 @@ -957,7 +957,7 @@ te test run --ci github --trx results.trx te test run --tag revenue ``` -Suites are validated before any connection is made; a suite that fails validation (for example, a missing `query_file`) exits `1` without running anything. Under `--output-format json`, `te test run` emits the shared findings JSON document with test-specific extras (`suites`, `invalidSuites`, `testSummary`) - see @te-cli-findings. +在建立任何连接之前会先验证测试套件;验证失败的套件(例如缺少 `query_file`)会以退出码 `1` 直接退出,不会运行任何内容。 在 `--output-format json` 下,`te test run` 会输出共享的 findings JSON 文档,并附带测试专用的额外字段(`suites`、`invalidSuites`、`testSummary`)——参见 @te-cli-findings。 ### test init / spec / use / list / snapshot / compare @@ -988,7 +988,7 @@ te connect --profile prod # Activate a saved profile te connect --clear # Clear the active connection (and any workspace mirror) ``` -`te connect --local` lists every local Analysis Services instance - Power BI Desktop (Store and installer versions), Visual Studio workspaces, and standalone SSAS - with a two-step prompt (instance, then database) when an instance hosts several databases. Non-interactive mode fails with the candidate list instead of picking silently; narrow it with `te connect --local `. +`te connect --local` 会列出所有本地 Analysis Services 实例,包括 Power BI Desktop(Store 版和安装程序版)、Visual Studio Workspace 以及独立的 SSAS;当某个实例托管多个数据库时,会提供两步提示(先选实例,再选数据库)。 非交互模式不会静默选择,而是会连同候选列表一起报错;可使用 `te connect --local ` 缩小范围。 #### 工作区模式(`-w` / `--workspace`) @@ -1019,9 +1019,9 @@ te connect ./revenue-model -w Finance "Revenue Model" # Mirror local → remo ### config list / paths / init / set -View and manage CLI configuration. (`te config list` 的别名是 `ls`。) 参见 @te-cli-config。 +查看和管理 CLI 配置。 (`te config list` 的别名是 `ls`。) 参见 @te-cli-config。 -`te config set` takes a positional `key value` pair or the equivalent `-p key=value`. +`te config set` 接受位置参数形式的 `key value` 键值对,或等效的 `-p key=value`。 ```bash te config list # Display all settings @@ -1031,17 +1031,17 @@ te config set autoFormat true te config set -p spinner=false # -p form ``` -## Utilities +## 实用工具 -Model-free helpers. `te util` subcommands never touch a model - `--model`, `-s`/`-d`, `--local`, `--recent`, and `--auth` are rejected. +不依赖模型的辅助工具。 `te util` 子命令不会触碰任何模型——`--model`、`-s`/`-d`、`--local`、`--recent` 和 `--auth` 都会被拒绝。 ### util format-dax -Format a loose DAX expression. +格式化一个独立的 DAX 表达式。 -- `` - the expression to format; `-` reads it from stdin. -- `--semicolons` - format DAX written with semicolons as list separators (European locale). The flag selects the semicolon dialect for the expression that is read as well as for the output, so it is for DAX you authored with semicolons - comma-separated DAX fails with a syntax error under it. It is accepted only here: `te set --format` refuses it, because an expression stored in a model is always comma-separated. -- `--long` - long format with fewer line breaks. 默认为短格式。 +- `` - 要格式化的表达式;`-` 表示从 stdin 读取。 +- `--semicolons` - 按使用分号作为列表分隔符编写的 DAX 进行格式化(欧洲区域设置)。 该标志会让读取到的表达式和输出都采用分号语法,因此仅适用于你用分号编写的 DAX;逗号分隔的 DAX 在该模式下会因语法错误而失败。 仅在此处支持:`te set --format` 会拒绝它,因为存储在模型中的表达式始终以逗号分隔。 +- `--long` - 使用较少换行的长格式。 默认为短格式。 - `--no-space-after-function` - 省略函数名称后的空格。 ```bash @@ -1050,11 +1050,11 @@ cat query.dax | te util format-dax - te util format-dax "CALCULATE(SUM(Sales[Amt]); Sales[Region] = \"EU\")" --semicolons # Semicolon-authored DAX ``` -JSON output carries `success`, `formatted`, and `errors`. For expressions already in the model, use `te set --format ` instead; for a whole-model sweep, `te script --inline "Model.AllMeasures.FormatDax();" --save`. +JSON 输出包含 `success`、`formatted` 和 `errors`。 对于模型中已有的表达式,请改用 `te set --format `;如果需要遍历整个模型的度量值,则使用 `te script --inline "Model.AllMeasures.FormatDax();" --save`。 ### util format-m -Format a loose M/Power Query expression. `-` reads from stdin; no language-specific options. A malformed expression - an unterminated string, for example - is reported as a failure with a non-zero exit code and the original text returned unchanged, never a silently shortened result. +格式化独立的 M/Power Query 表达式。 `-` 从标准输入读取;没有针对特定语言的选项。 格式错误的表达式——例如未闭合的字符串——会被 Report 为失败,退出代码为非零,并原样返回原始文本;绝不会在不提示的情况下返回被截短的结果。 ```bash te util format-m "let x = 1 in x" @@ -1094,7 +1094,7 @@ te interactive -s MyWorkspace -d MyModel # Start with a remote model printf "list Measures\nexit\n" | te interactive --model ./model # Pipe commands via stdin ``` -Inside the session, mutating commands stage in memory: `save` (no arguments) commits the staged edits and `revert` discards them, while `save-as` re-serializes to a format or location. Closing a session that still holds staged edits asks for confirmation (or, when nobody can answer, warns and exits non-zero); `exit --force` throws them away deliberately - see @te-cli-interactive. +在会话中,修改类命令会先将更改暂存在内存中:`save`(无参数)提交这些暂存编辑,`revert` 将其丢弃,而 `save-as` 会重新序列化到某种格式或位置。 关闭仍包含暂存编辑的会话时,会要求确认(或在无人确认时发出警告并以非零代码退出);`exit --force` 会主动丢弃这些更改——见 @te-cli-interactive。 引号和 DAX 风格的引用在会话内外的用法一致——有关 REPL 中支持括号感知的 argv 拆分的详细信息,请参见上文的[对象路径](#object-paths)一节以及 @te-cli-interactive。 @@ -1137,11 +1137,11 @@ te completion fish ## 退出代码 -| 退出代码 | 含义 | -| ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `0` | 成功。 | -| `1` | Generic failure (invalid arguments, command failed, validation errors, auth failure, BPA gate failed at severity >= error, a `te script` run in which a script reported an error, a `te deploy` the server accepted with object errors). 用于 `te diff`:发现差异。 | -| `2` | 仅适用于 `te diff`:比较时发生错误,因此差异状态未知。 | +| 退出代码 | 含义 | +| ---- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `0` | 成功。 | +| `1` | 通用失败(参数无效、命令失败、验证错误、身份验证失败、BPA gate 在严重性 >= error 时失败、`te script` 运行中脚本 Report 了错误、服务器接受了 `te deploy`,但对象存在错误)。 用于 `te diff`:发现差异。 | +| `2` | 仅适用于 `te diff`:比较时发生错误,因此差异状态未知。 | 如需在 CI 管道中进行更细致的控制,可将退出代码与 `--ci ` 注释以及 `--trx` 结果文件结合使用——参见 @te-cli-cicd。 @@ -1151,5 +1151,5 @@ te completion fish - @te-cli-install - 安装并设置 CLI。 - @te-cli-auth - 进行身份验证并管理连接。 - @te-cli-config - 配置文件、BPA 门禁和变更后行为。 -- @te-cli-findings - the findings JSON shared by validate, bpa run, test run, and query. +- @te-cli-findings - validate、bpa run、test run 和 query 共享的 findings JSON。 - @te-cli-migrate - TE2 → TE3 标志映射。 From fe99d085971f0359e0969759390f1b2e0c14291e Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:54 +0200 Subject: [PATCH 41/48] New translations te-cli-config.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-config.md | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-config.md b/localizedContent/zh/content/features/te-cli/te-cli-config.md index 9acefc17e..fc4483390 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-config.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-config.md @@ -19,7 +19,7 @@ applies_to: Tabular Editor CLI 可从 JSON 文件读取可选配置。 配置控制三类内容: -- **File paths** - where the CLI reads macros and BPA rules, and where to write the query log. +- **文件路径**——CLI 在哪里读取宏和 BPA 规则,以及将查询日志写入哪里。 - **行为默认设置** — BPA 门禁、自动格式化、校验。 - **已保存的连接配置文件** — 你可切换的已命名配置文件列表。 @@ -67,7 +67,7 @@ te config set macros null # Clear a path override te config set -p spinner=false # -p key=value works too ``` -Keys can be passed positionally (`te config set `) or as `-p key=value`. 如果键未知,命令将以退出码 `1` 失败,并返回一条列出有效键的错误信息。 +键可以按位置传入(`te config set `),也可以使用 `-p key=value`。 如果键未知,命令将以退出码 `1` 失败,并返回一条列出有效键的错误信息。 如果配置文件不存在,`te config set` 会先在解析后的路径自动创建一个配置文件 (若设置了则为 `$TE_CONFIG`,否则为 `~/.config/te/config.json`),然后再应用更改。 @@ -142,20 +142,20 @@ CLI 不会自动检测 TE3 的任何安装位置——请显式配置这些项 所有与 BPA 相关的设置都位于 `bpa` 对象下,并可在 `te config set` 中使用点号分隔的键进行设置。 -| 键名 | 默认值 | 说明 | -| ---------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `autoFormat` | `false` | Automatically format the DAX expressions changed by a mutating command. Formatting is scoped to the objects the command touched but covers every DAX expression property they hold (expressions, format string expressions, detail rows, KPI target/status/trend, calculation group and table permission expressions, etc.). Power Query (M) and SQL partition queries are never reformatted. Always uses the built-in offline formatter in the comma dialect; the `formatOptions` layout keys apply. | -| `validateOnMutation` | `true` | After a mutating command (`add`, `set`, `mv`, `macro run`), check that every `Table[Column]` reference in the model still resolves. 可在部署前捕获因重命名或删除而引入的悬空引用。 | -| `mutationOutput` | `diff` | How mutating commands (`add`, `set`, `move`, `remove`, `script`, `bpa run --fix`) render the resulting change set in text output: `diff` (full before/after diff), `stat` (per-object change counts), `name-only` (changed object paths), or `none` (suppress the change set; config-only - there is no `--none` flag). The per-command `--diff` / `--stat` / `--name-only` flags override for one invocation. JSON output always carries the full `changes` array regardless. | -| `bpa.onMutation` | `false` | 在每次更改命令(`set`、`add`、`mv`、`rm`、`macro run`)后,运行一次限定范围的 BPA 分析。 只检查受影响表中的对象,而不是整个模型——这对于迭代编辑时获得快速反馈很有用。 | -| `bpa.onDeploy` | `true` | 在执行 `te deploy` 之前运行 BPA 关卡检查。 如果有任何规则以严重级别 >= error 触发,部署将中止。 可通过 `--skip-bpa` 在单次调用中跳过,或通过 `--fix-bpa` 自动修复。 | -| `bpa.onSave` | `true` | Run the BPA gate before `te save-as` writes to disk. 可通过 `--skip-bpa` 或 `--force` 在单次调用中跳过。 | -| `bpa.builtInRules` | `true` | 每次运行关卡检查时,都包含精选的内置 BPA 规则集。 设为 `false` 可完全忽略内置规则;此时关卡检查只运行通过 `bpa.rules` 配置的规则以及嵌入模型中的规则。 | -| `bpa.disabledBuiltInRuleIds` | `null` | 要从门禁中排除的各个内置规则的 ID。 可通过 `te bpa rules disable ` / `te bpa rules enable ` 修改——优先使用这些命令,而不是直接编辑该数组。 | -| `vertipaqOnRefresh` | `false` | 成功刷新后(`full`、`dataonly`、`automatic` 或 `add`),自动运行 VertiPaq 分析,以显示已刷新表的存储统计信息。 有助于立即发现意外的基数变化或内存回归。 | -| `interactiveEditMode` | `stage` | 在 `te interactive` 中对内存中变更的默认处理方式。 `stage` 会将变更保留在内存中,直到调用 `save`(最安全);`save` 会在每次产生变更的命令后写回源(对远程源请谨慎使用——每次 `set` 都会触发一次 XMLA 写入);`revert` 会在每条命令后丢弃变更,除非传入了 `--save` 或 `--stage`。 每个命令上的 `--save` / `--revert` / `--stage` 标志始终会覆盖此设置。 | -| `launchInteractiveMode` | `auto` | 控制在终端中不带任何参数运行 `te` 时,是否启动交互式 REPL。 `auto` (默认) 仅在三个流(stdin、stdout、stderr)都连接到 TTY 时才会启动 REPL,因此脚本和 CI 流水线会按常规方式解析,不会进入 REPL。 `always` 会在无论是否重定向的情况下都启动 REPL。 `never` 会完全禁用自动启动,恢复传统的空参数显示帮助行为。 全局 `--non-interactive` 标志会在单次调用中强制设为 `never`。 也可通过 `TE_INTERACTIVE` 环境变量为单次调用设置该值。 | -| `disableTelemetry` | `false` | 选择不参与匿名使用遥测数据收集。 CLI 会收集粗粒度的命令使用数据(命令名称、退出代码、持续时间),用于确定功能优先级。 CLI 绝不会收集模型内容、PATH 或查询文本。 | +| 键名 | 默认值 | 说明 | +| ---------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `autoFormat` | `false` | 自动格式化由会产生变更的命令改动过的 DAX 表达式。 格式化范围仅限于命令触及的对象,但会覆盖这些对象包含的所有 DAX 表达式属性(表达式、格式字符串表达式、明细行、KPI 目标/状态/趋势、计算组和表格权限表达式等)。 Power Query (M) 和 SQL 分区查询永远不会被重新格式化。 始终使用内置的离线格式化程序并采用逗号方言;`formatOptions` 布局键会生效。 | +| `validateOnMutation` | `true` | 在执行更改命令(`add`、`set`、`mv`、`macro run`)后,检查模型中的每个 `Table[Column]` 引用是否仍可解析。 可在部署前捕获因重命名或删除而引入的悬空引用。 | +| `mutationOutput` | `diff` | 变更命令(`add`、`set`、`move`、`remove`、`script`、`bpa run --fix`)在文本输出中如何呈现最终的变更集:`diff`(完整的前后差异)、`stat`(按对象统计的变更计数)、`name-only`(已变更对象路径),或 `none`(不显示变更集;仅用于配置——没有 `--none` 标志)。 按命令提供的 `--diff` / `--stat` / `--name-only` 标志可在单次调用中覆盖该设置。 无论设置如何,JSON 输出始终包含完整的 `changes` 数组。 | +| `bpa.onMutation` | `false` | 在每次更改命令(`set`、`add`、`mv`、`rm`、`macro run`)后,运行一次限定范围的 BPA 分析。 只检查受影响表中的对象,而不是整个模型——这对于迭代编辑时获得快速反馈很有用。 | +| `bpa.onDeploy` | `true` | 在执行 `te deploy` 之前运行 BPA 关卡检查。 如果有任何规则以严重级别 >= error 触发,部署将中止。 可通过 `--skip-bpa` 在单次调用中跳过,或通过 `--fix-bpa` 自动修复。 | +| `bpa.onSave` | `true` | 在 `te save-as` 写入磁盘之前运行 BPA 闸门检查。 可通过 `--skip-bpa` 或 `--force` 在单次调用中跳过。 | +| `bpa.builtInRules` | `true` | 每次运行关卡检查时,都包含精选的内置 BPA 规则集。 设为 `false` 可完全忽略内置规则;此时关卡检查只运行通过 `bpa.rules` 配置的规则以及嵌入模型中的规则。 | +| `bpa.disabledBuiltInRuleIds` | `null` | 要从门禁中排除的各个内置规则的 ID。 可通过 `te bpa rules disable ` / `te bpa rules enable ` 修改——优先使用这些命令,而不是直接编辑该数组。 | +| `vertipaqOnRefresh` | `false` | 成功刷新后(`full`、`dataonly`、`automatic` 或 `add`),自动运行 VertiPaq 分析,以显示已刷新表的存储统计信息。 有助于立即发现意外的基数变化或内存回归。 | +| `interactiveEditMode` | `stage` | 在 `te interactive` 中对内存中变更的默认处理方式。 `stage` 会将变更保留在内存中,直到调用 `save`(最安全);`save` 会在每次产生变更的命令后写回源(对远程源请谨慎使用——每次 `set` 都会触发一次 XMLA 写入);`revert` 会在每条命令后丢弃变更,除非传入了 `--save` 或 `--stage`。 每个命令上的 `--save` / `--revert` / `--stage` 标志始终会覆盖此设置。 | +| `launchInteractiveMode` | `auto` | 控制在终端中不带任何参数运行 `te` 时,是否启动交互式 REPL。 `auto` (默认) 仅在三个流(stdin、stdout、stderr)都连接到 TTY 时才会启动 REPL,因此脚本和 CI 流水线会按常规方式解析,不会进入 REPL。 `always` 会在无论是否重定向的情况下都启动 REPL。 `never` 会完全禁用自动启动,恢复传统的空参数显示帮助行为。 全局 `--non-interactive` 标志会在单次调用中强制设为 `never`。 也可通过 `TE_INTERACTIVE` 环境变量为单次调用设置该值。 | +| `disableTelemetry` | `false` | 选择不参与匿名使用遥测数据收集。 CLI 会收集粗粒度的命令使用数据(命令名称、退出代码、持续时间),用于确定功能优先级。 CLI 绝不会收集模型内容、PATH 或查询文本。 | ```bash te config set bpa.rules "/etc/te/team.json,/etc/te/strict.json" @@ -166,13 +166,13 @@ te config set bpa.disabledBuiltInRuleIds "TE3_BUILT_IN_DATE_TABLE_EXISTS,TE3_BUI ### 格式选项 -Applied whenever the CLI formats DAX. The CLI ships a formatter that works fully offline. The layout keys (`shortFormat`, `skipSpaceAfterFunction`) apply when `autoFormat` reformats mutated expressions and when `te query` renders query text; explicit formatting via `te set --format ` and `te util format-dax` takes the equivalent per-invocation flags (`--long`, `--no-space-after-function`) instead. There is deliberately no list-separator key: DAX stored in a model or sent to Analysis Services is always comma-separated, so every config-driven formatting pass uses commas. The one place the semicolon dialect applies is the `--semicolons` flag on `te util format-dax`, for DAX you have typed with semicolons yourself. `formatOptions.useSqlBiDaxFormatter` routes explicit formatting and `te query`'s rendering through the SQL BI [daxformatter.com](https://www.daxformatter.com) web service (requires internet access) if you need that style; `autoFormat` always uses the built-in formatter regardless. +只要 CLI 格式化 DAX,就会应用这些设置。 CLI 自带一个可完全离线运行的格式化程序。 布局键(`shortFormat`、`skipSpaceAfterFunction`)会在 `autoFormat` 重新格式化被修改的表达式时,以及在 `te query` 渲染查询文本时生效;通过 `te set --format ` 和 `te util format-dax` 显式格式化时,则改用等效的单次调用标志(`--long`、`--no-space-after-function`)。 这里特意没有提供列表分隔符键:存储在模型中或发送到 Analysis Services 的 DAX 始终以逗号分隔,因此所有由配置驱动的格式化都会使用逗号。 唯一会用到分号方言的地方,是 `te util format-dax` 上的 `--semicolons` 标志,用于处理你自己以分号输入的 DAX。 `formatOptions.useSqlBiDaxFormatter` 会将显式格式化以及 `te query` 的渲染改为通过 SQL BI 的 [daxformatter.com](https://www.daxformatter.com) Web 服务(需要联网)来处理,以获得该风格;而 `autoFormat` 则始终使用内置格式化程序。 -| 键 | 默认值 | 说明 | -| -------------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `formatOptions.shortFormat` | `false` | 尽可能优先使用简短的单行格式,而不是默认的多行布局。 | -| `formatOptions.skipSpaceAfterFunction` | `false` | 省略函数名称与左括号之间的空格(例如使用 `SUM(x)`,而不是 `SUM (x)`)。 | -| `formatOptions.useSqlBiDaxFormatter` | `false` | Format DAX via the [SQL BI daxformatter.com](https://www.daxformatter.com) web service instead of the built-in formatter. 需要联网。 The built-in formatter (default) works offline and matches the Tabular Editor 3 Desktop default. | +| 键 | 默认值 | 说明 | +| -------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `formatOptions.shortFormat` | `false` | 尽可能优先使用简短的单行格式,而不是默认的多行布局。 | +| `formatOptions.skipSpaceAfterFunction` | `false` | 省略函数名称与左括号之间的空格(例如使用 `SUM(x)`,而不是 `SUM (x)`)。 | +| `formatOptions.useSqlBiDaxFormatter` | `false` | 通过 [SQL BI daxformatter.com](https://www.daxformatter.com) Web 服务格式化 DAX,而不是使用内置格式化程序。 需要联网。 内置格式化程序(默认)可离线工作,并与 Tabular Editor 3 Desktop 的默认格式一致。 | ### 显示 @@ -188,22 +188,22 @@ Applied whenever the CLI formats DAX. The CLI ships a formatter that works fully 已保存的连接配置文件存放在 `profiles` 键下。 不要手动编辑——请使用 `te profile set / remove / list`。 配置文件管理见 @te-cli-auth。 -配置文件可以包含 **覆盖项**,在配置文件处于启用状态时,用来覆盖上述默认行为。 The keys a profile can override are `autoFormat`, `validateOnMutation`, `mutationOutput`, `bpa.onMutation`, `bpa.onDeploy`, `bpa.onSave`, `vertipaqOnRefresh`, `spinner`, and `interactiveEditMode`. 这样一来,开发配置文件可以放宽验证和 BPA,而生产配置文件则保持严格: +配置文件可以包含 **覆盖项**,在配置文件处于启用状态时,用来覆盖上述默认行为。 配置文件可覆盖的键包括 `autoFormat`、`validateOnMutation`、`mutationOutput`、`bpa.onMutation`、`bpa.onDeploy`、`bpa.onSave`、`vertipaqOnRefresh`、`spinner` 和 `interactiveEditMode`。 这样一来,开发配置文件可以放宽验证和 BPA,而生产配置文件则保持严格: ```bash te profile set dev --validate-on-mutation false --bpa-on-deploy false te profile set prod --auto-format true ``` -`te profile set` exposes flags for the common ones (`--auto-format`, `--validate-on-mutation`, `--bpa-on-mutation`, `--bpa-on-deploy`, `--vertipaq-on-refresh`, `--spinner`); each accepts `true`, `false`, or `null` to clear the override. +`te profile set` 为常用项提供了标志(`--auto-format`、`--validate-on-mutation`、`--bpa-on-mutation`、`--bpa-on-deploy`、`--vertipaq-on-refresh`、`--spinner`);每项都接受 `true`、`false` 或 `null`,其中 `null` 用于清除覆盖。 ## BPA 闸门 BPA 闸门是一道安全防线,用于防止存在规则违规的模型被保存或部署。 执行以下命令时,它会自动运行: - `te deploy` 会触发闸门检查,除非传入 `--skip-bpa` 或 `bpa.onDeploy` 为 `false`。 -- `te save-as` runs the gate unless `--skip-bpa` (or `--force`) is passed or `bpa.onSave` is `false`. -- `te add`, `te set`, `te move`, `te remove`, `te macro run` run the gate only when `bpa.onMutation` is `true`. +- `te save-as` 会运行闸门检查,除非传入 `--skip-bpa`(或 `--force`),或 `bpa.onSave` 为 `false`。 +- `te add`、`te set`、`te move`、`te remove`、`te macro run` 仅在 `bpa.onMutation` 为 `true` 时才会执行 gate 检查。 闸门检查会从 `bpa.rules` 加载 BPA 规则,并且默认还会加载内置规则集(由 `bpa.builtInRules` 控制)。 可通过 `bpa.disabledBuiltInRuleIds` 单独排除内置规则——可使用 `te bpa rules disable ` / `te bpa rules enable ` 管理。 @@ -211,7 +211,7 @@ BPA 闸门是一道安全防线,用于防止存在规则违规的模型被保 - `--fix-bpa` - 在内存中将规则的 `fixExpression` 应用于部署/保存产物;不会修改源文件。 - `--skip-bpa` - 仅对本次命令禁用闸门检查。 -- `--bpa-rules ` - repeatable; override `bpa.rules` for this single `te deploy` or `te save-as` invocation. 除非 `bpa.builtInRules` 为 `false`,否则内置规则仍会生效。 +- `--bpa-rules ` - 可重复指定;仅在本次调用 `te deploy` 或 `te save-as` 时覆盖 `bpa.rules`。 除非 `bpa.builtInRules` 为 `false`,否则内置规则仍会生效。 可单独运行 `te bpa run`,在不部署的情况下预览闸门检查的行为: @@ -228,7 +228,7 @@ CLI 随附一套权威的内置 BPA 规则集,并以 JSON 资源的形式嵌 ## 变更后行为 -When you run a mutating command (`te add`, `te set`, `te move`, `te macro run`), the CLI performs these checks automatically: +运行会产生变更的命令(`te add`、`te set`、`te move`、`te macro run`)时,CLI 会自动执行以下检查: 1. **TOM 错误**始终会被提示。 度量值、列、分区或计算项中的无效 DAX 或 M 始终会导致命令失败。 2. **架构验证** (`validateOnMutation`,默认值为 `true`) 会验证 DAX 中的 `Table[Column]` 引用是否仍可解析,并交叉检查元数据一致性。 @@ -237,18 +237,18 @@ When you run a mutating command (`te add`, `te set`, `te move`, `te macro run`), 可使用 `te config set false` 禁用某项检查,或通过配置文件将放宽范围限定到特定环境。 -## Administrator policies +## 管理员策略 -On Windows, `te` honors the same administrator policies as Tabular Editor 3. Policies are read from the registry under `Software\Policies\Tabular Editor ApS` - with an optional `TECLI` subkey for values that should apply to the CLI only, and a `TE3` subkey for the desktop - and from the earlier `Software\Policies\Kapacity\Tabular Editor` key, which keeps working unchanged. A machine-wide value (`HKEY_LOCAL_MACHINE`) takes precedence over a per-user one (`HKEY_CURRENT_USER`), and within a hive a product-specific value takes precedence over a shared one. Where a policy turns a feature off, the command names the policy responsible, does nothing, and exits with a failure - so a pipeline that depends on something an administrator has since turned off fails visibly rather than reporting success for work it never did. +在 Windows 上,`te` 遵循与 Tabular Editor 3 相同的管理员策略。 策略从注册表 `Software\Policies\Tabular Editor ApS` 下读取:可选的 `TECLI` 子项用于仅对 CLI 生效的值,`TE3` 子项用于桌面版;同时也会从更早的 `Software\Policies\Kapacity\Tabular Editor` 项读取,该项仍按原样继续生效。 计算机范围的值 (`HKEY_LOCAL_MACHINE`) 优先于用户范围的值 (`HKEY_CURRENT_USER`);在同一注册表配置单元内,产品专用值优先于共享值。 如果某项策略关闭了某个功能,命令会指出是哪个策略导致的,不执行任何操作,并以失败退出——这样一来,依赖某项后来被管理员关闭的功能的管道会明确失败,而不是把根本没做的工作也 Report 为成功。 -| Policy | Effect on the CLI | -| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `DisableCSharpScripts` | Refuses `te script` and the automatic fixes of `te bpa run --fix`. | -| `DisableMacros` | Refuses every `te macro` command. | -| `DisableBpaDownload` | Refuses Best Practice Analyzer rules given as a URL. Rule files on disk and the built-in rules are unaffected. | -| `DisableTelemetry` | Turns anonymous usage statistics off, whatever `disableTelemetry` in config says. | +| 策略 | 对 CLI 的影响 | +| ---------------------- | ------------------------------------------------------------- | +| `DisableCSharpScripts` | 拒绝执行 `te script` 以及 `te bpa run --fix` 的自动修复功能。 | +| `DisableMacros` | 拒绝执行所有 `te macro` 命令。 | +| `DisableBpaDownload` | 拒绝使用以 URL 形式提供的 Best Practice Analyzer 规则。 磁盘上的规则文件和内置规则不受影响。 | +| `DisableTelemetry` | 无论配置中的 `disableTelemetry` 如何设置,都会关闭匿名使用情况统计。 | -Policies that govern features the CLI does not have - update checks, error reports, DAX Optimizer, the DAX Package Manager, the AI assistant, and the MCP server - have no effect on it. See @policies for the full list of policies and how to deploy them. +用于控制 CLI 不具备功能的策略——更新检查、错误Report、DAX优化器、DAX 组件管理器、AI 助手和 MCP 服务器——对 CLI 不起作用。 完整的策略列表及部署方式见 @policies。 ## 环境变量 @@ -256,7 +256,7 @@ Policies that govern features the CLI does not have - update checks, error repor | 变量 | 用途 | | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `TE_CONFIG` | 替代配置文件的路径。 Honored by every `te config` operation (`list`, `set`, `init`, `paths`). | +| `TE_CONFIG` | 替代配置文件的路径。 适用于所有 `te config` 操作(`list`、`set`、`init`、`paths`)。 | | `TE_MACROS_PATH` | 覆盖宏文件路径(在解析顺序中排第二,见上文)。 由 `te macro` 命令读取。 | | `TE_BPA_RULES` | 覆盖 `te bpa run` 和 `te bpa rules` 子命令使用的 BPA 规则文件/URL 列表。 | | `TE_BPA_CONFIG` | 覆盖 deploy/save 门禁读取的 BPA 门禁配置 (`.te-bpa.json`) 的路径。 | From 5c197ab781b188adb9209708e8590afbc60ab509 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:00:57 +0200 Subject: [PATCH 42/48] New translations te-cli-limitations.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-limitations.md | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-limitations.md b/localizedContent/zh/content/features/te-cli/te-cli-limitations.md index d4534f124..ea3913672 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-limitations.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-limitations.md @@ -1,6 +1,6 @@ --- uid: te-cli-limitations -title: Behavior Differences and Known Limitations +title: 行为差异与已知限制 author: Peer Grønnerup updated: 2026-09-11 applies_to: @@ -13,40 +13,40 @@ applies_to: full: true --- -# Behavior Differences and Known Limitations +# 行为差异与已知限制 [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -This page collects the places where the Tabular Editor CLI (`te`) behaves differently from Tabular Editor 2 and 3, together with the things it cannot do yet, so you can plan around both and avoid common pitfalls. 本页会随每次发布而更新;如果你发现此处未列出的问题,请在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository 中提交 issue。 +本页汇总了 Tabular Editor CLI (`te`) 与 Tabular Editor 2 和 3 在行为上的差异,以及它目前尚不支持的功能,帮助你据此规划并避开常见陷阱。 本页会随每次发布而更新;如果你发现此处未列出的问题,请在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository 中提交 issue。 > [!NOTE] -> Entries are grouped by area. Each one describes the difference or constraint and, where one exists, a workaround or the recommended CLI-friendly alternative. +> 条目按类别分组。 每一项都会说明差异或限制;如有可用方案,也会提供变通办法或更适合 CLI 的替代方案。 ## 脚本 CLI 会针对你在 Tabular Editor 2 和 3 中使用的同一个 `Model` 对象运行 C# Script(`te script`),但它是无界面的控制台宿主程序。 任何依赖 Windows Forms UI、TOM Explorer 的选择内容,或实时的 UI 端服务(宏注册表、在线 DAX Formatter、实时 VertiPaq分析器)的功能,其行为都会不同——通常表现为空、无操作,或直接报错。 -| 限制 | 说明 / 变通方法 | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **未加载 `System.Windows.Forms`** | CLI 使用的是跨平台 `TOMWrapper` 版本,其中剥离了所有与 WinForms 耦合的代码;WinForms 程序集不会被加载到 AppDomain 中。 引用 `System.Windows.Forms` 类型(`MessageBox`、`Form`、文件选择器、自定义对话框等)的脚本 将无法编译。 将所有 UI 交互重构为通过环境变量或 stdin 提供输入。 | -| **`Selected.` 返回空的可枚举对象** | 在 CLI 中,`Selected.Tables`、`Selected.Measures`、`Selected.Columns`、`Selected.Hierarchies` 等的枚举结果都为空——不会出现编译或运行时错误,只是不会返回任何项。 改用显式查找:`Model.AllMeasures.Where(...)`、`Model.Tables["Sales"].Measures`;或通过环境变量或 stdin 将对象路径传入脚本。 | -| **`Selected.` 会在运行时抛出错误** | `Selected.Table`、`Selected.Measure`、`Selected.Column`、`Selected.Hierarchy` 等都会报错,因为它们要求恰好选中一个该类型的对象,而 CLI 中的选择始终为空。 直接引用该对象,例如 `Model.Tables["Sales"]`。 | -| **`Selected.ActivePerspectives` 和 `Selected.ActiveCulture`**:分别为活动透视和活动区域设置 | 它们分别始终返回空集合和 `null`。 如果需要,就在脚本中显式设置透视或区域设置。 | -| **`Select` 对话框会抛出 `NotSupportedException`** | `SelectTable`、`SelectColumn`、`SelectMeasure`、`SelectObject`、`SelectObjects`(以及所有重载)都会返回以下错误:_"对象选择对话框… 在 CLI 脚本中不可用。 在编写脚本前,先按名称或路径预先选定对象。_ 通过环境变量、配置或查询模型,提前解析目标。 | -| **`Info` / `Warning` / `Error` / `Output` 会写入控制台** | 这些仍然可用,但会输出到 stdout/stderr,而不是打开对话框。 它们不会阻塞,也不会提供“忽略后续弹窗”的提示。 可安全用于 CI。 A script that calls `Error(...)` makes `te script` exit non-zero (changes are still saved with `--save`); `Warning` and `Info` do not. | -| **`ShowPrompt(...)` 始终返回 `Cancel`** | 无法进行交互式确认。 通过环境变量或配置预先确定答案。 | -| **`SuspendWaitForm` / `WaitFormVisible` 都是空操作** | “请稍候”加载指示器是 TE3 的一个 UI 元素。 `WaitFormVisible` 是一个可设置的标志位,但没有任何 Visual 效果;`SuspendWaitForm` 会被静默忽略——现有脚本仍可继续编译。 | -| **`host.Macro(...)` / `CustomAction(...)` throws an error** | CLI 不会加载 `%APPDATA%/TabularEditor3/MacroActions.json`,因此在脚本内部调用宏会报错。 Inline the macro logic, call the macro's underlying script file directly, or invoke the macro through `te macro run ` with a CLI macros file (`--macros` / `TE_MACROS_PATH` / the `macros` config key). | -| **`table.GetCardinality()` / `column.GetTotalSize()` 返回 0** | CLI 主机中没有实时 VPA,因此脚本内的 VertiPaq 基数辅助函数无法使用。 如果要查看 VPA 统计信息,显式加载 VPAX 并使用 `host.Vpa.*`,或运行 [`te vertipaq`](xref:te-cli-commands#vertipaq)。 | +| 限制 | 说明 / 变通方法 | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **未加载 `System.Windows.Forms`** | CLI 使用的是跨平台 `TOMWrapper` 版本,其中剥离了所有与 WinForms 耦合的代码;WinForms 程序集不会被加载到 AppDomain 中。 引用 `System.Windows.Forms` 类型(`MessageBox`、`Form`、文件选择器、自定义对话框等)的脚本 将无法编译。 将所有 UI 交互重构为通过环境变量或 stdin 提供输入。 | +| **`Selected.` 返回空的可枚举对象** | 在 CLI 中,`Selected.Tables`、`Selected.Measures`、`Selected.Columns`、`Selected.Hierarchies` 等的枚举结果都为空——不会出现编译或运行时错误,只是不会返回任何项。 改用显式查找:`Model.AllMeasures.Where(...)`、`Model.Tables["Sales"].Measures`;或通过环境变量或 stdin 将对象路径传入脚本。 | +| **`Selected.` 会在运行时抛出错误** | `Selected.Table`、`Selected.Measure`、`Selected.Column`、`Selected.Hierarchy` 等都会报错,因为它们要求恰好选中一个该类型的对象,而 CLI 中的选择始终为空。 直接引用该对象,例如 `Model.Tables["Sales"]`。 | +| **`Selected.ActivePerspectives` 和 `Selected.ActiveCulture`**:分别为活动透视和活动区域设置 | 它们分别始终返回空集合和 `null`。 如果需要,就在脚本中显式设置透视或区域设置。 | +| **`Select` 对话框会抛出 `NotSupportedException`** | `SelectTable`、`SelectColumn`、`SelectMeasure`、`SelectObject`、`SelectObjects`(以及所有重载)都会返回以下错误:_"对象选择对话框… 在 CLI 脚本中不可用。 在编写脚本前,先按名称或路径预先选定对象。_ 通过环境变量、配置或查询模型,提前解析目标。 | +| **`Info` / `Warning` / `Error` / `Output` 会写入控制台** | 这些仍然可用,但会输出到 stdout/stderr,而不是打开对话框。 它们不会阻塞,也不会提供“忽略后续弹窗”的提示。 可安全用于 CI。 调用 `Error(...)` 的脚本会使 `te script` 以非零状态退出(使用 `--save` 时更改仍会保存);`Warning` 和 `Info` 不会。 | +| **`ShowPrompt(...)` 始终返回 `Cancel`** | 无法进行交互式确认。 通过环境变量或配置预先确定答案。 | +| **`SuspendWaitForm` / `WaitFormVisible` 都是空操作** | “请稍候”加载指示器是 TE3 的一个 UI 元素。 `WaitFormVisible` 是一个可设置的标志位,但没有任何 Visual 效果;`SuspendWaitForm` 会被静默忽略——现有脚本仍可继续编译。 | +| **`host.Macro(...)` / `CustomAction(...)` 会抛出错误** | CLI 不会加载 `%APPDATA%/TabularEditor3/MacroActions.json`,因此在脚本内部调用宏会报错。 将宏逻辑直接写入脚本、直接调用宏对应的底层脚本文件,或结合 CLI 宏文件(`--macros` / `TE_MACROS_PATH` / `macros` 配置键)通过 `te macro run ` 调用该宏。 | +| **`table.GetCardinality()` / `column.GetTotalSize()` 返回 0** | CLI 主机中没有实时 VPA,因此脚本内的 VertiPaq 基数辅助函数无法使用。 如果要查看 VPA 统计信息,显式加载 VPAX 并使用 `host.Vpa.*`,或运行 [`te vertipaq`](xref:te-cli-commands#vertipaq)。 | ## Best Practice Analyzer -| 限制 | 说明 / 变通方法 | -| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **BPA 规则源必须是 HTTPS URL 或本地文件路径** | 只接受 `https://` URL 和不带协议的本地文件路径。 系统能识别 `http://`,但会在加载时故意拒绝,并给出清晰的错误信息——BPA 规则是可执行的规则表达式,通过未经过身份验证的通道获取会有被篡改的风险。 其他 URL 方案(`file://`、`ftp://`、…) 不受支持。 这既适用于 `te bpa run --rules`,也适用于通过 [`te config set`](xref:te-cli-commands#config-list--paths--init--set) 配置的规则列表。 | -| **规则 URL 的验证在运行阶段进行,而不是在 `te config set` 时** | 像 `http://` 这样的拼写错误会被 `te config set` 接受,只有在 BPA 实际运行时才会暴露出来。 编辑已配置的规则源后,运行一次 `te bpa run`(或 `te validate`),以验证每个 URL 都能成功加载。 | -| **`--rules` 不会禁用内置规则** | 当传入 `te bpa run --rules ` 时,本次运行将使用提供的规则覆盖 [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) 和 `TE_BPA_RULES` 中的条目,但仍会同时加载内置默认规则。 若只想运行显式指定的规则文件,还需传入 `--no-defaults`。 When a supplied rule file defines the same rule ID as a built-in rule, the rule is evaluated once - the definition from the explicit `--rules` file wins for that `te bpa run` invocation (in the deploy/save gate, the built-in definition wins). | -| **没有可在单次调用中跳过 `bpa.rules` 配置的标志** | 配置了 `bpa.rules` 后,每次执行 `te bpa run` 都会在加载内置规则的同时加载这些规则。 目前没有可在单次运行中跳过已配置规则文件的标志。 变通方法:显式传入 `--rules `——该标志会在本次调用中完全替换 `bpa.rules` 和 `TE_BPA_RULES`。 | +| 限制 | 说明 / 变通方法 | +| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **BPA 规则源必须是 HTTPS URL 或本地文件路径** | 只接受 `https://` URL 和不带协议的本地文件路径。 系统能识别 `http://`,但会在加载时故意拒绝,并给出清晰的错误信息——BPA 规则是可执行的规则表达式,通过未经过身份验证的通道获取会有被篡改的风险。 其他 URL 方案(`file://`、`ftp://`、…) 不受支持。 这既适用于 `te bpa run --rules`,也适用于通过 [`te config set`](xref:te-cli-commands#config-list--paths--init--set) 配置的规则列表。 | +| **规则 URL 的验证在运行阶段进行,而不是在 `te config set` 时** | 像 `http://` 这样的拼写错误会被 `te config set` 接受,只有在 BPA 实际运行时才会暴露出来。 编辑已配置的规则源后,运行一次 `te bpa run`(或 `te validate`),以验证每个 URL 都能成功加载。 | +| **`--rules` 不会禁用内置规则** | 当传入 `te bpa run --rules ` 时,本次运行将使用提供的规则覆盖 [`bpa.rules`](xref:te-cli-commands#config-list--paths--init--set) 和 `TE_BPA_RULES` 中的条目,但仍会同时加载内置默认规则。 若只想运行显式指定的规则文件,还需传入 `--no-defaults`。 当提供的规则文件定义了与内置规则相同的规则 ID 时,该规则只会评估一次——对于这次 `te bpa run` 调用,显式 `--rules` 文件中的定义优先(在 deploy/save gate 中,则以内置定义为准)。 | +| **没有可在单次调用中跳过 `bpa.rules` 配置的标志** | 配置了 `bpa.rules` 后,每次执行 `te bpa run` 都会在加载内置规则的同时加载这些规则。 目前没有可在单次运行中跳过已配置规则文件的标志。 变通方法:显式传入 `--rules `——该标志会在本次调用中完全替换 `bpa.rules` 和 `TE_BPA_RULES`。 | ## 验证 @@ -54,19 +54,19 @@ CLI 会针对你在 Tabular Editor 2 和 3 中使用的同一个 `Model` 对象 | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | **`te validate` 无法自动修复 Code Action 违规项** | `te validate` 会生成 Report 来指出 Code Action 违规项,但不提供用于应用建议修复的 CLI 参数。 在 Tabular Editor 3 中应用修复;或者对与 BPA 规则重叠的那部分 Code Action,使用 `te bpa run --fix`。 | -## Model initialization and save +## 模型初始化和保存 -| 限制 | 说明 / 变通方法 | -| ------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`--serialization` 不能将序列化格式与 PBIP 容器组合使用** | The `--serialization` option on [`te save-as`](xref:te-cli-commands#save-as) treats `bim`, `tmdl`, `database.json`, and `pbip` as mutually exclusive, so you cannot produce a full PBIP container around a TMSL-serialized (`.bim`) model. To wrap a `tmdl` or `bim` output in a `{modelName}.SemanticModel/` folder with `.platform` and `definition.pbism` files, pass `--supporting-files`; for a complete PBIP (including the report artifact), use `--serialization pbip`. | +| 限制 | 说明 / 变通方法 | +| ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`--serialization` 不能将序列化格式与 PBIP 容器组合使用** | [`te save-as`](xref:te-cli-commands#save-as) 的 `--serialization` 选项将 `bim`、`tmdl`、`Database.json` 和 `pbip` 视为互斥选项,因此无法为采用 TMSL 序列化的 (`.bim`) 模型生成完整的 PBIP 容器。 如果要将 `tmdl` 或 `bim` 输出封装到 `{modelName}.SemanticModel/` 文件夹中,并包含 `.platform` 和 `definition.pbism` 文件,请使用 `--supporting-files`;如果要生成完整的 PBIP(包括 Report 工件),请使用 `--serialization pbip`。 | ## 模型编辑 -| 限制 | 说明 / 变通方法 | -| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **Calculated sets cannot be created, removed, or moved from the CLI** | Sets are addressable for inspection (`te list Sets`, `te get "Sales/Sets/"`), but `te add`, `te remove`, and `te move` do not support set objects. Use `te script` for set mutations. | -| **No whole-model Power Query formatting sweep** | `te set --format ` formats named expression properties on one object and `te util format-m` formats a single loose expression, but there is no command to format every M expression in a model in one pass. (Whole-model DAX formatting is available via `te script --inline "Model.AllMeasures.FormatDax();" --save`.) | -| **Schema sync treats renamed source columns as removed + added** | `te set
--update-schema` cannot detect a rename; a renamed source column shows up as one removed and one new column. Remap manually with `te set
/ -p SourceColumn=` before syncing. `--update-schema` is refused on calculated tables and calculation groups. | +| 限制 | 说明 / 变通方法 | +| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **无法通过 CLI 创建、删除或移动计算集** | 可以访问集对象进行检查(`te list Sets`、`te get "Sales/Sets/"`),但 `te add`、`te remove` 和 `te move` 不支持集对象。 要修改集,请使用 `te script`。 | +| **不支持一次性格式化整个模型中的 Power Query** | `te set --format ` 可格式化某个对象上的 Named Expression 属性,`te util format-m` 可格式化单条独立表达式,但目前没有命令能一次性格式化模型中的所有 M 表达式。 (可通过 `te script --inline "Model.AllMeasures.FormatDax();" --save` 对整个模型执行 DAX 格式化。) | +| **架构同步会将重命名的源列视为“已删除 + 已新增”** | `te set
--update-schema` 无法检测重命名;重命名后的源列会显示为一列已删除、另一列为新增。 同步前,请先使用 `te set
/ -p SourceColumn=` 手动重新映射。 不能对计算表格和计算组使用 `--update-schema`。 | ## 身份验证 @@ -76,11 +76,11 @@ CLI 会针对你在 Tabular Editor 2 和 3 中使用的同一个 `Model` 对象 ## 命令行输入 -| 限制 | 说明 / 变通方法 | -| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **包含空格的 DAX 对象路径必须用 shell 引号括起来** | 当表名或列名包含空格时,必须在终端中用 shell 引号将整个 DAX 对象引用括起来:`te get "'My Table'[My Column]"`。 如果没有外层引号,shell 会将该路径拆分为多个参数,导致解析失败。 在 [`te interactive`](xref:te-cli-interactive) 中不需要 shell 引号,因为 REPL 会在 shell 将输入拆分为参数之前接收原始输入。 | -| **Object names containing reserved path characters must be quoted** | `/ [ ] ' " * ? { }` are reserved in object and filter paths. A name containing one must be quoted with the segment quoting rules, e.g. `te get "Tables/'{foo}'"` or `te get 'Sales/"my*name"'`. `?` is reserved but has no wildcard meaning. The Windows `cmd.exe` shell cannot express the mixed-quote forms - use PowerShell or a POSIX shell for such names (or `te interactive`, which takes the raw line). | -| **`-` (read from stdin) is not available inside `te interactive`** | The shell rejects it with _'-' (stdin) is not available inside the interactive shell._ Pass the value inline, or run the command from your OS shell where piping works. | +| 限制 | 说明 / 变通方法 | +| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **包含空格的 DAX 对象路径必须用 shell 引号括起来** | 当表名或列名包含空格时,必须在终端中用 shell 引号将整个 DAX 对象引用括起来:`te get "'My Table'[My Column]"`。 如果没有外层引号,shell 会将该路径拆分为多个参数,导致解析失败。 在 [`te interactive`](xref:te-cli-interactive) 中不需要 shell 引号,因为 REPL 会在 shell 将输入拆分为参数之前接收原始输入。 | +| **包含保留路径字符的对象名称必须加引号** | `/ [ ] ' " * ? { }` 在对象和筛选器路径中是保留字符。 如果名称包含其中任一字符,必须按分段引用规则进行引用,例如 `te get \"Tables/'{foo}'\"` 或 `te get 'Sales/\"my*name\"'`。 `?` 是保留字符,但不表示通配符。 Windows 的 `cmd.exe` shell 无法表示这种混合引号形式——遇到这类名称时,改用 PowerShell 或 POSIX shell(或者用会接收原始整行输入的 `te interactive`)。 | +| **在 `te interactive` 中无法使用 `-`(从 stdin 读取)** | 该 shell 会拒绝这种写法,并提示 _'-' (stdin) is not available inside the interactive shell._ 请将该值直接写在命令中,或在支持管道的操作系统 shell 中运行该命令。 | ## Report 缺失的限制 From 9b4968e008360e9a6265a9484c435505ec9f4939 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:01:00 +0200 Subject: [PATCH 43/48] New translations te-cli-skill.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-skill.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-skill.md b/localizedContent/zh/content/features/te-cli/te-cli-skill.md index 012fbdc3e..0fed28f42 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-skill.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-skill.md @@ -17,38 +17,38 @@ applies_to: [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -Tabular Editor CLI 自带一个开箱即用的**智能体技能**,让 AI 编码智能体学会如何驱动 `te` 命令行界面。 It's a skill folder - a [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) entry point plus a `references/` set of on-demand deep-dive files - packed with the CLI's conventions, command reference, workflows, and gotchas. 安装后,如果你说“部署这个模型”或“添加一个计算利润率的度量值”,智能体会给出符合 `te` 用法的命令,而不是靠猜测或臆造选项。 +Tabular Editor CLI 自带一个开箱即用的**智能体技能**,让 AI 编码智能体学会如何驱动 `te` 命令行界面。 这是一个技能文件夹——包含作为入口的 [`SKILL.md`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli),以及 `references/` 中一组按需查阅的深入资料——里面整理了 CLI 的约定、命令参考、工作流和常见坑点。 安装后,如果你说“部署这个模型”或“添加一个计算利润率的度量值”,智能体会给出符合 `te` 用法的命令,而不是靠猜测或臆造选项。 该技能在公开的 [TabularEditor/CLI](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) repository 中维护,并会随着 CLI 预览功能的演进同步更新。 ## 什么是技能 -A skill is a folder with a `SKILL.md` entry point that the agent loads on demand, based on your prompt. 它的 YAML frontmatter(`name`、`description`、`version`)会告诉智能体**何时**加载它,以及它涵盖**哪些**内容。 The Markdown body teaches the agent **how** to do the job, and larger skills - like this one - bundle extra reference files under `references/` that the agent reads only when needed. +技能就是一个文件夹,里面有一个作为入口的 `SKILL.md`,代理会根据你的提示按需加载它。 它的 YAML frontmatter(`name`、`description`、`version`)会告诉智能体**何时**加载它,以及它涵盖**哪些**内容。 Markdown 正文会教代理**如何**完成这项工作;而更大的技能——比如这个——会在 `references/` 下附带额外的参考文件,代理只会在需要时读取。 ## 技能涵盖的内容 该技能会向智能体讲解 `te` 的完整功能: -- every `te` command across all families - save-as, init, deploy, refresh, bpa, validate, query, script, util, and more +- 所有系列的 `te` 命令——涵盖 save-as、init、deploy、refresh、bpa、validate、query、script、util 等等 - 身份验证模式——交互式、使用机密或证书的服务主体、环境变量、托管标识 - 对象路径语法——斜杠形式、DAX 形式和通配符 -- the save model - dry run by default, `--save` to persist, and the interactive shell's `--stage`/`--revert` +- 保存模型——默认执行 dry run;使用 `--save` 才会持久化保存;交互式 shell 还支持 `--stage`/`--revert` - TE2 到 CLI 的迁移映射 - 适用于 GitHub Actions 和 Azure DevOps 的 CI/CD 实践方案 - 输出格式、退出代码、环境变量和配置键 -- a cheatsheet of common property names for `-p Name=Value` +- 用于 `-p Name=Value` 的常用属性名速查表 - 实践中容易让智能体出错的常见坑点 这些内容与本节其余部分面向人类读者的说明是同一套内容。 命令参考请参见 @te-cli-commands,身份验证请参见 @te-cli-auth,流水线模式请参见 @te-cli-cicd。 -## Download the skill +## 下载技能 -The skill lives in the [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder of the CLI repository - `SKILL.md` plus its `references/` subfolder. +该技能位于 CLI repository 的 [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) 文件夹中:包含 `SKILL.md` 以及其 `references/` 子文件夹。 -1. Clone the [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository, or download the repository ZIP (**Code > Download ZIP**) and extract it. -2. Copy the whole `skills/te-cli/` folder somewhere convenient, keeping the `references/` subfolder next to `SKILL.md`. +1. 克隆 [TabularEditor/CLI](https://github.com/TabularEditor/CLI) repository,或下载该 repository 的 ZIP(**Code > Download ZIP**)并解压。 +2. 将整个 `skills/te-cli/` 文件夹复制到一个方便的位置,并确保 `references/` 子文件夹与 `SKILL.md` 放在一起。 -You'll move this folder to a tool-specific location in the install steps below. 在下载较新版本之前,如果你想先看看版本之间有哪些变更,可以查看 [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md)。 +在下面的安装步骤中,你会把这个文件夹移到工具指定的位置。 在下载较新版本之前,如果你想先看看版本之间有哪些变更,可以查看 [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md)。 ## 选择安装范围 @@ -64,16 +64,16 @@ Claude Code 会从 `.claude/skills/` 下的命名文件夹中加载技能。 `de **项目范围** - 技能只会在这个项目中加载: 1. 在项目根目录中,创建文件夹 `.claude/skills/te-cli/`。 -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. 将下载的 `te-cli` 文件夹中的内容(`SKILL.md` 和 `references/`)复制到该文件夹中。 -The final path is `/.claude/skills/te-cli/SKILL.md`, with `references/` alongside it. +最终路径为 `/.claude/skills/te-cli/SKILL.md`,并让 `references/` 与其位于同一级目录。 **用户范围** - 技能会在当前用户的所有项目中加载: 1. 在你的用户级 Claude 技能目录中创建 `te-cli` 文件夹: - **macOS / Linux:** `~/.claude/skills/te-cli/` - **Windows:** `%USERPROFILE%\\.claude\\skills\\te-cli\\`(通常为 `C:\\Users\\\\.claude\\skills\\te-cli\\`) -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. 将下载的 `te-cli` 文件夹中的内容(`SKILL.md` 和 `references/`)复制到该文件夹中。 > [!NOTE] > Claude Code 会监视技能目录,并在当前会话中识别新增或已编辑的技能,无需重启。 例外情况是:如果 `.claude/skills/` 目录在会话开始时并不存在,而你后来才创建它,则需要重启一次 Claude Code,让它开始监视这个新目录。 @@ -94,14 +94,14 @@ The final path is `/.claude/skills/te-cli/SKILL.md`, with `referen what does `te deploy` do without `--execute`? ``` -Claude answers with the documented behavior - it's a dry run that prints the TMSL deployment script to stdout without deploying anything - which confirms the skill is loaded and in use. +Claude 会按文档所述的行为作答——这是一次 dry run:它会将 TMSL 部署脚本打印到 stdout,而不会部署任何内容——这就表明该技能已加载并正在使用。 ## 在 Claude.ai 和 Claude Desktop 中安装 Claude.ai(网页和桌面版)内置了 **Skills** 功能。 Skills 需要启用代码执行,并且上传时应使用技能文件夹打包成的 ZIP,而不是单独的 `SKILL.md` 文件。 1. 启用代码执行:前往 **Settings > Capabilities**,并开启 **Code execution and file creation**。 在 Team 和 Enterprise 计划中,所有者需要在组织设置里启用这个功能。 -2. Compress the whole downloaded `te-cli` folder (including `references/`) into `te-cli.zip`. +2. 将整个下载的 `te-cli` 文件夹(包括 `references/`)压缩为 `te-cli.zip`。 3. 前往 **Settings > Capabilities > Skills**(也可通过 **Customize > Skills** 进入)。 4. 点击 **+**,选择 **Upload skill**,然后选中 `te-cli.zip`。 Claude 会读取里面的 `SKILL.md`,并显示这个技能的摘要。 5. 开启这个技能。 当你提到 `te` 或相关概念时,它会自动加载。 @@ -112,11 +112,11 @@ Claude.ai(网页和桌面版)内置了 **Skills** 功能。 Skills 需要启 ## 在 GitHub Copilot 中安装 -VS Code 中的 GitHub Copilot 原生支持 Agent Skills 开放标准——也就是 Claude Code 和 Codex 使用的同一种 `SKILL.md` 格式。 这是推荐的方式,因为技能只会在相关时加载。 For Copilot setups that predate Agent Skills, fall back to the generic `AGENTS.md` install below. +VS Code 中的 GitHub Copilot 原生支持 Agent Skills 开放标准——也就是 Claude Code 和 Codex 使用的同一种 `SKILL.md` 格式。 这是推荐的方式,因为技能只会在相关时加载。 如果你的 Copilot 配置早于 Agent Skills,就改用下面通用的 `AGENTS.md` 安装方式。 ### Agent Skills(VS Code) -Place the skill folder contents (`SKILL.md` and `references/`) in a named folder under a skills directory. 文件夹名称必须与 frontmatter 中的 `name` 字段一致,因此请使用 `te-cli`,并保持 YAML frontmatter 完整不变。 +将技能文件夹中的内容(`SKILL.md` 和 `references/`)放到 skills 目录下一个单独命名的文件夹中。 文件夹名称必须与 frontmatter 中的 `name` 字段一致,因此请使用 `te-cli`,并保持 YAML frontmatter 完整不变。 - **Workspace 作用域:** `.github/skills/te-cli/SKILL.md`(Copilot 也会读取 `.claude/skills/` 和 `.agents/skills/`)。 - **用户范围:** `~/.copilot/skills/te-cli/SKILL.md`(Copilot 也会读取 `~/.claude/skills/` 和 `~/.agents/skills/`)。 @@ -130,14 +130,14 @@ Codex CLI 会直接从 `.agents/skills/` 下的命名文件夹中加载技能, **项目范围**——该技能只会在这个项目中加载: 1. 在项目根目录中创建文件夹 `.agents/skills/te-cli/`。 -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. 将下载的 `te-cli` 文件夹中的内容(`SKILL.md` 和 `references/`)复制到该文件夹中。 Codex 会从你的工作目录向上扫描,因此提交在 repository 根目录(`$REPO_ROOT/.agents/skills/te-cli/`)的技能,会在该 repository 中的所有协作者之间共享。 **个人范围**——该技能会在你的每个项目中加载: 1. 在你的个人 Codex 技能目录中创建 `te-cli` 文件夹:`~/.agents/skills/te-cli/`。 -2. Copy the contents of the downloaded `te-cli` folder (`SKILL.md` and `references/`) into that folder. +2. 将下载的 `te-cli` 文件夹中的内容(`SKILL.md` 和 `references/`)复制到该文件夹中。 在 Codex CLI 或 IDE 中运行 `/skills`,确认列表中有 `te-cli`,并输入 `te-cli` 以显式指定该技能。 @@ -145,21 +145,21 @@ Codex 会从你的工作目录向上扫描,因此提交在 repository 根目 对于遵循 [`AGENTS.md` convention](https://agents.md) 或支持使用任意说明文件的工具——Aider、Continue、自定义内部 Agent: -1. Download the skill folder. -2. In a copy of `SKILL.md`, remove the YAML frontmatter block at the top (everything between the first and second `---` lines, including those lines). -3. Rename that file to `AGENTS.md` and place it at your project root, or wherever the tool expects its instructions file. -4. Copy the `references/` folder next to your `AGENTS.md` so its relative links keep working. +1. 下载技能文件夹。 +2. 在 `SKILL.md` 的一个副本中,删除顶部的 YAML frontmatter 区块(即第一处和第二处 `---` 之间的所有内容,包括这两行本身)。 +3. 将该文件重命名为 `AGENTS.md`,并放到项目根目录,或该工具预期的说明文件位置。 +4. 将 `references/` 文件夹复制到 `AGENTS.md` 旁边,以便其中的相对链接继续正常工作。 5. 这个项目中下一次运行 Agent 时,就会读取这些说明。 ## 更新技能 要获取更新版本: -1. Grab the latest [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) folder from GitHub (re-clone, pull, or re-download the repository ZIP). -2. Replace what you previously installed: - - **Native skills (Claude Code, Codex, Copilot Agent Skills):** replace the whole skill folder contents (`SKILL.md` and `references/`). +1. 从 GitHub 获取最新的 [`skills/te-cli`](https://github.com/TabularEditor/CLI/tree/main/skills/te-cli) 文件夹(重新克隆、拉取更新,或重新下载 repository 的 ZIP 包)。 +2. 替换之前安装的内容: + - **原生技能(Claude Code、Codex、Copilot Agent Skills):** 替换整个技能文件夹的全部内容(`SKILL.md` 和 `references/`)。 - **Claude.ai / Desktop:** 重新将 `te-cli` 文件夹打包成 ZIP 文件,再通过 Skills UI 重新上传。 - - **Instruction-file installs (AGENTS.md):** re-paste the body into `AGENTS.md` and refresh the copied `references/` folder. + - **基于说明文件的安装(AGENTS.md):** 将正文重新粘贴到 `AGENTS.md` 中,并更新已复制的 `references/` 文件夹。 查看 [CHANGELOG](https://github.com/TabularEditor/CLI/blob/main/skills/te-cli/CHANGELOG.md) 了解各版本之间的变更。 From fa8c7b7dbba8d395cba4b2933e606f0e8de5dc31 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:01:10 +0200 Subject: [PATCH 44/48] New translations te-cli-install.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-install.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-install.md b/localizedContent/zh/content/features/te-cli/te-cli-install.md index f6baaad91..ead949cd1 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-install.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-install.md @@ -128,7 +128,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. 这样可确保在 CLI 停止工作前,你能看到明确的警告。 +> 在**预览结束日期前后 14 天内**(2026-10-31),无论如何设置 `hidePreviewNotice`,每次运行命令都会再次显示该横幅。 这样可确保在 CLI 停止工作前,你能看到明确的警告。 ## Shell 自动补全 @@ -169,16 +169,16 @@ te completion fish > ~/.config/fish/completions/te.fish 大多数功能在各个平台上都相同。 少数功能依赖仅 Windows 支持的传输机制: -| 功能 | Windows | macOS / Linux | -| ------------------------------------------------------------------------------------------------------------------------------------ | ------- | ------------- | -| Work with local TMDL and BIM model files | 是的 | 是 | -| 部署到 Power BI / Fabric / Azure Analysis Services | 是的 | 是 | -| Best Practice Analyzer 和 VertiPaq分析器 | 是的 | 是 | -| C# Script 脚本编写 | 是的 | 是 | -| 针对云端模型的 DAX 查询 | 是的 | 是 | -| Authentication: browser (interactive), service principal, environment variables, managed identity | 是的 | 是 | -| 连接到本地 SSAS 实例(TCP 传输) | 是 | **否** | -| 连接到 Power BI Desktop(命名管道传输) | 是 | **否** | +| 功能 | Windows | macOS / Linux | +| ----------------------------------------------- | ------- | ------------- | +| 使用本地 TMDL 和 BIM 模型文件 | 是的 | 是 | +| 部署到 Power BI / Fabric / Azure Analysis Services | 是的 | 是 | +| Best Practice Analyzer 和 VertiPaq分析器 | 是的 | 是 | +| C# Script 脚本编写 | 是的 | 是 | +| 针对云端模型的 DAX 查询 | 是的 | 是 | +| 身份验证方式:浏览器(交互式)、服务主体、环境变量、托管标识 | 是的 | 是 | +| 连接到本地 SSAS 实例(TCP 传输) | 是 | **否** | +| 连接到 Power BI Desktop(命名管道传输) | 是 | **否** | > [!IMPORTANT] > 本地 SSAS 和 Power BI Desktop 连接依赖于仅限 Windows 的传输协议。 所有基于云的工作流(Power BI Service、Fabric、Azure Analysis Services)均可在所有平台上运行。 From 60f08e12b2c02db1118777b04aa112e9c2f7debe Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:01:13 +0200 Subject: [PATCH 45/48] New translations te-cli-interactive.md (Chinese Simplified) [ci skip] --- .../features/te-cli/te-cli-interactive.md | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-interactive.md b/localizedContent/zh/content/features/te-cli/te-cli-interactive.md index 0f7f2e804..39ab10761 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-interactive.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-interactive.md @@ -78,47 +78,47 @@ ls 'Net Sales'/'Sales Amount' # Quoted segments with a slash separator 这些由 REPL 自身处理,而不是常规命令树: -| 命令 | 用途 | -| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `help` 或 `?` | 列出可用命令。 | -| `status` 或 `pwd` | 显示当前活动的模型/连接。 | -| `save` | Commit all staged in-memory edits back to the model source. | -| `revert` | Discard all staged edits made since the last save. | -| `clear` 或 `cls` | 清空屏幕。 | -| `exit`、`quit` 或 `q` | 退出交互模式。 If staged edits are unsaved you are asked to confirm (`n` is the default); `exit --force` discards them without asking. | +| 命令 | 用途 | +| ------------------- | -------------------------------------------------------------------- | +| `help` 或 `?` | 列出可用命令。 | +| `status` 或 `pwd` | 显示当前活动的模型/连接。 | +| `save` | 将所有暂存在内存中的编辑提交并写回模型源。 | +| `revert` | 丢弃自上次保存以来的所有暂存编辑。 | +| `clear` 或 `cls` | 清空屏幕。 | +| `exit`、`quit` 或 `q` | 退出交互模式。 如果暂存编辑尚未保存,系统会要求你确认(默认值为 `n`);`exit --force` 会直接丢弃这些编辑而不再询问。 | -`save` inside the session takes no arguments - re-serializing the model to another format or location is `save-as` (e.g. `save-as -o ./out --serialization bim`), exactly as outside the session. +会话中的 `save` 不接受任何参数;如果要将模型重新序列化到其他格式或位置,请使用 `save-as`(例如 `save-as -o ./out --serialization bim`),与会话外完全相同。 -## Staged edits +## 暂存编辑 -Inside the session, mutating commands (`set`, `add`, `remove`, `move`, `script`, `macro run`, ...) stage their changes in memory instead of writing to the source, and the prompt shows an indicator while unsaved staged edits exist. The built-in `save` command commits everything staged; `revert` discards everything staged. +在会话中,修改类命令 (`set`, `add`, `remove`, `move`, `script`, `macro run`, ...) 会先将更改暂存在内存中,而不是写回源文件;只要存在未保存的暂存编辑,提示符就会显示一个指示标记。 内置的 `save` 命令会提交所有已暂存的更改;`revert` 会丢弃所有已暂存的更改。 -Each mutating command can also decide for itself: `--save` persists that one command's change immediately, `--stage` keeps it in memory (the default), and `--revert` rolls the command's change back after showing its effect - useful for a "what would this do?" probe. The three are mutually exclusive, and `--stage`/`--revert` exist only inside the session. +每个修改类命令也可以自行决定处理方式:`--save` 会立即保存该命令的更改,`--stage` 会将其保留在内存中(默认行为),而 `--revert` 会在显示该命令的效果后回滚更改——很适合用来做一次“这会产生什么效果?”的试探。 这三者互斥,并且 `--stage`/`--revert` 仅在会话内可用。 -The default per-command behavior is the `interactiveEditMode` config key (`stage` | `save` | `revert`) - see @te-cli-config. +每个命令的默认行为由配置键 `interactiveEditMode` 决定(`stage` | `save` | `revert`)——请参阅 @te-cli-config。 -Staged edits are never thrown away silently. Closing a session that still holds them - with `exit`, **Ctrl+D**, or by reaching the end of piped input - first checks for unsaved changes. If unsaved changes exist and a terminal is active, you are asked to confirm, with "no" as the default, and declining returns you to the prompt with the edits intact. Where nobody can answer (stdin piped or redirected, or `--non-interactive`), the session writes a warning naming the unsaved changes and exits with a failure code instead of a success one. Nothing is saved on the way out either way: run `save` first, or `exit --force` to discard the edits deliberately. +暂存编辑绝不会被悄悄丢弃。 如果在仍保留这些编辑的情况下关闭会话——无论是使用 `exit`、按 **Ctrl+D**,还是到达管道输入的末尾——都会先检查是否存在未保存的更改。 如果存在未保存的更改且当前终端可交互,系统会要求你确认,默认选项为“否”;如果你选择不退出,就会返回提示符,且这些编辑会原样保留。 如果无法进行确认(例如 stdin 被管道传入或重定向,或使用了 `--non-interactive`),会话会输出一条警告,说明有哪些未保存的更改,然后以失败退出码退出,而不是成功退出码。 无论哪种退出方式,都不会在退出时自动保存:请先运行 `save`,或者使用 `exit --force` 有意丢弃这些编辑。 -## Line editing and keys +## 行编辑与按键 -The prompt offers single-line editing: +提示符支持单行编辑: -- **Left/Right** move the caret; **Home/End** (also **Ctrl+A**/**Ctrl+E**) jump to the ends; **Backspace/Delete** edit in place. -- **Up/Down** browse the command history, which persists across sessions. -- **Ctrl+C** cancels the current command without leaving the session and abandons the half-typed line for good - it is never run, Up does not bring it back, and it is not added to the history. -- **Ctrl+D** on an empty prompt exits (**Ctrl+Z** then **Enter** on Windows). +- **Left/Right** 移动光标;**Home/End**(也可用 **Ctrl+A**/**Ctrl+E**)跳到行首/行尾;**Backspace/Delete** 在当前位置删除字符。 +- **Up/Down** 浏览命令历史记录,并且该历史会在不同会话之间保留。 +- **Ctrl+C** 会取消当前命令而不退出会话,并永久放弃那条输入到一半的命令行——它不会被执行,按 **Up** 也无法找回,而且不会加入历史记录。 +- 在空提示符下按 **Ctrl+D** 可退出(Windows 上为先按 **Ctrl+Z** 再按 **Enter**)。 -There is no tab completion inside the session - shell completion via `te completion` applies to the outer shell only. +会话内没有 Tab 补全功能;通过 `te completion` 启用的 shell 补全只对外层 shell 生效。 ## 引导式提示 -启用交互模式后,需要补全输入的命令会提示你输入,而不是直接失败。 Running `auth` without a subcommand opens a picker for Login / Status / Logout; running `deploy --execute` or `refresh --execute` without `--force` shows a summary and asks for confirmation (`n` is the safe default). A `deploy` or `refresh` without `--execute` is a dry run that prints the TMSL it would send, so it never prompts. +启用交互模式后,需要补全输入的命令会提示你输入,而不是直接失败。 运行 `auth` 时如果不带子命令,会打开一个选择器,让你在 Login / Status / Logout 之间选择;运行 `deploy --execute` 或 `refresh --execute` 时如果不带 `--force`,会先显示摘要并请求确认(`n` 是更安全的默认选项)。 不带 `--execute` 的 `deploy` 或 `refresh` 属于试运行:它会打印将要发送的 TMSL,因此不会弹出确认提示。 如果想在当前会话中为单个命令禁用提示,传入 `--non-interactive`。 ## 管道与重定向输入 -交互模式也支持通过管道传入或重定向的 stdin,因此你可以用脚本驱动同一个 REPL,而不必手动逐条输入。 每一行输入都会作为一条命令执行,就像你在提示符处输入它一样;当输入耗尽时,会话将退出(或者在读到 `exit` 这一行时退出)。 If staged edits are still unsaved at that point, the session warns and exits non-zero - end a mutating script with `save` (or `exit --force` to discard on purpose). +交互模式也支持通过管道传入或重定向的 stdin,因此你可以用脚本驱动同一个 REPL,而不必手动逐条输入。 每一行输入都会作为一条命令执行,就像你在提示符处输入它一样;当输入耗尽时,会话将退出(或者在读到 `exit` 这一行时退出)。 如果此时暂存的编辑仍未保存,会话会发出警告并以非零退出码退出——会产生更改的脚本应以 `save` 结束(或使用 `exit --force` 有意丢弃更改)。 ```bash printf "ls\nexit\n" | te interactive --model ./model # bash / git-bash @@ -129,7 +129,7 @@ te interactive --model ./model < script.te # redirected file (echo ls & echo exit) | te interactive --model .\model :: Windows cmd.exe ``` -The `-` stdin convention (`set -p Expression=-`, `query -q -`, and so on) is refused inside the interactive session, because the session itself owns stdin - use it from the outer shell instead. +在交互式会话中会拒绝使用 `-` 这一 stdin 约定(`set -p Expression=-`、`query -q -` 等),因为 stdin 由会话本身占用——请在外层 shell 中使用。 以 `#` 开头的行会被视为注释并跳过,因此你可以为脚本文件添加注释: @@ -182,11 +182,11 @@ printf "ls tables\nexit\n" | te interactive --model ./model --echo 此行为由 `launchInteractiveMode` 配置项控制,提供三个取值: -| 值 | 效果 | -| ---------- | --------------------------------------------------------- | -| `auto`(默认) | 仅当三个流都连接到 TTY 时才启动 REPL。 否则回退到常规解析流程。 | -| `always` | 无论流是否被重定向,都启动 REPL。 适合始终需要交互式会话的情况。 | -| `never` | 从不自动启动 REPL。 `te` on its own prints help. | +| 值 | 效果 | +| ---------- | ------------------------------------- | +| `auto`(默认) | 仅当三个流都连接到 TTY 时才启动 REPL。 否则回退到常规解析流程。 | +| `always` | 无论流是否被重定向,都启动 REPL。 适合始终需要交互式会话的情况。 | +| `never` | 从不自动启动 REPL。 `te` 单独运行时会输出帮助信息。 | 可通过以下方式全局更改: From 806e2fc9e1e9a259d25f8094da3251b2ab1491ab Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:01:16 +0200 Subject: [PATCH 46/48] New translations te-cli-migrate.md (Chinese Simplified) [ci skip] --- .../content/features/te-cli/te-cli-migrate.md | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli-migrate.md b/localizedContent/zh/content/features/te-cli/te-cli-migrate.md index 3de9044ac..e6a4c8f03 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli-migrate.md +++ b/localizedContent/zh/content/features/te-cli/te-cli-migrate.md @@ -27,7 +27,7 @@ applies_to: 1. **二进制名称。** 将 `te` 重命名为 `te2`(或为其创建符号链接),CLI 就会以与 TE2 完全一致的模式运行。 这是直接替换的做法:在现有管道中把 `TabularEditor.exe` 换成 `te2`,原来的参数照样可用。 2. **环境变量。** 在调用 `te` 之前设置 `TE_COMPAT=te2`,即可强制启用 TE2 模式。 -3. **Auto-detection.** If the first argument isn't a `te` subcommand (`deploy`, `validate`, …) 并且只要在参数列表的任意位置出现了至少一个可识别的 TE2 标志,CLI 就会自动切换到 TE2 模式。 这意味着大多数现有的 TE2 调用无需任何更改即可运行。 +3. **自动检测。** 如果第一个参数不是 `te` 子命令(`deploy`、`validate` 等) 并且只要在参数列表的任意位置出现了至少一个可识别的 TE2 标志,CLI 就会自动切换到 TE2 模式。 这意味着大多数现有的 TE2 调用无需任何更改即可运行。 ```bash # All three are equivalent - each runs in TE2 mode @@ -41,7 +41,7 @@ te Model.bim -S fix.csx -D "localhost\tabular" MyDB -O ## Migrate 命令 -Use `te util migrate` as a live reference for how TE2 flags map to the new CLI. 它会输出一张彩色表格,列出每个已知 TE2 标志、其状态(受支持、已重命名、计划支持)以及对应的 `te` 命令。 +可将 `te util migrate` 作为实时参考,用于了解 TE2 选项如何映射到新的 CLI。 它会输出一张彩色表格,列出每个已知 TE2 标志、其状态(受支持、已重命名、计划支持)以及对应的 `te` 命令。 ```bash te util migrate # Full flag mapping table @@ -49,40 +49,40 @@ te util migrate -A # Look up a single flag te util migrate --output-format json # Machine-readable mapping ``` -Refer to the output of the `te util migrate` command for the current mapping that reflects the CLI version you have installed. +请查看 `te util migrate` 命令的输出,其中包含与你已安装的 CLI 版本相对应的当前映射关系。 ## 标志映射(整理的子集) -Below is a non-exhaustive summary of the most commonly used flags. Run `te util migrate` for the full list. - -| TE2 标志 | 新 CLI 等效参数 | 说明 | -| ----------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file`(位置参数) | `--model ` (global option) | Always the global `--model` option; no command takes the model as a positional argument. Or set an active model once with `te connect `. | -| `server`、`database` | `te connect ` or global `-s -d ` | `-s`/`-d` always identify the model source; deploy destinations use `--target-server` / `--target-database`. | -| `-L` / `-LOCAL` | `te connect --local` | 仅限 Windows。 | -| `-S` / `-SCRIPT` | `te script --file ` or `--inline "code"` | A bare `.csx` path also works (`te script fix.csx`). Supports multiple scripts (`--file a.csx --file b.csx`), inline code, and stdin (`--inline -`); files and inline code run in the order given. | -| `-A` / `-ANALYZE` | `te bpa run --rules ` | 支持 `--fail-on`、`--fix` 和多个规则文件。 | -| `-AX` / `-ANALYZEX` | `te bpa run --rules --no-model-rules` | Model-embedded rules are included by default; `--no-model-rules` excludes them, matching what `-AX` did. | -| `-B` / `-BIM` | `te save-as --model -o --serialization bim` | | -| `-F` / `-FOLDER` | `te save-as --model -o --serialization database.json` | 在 `-D` 之后,TE2 的 `-F` 表示 `-FULL`;参见 `--deploy-full`。 | -| `-TMDL` | `te save-as --model -o --serialization tmdl` | `--serialization` can be omitted - the format is inferred from the output path. | -| `-D` / `-DEPLOY` | `te deploy --model --target-server --target-database --execute` | 这是一个独立的命令,使用具名选项。 Without `--execute`, `te deploy` is a dry run that prints the TMSL it would send. | -| `-O` / `-OVERWRITE` | (默认)或使用 `--create-only` 选择不覆盖 | 在新的 CLI 中,覆盖是默认行为。 | -| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | -| `-P` / `-PARTITIONS` 分区 | `te deploy --deploy-partitions` 部署分区 | | -| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` 部署分区并跳过刷新策略 | 需要 `--deploy-partitions`。 | -| `-SHARED` | `te deploy --deploy-shared-expressions` | 在 `-D` 之后,TE2 的 `-S` 表示 `-SHARED`。 | -| `-R` / `-ROLES` 角色 | `te deploy --deploy-roles` | | -| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | -| `-FULL`(在 `-D` 之后) | `te deploy --deploy-full` | 等同于:覆盖 + 连接 + 分区 + 共享 + 角色 + 角色成员。 | -| `-X` / `-XMLA ` | `te deploy ... > ` (omit `--execute`) | Script emission is the default: without `--execute`, deploy connects read-only and prints the TMSL to stdout - redirect it to a file. | -| `-V` / `-VSTS` | `--ci vsts` on `validate`, `bpa run`, `deploy`, `test run` | 会向 stderr 输出 `##vso[...]` 注释。 `azdo` and `azure-devops` are accepted aliases. | -| `-G` / `-GITHUB` | `--ci github` (alias `gh`) | Emits `::error::` / `::warning::` / `::notice::` annotations. | -| `-T` / `-TRX ` | 在 `validate`、`bpa run` 和 `test run` 命令中使用 `--trx ` | 用于 Azure DevOps 测试发布的 VSTEST `.trx` 文件。 | -| `-W` / `-WARN` | (默认) | 部署结果中始终会 Report 警告。 | -| `-E` / `-ERR` | (默认) | 出现 DAX 错误时,部署会返回非零退出代码。 | -| `-SC` / `-SCHEMACHECK` | _尚未实现。_ | TE2 架构检查会连接到真实的数据源。 这不同于 `te validate`(DAX 语义验证,不连接数据源)。 | -| `-L` / `-LOGIN `(位于 `-D` 之后) | `te auth login -u -p -t ` | 使用服务主体或基于环境变量的凭据。 登录状态会被缓存,因此后续命令会静默获取令牌——见 @te-cli-auth。 | +下面是最常用选项的非完整汇总。 要看完整列表,运行 `te util migrate`。 + +| TE2 标志 | 新 CLI 等效参数 | 说明 | +| ----------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `file`(位置参数) | `--model `(全局选项) | 始终使用全局 `--model` 选项;没有任何命令会将模型作为位置参数接收。 或者通过 `te connect ` 一次设置并激活某个模型。 | +| `server`、`database` | `te connect ` 或全局 `-s -d ` | `-s`/`-d` 始终用于标识模型源;部署目标使用 `--target-server` / `--target-database`。 | +| `-L` / `-LOCAL` | `te connect --local` | 仅限 Windows。 | +| `-S` / `-SCRIPT` | `te script --file ` 或 `--inline "code"` | 也可以直接使用 `.csx` 路径(`te script fix.csx`)。 支持多个脚本(`--file a.csx --file b.csx`)、内联代码以及标准输入(stdin,`--inline -`);文件和内联代码会按给定顺序运行。 | +| `-A` / `-ANALYZE` | `te bpa run --rules ` | 支持 `--fail-on`、`--fix` 和多个规则文件。 | +| `-AX` / `-ANALYZEX` | `te bpa run --rules --no-model-rules` | 默认包含嵌入在模型中的规则;`--no-model-rules` 会将其排除,这与 `-AX` 的行为一致。 | +| `-B` / `-BIM` | `te save-as --model -o --serialization bim` | | +| `-F` / `-FOLDER` | `te save-as --model -o --serialization Database.json` | 在 `-D` 之后,TE2 的 `-F` 表示 `-FULL`;参见 `--deploy-full`。 | +| `-TMDL` | `te save-as --model -o --serialization tmdl` | `--serialization` 可以省略——格式会根据输出路径推断。 | +| `-D` / `-DEPLOY` | `te deploy --model --target-server --target-database --execute` | 这是一个独立的命令,使用具名选项。 如果不带 `--execute`,`te deploy` 会进行试运行,并打印它将发送的 TMSL。 | +| `-O` / `-OVERWRITE` | (默认)或使用 `--create-only` 选择不覆盖 | 在新的 CLI 中,覆盖是默认行为。 | +| `-C` / `-CONNECTIONS` | `te deploy --deploy-connections` | | +| `-P` / `-PARTITIONS` 分区 | `te deploy --deploy-partitions` 部署分区 | | +| `-Y` / `-SKIPPOLICY` | `te deploy --deploy-partitions --skip-refresh-policy` 部署分区并跳过刷新策略 | 需要 `--deploy-partitions`。 | +| `-SHARED` | `te deploy --deploy-shared-expressions` | 在 `-D` 之后,TE2 的 `-S` 表示 `-SHARED`。 | +| `-R` / `-ROLES` 角色 | `te deploy --deploy-roles` | | +| `-M` / `-MEMBERS` | `te deploy --deploy-role-members` | | +| `-FULL`(在 `-D` 之后) | `te deploy --deploy-full` | 等同于:覆盖 + 连接 + 分区 + 共享 + 角色 + 角色成员。 | +| `-X` / `-XMLA ` | `te deploy ... > `(省略 `--execute`) | 默认会输出脚本:如果不带 `--execute`,`te deploy` 会以只读方式连接,并将 TMSL 打印到 stdout——把它重定向到文件即可。 | +| `-V` / `-VSTS` | 在 `validate`、`bpa run`、`deploy` 和 `test run` 命令中使用 `--ci vsts` | 会向 stderr 输出 `##vso[...]` 注释。 `azdo` 和 `azure-devops` 都是可接受的别名。 | +| `-G` / `-GITHUB` | `--ci github`(别名 `gh`) | 会输出 `::error::` / `::warning::` / `::notice::` 注释。 | +| `-T` / `-TRX ` | 在 `validate`、`bpa run` 和 `test run` 命令中使用 `--trx ` | 用于 Azure DevOps 测试发布的 VSTEST `.trx` 文件。 | +| `-W` / `-WARN` | (默认) | 部署结果中始终会 Report 警告。 | +| `-E` / `-ERR` | (默认) | 出现 DAX 错误时,部署会返回非零退出代码。 | +| `-SC` / `-SCHEMACHECK` | _尚未实现。_ | TE2 架构检查会连接到真实的数据源。 这不同于 `te validate`(DAX 语义验证,不连接数据源)。 | +| `-L` / `-LOGIN `(位于 `-D` 之后) | `te auth login -u -p -t ` | 使用服务主体或基于环境变量的凭据。 登录状态会被缓存,因此后续命令会静默获取令牌——见 @te-cli-auth。 | ## 迁移指南 @@ -93,13 +93,13 @@ Below is a non-exhaustive summary of the most commonly used flags. Run `te util - 先从 `-A` / `-AX` → `te bpa run` 开始,以获得更丰富的 BPA 输出(`--fail-on`、`--fix`、`--trx`)。 - 然后把 `-D` 替换为 `te deploy`,以获得更细粒度的部署控制。 - 最后:`-V` / `-G` → `--ci vsts` / `--ci github`。 -3. **Switch to non-interactive CI flags.** Add `--non-interactive` to every `te` command (and `--ci ` on `validate`, `bpa run`, `deploy`, and `test run`), pass `--execute --force` on `deploy`/`refresh` steps that must act, and remove any `start /wait` wrappers - the new CLI is a regular console binary and doesn't need them. +3. **切换到非交互式 CI 标志。** 为每个 `te` 命令都加上 `--non-interactive`(并在 `validate`、`bpa run`、`deploy` 和 `test run` 中加上 `--ci `);对必须执行实际操作的 `deploy`/`refresh` 步骤,传入 `--execute --force`;并移除所有 `start /wait` 包装——新的 CLI 是普通的控制台可执行文件,不需要这些。 4. **采用服务主体身份验证。** 将 `-D -L ` 替换为 `te auth login -u …… -p …… -t ...`,或在管道中使用基于环境变量凭据的步骤。 见 @te-cli-auth。 ## 重要差异 - **部署时的 BPA 检查。** `te deploy` 现在默认会在部署前运行 BPA,作为前置检查。 使用 `--skip-bpa` 可保留旧行为,或使用 `--fix-bpa` 在部署前自动修复违规项。 见 @te-cli-config。 -- **Dry run by default.** `te deploy` and `te refresh` print the exact TMSL they would send and change nothing; pass `--execute` to act. `--execute` asks for confirmation at a terminal (with `n` as the safe default); CI pipelines must pass `--execute --force`. +- **默认进行试运行。** `te deploy` 和 `te refresh` 会打印它们将发送的确切 TMSL,但不会做任何更改;传入 `--execute` 才会实际执行。 `--execute` 会在终端中请求确认(安全默认值为 `n`);CI 管道必须传入 `--execute --force`。 - **结构化输出。** 每个命令都支持 `--output-format json`,以生成机器可读输出——参见 @te-cli-automation。 - **无需 `start /wait`。** 新 CLI 是普通的控制台可执行文件;你可以在 shell 脚本、PowerShell 和 CI 任务中直接调用它。 - **跨平台。** CLI 可在 Windows、macOS 和 Linux 上运行。 本地 SSAS 和 Power BI Desktop 连接仍仅支持 Windows。 From a1e967c1fda488310284393fa925dd6537a30c96 Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:01:19 +0200 Subject: [PATCH 47/48] New translations te-cli.md (Chinese Simplified) [ci skip] --- .../zh/content/features/te-cli/te-cli.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/localizedContent/zh/content/features/te-cli/te-cli.md b/localizedContent/zh/content/features/te-cli/te-cli.md index 6d78ca432..5da7193cf 100644 --- a/localizedContent/zh/content/features/te-cli/te-cli.md +++ b/localizedContent/zh/content/features/te-cli/te-cli.md @@ -23,13 +23,13 @@ Tabular Editor CLI (`te`) 是适用于 Power BI 和 Analysis Services 语义模 [!INCLUDE [te-cli-preview-notice](includes/te-cli-preview-notice.md)] -## Design pillars and target audiences +## 设计支柱与目标受众 -Four design pillars shape every command: +每个命令都围绕四大设计支柱构建: - **结构化输出** — 除默认的易读文本外,还可输出 JSON、CSV、TMDL 和 TMSL。 - **非交互模式** — 全局 `--non-interactive` 标志会禁用交互提示,并在出错时快速失败。 -- **Safe by default** - editing commands such as `te set`, `te add` and `te remove` show their change as a diff and write nothing until you add `--save`; adding `--force` saves even when the change introduces validation errors. `te deploy` and `te refresh` print the exact TMSL they would send until you add `--execute`, and then ask for confirmation first unless you add `--force`. +- **默认安全**:`te set`、`te add` 和 `te remove` 等编辑命令会以差异对比的形式显示更改,在你添加 `--save` 之前不会写入任何内容;如果添加 `--force`,即使更改会引入验证错误,也会照样保存。 `te deploy` 和 `te refresh` 在你添加 `--execute` 之前,会打印将要发送的确切 TMSL;添加后,除非再加上 `--force`,否则会先让你确认。 - **清晰的错误信息** — 写入 stderr,并返回可预测的退出码。 这三者结合起来,让同一个二进制文件能够很好地服务于三类截然不同的用户: @@ -43,22 +43,22 @@ Four design pillars shape every command: ## CLI 可以做什么 -The CLI organizes its commands into 10 families. 每个命令族都对应语义模型生命周期中的一个具体阶段。 +CLI 将命令分为 10 类。 每个命令族都对应语义模型生命周期中的一个具体阶段。 有关每个命令的语法、选项和示例的完整命令参考,请参阅 @te-cli-commands。 点击表中的任意示例命令,直接跳转到对应的参考条目。 -| 命令族 | 功能 | 示例命令 | -| ----------------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [Model initialization and save](xref:te-cli-commands#model-initialization-and-save) | Save, convert, initialize models | [`te save-as`](xref:te-cli-commands#save-as), [`te init`](xref:te-cli-commands#init) | -| [模型编辑](xref:te-cli-commands#model-editing) | 获取/设置属性,添加/删除/移动对象 | [`te set`](xref:te-cli-commands#set)、[`te add`](xref:te-cli-commands#add)、[`te remove`](xref:te-cli-commands#remove)、[`te move`](xref:te-cli-commands#move) | -| [检视](xref:te-cli-commands#inspection) | 列出对象、搜索、比较差异、分析依赖关系 | [`te list`](xref:te-cli-commands#list)、[`te find`](xref:te-cli-commands#find)、[`te diff`](xref:te-cli-commands#diff)、[`te deps`](xref:te-cli-commands#deps) | -| [分析与质量](xref:te-cli-commands#analysis-and-quality) | Validate, run BPA, format DAX and M, analyze storage | [`te validate`](xref:te-cli-commands#validate), [`te bpa run`](xref:te-cli-commands#bpa-run), [`te util`](xref:te-cli-commands#utilities), [`te vertipaq`](xref:te-cli-commands#vertipaq) | -| [执行](xref:te-cli-commands#execution) | 运行 DAX 查询、C# Script 和宏 | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te 宏`](xref:te-cli-commands#macro) | -| [部署与刷新](xref:te-cli-commands#deployment-and-refresh) | Deploy to workspace, trigger refresh, apply refresh policies | [`te deploy`](xref:te-cli-commands#deploy), [`te refresh`](xref:te-cli-commands#refresh) | -| [测试](xref:te-cli-commands#testing) | 断言测试、快照、A/B 比较 | [`te test run`](xref:te-cli-commands#test-run) | -| [连接与身份验证](xref:te-cli-commands#connection-and-authentication) | 连接到 Workspace,管理身份验证和配置文件 | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | -| [配置](xref:te-cli-commands#configuration) | CLI settings and defaults | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | -| [Shell](xref:te-cli-commands#shell) | 交互模式、会话状态、Shell 自动补全 | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | +| 命令族 | 功能 | 示例命令 | +| -------------------------------------------------------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [模型初始化和保存](xref:te-cli-commands#model-initialization-and-save) | 保存、转换和初始化模型 | [`te save-as`](xref:te-cli-commands#save-as)、[`te init`](xref:te-cli-commands#init) | +| [模型编辑](xref:te-cli-commands#model-editing) | 获取/设置属性,添加/删除/移动对象 | [`te set`](xref:te-cli-commands#set)、[`te add`](xref:te-cli-commands#add)、[`te remove`](xref:te-cli-commands#remove)、[`te move`](xref:te-cli-commands#move) | +| [检视](xref:te-cli-commands#inspection) | 列出对象、搜索、比较差异、分析依赖关系 | [`te list`](xref:te-cli-commands#list)、[`te find`](xref:te-cli-commands#find)、[`te diff`](xref:te-cli-commands#diff)、[`te deps`](xref:te-cli-commands#deps) | +| [分析与质量](xref:te-cli-commands#analysis-and-quality) | 验证、运行 BPA、格式化 DAX 和 M、分析存储 | [`te validate`](xref:te-cli-commands#validate)、[`te bpa run`](xref:te-cli-commands#bpa-run)、[`te util`](xref:te-cli-commands#utilities)、[`te vertipaq`](xref:te-cli-commands#vertipaq) | +| [执行](xref:te-cli-commands#execution) | 运行 DAX 查询、C# Script 和宏 | [`te query`](xref:te-cli-commands#query), [`te script`](xref:te-cli-commands#script), [`te 宏`](xref:te-cli-commands#macro) | +| [部署与刷新](xref:te-cli-commands#deployment-and-refresh) | 部署到 Workspace,触发刷新,应用刷新策略 | [`te deploy`](xref:te-cli-commands#deploy)、[`te refresh`](xref:te-cli-commands#refresh) | +| [测试](xref:te-cli-commands#testing) | 断言测试、快照、A/B 比较 | [`te test run`](xref:te-cli-commands#test-run) | +| [连接与身份验证](xref:te-cli-commands#connection-and-authentication) | 连接到 Workspace,管理身份验证和配置文件 | [`te connect`](xref:te-cli-commands#connect), [`te auth`](xref:te-cli-commands#auth-login--status--logout), [`te profile`](xref:te-cli-commands#profile-list--show--set--remove) | +| [配置](xref:te-cli-commands#configuration) | CLI 设置和默认值 | [`te config`](xref:te-cli-commands#config-list--paths--init--set) | +| [Shell](xref:te-cli-commands#shell) | 交互模式、会话状态、Shell 自动补全 | [`te interactive`](xref:te-cli-commands#interactive), [`te session`](xref:te-cli-commands#session), [`te completion`](xref:te-cli-commands#completion) | > [!TIP] > 文档中使用规范的长形式动词(`list`、`remove`、`move`),但传统的短形式仍可作为别名使用(`ls`、`rm`、`mv`、`rename`)。 这既适用于顶层命令,也适用于 `te bpa rules`、`te macro`、`te config`、`te profile`、`te session` 和 `te test` 等命令组下的 `remove` / `list` 子命令。 完整映射请参见 @te-cli-commands#command-aliases。 @@ -92,7 +92,7 @@ te config set hidePreviewNotice true ``` > [!WARNING] -> The banner reappears on every command within **14 days of the preview end date** (2026-10-31), regardless of `hidePreviewNotice`. 这可确保在 CLI 停止运行之前,你能提前看到醒目的警告。 +> 在预览结束日期(2026-10-31)前 14 天内,无论 `hidePreviewNotice` 如何设置,每次执行命令时该横幅都会再次出现。 这可确保在 CLI 停止运行之前,你能提前看到醒目的警告。 ## 许可概览 From 80058e9435d49244bf9bd291806cf1d7c2952b4f Mon Sep 17 00:00:00 2001 From: David Bojsen Date: Fri, 11 Sep 2026 19:01:22 +0200 Subject: [PATCH 48/48] New translations github-flow.md (Chinese Simplified) [ci skip] --- localizedContent/zh/content/getting-started/github-flow.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/localizedContent/zh/content/getting-started/github-flow.md b/localizedContent/zh/content/getting-started/github-flow.md index f0e653b1d..ff499d144 100644 --- a/localizedContent/zh/content/getting-started/github-flow.md +++ b/localizedContent/zh/content/getting-started/github-flow.md @@ -79,7 +79,7 @@ flowchart LR ``` > [!NOTE] -> Tabular Editor 现已提供跨平台 CLI(`te`),目前处于有限公开预览阶段,专为 CI/CD 场景打造——支持非交互模式、原生 GitHub Actions/Azure DevOps 注解、VSTEST 输出,以及用于在管道中运行回归测试的 `te test run` 命令。 它与下文描述的这类管道天然契合,值得关注。 As of this writing, Tabular Editor's own documentation advises against using it in production pipelines during preview (the preview build is stated to expire 2026-10-31), so the reference implementation in this article uses the established `TabularEditor.exe` CLI instead. 有关这个新 CLI 当前具备的能力和示例,可以查看 [CI/CD 集成](xref:te-cli-cicd)。 +> Tabular Editor 现已提供跨平台 CLI(`te`),目前处于有限公开预览阶段,专为 CI/CD 场景打造——支持非交互模式、原生 GitHub Actions/Azure DevOps 注解、VSTEST 输出,以及用于在管道中运行回归测试的 `te test run` 命令。 它与下文描述的这类管道天然契合,值得关注。 截至本文撰写时,Tabular Editor 的官方文档仍建议在预览阶段不要将其用于生产管道(文档称该预览版将于 2026-10-31 到期),因此本文中的参考实现改用成熟的 `TabularEditor.exe` CLI。 有关这个新 CLI 当前具备的能力和示例,可以查看 [CI/CD 集成](xref:te-cli-cicd)。