openyida 2026.4.2 → 2026.4.14-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +3 -0
  2. package/bin/yida.js +203 -140
  3. package/lib/app/app-list.js +134 -0
  4. package/lib/app/create-app.js +26 -32
  5. package/lib/app/create-form.js +176 -165
  6. package/lib/app/create-page.js +19 -24
  7. package/lib/app/export-app.js +26 -28
  8. package/lib/app/get-schema.js +24 -35
  9. package/lib/app/import-app.js +42 -52
  10. package/lib/app/publish.js +165 -77
  11. package/lib/app/update-app.js +197 -0
  12. package/lib/app/update-form-config.js +38 -44
  13. package/lib/auth/auth.js +29 -27
  14. package/lib/auth/login.js +43 -45
  15. package/lib/auth/org.js +36 -36
  16. package/lib/auth/qr-login.js +42 -39
  17. package/lib/cdn/cdn-config.js +2 -1
  18. package/lib/cdn/cdn-refresh.js +14 -13
  19. package/lib/cdn/cdn-upload.js +12 -11
  20. package/lib/connector/action-generator.js +23 -9
  21. package/lib/connector/connector-add-action.js +4 -3
  22. package/lib/connector/connector-create-connection.js +3 -2
  23. package/lib/connector/connector-create.js +9 -8
  24. package/lib/connector/connector-delete-action.js +3 -2
  25. package/lib/connector/connector-delete.js +2 -1
  26. package/lib/connector/connector-detail.js +2 -1
  27. package/lib/connector/connector-gen-template.js +2 -1
  28. package/lib/connector/connector-list-actions.js +2 -1
  29. package/lib/connector/connector-list-connections.js +2 -1
  30. package/lib/connector/connector-parse-api.js +3 -2
  31. package/lib/connector/connector-smart-create.js +3 -1
  32. package/lib/connector/connector-test.js +5 -4
  33. package/lib/conversation/collector.js +9 -8
  34. package/lib/conversation/export-conversation.js +17 -20
  35. package/lib/core/chalk.js +344 -0
  36. package/lib/core/check-data.js +516 -0
  37. package/lib/core/check-update.js +2 -1
  38. package/lib/core/copy.js +22 -25
  39. package/lib/core/doctor.js +24 -19
  40. package/lib/core/env-cmd.js +385 -0
  41. package/lib/core/env-manager.js +218 -0
  42. package/lib/core/env.js +34 -36
  43. package/lib/core/i18n.js +1 -1
  44. package/lib/core/locales/ar.js +93 -0
  45. package/lib/core/locales/de.js +93 -0
  46. package/lib/core/locales/en.js +326 -21
  47. package/lib/core/locales/es.js +93 -0
  48. package/lib/core/locales/fr.js +93 -0
  49. package/lib/core/locales/hi.js +93 -0
  50. package/lib/core/locales/ja.js +176 -21
  51. package/lib/core/locales/ko.js +93 -0
  52. package/lib/core/locales/pt.js +93 -0
  53. package/lib/core/locales/vi.js +93 -0
  54. package/lib/core/locales/zh-TW.js +191 -21
  55. package/lib/core/locales/zh.js +326 -21
  56. package/lib/core/query-data.js +39 -3
  57. package/lib/core/sample.js +140 -0
  58. package/lib/core/task-center.js +4 -3
  59. package/lib/core/update.js +149 -0
  60. package/lib/core/utils.js +100 -17
  61. package/lib/db/db-seq-fix.js +437 -0
  62. package/lib/dws/dws-wrapper.js +27 -8
  63. package/lib/flash-note/flash-to-prd.js +45 -44
  64. package/lib/integration/integration-create.js +71 -70
  65. package/lib/page-config/get-page-config.js +18 -22
  66. package/lib/page-config/save-share-config.js +31 -36
  67. package/lib/page-config/verify-short-url.js +31 -36
  68. package/lib/permission/get-permission.js +20 -19
  69. package/lib/permission/save-permission.js +50 -49
  70. package/lib/process/configure-process.js +54 -47
  71. package/lib/process/create-process.js +57 -43
  72. package/lib/process/preview-process.js +879 -0
  73. package/lib/report/append.js +42 -41
  74. package/lib/report/chart-builder.js +9 -8
  75. package/lib/report/create-report.js +2 -1
  76. package/lib/report/index.js +45 -43
  77. package/{yida-skills/skills/yida-custom-page/templates → lib/samples/yida-custom-page}/custom-page-template.js +48 -18
  78. package/package.json +1 -1
  79. package/project/pages/src/demo-chip-insight.js +3 -1
  80. package/project/pages/src/demo-ppt.js +1192 -0
  81. package/yida-skills/SKILL.md +33 -3
  82. package/yida-skills/references/yida-api.md +24 -1
  83. package/yida-skills/skills/large-file-write/SKILL.md +32 -43
  84. package/yida-skills/skills/large-file-write/references/write-patterns.md +124 -0
  85. package/yida-skills/skills/yida-app/SKILL.md +47 -14
  86. package/yida-skills/skills/yida-chart/SKILL.md +5 -5
  87. package/yida-skills/skills/yida-chart/{reference → references}/echarts-code-template.md +3 -3
  88. package/yida-skills/skills/yida-chart/references/examples.md +164 -0
  89. package/yida-skills/skills/yida-connector/SKILL.md +41 -1
  90. package/yida-skills/skills/yida-create-app/SKILL.md +19 -3
  91. package/yida-skills/skills/yida-create-form-page/SKILL.md +25 -1
  92. package/yida-skills/skills/yida-create-page/SKILL.md +23 -2
  93. package/yida-skills/skills/yida-create-process/SKILL.md +42 -2
  94. package/yida-skills/skills/yida-custom-page/SKILL.md +101 -239
  95. package/yida-skills/skills/yida-custom-page/examples/attachment-upload.js +223 -0
  96. package/yida-skills/skills/yida-custom-page/references/assets-guide.md +3 -3
  97. package/yida-skills/skills/yida-custom-page/references/attachment-upload-guide.md +459 -0
  98. package/yida-skills/skills/yida-custom-page/references/coding-guide.md +116 -86
  99. package/yida-skills/skills/yida-custom-page/references/design-system.md +4 -0
  100. package/yida-skills/skills/yida-data-management/SKILL.md +51 -0
  101. package/yida-skills/skills/yida-db-seq-fix/SKILL.md +110 -0
  102. package/yida-skills/skills/yida-density/SKILL.md +65 -246
  103. package/yida-skills/skills/yida-export-conversation/SKILL.md +39 -2
  104. package/yida-skills/skills/yida-flash-note-to-prd/SKILL.md +42 -250
  105. package/yida-skills/skills/yida-flash-note-to-prd/references/examples.md +124 -0
  106. package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prd-template.md +42 -0
  107. package/yida-skills/skills/yida-flash-note-to-prd/references/flash-note-prompt.md +197 -0
  108. package/yida-skills/skills/yida-flash-note-to-prd/references/yida-field-types.md +20 -0
  109. package/yida-skills/skills/yida-form-permission/SKILL.md +36 -2
  110. package/yida-skills/skills/yida-formula/SKILL.md +37 -21
  111. package/yida-skills/skills/yida-formula/references/examples.md +149 -0
  112. package/yida-skills/skills/yida-get-schema/SKILL.md +35 -1
  113. package/yida-skills/skills/yida-integration/SKILL.md +71 -127
  114. package/yida-skills/skills/yida-integration/references/examples.md +119 -0
  115. package/yida-skills/skills/yida-integration/references/integration-node-schemas.md +377 -0
  116. package/yida-skills/skills/yida-login/SKILL.md +24 -2
  117. package/yida-skills/skills/yida-logout/SKILL.md +33 -1
  118. package/yida-skills/skills/yida-page-config/SKILL.md +36 -1
  119. package/yida-skills/skills/yida-ppt-slider/SKILL.md +750 -1
  120. package/yida-skills/skills/yida-ppt-slider/references/examples.md +381 -0
  121. package/yida-skills/skills/yida-process-rule/SKILL.md +30 -320
  122. package/yida-skills/skills/yida-process-rule/references/examples.md +344 -0
  123. package/yida-skills/skills/yida-publish-page/SKILL.md +56 -1
  124. package/yida-skills/skills/yida-report/SKILL.md +25 -341
  125. package/yida-skills/skills/yida-report/references/examples.md +145 -0
  126. package/yida-skills/skills/yida-report/references/report-api-guide.md +287 -0
  127. package/yida-skills/skills/yida-table-form/SKILL.md +65 -437
  128. package/yida-skills/skills/yida-table-form/references/examples.md +113 -0
  129. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/china-map.js +0 -0
  130. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/dashboard-bindform.js +0 -0
  131. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/line-trend.js +0 -0
  132. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/multi-bar-compare.js +0 -0
  133. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/radar-chart.js +0 -0
  134. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/scatter-bindform.js +0 -0
  135. /package/{yida-skills/skills/yida-chart/examples → lib/samples/yida-chart}/stacked-area.js +0 -0
  136. /package/{yida-skills/skills/yida-create-app/templates → lib/samples/yida-create-app}/ipd-app-template.js +0 -0
  137. /package/{yida-skills/skills/yida-custom-page/examples → lib/samples/yida-custom-page}/design-tokens.js +0 -0
  138. /package/{yida-skills/skills/yida-data-management/templates → lib/samples/yida-data-management}/form-field-template.js +0 -0
  139. /package/{yida-skills/skills/yida-density/examples → lib/samples/yida-density}/density-switch-page.js +0 -0
  140. /package/{yida-skills/skills/yida-table-form/examples → lib/samples/yida-table-form}/table-form-batch-submit.js +0 -0
  141. /package/yida-skills/skills/yida-chart/{reference → references}/echarts-bindding-guide.md +0 -0
  142. /package/yida-skills/skills/yida-chart/{reference → references}/echarts-design-spec.md +0 -0
package/README.md CHANGED
@@ -99,7 +99,9 @@ openyida create-form # Create / update a form page
99
99
  openyida create-page # Create a custom display page
100
100
  openyida create-process # Create a process form (integrated)
101
101
  openyida create-report # Create a Yida report
102
+ openyida process preview # Preview process instance (generate visual flowchart)
102
103
  openyida data # Unified data management (form/process/task/subform)
104
+ openyida data check <appType> <formUuid> <rules.json> [options] # Detect anomalous records in process forms based on custom rules
103
105
  openyida doctor # Environment diagnostics and auto-repair
104
106
  openyida dws <command> [args] # DingTalk CLI (Contacts/Calendar/Todo/Approval, etc.)
105
107
  openyida env # Detect current AI tool environment and login status
@@ -205,6 +207,7 @@ Thanks to everyone who has contributed to OpenYida! Read the [Contributing Guide
205
207
  <a href="https://github.com/liug0911"><img src="https://avatars.githubusercontent.com/u/1578814?v=4&s=48" width="48" height="48" alt="LIUG" title="LIUG"/></a>
206
208
  <a href="https://github.com/sunliz-xiuli"><img src="https://avatars.githubusercontent.com/u/76982855?v=4&s=48" width="48" height="48" alt="sunliz-xiuli" title="sunliz-xiuli"/></a>
207
209
  <a href="https://github.com/M12REDX"><img src="https://avatars.githubusercontent.com/u/22703542?v=4&s=48" width="48" height="48" alt="M12REDX" title="M12REDX"/></a>
210
+ <a href="https://github.com/key-668"><img src="https://avatars.githubusercontent.com/u/270536058?v=4&s=48" width="48" height="48" alt="再不喝汽水" title="再不喝汽水"/></a>
208
211
  </p>
209
212
 
210
213
  ---
package/bin/yida.js CHANGED
@@ -26,6 +26,7 @@
26
26
  * openyida save-share-config <appType> <formUuid> <url> <isOpen> [openAuth] 保存公开访问/分享配置
27
27
  * openyida get-page-config <appType> <formUuid> 查询页面公开访问/分享配置
28
28
  * openyida update-form-config <appType> <formUuid> <isRenderNav> <title> 更新表单配置
29
+ * openyida update-app <appType> --name "新名称" [--desc "描述"] [--icon "图标"] 更新应用信息
29
30
  * openyida data <action> <resource> [args] 统一数据管理(表单/流程/任务/子表单)
30
31
  * openyida task-center <type> [--page N] [--size N] [--keyword TEXT] 全局任务中心(待办/我创建的/我已处理/抄送/代提交)
31
32
  * openyida doctor [选项] 检查环境依赖,诊断应用问题
@@ -33,6 +34,7 @@
33
34
  * openyida import <file> [name] 导入迁移包,在目标环境重建应用
34
35
  * openyida get-permission <appType> <formUuid> 查询表单权限配置
35
36
  * openyida save-permission <appType> <formUuid> [--data-permission <json>] [--action-permission <json>] 保存表单权限配置
37
+ * openyida process preview <appType> <processInstanceId> [--output <path>] 预览流程实例(生成可视化流程图)
36
38
  * openyida connector list [选项] 列出 HTTP 连接器
37
39
  * openyida connector create "名称" "域名" --operations <file> [选项] 创建连接器
38
40
  * openyida connector detail <connector-id> 查看连接器详情
@@ -50,6 +52,7 @@
50
52
  * openyida create-report <appType> "<报表名称>" <图表定义JSON或文件路径> 创建宜搭报表
51
53
  * openyida append-chart <appType> <reportId> <图表定义JSON或文件路径> 向已有报表追加图表
52
54
  * openyida dws <command> [args] 钉钉 CLI(通讯录/日历/待办/审批等)
55
+ * openyida update 检查并更新 openyida 到最新版本
53
56
  */
54
57
 
55
58
  'use strict';
@@ -57,6 +60,7 @@
57
60
  const { checkUpdate } = require('../lib/core/check-update');
58
61
  const { version: currentVersion } = require('../package.json');
59
62
  const { t } = require('../lib/core/i18n');
63
+ const { warn, fail } = require('../lib/core/chalk');
60
64
 
61
65
  // 异步检查更新,fire-and-forget,不阻塞主流程
62
66
  const updateCheckPromise = checkUpdate(currentVersion);
@@ -65,106 +69,129 @@ const command = process.argv[2];
65
69
  const args = process.argv.slice(3);
66
70
 
67
71
  function printHelp() {
68
- console.log(`
69
- openyida - 宜搭命令行工具
70
-
71
- 用法:
72
- openyida <命令> [参数...](别名:yida)
73
-
74
- 命令:
75
- env 检测当前 AI 工具环境和登录态
76
- copy [--force] 复制 project 工作目录到当前 AI 工具环境
77
- login 登录态管理(优先缓存,否则扫码)
78
- logout 退出登录 / 切换账号
79
- create-app "<名称>" [描述] [图标] [颜色] [主题色] [导航风格] [布局] 创建应用,输出 appType
80
- create-page <appType> "<页面名>" 创建自定义页面,输出 pageId
81
- create-form create <appType> "<表单名>" <字段JSON> [--layout <布局>] [--theme <主题>] [--label-align <对齐>] 创建表单页面
82
- create-form update <appType> <formUuid> <修改JSON> 更新表单页面
83
- get-schema <appType> <formUuid> 获取表单 Schema
84
- publish <源文件路径> <appType> <formUuid> 编译并发布自定义页面
85
- verify-short-url <appType> <formUuid> <url> 验证短链接 URL 是否可用
86
- save-share-config <appType> <formUuid> <url> <isOpen> [auth] 保存公开访问/分享配置
87
- get-page-config <appType> <formUuid> 查询页面公开访问/分享配置
88
- update-form-config <appType> <formUuid> <isRenderNav> <title> 更新表单配置
89
- data <action> <resource> [args] 统一数据管理(表单/流程/任务/子表单)
90
- doctor [选项] 检查环境依赖,诊断应用问题
91
- --fix / --repair 诊断并自动修复
92
- --production --app <appId> 线上应用诊断
93
- --monitor 启动实时健康度监控
94
- --report <format> 生成诊断报告(json | markdown | html)
95
- --create-ticket 根据诊断结果创建工单
96
- --create-voc 创建 VOC(需求反馈)
97
- --auto-submit 自动判断并提交工单或 VOC
98
- auth status 查看当前登录状态
99
- auth login 执行登录
100
- auth refresh 刷新登录态
101
- auth logout 退出登录
102
- org list 列出可访问的组织
103
- org switch --corp-id <corpId> 切换组织(无需重新登录)
104
- get-permission <appType> <formUuid> 查询表单权限配置
105
- save-permission <appType> <formUuid> [--data-permission <json>] [--action-permission <json>] 保存表单权限配置
106
- configure-process <appType> <formUuid> <processDefinitionFile> [processCode] 配置并发布流程
107
- create-process <appType> <formTitle> <fieldsJsonFile> <processDefinitionFile> 创建流程表单(一体化)
108
- create-process <appType> --formUuid <formUuid> <processDefinitionFile> 复用已有表单创建流程
109
- connector list [选项] 列出 HTTP 连接器
110
- connector create "名称" "域名" --operations <file> [选项] 创建连接器
111
- connector detail <connector-id> 查看连接器详情
112
- connector delete <connector-id> [--force] 删除连接器
113
- connector add-action --operations <file> --connector-id <id> 添加执行动作到连接器
114
- connector list-actions <connector-id> 列出执行动作
115
- connector delete-action <connector-id> <operation-id> 删除执行动作
116
- connector test --connector-id <id> --action <actionId> 测试执行动作
117
- connector list-connections <connector-id> 列出鉴权账号
118
- connector create-connection <connector-id> <name> [选项] 创建鉴权账号
119
- connector smart-create --curl "curl命令" [选项] 智能创建连接器
120
- connector parse-api [选项] 解析接口信息
121
- connector gen-template [输出路径] 生成接口文档模板
122
- dws <command> [args] 钉钉 CLI(通讯录/日历/待办/审批等)
123
- create-report <appType> "<报表名称>" <图表定义 JSON 或文件路径> 创建宜搭报表
124
- append-chart <appType> <reportId> <图表定义 JSON 或文件路径> 向已有报表追加图表
125
- export-conversation [选项] 导出 AI 对话记录
126
- --output, -o <path> 指定输出文件路径
127
- --input, -i <file> 指定输入对话文件
128
- --latest 只导出最新对话(默认)
129
- --list 列出可用的对话记录
130
-
131
- 示例:
132
- openyida login
133
- openyida logout
134
- openyida create-app "考勤管理"
135
- openyida create-app "考勤管理" "员工考勤系统" "xian-daka" "#00B853" "deepBlue" "dark" "slide"
136
- openyida create-app "党建管理" "党员管理系统" "xian-zhengfu" "#FF4D4F" "red" "light" "ver"
137
- openyida create-page APP_XXX "游戏主页"
138
- openyida create-form create APP_XXX "员工信息" fields.json
139
- openyida create-form update APP_XXX FORM-XXX '[{"action":"add","field":{"type":"TextField","label":"备注"}}]'
140
- openyida get-schema APP_XXX FORM-XXX
141
- openyida publish pages/src/home.jsx APP_XXX FORM-XXX
142
- openyida verify-short-url APP_XXX FORM-XXX /o/myapp
143
- openyida save-share-config APP_XXX FORM-XXX /o/myapp y n
144
- openyida get-page-config APP_XXX FORM-XXX
145
- openyida update-form-config APP_XXX FORM-XXX false "页面标题"
146
- openyida data query form APP_XXX FORM-XXX --page 1 --size 20
147
- openyida dws contact user search --keyword "悟空"
148
- openyida dws calendar event list
149
- openyida dws todo task create --title "任务"
150
- openyida create-report APP_XXX "销售报表" charts.json
151
- openyida append-chart APP_XXX REPORT-XXX charts.json
152
- openyida configure-process APP_XXX FORM-YYY process-def.json
153
- openyida create-process APP_XXX "订单处理表" fields.json process-def.json
154
- openyida create-process APP_XXX --formUuid FORM-YYY process-def.json
155
- openyida doctor 完整诊断
156
- openyida doctor --fix 诊断并自动修复
157
- openyida doctor --production --app APP_XXX 线上应用诊断
158
- openyida doctor --monitor 实时监控
159
- openyida doctor --report markdown 生成 Markdown 报告
160
- openyida doctor --create-ticket 创建工单
161
- openyida doctor --create-voc 创建 VOC
162
- openyida doctor --auto-submit 自动判断并提交
163
- openyida export-conversation 导出当前对话记录
164
- openyida export-conversation -o output.md 指定输出路径
165
- openyida export-conversation --list 列出可用对话
166
- `);
167
- console.log(t('cli.help'));
72
+ const RESET = '\x1b[0m';
73
+ const BOLD = '\x1b[1m';
74
+ const DIM = '\x1b[2m';
75
+ const CYAN = '\x1b[36m';
76
+ const GREEN = '\x1b[32m';
77
+ const YELLOW = '\x1b[33m';
78
+
79
+ const SEP = `${DIM}${'─'.repeat(60)}${RESET}`;
80
+
81
+ /**
82
+ * 渲染一组命令列表。
83
+ * @param {string} groupTitle - 分组标题
84
+ * @param {Array<[string, string]>} commands - [命令, 描述] 数组
85
+ */
86
+ function renderGroup(groupTitle, commands) {
87
+ console.log(`\n ${BOLD}${CYAN}${groupTitle}${RESET}`);
88
+ const maxCmdLen = Math.max(...commands.map(([cmd]) => cmd.length));
89
+ const padWidth = Math.min(maxCmdLen + 2, 50);
90
+ for (const [cmd, desc] of commands) {
91
+ console.log(` ${GREEN}${cmd.padEnd(padWidth)}${RESET}${DIM}${desc}${RESET}`);
92
+ }
93
+ }
94
+
95
+ // ── 标题 ──
96
+ console.log('');
97
+ console.log(` ${BOLD}${CYAN}OpenYida${RESET} ${DIM}v${currentVersion}${RESET}`);
98
+ console.log(` ${DIM}${t('help.subtitle')}${RESET}`);
99
+ console.log(` ${DIM}"We are on the verge of the Singularity"${RESET}`);
100
+ console.log('');
101
+ console.log(` ${YELLOW}${t('help.usage')}${RESET} openyida <command> [args...]`);
102
+ console.log(` ${DIM}${t('help.alias')}${RESET} yida`);
103
+ console.log(SEP);
104
+
105
+ // ── 环境 & 认证 ──
106
+ renderGroup(t('help.group_auth'), [
107
+ ['login [--qr]', t('help.cmd_login')],
108
+ ['logout', t('help.cmd_logout')],
109
+ ['auth <status|login|refresh|logout>', t('help.cmd_auth')],
110
+ ['org <list|switch>', t('help.cmd_org')],
111
+ ['env', t('help.cmd_env')],
112
+ ]);
113
+
114
+ // ── 应用管理 ──
115
+ renderGroup(t('help.group_app'), [
116
+ ['create-app "<name>" [options]', t('help.cmd_create_app')],
117
+ ['update-app <appType> --name "..."', t('help.cmd_update_app')],
118
+ ['export <appType> [output]', t('help.cmd_export')],
119
+ ['import <file> [name]', t('help.cmd_import')],
120
+ ]);
121
+
122
+ // ── 表单 & 页面 ──
123
+ renderGroup(t('help.group_form'), [
124
+ ['create-form create <appType> ...', t('help.cmd_create_form')],
125
+ ['create-form update <appType> ...', t('help.cmd_update_form')],
126
+ ['get-schema <appType> <formUuid>', t('help.cmd_get_schema')],
127
+ ['create-page <appType> "<name>"', t('help.cmd_create_page')],
128
+ ['publish <src> <appType> <formUuid>', t('help.cmd_publish')],
129
+ ['update-form-config <appType> ...', t('help.cmd_update_form_config')],
130
+ ]);
131
+
132
+ // ── 数据 & 权限 ──
133
+ renderGroup(t('help.group_data'), [
134
+ ['data <action> <resource> [args]', t('help.cmd_data')],
135
+ ['task-center <type> [options]', t('help.cmd_task_center')],
136
+ ['get-permission <appType> <formUuid>', t('help.cmd_get_permission')],
137
+ ['save-permission <appType> <formUuid> ...', t('help.cmd_save_permission')],
138
+ ]);
139
+
140
+ // ── 流程 ──
141
+ renderGroup(t('help.group_process'), [
142
+ ['configure-process <appType> ...', t('help.cmd_configure_process')],
143
+ ['create-process <appType> ...', t('help.cmd_create_process')],
144
+ ['process preview <appType> ...', t('help.cmd_process_preview')],
145
+ ]);
146
+
147
+ // ── 页面配置 & 分享 ──
148
+ renderGroup(t('help.group_share'), [
149
+ ['verify-short-url <appType> ...', t('help.cmd_verify_url')],
150
+ ['save-share-config <appType> ...', t('help.cmd_save_share')],
151
+ ['get-page-config <appType> <formUuid>', t('help.cmd_get_page_config')],
152
+ ]);
153
+
154
+ // ── 报表 ──
155
+ renderGroup(t('help.group_report'), [
156
+ ['create-report <appType> "<name>" ...', t('help.cmd_create_report')],
157
+ ['append-chart <appType> <reportId> ...', t('help.cmd_append_chart')],
158
+ ]);
159
+
160
+ // ── 连接器 ──
161
+ renderGroup(t('help.group_connector'), [
162
+ ['connector list', t('help.cmd_connector_list')],
163
+ ['connector create "name" "domain" ...', t('help.cmd_connector_create')],
164
+ ['connector detail <id>', t('help.cmd_connector_detail')],
165
+ ['connector delete <id>', t('help.cmd_connector_delete')],
166
+ ['connector smart-create --curl "..."', t('help.cmd_connector_smart')],
167
+ ['connector <sub-command> --help', t('help.cmd_connector_more')],
168
+ ]);
169
+
170
+ // ── 集成 & 钉钉 ──
171
+ renderGroup(t('help.group_integration'), [
172
+ ['integration create <appType> ...', t('help.cmd_integration')],
173
+ ['dws <command> [args]', t('help.cmd_dws')],
174
+ ]);
175
+
176
+ // ── 工具 ──
177
+ renderGroup(t('help.group_utility'), [
178
+ ['copy [--force]', t('help.cmd_copy')],
179
+ ['doctor [--fix]', t('help.cmd_doctor')],
180
+ ['update', t('help.cmd_update')],
181
+ ['export-conversation [options]', t('help.cmd_export_conversation')],
182
+ ['cdn-config / cdn-upload / cdn-refresh', t('help.cmd_cdn')],
183
+ ]);
184
+
185
+ // ── 快速上手 ──
186
+ console.log(SEP);
187
+ console.log(`\n ${BOLD}${CYAN}${t('help.quickstart_title')}${RESET}`);
188
+ console.log(` ${DIM}${RESET} openyida login`);
189
+ console.log(` ${DIM}${RESET} openyida create-app "${t('help.quickstart_app_name')}"`);
190
+ console.log(` ${DIM}${RESET} openyida create-form create APP_XXX "${t('help.quickstart_form_name')}" fields.json`);
191
+ console.log(` ${DIM}${RESET} openyida dws contact user search --keyword "张三"`);
192
+ console.log('');
193
+ console.log(` ${DIM}${t('help.docs')} https://openyida.ai · https://github.com/openyida/openyida${RESET}`);
194
+ console.log('');
168
195
  }
169
196
 
170
197
  /**
@@ -299,8 +326,8 @@ async function main() {
299
326
  } else if (subCommand === 'logout') {
300
327
  authLogout();
301
328
  } else {
302
- console.error(t('cli.auth_usage'));
303
- console.error(t('cli.auth_example'));
329
+ warn(t('cli.auth_usage'));
330
+ warn(t('cli.auth_example'));
304
331
  process.exit(1);
305
332
  }
306
333
  break;
@@ -314,14 +341,14 @@ async function main() {
314
341
  if (subCommand === 'list') {
315
342
  const cookieData = loadCookieData();
316
343
  if (!cookieData || !cookieData.cookies) {
317
- console.error(t('org.no_login'));
344
+ warn(t('org.no_login'));
318
345
  process.exit(1);
319
346
  }
320
347
  await listOrganizations(cookieData);
321
348
  } else if (subCommand === 'switch') {
322
349
  const cookieData = loadCookieData();
323
350
  if (!cookieData || !cookieData.cookies) {
324
- console.error(t('org.no_login'));
351
+ warn(t('org.no_login'));
325
352
  process.exit(1);
326
353
  }
327
354
 
@@ -335,8 +362,8 @@ async function main() {
335
362
  await interactiveSwitch(cookieData);
336
363
  }
337
364
  } else {
338
- console.error(t('cli.org_usage'));
339
- console.error(t('cli.org_example'));
365
+ warn(t('cli.org_usage'));
366
+ warn(t('cli.org_example'));
340
367
  process.exit(1);
341
368
  }
342
369
  break;
@@ -373,8 +400,8 @@ async function main() {
373
400
  const skipLint = args.includes('--skip-lint');
374
401
  const filteredArgs = args.filter(arg => arg !== '--skip-lint');
375
402
  if (filteredArgs.length < 3) {
376
- console.error(t('cli.publish_usage'));
377
- console.error(t('cli.publish_example'));
403
+ warn(t('cli.publish_usage'));
404
+ warn(t('cli.publish_example'));
378
405
  process.exit(1);
379
406
  }
380
407
  const [sourceFile, appType, formUuid] = filteredArgs;
@@ -390,8 +417,8 @@ async function main() {
390
417
 
391
418
  case 'verify-short-url': {
392
419
  if (args.length < 3) {
393
- console.error(t('cli.verify_usage'));
394
- console.error(t('cli.verify_example'));
420
+ warn(t('cli.verify_usage'));
421
+ warn(t('cli.verify_example'));
395
422
  process.exit(1);
396
423
  }
397
424
  process.argv = [process.argv[0], process.argv[1], ...args];
@@ -401,8 +428,8 @@ async function main() {
401
428
 
402
429
  case 'save-share-config': {
403
430
  if (args.length < 4) {
404
- console.error(t('cli.share_usage'));
405
- console.error(t('cli.share_example'));
431
+ warn(t('cli.share_usage'));
432
+ warn(t('cli.share_example'));
406
433
  process.exit(1);
407
434
  }
408
435
  process.argv = [process.argv[0], process.argv[1], ...args];
@@ -412,8 +439,8 @@ async function main() {
412
439
 
413
440
  case 'get-page-config': {
414
441
  if (args.length < 2) {
415
- console.error(t('cli.page_config_usage'));
416
- console.error(t('cli.page_config_example'));
442
+ warn(t('cli.page_config_usage'));
443
+ warn(t('cli.page_config_example'));
417
444
  process.exit(1);
418
445
  }
419
446
  process.argv = [process.argv[0], process.argv[1], ...args];
@@ -423,8 +450,8 @@ async function main() {
423
450
 
424
451
  case 'update-form-config': {
425
452
  if (args.length < 4) {
426
- console.error(t('cli.form_config_usage'));
427
- console.error(t('cli.form_config_example'));
453
+ warn(t('cli.form_config_usage'));
454
+ warn(t('cli.form_config_example'));
428
455
  process.exit(1);
429
456
  }
430
457
  process.argv = [process.argv[0], process.argv[1], ...args];
@@ -432,10 +459,21 @@ async function main() {
432
459
  break;
433
460
  }
434
461
 
462
+ case 'update-app': {
463
+ if (args.length < 2) {
464
+ warn(t('cli.update_app_usage'));
465
+ warn(t('cli.update_app_example'));
466
+ process.exit(1);
467
+ }
468
+ const { run: runUpdateApp } = require('../lib/app/update-app');
469
+ await runUpdateApp(args);
470
+ break;
471
+ }
472
+
435
473
  case 'data': {
436
474
  if (args.length < 2) {
437
- console.error('用法: openyida data <action> <resource> [args] [options]');
438
- console.error('示例: openyida data query form APP_XXX FORM_XXX --page 1 --size 20');
475
+ warn('用法: openyida data <action> <resource> [args] [options]');
476
+ warn('示例: openyida data query form APP_XXX FORM_XXX --page 1 --size 20');
439
477
  process.exit(1);
440
478
  }
441
479
  const { run: runDataManagement } = require('../lib/core/query-data');
@@ -451,9 +489,9 @@ async function main() {
451
489
 
452
490
  case 'export': {
453
491
  if (args.length < 1) {
454
- console.error(t('cli.export_usage'));
455
- console.error(t('cli.export_example1'));
456
- console.error(t('cli.export_example2'));
492
+ warn(t('cli.export_usage'));
493
+ warn(t('cli.export_example1'));
494
+ warn(t('cli.export_example2'));
457
495
  process.exit(1);
458
496
  }
459
497
  const { run: runExport } = require('../lib/app/export-app');
@@ -463,9 +501,9 @@ async function main() {
463
501
 
464
502
  case 'import': {
465
503
  if (args.length < 1) {
466
- console.error(t('cli.import_usage'));
467
- console.error(t('cli.import_example1'));
468
- console.error(t('cli.import_example2'));
504
+ warn(t('cli.import_usage'));
505
+ warn(t('cli.import_example1'));
506
+ warn(t('cli.import_example2'));
469
507
  process.exit(1);
470
508
  }
471
509
  const { run: runImport } = require('../lib/app/import-app');
@@ -475,8 +513,8 @@ async function main() {
475
513
 
476
514
  case 'get-permission': {
477
515
  if (args.length < 2) {
478
- console.error(t('cli.get_permission_usage'));
479
- console.error(t('cli.get_permission_example'));
516
+ warn(t('cli.get_permission_usage'));
517
+ warn(t('cli.get_permission_example'));
480
518
  process.exit(1);
481
519
  }
482
520
  const { run: runGetPermission } = require('../lib/permission/get-permission');
@@ -486,8 +524,8 @@ async function main() {
486
524
 
487
525
  case 'save-permission': {
488
526
  if (args.length < 2) {
489
- console.error(t('cli.save_permission_usage'));
490
- console.error(t('cli.save_permission_example'));
527
+ warn(t('cli.save_permission_usage'));
528
+ warn(t('cli.save_permission_example'));
491
529
  process.exit(1);
492
530
  }
493
531
  const { run: runSavePermission } = require('../lib/permission/save-permission');
@@ -497,8 +535,8 @@ async function main() {
497
535
 
498
536
  case 'configure-process': {
499
537
  if (args.length < 3) {
500
- console.error(t('cli.configure_process_usage'));
501
- console.error(t('cli.configure_process_example'));
538
+ warn(t('cli.configure_process_usage'));
539
+ warn(t('cli.configure_process_example'));
502
540
  process.exit(1);
503
541
  }
504
542
  const { run: runConfigureProcess } = require('../lib/process/configure-process');
@@ -508,8 +546,8 @@ async function main() {
508
546
 
509
547
  case 'create-process': {
510
548
  if (args.length < 2) {
511
- console.error(t('cli.create_process_usage'));
512
- console.error(t('cli.create_process_example'));
549
+ warn(t('cli.create_process_usage'));
550
+ warn(t('cli.create_process_example'));
513
551
  process.exit(1);
514
552
  }
515
553
  const { run: runCreateProcess } = require('../lib/process/create-process');
@@ -517,6 +555,25 @@ async function main() {
517
555
  break;
518
556
  }
519
557
 
558
+ case 'process': {
559
+ const subCommand = args[0];
560
+ const subArgs = args.slice(1);
561
+
562
+ if (subCommand === 'preview') {
563
+ if (subArgs.length < 2) {
564
+ warn(t('cli.process_preview_usage'));
565
+ warn(t('cli.process_preview_example'));
566
+ process.exit(1);
567
+ }
568
+ const { run: runPreviewProcess } = require('../lib/process/preview-process');
569
+ await runPreviewProcess(subArgs);
570
+ } else {
571
+ warn(t('cli.process_usage'));
572
+ process.exit(1);
573
+ }
574
+ break;
575
+ }
576
+
520
577
  case 'create-report': {
521
578
  const { run } = require('../lib/report/create-report');
522
579
  await run(args);
@@ -593,8 +650,8 @@ async function main() {
593
650
 
594
651
  const modulePath = connectorSubCommands[subCommand];
595
652
  if (!modulePath) {
596
- console.error(`未知的 connector 子命令: ${subCommand}`);
597
- console.error('使用 openyida connector --help 查看可用子命令');
653
+ warn(`未知的 connector 子命令: ${subCommand}`);
654
+ warn('使用 openyida connector --help 查看可用子命令');
598
655
  process.exit(1);
599
656
  }
600
657
 
@@ -614,7 +671,7 @@ async function main() {
614
671
  const subArgs = args.slice(1); // 路由层消费 subCommand,传递剩余参数
615
672
 
616
673
  if (!subCommand || subCommand === '--help' || subCommand === '-h') {
617
- console.error(t('cli.integration_help'));
674
+ warn(t('cli.integration_help'));
618
675
  break;
619
676
  }
620
677
 
@@ -622,8 +679,8 @@ async function main() {
622
679
  const { run: runIntegration } = require('../lib/integration/integration-create');
623
680
  await runIntegration(subArgs);
624
681
  } else {
625
- console.error(t('cli.integration_unknown', subCommand));
626
- console.error(t('cli.integration_help_hint'));
682
+ warn(t('cli.integration_unknown', subCommand));
683
+ warn(t('cli.integration_help_hint'));
627
684
  process.exit(1);
628
685
  }
629
686
  break;
@@ -659,9 +716,15 @@ async function main() {
659
716
  break;
660
717
  }
661
718
 
719
+ case 'update': {
720
+ const { runUpdate } = require('../lib/core/update');
721
+ await runUpdate(currentVersion);
722
+ break;
723
+ }
724
+
662
725
  default: {
663
- console.error(t('cli.unknown_command', command));
664
- console.error(t('cli.run_help'));
726
+ warn(t('cli.unknown_command', command));
727
+ warn(t('cli.run_help'));
665
728
  process.exit(1);
666
729
  }
667
730
  }
@@ -670,6 +733,6 @@ async function main() {
670
733
  main()
671
734
  .then(() => updateCheckPromise)
672
735
  .catch((err) => {
673
- console.error(t('cli.exec_failed', err.message));
736
+ warn(t('cli.exec_failed', err.message));
674
737
  process.exit(1);
675
738
  });