uniner-cli 1.0.22 → 1.0.24

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.
@@ -165,7 +165,8 @@ uniner-cli [全局选项] <模块> <子命令> <命令> [命令选项]
165
165
  1. **网页操作只用 `web`**(即使是桌面里嵌的 web)
166
166
  2. **`web action execute-js` 是万能 fallback**:Vue/React 组件、动态元素、复杂表格提取,普通 element 命令做不到时直接 JS
167
167
  3. **iframe 嵌套**用 XPath JSON 格式:`{"ElementName":"...","XPaths":[["iframe_xpath","element_xpath"],["backup_xpath"]]}`
168
- 4. **session 自动管理**:第一次 `web browser open` 后,后续 web 命令默认用最新 session,可省 `--session`
168
+ 4. **session 自动管理**:第一次 `web browser open` 后,后续 web 命令默认用最新 session,可省 `--session`;报 `Session not found`(如 CLI 进程退出过)时先 `web browser reconnect` 恢复,不要重开浏览器
169
+ 5. **业务产物写当前目录**:Excel/JSON/中间文件等业务产物一律用**相对路径**写当前工作目录(或流程目录),**禁止写 `{{INSTALL_PATH}}/workdir/`**——workdir 是 CLI 安装目录里的临时工作区(路径含版本号,升级即失效),内容也不随流程发布进包
169
170
 
170
171
  ## 关键注意事项(6 条 TOC,详情看链接)
171
172
 
@@ -191,7 +192,7 @@ uniner-cli [全局选项] <模块> <子命令> <命令> [命令选项]
191
192
  | 实战案例(TMS 抓单) | [{{INSTALL_PATH}}/skills/tms-workflow-test-report.md]({{INSTALL_PATH}}/skills/tms-workflow-test-report.md) |
192
193
  | Helper 脚本(Chrome 启动 / Vue 日期 / 表格提取) | [{{INSTALL_PATH}}/skills/cli/helpers/]({{INSTALL_PATH}}/skills/cli/helpers/) |
193
194
  | 用户手册 | [{{INSTALL_PATH}}/docs/]({{INSTALL_PATH}}/docs/) |
194
- | 工作目录(保存截图/Excel/下载) | [{{INSTALL_PATH}}/workdir/]({{INSTALL_PATH}}/workdir/) |
195
+ | 工作目录(CLI 内部临时缓存:截图/下载;**业务产物不要写这里**,写当前目录) | [{{INSTALL_PATH}}/workdir/]({{INSTALL_PATH}}/workdir/) |
195
196
 
196
197
  ## 触发词路由
197
198
 
@@ -209,11 +210,11 @@ test)→ publish,publish 时提示云端最新版本号、版本号由用户
209
210
  # 1. 打开浏览器
210
211
  uniner-cli web browser open --url "https://example.com/login"
211
212
 
212
- # 2. 输账号密码 + 截验证码 + OCR
213
+ # 2. 输账号密码 + 截验证码 + OCR(截图 temp 文件放当前目录,勿写 workdir)
213
214
  uniner-cli web element input --xpath "//input[@id='user']" --value "u01"
214
215
  uniner-cli web element input --xpath "//input[@id='pwd']" --value "p01"
215
- uniner-cli web element screenshot --xpath "//img[@id='captcha']" --output "{{INSTALL_PATH}}/workdir/cap.png"
216
- uniner-cli tool ocr ddddocr --img "{{INSTALL_PATH}}/workdir/cap.png"
216
+ uniner-cli web element screenshot --xpath "//img[@id='captcha']" --output "cap.png"
217
+ uniner-cli tool ocr ddddocr --img "cap.png"
217
218
  # 从返回 JSON 的 data.result 取识别文本
218
219
 
219
220
  # 3. 提交登录
@@ -224,9 +225,9 @@ uniner-cli web element click --xpath "//button[@type='submit']"
224
225
  uniner-cli web navigation wait --type element --xpath "//table"
225
226
  uniner-cli web action execute-js --code "return Array.from(document.querySelectorAll('table tr')).map(r => Array.from(r.cells).map(c => c.textContent.trim()))"
226
227
 
227
- # 5. 写 Excel
228
- uniner-cli excel file create --file "{{INSTALL_PATH}}/workdir/out.xlsx"
229
- uniner-cli excel data write-range --file "{{INSTALL_PATH}}/workdir/out.xlsx" --cell A1 --values "<上一步的 JSON 二维数组>"
228
+ # 5. 写 Excel(产物写当前目录)
229
+ uniner-cli excel file create --file "out.xlsx"
230
+ uniner-cli excel data write-range --file "out.xlsx" --cell A1 --values "<上一步的 JSON 二维数组>"
230
231
 
231
232
  # 6. 关浏览器
232
233
  uniner-cli web browser close
@@ -291,7 +292,7 @@ uniner-cli skill run <name> --param ...
291
292
  {
292
293
  "id": "ocr-captcha",
293
294
  "cmd": "tool ocr ddddocr",
294
- "args": { "img": "workdir/captcha.png" },
295
+ "args": { "img": "out/captcha.png" },
295
296
  "store": "ocrResult",
296
297
  "comment": "整个 stdout JSON 存到 ocrResult,下面用 ${ocrResult.data.result} 取"
297
298
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniner-cli",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "uniner-cli — RPA automation CLI: browser automation (Playwright/CDP), Excel, OCR, desktop/SAP, crypto/HTTP/email tools. Auto-installs a Claude Code skill on install.",
5
5
  "keywords": [
6
6
  "rpa",