@optima-chat/browser-cli 0.5.3 → 0.5.4

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.
@@ -43,23 +43,30 @@ owner_repo: Optima-Chat/optima-browser-use
43
43
 
44
44
  ### 紫鸟浏览器(跨境电商多店铺管理)
45
45
 
46
- 当用户提到紫鸟、多店铺、反指纹浏览器、或需要操作特定店铺时:
46
+ 当用户提到紫鸟、多店铺、反指纹浏览器、TikTok Shop 店铺、或需要操作特定店铺时,按以下步骤操作:
47
47
 
48
48
  ```bash
49
- # 设置紫鸟凭证(首次使用)
50
- browser-cli ziniao set --company "公司名" --username "用户名" --password "密码"
51
-
52
- # 查看紫鸟配置
49
+ # 1. 检查紫鸟凭证是否已配置
53
50
  browser-cli ziniao show
54
51
 
55
- # 使用紫鸟指定店铺启动浏览器
56
- browser-cli launch --connector ziniao --ziniao-profile <profile_id> --url <url>
52
+ # 2. 如果未配置,设置凭证(需要用户提供)
53
+ browser-cli ziniao set --company "公司名" --username "用户名" --password "密码"
54
+
55
+ # 3. 查看可用的紫鸟店铺列表(需要 Desktop app 在线)
56
+ browser-cli ziniao profiles
57
+ # 输出示例:
58
+ # 27774259938707 迪士尼授权林总店铺
59
+ # 27772540507986 Gigilli-US
60
+ # 27732948017158 马来本土店3SAVEZO
57
61
 
58
- # 普通启动(自动选择模式)
59
- browser-cli launch --url <url>
62
+ # 4. 用店铺 profile 启动浏览器(根据用户描述匹配店铺名)
63
+ browser-cli launch --connector ziniao --ziniao-profile 27774259938707 --url https://seller.tiktokshopglobalselling.com/homepage --force
60
64
  ```
61
65
 
62
- **紫鸟 profile_id** 需要从 Desktop app 的 capabilities 获取,或者用户直接提供。
66
+ **重要**:
67
+ - 用户说"迪士尼店铺"、"林总店铺"等 → 先 `ziniao profiles` 查列表,按名称模糊匹配找到 profile_id
68
+ - 用户说"打开紫鸟"但没指定店铺 → 先列出 profiles 让用户选
69
+ - 紫鸟需要 Desktop app 在线 + 紫鸟 WebDriver 模式已启动
63
70
 
64
71
  ## 命令
65
72
 
package/dist/index.js CHANGED
@@ -187,6 +187,9 @@ var BrowserAPI = class {
187
187
  async deleteZiNiaoConfig() {
188
188
  return request("/api/user/ziniao-config", { method: "DELETE" });
189
189
  }
190
+ async getZiNiaoProfiles() {
191
+ return request("/api/user/ziniao-profiles");
192
+ }
190
193
  async closeSession(sessionId) {
191
194
  await request(`/api/sessions/${sessionId}`, { method: "DELETE" });
192
195
  }
@@ -849,6 +852,32 @@ function registerZiNiaoCommands(program2) {
849
852
  process.exit(1);
850
853
  }
851
854
  });
855
+ ziniao.command("profiles").description("List ZiNiao browser profiles (requires Desktop app online)").action(async () => {
856
+ try {
857
+ const result = await api.getZiNiaoProfiles();
858
+ if (!result.connected) {
859
+ console.log("Desktop app not connected. Start Optima Browser Operator first.");
860
+ process.exit(1);
861
+ }
862
+ if (!result.ziniao_available) {
863
+ console.log("ZiNiao not available on Desktop app. Start ZiNiao WebDriver mode first.");
864
+ process.exit(1);
865
+ }
866
+ if (result.profiles.length === 0) {
867
+ console.log("No ZiNiao profiles found.");
868
+ return;
869
+ }
870
+ console.log(`ZiNiao profiles (${result.profiles.length}):
871
+ `);
872
+ for (const p of result.profiles) {
873
+ console.log(` ${p.id} ${p.name}`);
874
+ }
875
+ console.log("\nUse: browser-cli launch --connector ziniao --ziniao-profile <id> --url <url>");
876
+ } catch (err) {
877
+ console.error(formatError(err));
878
+ process.exit(1);
879
+ }
880
+ });
852
881
  ziniao.command("clear").description("Remove ZiNiao credentials").action(async () => {
853
882
  try {
854
883
  await api.deleteZiNiaoConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/browser-cli",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {