DevExpress Dashboard CLI
raw JSON →The `devexpress-dashboard-cli` package provides command-line interface tools specifically designed to streamline development with DevExpress Dashboards. Its primary functions include building custom themes for the Web Dashboard using metadata from the DevExtreme ThemeBuilder and generating new application projects that integrate DevExpress Dashboard controls. The current stable version is 25.2.6, aligning with DevExpress's consistent twice-per-year major release cadence. This CLI is an essential tool for developers working within the DevExpress ecosystem, enabling automated theme generation and project setup, differentiating it from generic CLIs by its deep integration with DevExpress components and design patterns. It handles the conversion of customized DevExtreme ThemeBuilder resource files into Web Dashboard themes and assists in the initial scaffolding of DevExpress-enabled applications, particularly in client-server architectures like Angular with ASP.NET Core backends.
Common errors
error NU1101: Unable to find package DevExpress. <Product>.ProjectTemplates ↓
dotnet nuget add source <source-url> -n DevExpress or enable it with dotnet nuget enable source <source-name> if it's already listed but disabled. error SyntaxError: Unexpected token 'export' (in Jest tests involving DevExtreme/Angular) ↓
transformIgnorePatterns to transpile DevExtreme and its ESM-only dependencies (e.g., @preact/signals-core) from ESM to CJS during testing. Alternatively, explore Jest presets for Angular that handle ESM modules or migrate to a test runner that natively supports ESM. error Dashboard works locally but fails on production server (e.g., connection errors) ↓
ASPxDashboard.ConnectionError event and HandleServerErrors property to get detailed error information. Warnings
breaking All DevExpress npm packages, including `devexpress-dashboard-cli`, and corresponding client-side scripts/server-side libraries, must use matching major.minor version numbers. Mismatched versions can lead to runtime errors and unexpected behavior. ↓
gotcha `devexpress-dashboard-cli` lists several packages as peer dependencies, which npm versions 3+ do not automatically install. These must be manually installed and updated alongside the CLI to ensure full functionality. ↓
gotcha Older versions (e.g., v23.1.5) of `devexpress-dashboard-cli` had reported moderate severity vulnerabilities in transient dependencies like `less` and `request`. While DevExpress indicated these might not be exploitable in common usage scenarios for theme building, it highlights the importance of regular security audits. ↓
gotcha When building Angular applications that use DevExtreme components (which often accompany DevExpress Dashboards) with `--prod` (AOT compilation), `SyntaxError: Unexpected token 'export'` errors may occur at runtime. This can be related to how bundlers and test runners (like Jest) handle ESM/CJS modules from DevExtreme's dependencies. ↓
gotcha The `devexpress-dashboard-cli` package is focused on client-side asset generation (themes) and project scaffolding. It does not provide a backend for dashboards. A separate ASP.NET Core or ASP.NET MVC application is required to serve as the backend (server-side) for the Web Dashboard. ↓
Install
npm install devexpress-dashboard-cli yarn add devexpress-dashboard-cli pnpm add devexpress-dashboard-cli Imports
- dev-dashboard wrong
import { buildTheme } from 'devexpress-dashboard-cli';correctnpx devexpress-dashboard-cli <command> [options] - Build Theme wrong
devexpress-dashboard-cli build-themecorrectnpx devexpress-dashboard-cli build-theme --input-file="./theme-metadata.json" --output-file="./dx-dashboard.custom-theme.css" --output-color-scheme="custom-scheme" - Help wrong
npx devexpress-dashboard-cli helpcorrectnpx devexpress-dashboard-cli --help
Quickstart
{
"name": "my-dashboard-app",
"version": "1.0.0",
"description": "DevExpress Dashboard application with custom theme",
"scripts": {
"install-deps": "npm install devexpress-dashboard@25.2.6 devextreme-themebuilder@25.2.6 @devexpress/analytics-core@25.2.6 @devexpress/analytics-core-cli@25.2.6 devextreme@25.2.6",
"build-custom-theme": "npx devexpress-dashboard-cli build-theme --input-file='./src/custom-theme-metadata.json' --output-file='./src/dx-dashboard.custom.css' --output-color-scheme='light-yellow'"
},
"keywords": [],
"author": "",
"license": "MIT"
}
// To run this quickstart:
// 1. Save the above JSON as package.json in an empty directory.
// 2. Create a file named 'src/custom-theme-metadata.json'. (Content can be an empty JSON object {} for a default build, or actual metadata from DevExtreme ThemeBuilder).
// 3. Open your terminal in the directory and run:
// npm run install-deps
// npm run build-custom-theme
// This will generate 'src/dx-dashboard.custom.css' based on the theme metadata.