重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
sapui5-cli by secondsky/sap-skills
npx skills add https://github.com/secondsky/sap-skills --skill sapui5-cli此技能为使用 UI5 CLI(UI5 工具)提供全面的指导,UI5 CLI 是用于开发、构建和部署 SAPUI5 及 OpenUI5 应用程序和库的官方命令行界面。
当前 CLI 版本 : 4.0.0+(发布于 2024 年 7 月 24 日) Node.js 要求 : v20.11.0+ 或 v22.0.0+(不支持 v21) npm 要求 : v8.0.0+
在以下情况下使用此技能:
# 1. 安装 UI5 CLI(选择一种)
npm install --global @ui5/cli # 全局安装
npm install --save-dev @ui5/cli # 项目级安装
# 2. 初始化项目(如果是新项目)
npm init --yes # 初始化 npm
ui5 init # 创建 ui5.yaml
# 3. 选择框架变体
ui5 use openui5@latest # 对于 OpenUI5
ui5 use sapui5@latest # 对于 SAPUI5
# 4. 添加框架库
ui5 add sap.ui.core sap.m sap.ui.table themelib_sap_fiori_3
# 5. 开始开发
ui5 serve # 启动开发服务器
ui5 serve --open index.html # 启动并打开浏览器
# 6. 为生产环境构建
ui5 build --all # 构建包含依赖项
ui5 build --clean-dest # 构建前清理目标目录
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 1. 启用 CLI 支持
ui5 init
# 2. 配置框架(如果 ui5.yaml 已存在)
ui5 use openui5@latest # 或 sapui5@latest
# 3. 验证设置
ui5 tree # 显示依赖树
ui5 serve # 测试开发服务器
UI5 CLI 支持四种项目类型,每种都有特定的配置:
标准的 UI5 应用程序,具有 webapp 目录。
webapp/ → /templates/ui5.yaml.application可在项目间共享的可复用组件库。
src/ → /resources, test/ → /test-resourcessrc/my/company/library/)templates/ui5.yaml.library为库提供主题资源。
my/library/themes/custom_theme/)references/configuration.md具有灵活路径映射的第三方资源。
references/project-types.mdui5 init # 初始化 UI5 CLI 配置
ui5 use <framework>[@version] # 设置框架(openui5/sapui5)
ui5 add <libraries...> # 添加框架库
ui5 remove <libraries...> # 移除框架库
ui5 serve [options] # 启动开发服务器
--port <number> # 指定端口(默认:8080)
--open <path> # 打开浏览器到指定路径
--h2 # 启用 HTTP/2
--accept-remote-connections # 允许非本地主机访问
ui5 tree [options] # 显示依赖树
--flat # 显示扁平列表
--level <number> # 限制树深度
ui5 build [child-command] [options] # 构建项目
preload # 创建预加载包(默认)
self-contained # 创建独立包
jsdoc # 生成 JSDoc 文档
--all # 包含所有依赖项
--include-dependency <names> # 包含特定依赖项
--exclude-dependency <names> # 排除依赖项
--dest <path> # 输出目录(默认:./dist)
--clean-dest # 构建前清理目标目录
--create-build-manifest # 存储构建元数据
--experimental-css-variables # 生成 CSS 变量工件 [实验性]
ui5 config set <key> [value] # 设置配置值
ui5 config get <key> # 获取配置值
ui5 config list # 列出所有设置
# 常见配置
ui5 config set ui5DataDir /path/.ui5 # 更改缓存目录
ui5 versions # 显示所有模块版本
ui5 --help # 显示帮助
ui5 --version # 显示版本
完整命令参考,请参见 references/cli-commands.md。
specVersion: "4.0" # 规范版本(必需)
type: application # 项目类型(必需)
metadata:
name: my.project.name # 项目名称(必需)
copyright: "© ${currentYear} Company" # 可选版权声明
framework:
name: SAPUI5 # OpenUI5 或 SAPUI5
version: "1.120.0" # 框架版本
libraries:
- name: sap.ui.core
- name: sap.m
- name: sap.ui.table
- name: themelib_sap_fiori_3
optional: true # 可选库
resources:
configuration:
paths:
webapp: webapp # 路径映射
propertiesFileSourceEncoding: UTF-8 # 编码(默认:UTF-8)
builder:
resources:
excludes:
- "index.html" # 从构建中排除
- "/resources/my/project/test/**"
server:
settings:
httpPort: 8080 # HTTP 端口
httpsPort: 8443 # HTTPS 端口
完整配置参考,请参见 references/configuration.md。
此主技能文件提供了基本工作流和快速参考。关于特定主题的详细信息,请参考这些参考文件:
references/cli-commands.md : 完整的 CLI 命令参考,包含所有选项和示例references/configuration.md : 全面的 ui5.yaml 配置指南(包含工作空间配置)references/project-structures.md : 详细的项目类型,包含目录结构和构建输出样式references/extensibility.md : 自定义任务、中间件和项目垫片,包含完整的 API 文档references/filesystem-api.md : 用于自定义任务/中间件开发的完整 FileSystem APIreferences/build-process.md : 完整的构建过程,包括任务、压缩、源映射和捆绑references/server-features.md : 完整的服务器文档,包含中间件栈、HTTP/2、SSL 和 CSPreferences/code-analysis.md : 依赖分析器、JSDoc 生成和代码分析功能references/es-support.md : 完整的 ECMAScript 版本支持、限制和模块格式要求references/benchmarking.md : 使用 hyperfine 进行性能测试和基准测试references/migration-guides.md : 完整的版本迁移指南(v1→v2→v3→v4)references/troubleshooting.md : 常见问题、错误和解决方案,包含确切的错误消息何时使用 : 从零开始新的 SAPUI5/OpenUI5 应用程序。
步骤 :
npm init --yesnpm install --save-dev @ui5/cliui5 initui5 use sapui5@latest(或 openui5@latest)ui5 add sap.ui.core sap.m themelib_sap_fiori_3ui5 servegit add ui5.yaml package.json && git commit何时使用 : 为现有的 UI5 项目添加 UI5 CLI 支持。
步骤 :
ui5 init 以创建 ui5.yamlui5 use sapui5@latestui5 add sap.ui.core sap.m sap.ui.tableresources.configuration.pathsui5 serve 测试ui5 build --all 构建何时使用 : 通过自定义处理扩展构建过程。
步骤 :
lib/tasks/customTask.js)templates/custom-task-template.js)ui5 build 测试references/extensibility.md何时使用 : 在单个仓库中管理多个相关的 UI5 项目。
步骤 :
--workspace <name> 标志激活特定工作空间ui5 tree 以验证依赖项解析references/configuration.md(工作空间部分)何时使用 : 从 UI5 CLI v3 升级到 v4。
先决条件 :
步骤 :
npm install --save-dev @ui5/cli@latest"4.0"references/migration-guides.md 中查看破坏性变更usePredefineCalls 捆绑选项(如果存在)async: trueui5 build --allui5 serve问题 : 我应该使用哪个框架?
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.
问题 : 我应该使用哪种构建类型?
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
问题 : 我应该创建自定义任务还是中间件?
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
此技能为常见配置提供了可用的模板:
templates/ui5.yaml.application : 完整的应用程序配置templates/ui5.yaml.library : 完整的库配置templates/ui5-workspace.yaml : 单仓库工作空间设置templates/custom-task-template.js : 自定义构建任务样板templates/custom-middleware-template.js : 自定义服务器中间件样板UI5 CLI 使用规范版本来管理功能:
对于新项目,始终使用最新的 specVersion。
重要 : 在开发期间,始终使用 ui5 serve 而不是 ui5 build。构建应仅在部署到生产环境时进行。开发服务器提供:
当同时存在全局和本地 UI5 CLI 安装时,本地版本会自动优先。这允许不同的项目使用不同的 CLI 版本。
覆盖行为:UI5_CLI_NO_LOCAL=X ui5 serve
UI5 CLI 将框架版本缓存在 ~/.ui5/ 中(可通过 ui5DataDir 配置)。
清除缓存:rm -rf ~/.ui5/framework/
UI5 CLI 不支持 使用 import/export 语法的 JavaScript 模块。所有模块必须使用 sap.ui.define 格式。
不支持 :
import Module from './module.js';
export default MyClass;
支持 :
sap.ui.define(['./module'], function(Module) {
return MyClass;
});
模板字面量中的表达式不能用于:
不支持 :
sap.ui.define([`modules/${moduleName}`], ...); // 将失败
需要“顶层作用域”的 JavaScript 模块不能作为字符串捆绑。它们将从捆绑包中省略,并记录错误。
对于 UI5 1.71,清单的 _version 属性必须 ≤ 1.17.0 才能生成 supportedLocales。请更新清单版本以匹配 UI5 框架版本。
详细的故障排除,请参见 references/troubleshooting.md。
问题 : 在 Chrome 中访问 HTTP 服务器时出现 ERR_SSL_PROTOCOL_ERROR
解决方案 : Chrome 通过 HSTS 强制使用 HTTPS。清除 HSTS 设置:
chrome://net-internals/#hsts问题 : ~/.ui5/ 中占用过多磁盘空间
解决方案 : 清除缓存的框架版本:
rm -rf ~/.ui5/framework/
问题 : 构建失败,提示“TypeError: invalid input”
解决方案 : 检查清单 _version 与 UI5 框架版本的兼容性。对于 UI5 1.71,请使用清单版本 ≤ 1.17.0。
问题 : 自定义任务未执行
解决方案 : 验证任务配置:
beforeTask 或 afterTask 引用了有效的任务名称ui5 build --verbose 获取详细日志UI5_LOG_LVL : 设置日志级别(silent/error/warn/info/perf/verbose/silly)UI5_DATA_DIR : 覆盖默认数据目录(~/.ui5)UI5_CLI_NO_LOCAL : 禁用本地 CLI 优先(使用全局)示例:
UI5_LOG_LVL=verbose ui5 build
UI5_DATA_DIR=/custom/.ui5 ui5 serve
--save-dev)ui5 serve --h2)ui5 build --clean-dest --all)references/cli-commands.md - 完整的 CLI 命令参考references/configuration.md - 配置选项和 ui5.yamlreferences/project-structures.md - 项目结构模式references/server-features.md - 开发服务器功能references/build-process.md - 构建过程和优化references/es-support.md - ES 模块支持references/extensibility.md - 扩展性选项references/code-analysis.md - 代码分析工具references/migration-guides.md - 从旧版本迁移references/troubleshooting.md - 常见问题和解决方案references/benchmarking.md - 性能基准测试templates/package.json.template - Package.json 模板此技能遵循官方 Anthropic Agent Skills 最佳实践和 SAP UI5 CLI 文档标准。
每周安装次数
70
仓库
GitHub 星标数
164
首次出现
Feb 5, 2026
安全审计
安装于
gemini-cli70
github-copilot70
amp70
codex70
kimi-cli70
opencode70
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)references/cli-commands.md - Complete CLI command referencereferences/configuration.md - Configuration options and ui5.yamlreferences/project-structures.md - Project structure patternsreferences/server-features.md - Development server featuresreferences/build-process.md - Build process and optimizationreferences/es-support.md - ES module supportreferences/extensibility.md - Extensibility optionsreferences/code-analysis.md - Code analysis toolsreferences/migration-guides.md - Migration from older versionstemplates/package.json.template - Package.json templateThis skill follows official Anthropic Agent Skills best practices and SAP UI5 CLI documentation standards.
Weekly Installs
70
Repository
GitHub Stars
164
First Seen
Feb 5, 2026
Security Audits
Gen Agent Trust HubWarnSocketPassSnykWarn
Installed on
gemini-cli70
github-copilot70
amp70
codex70
kimi-cli70
opencode70
Lark Skill Maker 教程:基于飞书CLI创建AI技能,自动化工作流与API调用指南
41,900 周安装
references/troubleshooting.md - Common issues and solutionsreferences/benchmarking.md - Performance benchmarking