zalo-agent-cli 1.0.29 → 1.0.31

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.
package/README.md CHANGED
@@ -35,9 +35,10 @@ Built on top of [zca-js](https://github.com/AKAspanion/zca-js), the unofficial Z
35
35
  - Send text, images, files, contact cards, stickers, reactions
36
36
  - Send bank cards (55+ Vietnamese banks)
37
37
  - Generate and send VietQR transfer images via qr.sepay.vn
38
- - Friend management (list, find, add, remove, block)
39
- - Group management (create, rename, add/remove members)
40
- - Conversation management (mute, pin, archive, read/unread)
38
+ - Friend management (list, find, add, remove, block, alias, recommendations)
39
+ - Group management (create, rename, members, settings, links, notes, invites)
40
+ - Conversation management (mute, pin, archive, hidden, auto-delete)
41
+ - Auto-reply, quick messages, labels, Zalo Shop catalogs
41
42
  - Export/import credentials for headless server deployment
42
43
  - Local HTTP server for QR display on VPS (via SSH tunnel)
43
44
  - `--json` output on all commands for scripting and coding agents
@@ -141,59 +142,65 @@ zalo-agent whoami
141
142
 
142
143
  #### Global Flags
143
144
 
144
- | Flag | Description |
145
- |------|-------------|
146
- | `--json` | Output all results as JSON |
147
- | `-V, --version` | Show version number |
148
- | `-h, --help` | Show help |
145
+ | Flag | Description |
146
+ | --------------- | -------------------------- |
147
+ | `--json` | Output all results as JSON |
148
+ | `-V, --version` | Show version number |
149
+ | `-h, --help` | Show help |
149
150
 
150
151
  #### Auth
151
152
 
152
- | Command | Description |
153
- |---------|-------------|
153
+ | Command | Description |
154
+ | ----------------------------------------------------- | ----------------------------------------- |
154
155
  | `login [--proxy URL] [--credentials PATH] [--qr-url]` | Login via QR or from exported credentials |
155
- | `logout` | Clear current session |
156
- | `status` | Show login state |
157
- | `whoami` | Show current user profile |
156
+ | `logout` | Clear current session |
157
+ | `status` | Show login state |
158
+ | `whoami` | Show current user profile |
158
159
 
159
160
  #### Messages (`msg`)
160
161
 
161
- | Command | Description |
162
- |---------|-------------|
163
- | `msg send <threadId> <text> [-t 0\|1] [--md] [--style specs...]` | Send text message (with formatting) |
164
- | `msg send-image <threadId> <paths...> [-t 0\|1] [-m caption]` | Send images |
165
- | `msg send-file <threadId> <paths...> [-t 0\|1] [-m caption]` | Send files |
166
- | `msg send-card <threadId> <userId> [-t 0\|1] [--phone NUM]` | Send contact card |
167
- | `msg send-bank <threadId> <accountNum> -b BANK [-n name] [-t 0\|1]` | Send bank card |
168
- | `msg send-qr-transfer <threadId> <accountNum> -b BANK [-a amount] [-m content] [--template tpl]` | Send VietQR transfer image |
169
- | `msg send-link <threadId> <url> [-m caption] [-t 0\|1]` | Send link with auto-preview |
170
- | `msg send-video <threadId> <videoUrl> --thumb <thumbUrl> [-m caption] [-d ms] [-W px] [-H px]` | Send video from URL |
171
- | `msg sticker <threadId> <keyword> [-t 0\|1]` | Search and send sticker |
172
- | `msg react <msgId> <threadId> <emoji> [-t 0\|1]` | React to a message |
173
- | `msg delete <msgId> <threadId> [-t 0\|1]` | Delete a message |
174
- | `msg forward <msgId> <threadId> [-t 0\|1]` | Forward a message |
162
+ | Command | Description |
163
+ | ------------------------------------------------------------------------------------------------ | ----------------------------------- |
164
+ | `msg send <threadId> <text> [-t 0\|1] [--md] [--style specs...]` | Send text message (with formatting) |
165
+ | `msg send-image <threadId> <paths...> [-t 0\|1] [-m caption]` | Send images |
166
+ | `msg send-file <threadId> <paths...> [-t 0\|1] [-m caption]` | Send files |
167
+ | `msg send-card <threadId> <userId> [-t 0\|1] [--phone NUM]` | Send contact card |
168
+ | `msg send-bank <threadId> <accountNum> -b BANK [-n name] [-t 0\|1]` | Send bank card |
169
+ | `msg send-qr-transfer <threadId> <accountNum> -b BANK [-a amount] [-m content] [--template tpl]` | Send VietQR transfer image |
170
+ | `msg send-voice <threadId> <voiceUrl> [-t 0\|1] [--ttl ms]` | Send a voice message from URL |
171
+ | `msg send-link <threadId> <url> [-m caption] [-t 0\|1]` | Send link with auto-preview |
172
+ | `msg send-video <threadId> <videoUrl> --thumb <thumbUrl> [-m caption] [-d ms] [-W px] [-H px]` | Send video from URL |
173
+ | `msg sticker <threadId> <keyword> [-t 0\|1]` | Search and send sticker |
174
+ | `msg sticker-list <keyword>` | Search stickers (returns IDs) |
175
+ | `msg sticker-detail <stickerIds...>` | Get sticker details by IDs |
176
+ | `msg sticker-category <categoryId>` | Get sticker category details |
177
+ | `msg react <msgId> <threadId> <emoji> [-t 0\|1]` | React to a message |
178
+ | `msg delete <msgId> <threadId> [-t 0\|1]` | Delete a message |
179
+ | `msg forward <msgId> <threadId> [-t 0\|1]` | Forward a message |
175
180
 
176
181
  > `-t 0` = User (default), `-t 1` = Group
177
182
 
178
183
  **Text formatting with `--md` (markdown mode):**
184
+
179
185
  ```bash
180
186
  zalo-agent msg send <threadId> "**Bold** *Italic* __Underline__ ~~Strike~~ {red:Red} {big:BIG}" --md
181
187
  ```
182
188
 
183
- | Syntax | Style |
184
- |--------|-------|
185
- | `**text**` | Bold |
186
- | `*text*` | Italic |
187
- | `__text__` | Underline |
188
- | `~~text~~` | Strikethrough |
189
- | `{red:text}` | Red text |
190
- | `{orange:text}` | Orange text |
191
- | `{yellow:text}` | Yellow text |
192
- | `{green:text}` | Green text |
193
- | `{big:text}` | Large font |
194
- | `{small:text}` | Small font |
189
+ | Syntax | Style |
190
+ | --------------- | ------------- |
191
+ | `**text**` | Bold |
192
+ | `*text*` | Italic |
193
+ | `__text__` | Underline |
194
+ | `~~text~~` | Strikethrough |
195
+ | `{red:text}` | Red text |
196
+ | `{orange:text}` | Orange text |
197
+ | `{yellow:text}` | Yellow text |
198
+ | `{green:text}` | Green text |
199
+ | `{big:text}` | Large font |
200
+ | `{small:text}` | Small font |
195
201
 
196
202
  **Manual style with `--style` (for agents/automation):**
203
+
197
204
  ```bash
198
205
  # Format: start:len:style — style names: bold, italic, underline, strikethrough, red, orange, yellow, green, big, small
199
206
  zalo-agent msg send <threadId> "Hello World" --style 0:5:bold 6:5:italic
@@ -201,77 +208,119 @@ zalo-agent msg send <threadId> "Hello World" --style 0:5:bold 6:5:italic
201
208
 
202
209
  #### Friends (`friend`)
203
210
 
204
- | Command | Description |
205
- |---------|-------------|
206
- | `friend list` | List all friends |
207
- | `friend search <name>` | Search friends by name (get thread_id) |
208
- | `friend online` | List online friends |
209
- | `friend find <query>` | Find by phone or ID |
210
- | `friend info <userId>` | Get user profile |
211
- | `friend add <userId> [-m msg]` | Send friend request |
212
- | `friend accept <userId>` | Accept request |
213
- | `friend remove <userId>` | Remove friend |
214
- | `friend block <userId>` | Block user |
215
- | `friend unblock <userId>` | Unblock user |
216
- | `friend last-online <userId>` | Check last seen |
211
+ | Command | Description |
212
+ | ---------------------------------------- | ---------------------------------------------- |
213
+ | `friend list` | List all friends |
214
+ | `friend search <name>` | Search friends by name (get thread_id) |
215
+ | `friend online` | List online friends |
216
+ | `friend find <query>` | Find by phone or ID |
217
+ | `friend info <userId>` | Get user profile |
218
+ | `friend add <userId> [-m msg]` | Send friend request |
219
+ | `friend accept <userId>` | Accept request |
220
+ | `friend remove <userId>` | Remove friend |
221
+ | `friend block <userId>` | Block user |
222
+ | `friend unblock <userId>` | Unblock user |
223
+ | `friend last-online <userId>` | Check last seen |
224
+ | `friend find-username <username>` | Find user by Zalo username |
225
+ | `friend alias <friendId> <alias>` | Set nickname for a friend |
226
+ | `friend alias-list [-c count] [-p page]` | List all friend aliases |
227
+ | `friend alias-remove <friendId>` | Remove a friend's alias |
228
+ | `friend reject <userId>` | Reject a friend request |
229
+ | `friend undo-request <userId>` | Cancel a sent friend request |
230
+ | `friend sent-requests` | List sent friend requests |
231
+ | `friend request-status <userId>` | Check friend request status |
232
+ | `friend close` | List close friends |
233
+ | `friend recommendations` | Get friend recommendations & received requests |
234
+ | `friend find-phones <phones...>` | Find users by phone numbers |
217
235
 
218
236
  #### Groups (`group`)
219
237
 
220
- | Command | Description |
221
- |---------|-------------|
222
- | `group list` | List all groups |
223
- | `group create <name> <memberIds...>` | Create group |
224
- | `group history <groupId> [-n count]` | Get chat history (normalized JSON) |
225
- | `group info <groupId>` | Group details |
226
- | `group members <groupId>` | List members |
227
- | `group add-member <groupId> <userIds...>` | Add members |
228
- | `group remove-member <groupId> <userIds...>` | Remove members |
229
- | `group rename <groupId> <name>` | Rename |
230
- | `group upgrade-community <groupId>` | Upgrade group to Zalo Community |
231
- | `group leave <groupId>` | Leave group |
232
- | `group join <link>` | Join via invite link |
238
+ | Command | Description |
239
+ | ---------------------------------------------------- | --------------------------------------- |
240
+ | `group list` | List all groups |
241
+ | `group create <name> <memberIds...>` | Create group |
242
+ | `group history <groupId> [-n count]` | Get chat history (normalized JSON) |
243
+ | `group info <groupId>` | Group details |
244
+ | `group members <groupId>` | List members |
245
+ | `group add-member <groupId> <userIds...>` | Add members |
246
+ | `group remove-member <groupId> <userIds...>` | Remove members |
247
+ | `group rename <groupId> <name>` | Rename |
248
+ | `group upgrade-community <groupId>` | Upgrade group to Zalo Community |
249
+ | `group leave <groupId>` | Leave group |
250
+ | `group join <link>` | Join via invite link |
251
+ | `group members-info <userIds...>` | Get detailed info for members by IDs |
252
+ | `group settings <groupId> [flags]` | Update group settings (see flags below) |
253
+ | `group pending <groupId>` | List pending member requests (admin) |
254
+ | `group approve <groupId> <userIds...>` | Approve pending members (admin) |
255
+ | `group reject-member <groupId> <userIds...>` | Reject pending members (admin) |
256
+ | `group enable-link <groupId>` | Enable group invite link |
257
+ | `group disable-link <groupId>` | Disable group invite link |
258
+ | `group link-info <groupId>` | Get group invite link details |
259
+ | `group blocked <groupId> [-c count] [-p page]` | List blocked members |
260
+ | `group note-create <groupId> <title> [--pin]` | Create a note |
261
+ | `group note-edit <groupId> <noteId> <title> [--pin]` | Edit a note |
262
+ | `group invite-boxes` | List received group invitations |
263
+ | `group join-invite <groupId>` | Accept a group invitation |
264
+ | `group delete-invite <groupIds...> [--block]` | Delete invitations |
265
+ | `group invite-to <userId> <groupIds...>` | Invite user to groups |
266
+ | `group disperse <groupId>` | Disperse group (irreversible!) |
267
+
268
+ **Group settings flags:** `--block-name`, `--sign-admin`, `--msg-history`, `--join-appr`, `--lock-post`, `--lock-poll`, `--lock-msg`, `--lock-view-member` (prefix with `--no-` to disable)
233
269
 
234
270
  #### Conversations (`conv`)
235
271
 
236
- | Command | Description |
237
- |---------|-------------|
272
+ | Command | Description |
273
+ | --------------------------------------------------------- | ---------------------------------------- |
238
274
  | `conv recent [-n limit] [--friends-only] [--groups-only]` | List recent conversations with thread_id |
239
- | `conv pinned` | List pinned |
240
- | `conv archived` | List archived |
241
- | `conv mute <threadId> [-t 0\|1] [-d secs]` | Mute (-1 = forever) |
242
- | `conv unmute <threadId> [-t 0\|1]` | Unmute |
243
- | `conv read <threadId> [-t 0\|1]` | Mark as read |
244
- | `conv unread <threadId> [-t 0\|1]` | Mark as unread |
245
- | `conv delete <threadId> [-t 0\|1]` | Delete conversation |
275
+ | `conv pinned` | List pinned |
276
+ | `conv archived` | List archived |
277
+ | `conv mute <threadId> [-t 0\|1] [-d secs]` | Mute (-1 = forever) |
278
+ | `conv unmute <threadId> [-t 0\|1]` | Unmute |
279
+ | `conv read <threadId> [-t 0\|1]` | Mark as read |
280
+ | `conv unread <threadId> [-t 0\|1]` | Mark as unread |
281
+ | `conv hidden` | List hidden conversations |
282
+ | `conv hide <threadIds...> [-t 0\|1]` | Hide conversation(s) |
283
+ | `conv unhide <threadIds...> [-t 0\|1]` | Unhide conversation(s) |
284
+ | `conv hidden-pin <pin>` | Set PIN for hidden conversations |
285
+ | `conv hidden-pin-reset` | Reset hidden conversations PIN |
286
+ | `conv auto-delete-status` | View auto-delete chat settings |
287
+ | `conv auto-delete <threadId> <ttl> [-t 0\|1]` | Set auto-delete (off, 1d, 7d, 14d) |
288
+ | `conv delete <threadId> [-t 0\|1]` | Delete conversation |
246
289
 
247
290
  #### Profile (`profile`)
248
291
 
249
- | Command | Description |
250
- |---------|-------------|
251
- | `profile me` | Show your profile (name, phone, avatar, etc.) |
252
- | `profile avatar <imagePath>` | Change profile avatar |
253
- | `profile bio [text]` | View or update bio/status |
254
- | `profile update [-n name] [-d YYYY-MM-DD] [-g 0\|1]` | Update name, birthday, gender |
255
- | `profile settings` | View privacy settings |
256
- | `profile set <setting> <value>` | Update a privacy setting |
292
+ | Command | Description |
293
+ | ---------------------------------------------------- | --------------------------------------------- |
294
+ | `profile me` | Show your profile (name, phone, avatar, etc.) |
295
+ | `profile avatar <imagePath>` | Change profile avatar |
296
+ | `profile bio [text]` | View or update bio/status |
297
+ | `profile update [-n name] [-d YYYY-MM-DD] [-g 0\|1]` | Update name, birthday, gender |
298
+ | `profile avatars [-c count] [-p page]` | List avatar gallery |
299
+ | `profile full-avatar <friendId>` | Get full-size avatar URL |
300
+ | `profile avatar-url <friendIds...>` | Get avatar URLs for users |
301
+ | `profile delete-avatar <photoIds...>` | Delete avatar(s) from gallery |
302
+ | `profile reuse-avatar <photoId>` | Reuse a previous avatar |
303
+ | `profile settings` | View privacy settings |
304
+ | `profile set <setting> <value>` | Update a privacy setting |
257
305
 
258
306
  **Privacy settings:** `online-status`, `seen-status`, `birthday`, `receive-msg`, `accept-call`, `add-by-phone`, `add-by-qr`, `add-by-group`, `recommend`
259
307
 
260
308
  #### Polls (`poll`)
261
309
 
262
- | Command | Description |
263
- |---------|-------------|
264
- | `poll create <groupId> <question> <options...>` | Create a poll (see flags below) |
265
- | `poll info <pollId>` | View poll details and vote results |
266
- | `poll vote <pollId> <optionIds...>` | Vote on a poll (option IDs from `poll info`) |
267
- | `poll unvote <pollId>` | Remove your vote |
268
- | `poll add-option <pollId> <options...> [--vote]` | Add new options to a poll |
269
- | `poll lock <pollId>` | Close a poll (no more votes) |
270
- | `poll share <pollId>` | Share a poll |
310
+ | Command | Description |
311
+ | ------------------------------------------------ | -------------------------------------------- |
312
+ | `poll create <groupId> <question> <options...>` | Create a poll (see flags below) |
313
+ | `poll info <pollId>` | View poll details and vote results |
314
+ | `poll vote <pollId> <optionIds...>` | Vote on a poll (option IDs from `poll info`) |
315
+ | `poll unvote <pollId>` | Remove your vote |
316
+ | `poll add-option <pollId> <options...> [--vote]` | Add new options to a poll |
317
+ | `poll lock <pollId>` | Close a poll (no more votes) |
318
+ | `poll share <pollId>` | Share a poll |
271
319
 
272
320
  **Poll create flags:** `--multi` (multiple choices), `--add-options` (members can add options), `--anonymous` (hide voters), `--hide-preview` (hide results until voted), `--expire <minutes>` (auto-close)
273
321
 
274
322
  **Example:**
323
+
275
324
  ```bash
276
325
  # Create a multi-choice poll with 3 options, auto-close after 60 minutes
277
326
  zalo-agent poll create <groupId> "Chọn ngày họp" "Thứ 2" "Thứ 4" "Thứ 6" --multi --expire 60
@@ -288,18 +337,19 @@ zalo-agent poll lock <pollId>
288
337
 
289
338
  #### Reminders (`reminder`)
290
339
 
291
- | Command | Description |
292
- |---------|-------------|
293
- | `reminder create <threadId> <title> [-t 0\|1] [--time "YYYY-MM-DD HH:mm"] [--repeat mode] [--emoji]` | Create a reminder |
294
- | `reminder list <threadId> [-t 0\|1] [-n count]` | List reminders |
295
- | `reminder info <reminderId>` | View reminder details (group only) |
296
- | `reminder responses <reminderId>` | View who accepted/rejected (group only) |
297
- | `reminder edit <reminderId> <threadId> <title> [-t 0\|1] [--time] [--repeat] [--emoji]` | Edit a reminder |
298
- | `reminder remove <reminderId> <threadId> [-t 0\|1]` | Remove a reminder |
340
+ | Command | Description |
341
+ | ---------------------------------------------------------------------------------------------------- | --------------------------------------- |
342
+ | `reminder create <threadId> <title> [-t 0\|1] [--time "YYYY-MM-DD HH:mm"] [--repeat mode] [--emoji]` | Create a reminder |
343
+ | `reminder list <threadId> [-t 0\|1] [-n count]` | List reminders |
344
+ | `reminder info <reminderId>` | View reminder details (group only) |
345
+ | `reminder responses <reminderId>` | View who accepted/rejected (group only) |
346
+ | `reminder edit <reminderId> <threadId> <title> [-t 0\|1] [--time] [--repeat] [--emoji]` | Edit a reminder |
347
+ | `reminder remove <reminderId> <threadId> [-t 0\|1]` | Remove a reminder |
299
348
 
300
349
  **Repeat modes:** `none`, `daily`, `weekly`, `monthly`
301
350
 
302
351
  **Example:**
352
+
303
353
  ```bash
304
354
  # Create a daily reminder in a group at 9:00 AM tomorrow
305
355
  zalo-agent reminder create <groupId> "Standup meeting" -t 1 --time "2026-03-16 09:00" --repeat daily
@@ -317,16 +367,59 @@ zalo-agent reminder edit <reminderId> <groupId> "New title" -t 1 --time "2026-03
317
367
  zalo-agent reminder remove <reminderId> <groupId> -t 1
318
368
  ```
319
369
 
370
+ #### Auto-Reply (`auto-reply`)
371
+
372
+ | Command | Description |
373
+ | --------------------------------------------------------------------------------- | ------------------------- |
374
+ | `auto-reply list` | List all auto-reply rules |
375
+ | `auto-reply create <content> [--enable] [--start ms] [--end ms] [--scope n]` | Create auto-reply |
376
+ | `auto-reply update <id> <content> [--enable] [--start ms] [--end ms] [--scope n]` | Update auto-reply |
377
+ | `auto-reply delete <id>` | Delete auto-reply |
378
+
379
+ **Scope:** `0`=all, `1`=friends, `2`=strangers
380
+
381
+ #### Quick Messages (`quick-msg`)
382
+
383
+ | Command | Description |
384
+ | --------------------------------------------- | ------------------------- |
385
+ | `quick-msg list` | List saved quick messages |
386
+ | `quick-msg add <keyword> <title>` | Add a quick message |
387
+ | `quick-msg update <itemId> <keyword> <title>` | Update a quick message |
388
+ | `quick-msg remove <itemIds...>` | Remove quick message(s) |
389
+
390
+ #### Labels (`label`)
391
+
392
+ | Command | Description |
393
+ | --------------------- | -------------------------------- |
394
+ | `label list` | List all conversation labels |
395
+ | `label update <json>` | Update labels (raw JSON payload) |
396
+
397
+ #### Catalog / Shop (`catalog`)
398
+
399
+ | Command | Description |
400
+ | ----------------------------------------------------------------------------------------- | ---------------------------------- |
401
+ | `catalog list [-l limit] [-p page]` | List all catalogs |
402
+ | `catalog create <name>` | Create a catalog |
403
+ | `catalog rename <catalogId> <name>` | Rename a catalog |
404
+ | `catalog delete <catalogId>` | Delete a catalog |
405
+ | `catalog products <catalogId> [-l limit] [-p page]` | List products in a catalog |
406
+ | `catalog add-product <catalogId> <name> <price> <desc> [--photos urls...]` | Add product |
407
+ | `catalog update-product <catalogId> <productId> <name> <price> <desc> [--photos urls...]` | Update product |
408
+ | `catalog delete-product <catalogId> <productIds...>` | Delete product(s) |
409
+ | `catalog upload-photo <filePath>` | Upload product photo (returns URL) |
410
+
411
+ > Catalog/Shop APIs require a Zalo Business account.
412
+
320
413
  #### Accounts (`account`)
321
414
 
322
- | Command | Description |
323
- |---------|-------------|
324
- | `account list` | List all registered accounts |
415
+ | Command | Description |
416
+ | ----------------------------------------------- | ------------------------------------- |
417
+ | `account list` | List all registered accounts |
325
418
  | `account login [-p proxy] [-n name] [--qr-url]` | Login new account with optional proxy |
326
- | `account switch <ownerId>` | Switch active account |
327
- | `account remove <ownerId>` | Remove account + credentials |
328
- | `account info` | Show active account |
329
- | `account export [ownerId] [-o path]` | Export credentials for transfer |
419
+ | `account switch <ownerId>` | Switch active account |
420
+ | `account remove <ownerId>` | Remove account + credentials |
421
+ | `account info` | Show active account |
422
+ | `account export [ownerId] [-o path]` | Export credentials for transfer |
330
423
 
331
424
  #### Listener (`listen`)
332
425
 
@@ -372,6 +465,7 @@ zalo-agent account switch 789012...
372
465
  ```
373
466
 
374
467
  **Important notes:**
468
+
375
469
  - Zalo enforces 1 account = 1 device (IMEI). Each QR login auto-generates a unique IMEI.
376
470
  - Use 1 dedicated proxy per account — sharing proxies risks both accounts being flagged.
377
471
  - Supported proxy protocols: `http://`, `https://`, `socks5://`
@@ -486,9 +580,10 @@ This is an **unofficial** project and is **not affiliated with, endorsed by, or
486
580
  - Gửi tin nhắn, hình ảnh, file, danh thiếp, sticker, reaction
487
581
  - Gửi thẻ ngân hàng (55+ ngân hàng Việt Nam)
488
582
  - Tạo và gửi ảnh QR chuyển khoản qua qr.sepay.vn
489
- - Quản lý bạn bè (danh sách, tìm kiếm, thêm, xóa, chặn)
490
- - Quản lý nhóm (tạo, đổi tên, thêm/xóa thành viên)
491
- - Quản lý hội thoại (tắt thông báo, ghim, lưu trữ)
583
+ - Quản lý bạn bè (danh sách, tìm kiếm, thêm, xóa, chặn, biệt danh, gợi ý)
584
+ - Quản lý nhóm (tạo, đổi tên, thành viên, cài đặt, link, ghi chú, lời mời)
585
+ - Quản lý hội thoại (tắt thông báo, ghim, lưu trữ, ẩn, tự xóa)
586
+ - Trả lời tự động, tin nhắn nhanh, nhãn, cửa hàng Zalo Shop
492
587
  - Xuất/nhập credentials cho triển khai trên server
493
588
  - HTTP server local hiển thị QR cho VPS (qua SSH tunnel)
494
589
  - Output `--json` cho mọi lệnh, phục vụ scripting và coding agent
@@ -636,6 +731,7 @@ zalo-agent account switch <ID>
636
731
  ```
637
732
 
638
733
  **Lưu ý quan trọng:**
734
+
639
735
  - Zalo giới hạn 1 tài khoản = 1 thiết bị (IMEI). Mỗi lần quét QR tự tạo IMEI mới.
640
736
  - Dùng 1 proxy riêng cho mỗi tài khoản — dùng chung proxy có nguy cơ bị khóa cả 2.
641
737
  - Hỗ trợ: `http://`, `https://`, `socks5://`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zalo-agent-cli",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "CLI tool for Zalo automation — multi-account, proxy support, bank transfers, QR payments",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Auto-reply commands — list, create, update, delete auto-reply messages.
3
+ */
4
+
5
+ import { getApi } from "../core/zalo-client.js";
6
+ import { success, error, output } from "../utils/output.js";
7
+
8
+ export function registerAutoReplyCommands(program) {
9
+ const ar = program.command("auto-reply").description("Manage auto-reply messages");
10
+
11
+ ar.command("list")
12
+ .description("List all auto-reply rules")
13
+ .action(async () => {
14
+ try {
15
+ const result = await getApi().getAutoReplyList();
16
+ output(result, program.opts().json);
17
+ } catch (e) {
18
+ error(`Get auto-reply list failed: ${e.message}`);
19
+ }
20
+ });
21
+
22
+ ar.command("create <content>")
23
+ .description("Create an auto-reply rule")
24
+ .option("--enable", "Enable the rule (default: true)", true)
25
+ .option("--no-enable", "Create disabled")
26
+ .option("--start <ms>", "Start time (epoch ms)", parseInt, 0)
27
+ .option("--end <ms>", "End time (epoch ms)", parseInt, 0)
28
+ .option("--scope <n>", "Scope: 0=all, 1=friends, 2=strangers", parseInt, 0)
29
+ .option("--uids <ids...>", "Specific user IDs to auto-reply to")
30
+ .action(async (content, opts) => {
31
+ try {
32
+ const payload = {
33
+ content,
34
+ isEnable: opts.enable,
35
+ startTime: opts.start,
36
+ endTime: opts.end,
37
+ scope: opts.scope,
38
+ };
39
+ if (opts.uids) payload.uids = opts.uids;
40
+ const result = await getApi().createAutoReply(payload);
41
+ output(result, program.opts().json, () => success("Auto-reply created"));
42
+ } catch (e) {
43
+ error(`Create auto-reply failed: ${e.message}`);
44
+ }
45
+ });
46
+
47
+ ar.command("update <id> <content>")
48
+ .description("Update an auto-reply rule")
49
+ .option("--enable", "Enable the rule")
50
+ .option("--no-enable", "Disable the rule")
51
+ .option("--start <ms>", "Start time (epoch ms)", parseInt, 0)
52
+ .option("--end <ms>", "End time (epoch ms)", parseInt, 0)
53
+ .option("--scope <n>", "Scope: 0=all, 1=friends, 2=strangers", parseInt, 0)
54
+ .option("--uids <ids...>", "Specific user IDs")
55
+ .action(async (id, content, opts) => {
56
+ try {
57
+ const payload = {
58
+ id: Number(id),
59
+ content,
60
+ isEnable: opts.enable ?? true,
61
+ startTime: opts.start,
62
+ endTime: opts.end,
63
+ scope: opts.scope,
64
+ };
65
+ if (opts.uids) payload.uids = opts.uids;
66
+ const result = await getApi().updateAutoReply(payload);
67
+ output(result, program.opts().json, () => success(`Auto-reply ${id} updated`));
68
+ } catch (e) {
69
+ error(`Update auto-reply failed: ${e.message}`);
70
+ }
71
+ });
72
+
73
+ ar.command("delete <id>")
74
+ .description("Delete an auto-reply rule")
75
+ .action(async (id) => {
76
+ try {
77
+ const result = await getApi().deleteAutoReply(Number(id));
78
+ output(result, program.opts().json, () => success(`Auto-reply ${id} deleted`));
79
+ } catch (e) {
80
+ error(`Delete auto-reply failed: ${e.message}`);
81
+ }
82
+ });
83
+ }