// Manages SAPUI5/OpenUI5 projects using the UI5 Tooling CLI (@ui5/cli). Use when initializing UI5 projects, configuring ui5.yaml or ui5-workspace.yaml files, building UI5 applications or libraries, running development servers with HTTP/2 support, creating custom build tasks or server middleware, managing workspace/monorepo setups, troubleshooting UI5 CLI errors, migrating between UI5 CLI versions, or optimizing build performance. Supports both OpenUI5 and SAPUI5 frameworks with complete configuration and extensibility guidance.
| name | sapui5-cli |
| description | Manages SAPUI5/OpenUI5 projects using the UI5 Tooling CLI (@ui5/cli). Use when initializing UI5 projects, configuring ui5.yaml or ui5-workspace.yaml files, building UI5 applications or libraries, running development servers with HTTP/2 support, creating custom build tasks or server middleware, managing workspace/monorepo setups, troubleshooting UI5 CLI errors, migrating between UI5 CLI versions, or optimizing build performance. Supports both OpenUI5 and SAPUI5 frameworks with complete configuration and extensibility guidance. |
| license | GPL-3.0 |
| metadata | {"version":"4.0.0","lastUpdated":"2025-11-21T00:00:00.000Z","officialDocs":"https://ui5.github.io/cli/stable/"} |
This skill provides comprehensive guidance for working with the UI5 CLI (UI5 Tooling), the official command-line interface for developing, building, and deploying SAPUI5 and OpenUI5 applications and libraries.
Current CLI Version: 4.0.0+ (Released July 24, 2024) Node.js Requirements: v20.11.0+ or v22.0.0+ (v21 not supported) npm Requirements: v8.0.0+
Use this skill when you need to:
# 1. Install UI5 CLI (choose one)
npm install --global @ui5/cli # Global installation
npm install --save-dev @ui5/cli # Project-level installation
# 2. Initialize project (if new)
npm init --yes # Initialize npm
ui5 init # Create ui5.yaml
# 3. Select framework variant
ui5 use openui5@latest # For OpenUI5
ui5 use sapui5@latest # For SAPUI5
# 4. Add framework libraries
ui5 add sap.ui.core sap.m sap.ui.table themelib_sap_fiori_3
# 5. Start development
ui5 serve # Start dev server
ui5 serve --open index.html # Start and open browser
# 6. Build for production
ui5 build --all # Build with dependencies
ui5 build --clean-dest # Clean before building
# 1. Enable CLI support
ui5 init
# 2. Configure framework (if ui5.yaml exists)
ui5 use openui5@latest # or sapui5@latest
# 3. Verify setup
ui5 tree # Show dependency tree
ui5 serve # Test development server
UI5 CLI supports four project types, each with specific configurations:
Standard UI5 applications with a webapp directory.
webapp/ โ /templates/ui5.yaml.application for configuration templateReusable component libraries for sharing across projects.
src/ โ /resources, test/ โ /test-resourcessrc/my/company/library/)templates/ui5.yaml.library for configuration templateProvides theming resources for libraries.
my/library/themes/custom_theme/)references/configuration.md for detailed configurationThird-party resources with flexible path mapping.
references/project-types.md for module configurationui5 init # Initialize UI5 CLI configuration
ui5 use <framework>[@version] # Set framework (openui5/sapui5)
ui5 add <libraries...> # Add framework libraries
ui5 remove <libraries...> # Remove framework libraries
ui5 serve [options] # Start development server
--port <number> # Specify port (default: 8080)
--open <path> # Open browser to path
--h2 # Enable HTTP/2
--accept-remote-connections # Allow non-localhost access
ui5 tree [options] # Display dependency tree
--flat # Show flat list
--level <number> # Limit tree depth
ui5 build [child-command] [options] # Build project
preload # Create preload bundles (default)
self-contained # Create standalone bundle
jsdoc # Generate JSDoc documentation
--all # Include all dependencies
--include-dependency <names> # Include specific dependencies
--exclude-dependency <names> # Exclude dependencies
--dest <path> # Output directory (default: ./dist)
--clean-dest # Clean destination before build
--create-build-manifest # Store build metadata
--experimental-css-variables # Generate CSS variable artifacts [experimental]
ui5 config set <key> [value] # Set configuration value
ui5 config get <key> # Get configuration value
ui5 config list # List all settings
# Common configurations
ui5 config set ui5DataDir /path/.ui5 # Change cache directory
ui5 versions # Display all module versions
ui5 --help # Display help
ui5 --version # Display version
For complete command reference, see references/cli-commands.md.
specVersion: "4.0" # Specification version (required)
type: application # Project type (required)
metadata:
name: my.project.name # Project name (required)
copyright: "ยฉ ${currentYear} Company" # Optional copyright
framework:
name: SAPUI5 # OpenUI5 or SAPUI5
version: "1.120.0" # Framework version
libraries:
- name: sap.ui.core
- name: sap.m
- name: sap.ui.table
- name: themelib_sap_fiori_3
optional: true # Optional library
resources:
configuration:
paths:
webapp: webapp # Path mapping
propertiesFileSourceEncoding: UTF-8 # Encoding (default: UTF-8)
builder:
resources:
excludes:
- "index.html" # Exclude from build
- "/resources/my/project/test/**"
server:
settings:
httpPort: 8080 # HTTP port
httpsPort: 8443 # HTTPS port
For complete configuration reference, see references/configuration.md.
This main skill file provides essential workflows and quick reference. For detailed information on specific topics, refer to these reference files:
references/cli-commands.md: Complete CLI command reference with all options and examplesreferences/configuration.md: Comprehensive ui5.yaml configuration guide (includes workspace config)references/project-structures.md: Detailed project types with directory structures and build output stylesreferences/extensibility.md: Custom tasks, middleware, and project shims with complete API documentationreferences/filesystem-api.md: Complete FileSystem API for custom task/middleware developmentreferences/build-process.md: Complete build process including tasks, minification, source maps, and bundlingreferences/server-features.md: Complete server documentation with middleware stack, HTTP/2, SSL, and CSPreferences/code-analysis.md: Dependency analyzers, JSDoc generation, and code analysis featuresreferences/es-support.md: Complete ECMAScript version support, restrictions, and module format requirementsreferences/benchmarking.md: Performance testing and benchmarking with hyperfinereferences/migration-guides.md: Complete version migration guides (v1โv2โv3โv4)references/troubleshooting.md: Common issues, errors, and solutions with exact error messagesWhen to use: Starting a new SAPUI5/OpenUI5 application from scratch.
Steps:
npm init --yesnpm install --save-dev @ui5/cliui5 initui5 use sapui5@latest (or openui5@latest)ui5 add sap.ui.core sap.m themelib_sap_fiori_3ui5 servegit add ui5.yaml package.json && git commitWhen to use: Adding UI5 CLI support to an existing UI5 project.
Steps:
ui5 init to create ui5.yamlui5 use sapui5@latestui5 add sap.ui.core sap.m sap.ui.tableresources.configuration.paths if neededui5 serveui5 build --allWhen to use: Extending the build process with custom processing.
Steps:
lib/tasks/customTask.js)templates/custom-task-template.js)ui5 buildreferences/extensibility.mdWhen to use: Managing multiple related UI5 projects in a single repository.
Steps:
--workspace <name> flag to activate specific workspaceui5 tree to verify dependency resolutionreferences/configuration.md (workspace section)When to use: Upgrading from UI5 CLI v3 to v4.
Prerequisites:
Steps:
npm install --save-dev @ui5/cli@latest"4.0"references/migration-guides.mdusePredefineCalls bundle option if presentasync: true for modern loadingui5 build --allui5 serveQuestion: Which framework should I use?
Does project need SAP-specific components (e.g., sap.ui.comp, sap.ushell)?
โโ YES โ Use SAPUI5
โ โโ Command: ui5 use sapui5@latest
โโ NO โ Can use OpenUI5
โโ Command: ui5 use openui5@latest
Note: SAPUI5 projects can depend on OpenUI5, but not vice versa.
Question: Which build type should I use?
What is the deployment target?
โโ Standard deployment (with separate framework loading)
โ โโ Use: ui5 build --all
โ
โโ Standalone deployment (single bundle with framework)
โ โโ Use: ui5 build self-contained --all
โ
โโ Documentation generation
โ โโ Use: ui5 build jsdoc
โ
โโ Development/testing (no build needed)
โโ Use: ui5 serve
Question: Should I create a custom task or middleware?
What do you need to extend?
โโ Build process (modify/generate resources during build)
โ โโ Create custom task (see templates/custom-task-template.js)
โ Examples: Transpiling, image optimization, file generation
โ
โโ Development server (modify requests/responses during dev)
โ โโ Create custom middleware (see templates/custom-middleware-template.js)
โ Examples: Proxying, authentication, dynamic content
โ
โโ Third-party library configuration
โโ Create project shim (see references/extensibility.md)
Examples: Configuring non-UI5 npm packages
This skill provides working templates for common configurations:
templates/ui5.yaml.application: Complete application configurationtemplates/ui5.yaml.library: Complete library configurationtemplates/ui5-workspace.yaml: Monorepo workspace setuptemplates/custom-task-template.js: Custom build task boilerplatetemplates/custom-middleware-template.js: Custom server middleware boilerplateUI5 CLI uses specification versions to manage features:
Always use the latest specVersion for new projects.
Important: During development, always use ui5 serve instead of ui5 build. Building should only occur when deploying to production. The development server provides:
When both global and local UI5 CLI installations exist, the local version takes precedence automatically. This allows different projects to use different CLI versions.
Override behavior: UI5_CLI_NO_LOCAL=X ui5 serve
UI5 CLI caches framework versions in ~/.ui5/ (configurable via ui5DataDir).
Clear cache: rm -rf ~/.ui5/framework/
UI5 CLI does not support JavaScript modules with import/export syntax. All modules must use sap.ui.define format.
Unsupported:
import Module from './module.js';
export default MyClass;
Supported:
sap.ui.define(['./module'], function(Module) {
return MyClass;
});
Expressions in template literals cannot be used in:
Unsupported:
sap.ui.define([`modules/${moduleName}`], ...); // Will fail
JavaScript modules requiring 'top level scope' cannot be bundled as strings. They will be omitted from bundles with error logging.
For UI5 1.71, manifest _version property must be โค 1.17.0 for supportedLocales generation. Update manifest version to match UI5 framework version.
For detailed troubleshooting, see references/troubleshooting.md.
Issue: ERR_SSL_PROTOCOL_ERROR in Chrome when accessing HTTP server
Solution: Chrome enforces HTTPS via HSTS. Clear HSTS settings:
chrome://net-internals/#hstsIssue: Excessive disk space in ~/.ui5/
Solution: Clear cached framework versions:
rm -rf ~/.ui5/framework/
Issue: Build fails with "TypeError: invalid input"
Solution: Check manifest _version compatibility with UI5 framework version. For UI5 1.71, use manifest version โค 1.17.0.
Issue: Custom task not executing
Solution: Verify task configuration:
beforeTask or afterTask references valid task nameui5 build --verbose for detailed loggingUI5_LOG_LVL: Set log level (silent/error/warn/info/perf/verbose/silly)UI5_DATA_DIR: Override default data directory (~/.ui5)UI5_CLI_NO_LOCAL: Disable local CLI precedence (use global)Examples:
UI5_LOG_LVL=verbose ui5 build
UI5_DATA_DIR=/custom/.ui5 ui5 serve
--save-dev)ui5 serve --h2)ui5 build --clean-dest --all)This skill follows official Anthropic Agent Skills best practices and SAP UI5 CLI documentation standards.