zalo-tui 0.0.0-stage → 0.2.0
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/CHANGELOG.md +49 -0
- package/LICENSE +21 -0
- package/README.md +108 -2
- package/bin/zalo-tui.js +2 -0
- package/dist/zalo-tui.js +2887 -0
- package/package.json +63 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow [Semantic Versioning](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
A release is made by adding a section for the new version below and bumping `version` in `package.json` to match, then pushing to `main`.
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.2.0] - 2026-11-28
|
|
10
|
+
|
|
11
|
+
Unread tracking starts when you first run this version: messages from before the upgrade aren't counted as unread.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- `zalo-tui --version` (or `-v`) prints the installed version.
|
|
16
|
+
- `w` on a message shows who reacted with what, newest first.
|
|
17
|
+
- Search: `/` in the messages pane searches the open chat (`n`/`N` step through matches), and the chat list filter also finds chats by message text. Accents are optional, so "hoa don" finds "hóa đơn". Only loaded messages are searched.
|
|
18
|
+
- @mentions: typing `@` in a group suggests members; picked names are sent as real mentions, so those people get a mention alert. `@All` mentions everyone.
|
|
19
|
+
- `r` replies to the selected message with a quote, and replies from others show the message they quote.
|
|
20
|
+
- Multi-line messages: `Alt+Enter` adds a line, the message box grows up to five lines (the message pane shrinks to make room), and `↑`/`↓` move between lines. `Ctrl+w` deletes a word.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- Group messages now notify like direct messages, as in the Zalo app; muted groups stay silent. Press `m` in the chat list to notify only when you're @mentioned (mentions then notify even in muted groups).
|
|
25
|
+
- On macOS, notifications use terminal-notifier when it's installed: clicking one brings the terminal to the front and opens that chat, and each chat keeps only its latest notification.
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- Unread counts are no longer lost by moving through the chat list: a highlighted chat is only previewed, and it counts as read once you open it (Enter, `l`, a click, or typing). Messages that arrived while the app was closed now count as unread, and a "new messages" line marks where they start.
|
|
30
|
+
- A message now shows every reaction a person adds, not only their latest one.
|
|
31
|
+
- Long drafts wrap instead of being cut off, so the cursor stays visible after `Home` or `Ctrl+a`, including with emoji and other wide characters.
|
|
32
|
+
- A link whose title is its URL no longer shows the URL twice.
|
|
33
|
+
- Help scrolls with `j`/`k` in small terminals instead of overlapping, lists keys that were missing, and no longer mentions an `m` key in the react popup that didn't exist.
|
|
34
|
+
- Shorter status bar hints that fit the terminal.
|
|
35
|
+
|
|
36
|
+
## [0.1.0] - 2026-11-24
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- QR code login with a remembered session.
|
|
41
|
+
- Chat list of friends and groups, recent chats first, with unread counts, a name filter and the order kept between runs.
|
|
42
|
+
- Message pane that follows the highlighted chat, with word wrapping, per-chat drafts and scrollback.
|
|
43
|
+
- Sending text, photos and files, by path, drag and drop, `/photo` or `/file`.
|
|
44
|
+
- Reactions with a searchable popup of all Zalo reactions, shown under each message with your own highlighted.
|
|
45
|
+
- Recall your own messages and delete any message for yourself.
|
|
46
|
+
- Clickable links, and `o` to open photos, files and links.
|
|
47
|
+
- Desktop notifications for direct messages and @mentions, respecting muted chats and terminal focus.
|
|
48
|
+
- Vim-style keys, mouse clicks and wheel scrolling, and a `/help` panel.
|
|
49
|
+
- Reconnect after another Zalo session takes over.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 paulcoding810
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
|
1
|
-
#
|
|
1
|
+
# zalo-tui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A terminal client for Zalo personal accounts, built on [zca-js](https://github.com/RFS-ADRENO/zca-js) and [Ink](https://github.com/vadimdemedes/ink).
|
|
4
|
+
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> This uses an **unofficial** Zalo API. Zalo does not support it, and using it may get your account locked or banned. Use it at your own risk, and don't use it for bulk or automated messaging.
|
|
7
|
+
|
|
8
|
+
## Features
|
|
9
|
+
|
|
10
|
+
- Log in by scanning a QR code; the session is remembered.
|
|
11
|
+
- Chat list with friends and groups, recent chats first, unread counts and a name filter.
|
|
12
|
+
- Read and send messages; links are clickable and open with `o`.
|
|
13
|
+
- Send photos and files (drag a file into the terminal, or `/photo` and `/file`).
|
|
14
|
+
- Quote replies, @mentions in groups, and search through loaded messages.
|
|
15
|
+
- Reactions (all of Zalo's built-in ones), recall, and delete for yourself.
|
|
16
|
+
- Desktop notifications, respecting muted chats; groups can be limited to @mentions.
|
|
17
|
+
- Keyboard first (vim-style keys), with mouse clicks and wheel scrolling.
|
|
18
|
+
|
|
19
|
+
## Requirements
|
|
20
|
+
|
|
21
|
+
- Node.js 22 or newer.
|
|
22
|
+
- macOS is the main target. Notifications and opening links use `osascript` and `open`; on Linux they fall back to `notify-send` and `xdg-open`, which are untested. Windows is not supported.
|
|
23
|
+
- Optional on macOS: with [terminal-notifier](https://github.com/julienXX/terminal-notifier) installed (`brew install terminal-notifier`), clicking a notification brings your terminal to the front and opens that chat, and each chat keeps only its latest notification.
|
|
24
|
+
- A terminal with true mouse and focus reporting works best (Ghostty, iTerm2, WezTerm, Kitty).
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
npm install -g zalo-tui
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Install from source
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
git clone https://github.com/paulcoding810/zalo-tui.git
|
|
36
|
+
cd zalo-tui
|
|
37
|
+
pnpm install
|
|
38
|
+
pnpm build
|
|
39
|
+
ln -s "$PWD/bin/zalo-tui.js" ~/.local/bin/zalo-tui
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Run `pnpm build` again after pulling changes.
|
|
43
|
+
|
|
44
|
+
## Usage
|
|
45
|
+
|
|
46
|
+
Run `zalo-tui`, then open Zalo on your phone, use its QR scanner on the code shown, and confirm the login on the phone.
|
|
47
|
+
|
|
48
|
+
Type `/help` or press `?` inside the app to see all keys. `zalo-tui --version` prints the installed version.
|
|
49
|
+
|
|
50
|
+
| Where | Keys |
|
|
51
|
+
|---|---|
|
|
52
|
+
| Chat list | `j`/`k` or `↑`/`↓` move · `g`/`G` top/bottom · `Ctrl+d`/`Ctrl+u` half page · `/` filter by name or message text (`↑`/`↓` move while typing, `Enter` opens at the match, `Esc` clears) · `Enter` or `i` open and type · `l` or `Tab` messages · `n` notifications · `m` group alerts: all or @mentions · `r` reconnect |
|
|
53
|
+
| Messages | `j`/`k` select · `g`/`G` top/bottom · `Ctrl+d`/`Ctrl+u` half page · `/` search this chat, then `n`/`N` older/newer match · `r` reply · `e` react · `w` who reacted · `d` recall or delete · `o` open photo, file or link · `Enter` or `i` type · `h`, `Esc` or `Tab` chats |
|
|
54
|
+
| React popup | `1`–`6` quick reactions (or click them) · type to search all · `↑`/`↓` `Enter` pick · `0` remove yours · `Esc` close |
|
|
55
|
+
| Message box | `Enter` send · `Alt+Enter` new line · `Esc` back · arrows move · `Ctrl+a`/`Ctrl+e` or `Home`/`End` start/end · `Ctrl+w` delete word · `Ctrl+u` delete to start · `@` in a group suggests members to mention (`↑`/`↓`, `Enter` or `Tab` picks, `Esc` dismisses) |
|
|
56
|
+
| Anywhere | `PgUp`/`PgDn` or wheel scroll messages (the wheel over the chat list moves the selection) · click to open a chat, select a message or type · `Shift`-drag selects text · `Ctrl+C` quit |
|
|
57
|
+
|
|
58
|
+
Commands in the message box:
|
|
59
|
+
|
|
60
|
+
| Command | |
|
|
61
|
+
|---|---|
|
|
62
|
+
| `/photo <path> [caption]` | send a photo (jpg, png, webp) |
|
|
63
|
+
| `/file <path> [caption]` | send any other file |
|
|
64
|
+
| `//text` | send text that starts with `/` |
|
|
65
|
+
| `/help` | show help |
|
|
66
|
+
|
|
67
|
+
Paths can start with `~/`, be quoted, or use `\ ` for spaces. A path on its own, for example from dragging a file into the terminal, asks before sending it.
|
|
68
|
+
|
|
69
|
+
Moving through the chat list previews the highlighted chat; it only counts as read once you open it (`Enter`, `l`, a click, or typing). Each chat keeps its own unsent draft.
|
|
70
|
+
|
|
71
|
+
## Your data
|
|
72
|
+
|
|
73
|
+
Everything is stored in `~/.config/zalo-tui/`, readable only by you:
|
|
74
|
+
|
|
75
|
+
| File | Contents |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `credentials.json` | your logged-in session. Anyone with this file can use your account. Delete it to log out. |
|
|
78
|
+
| `settings.json` | notification preferences |
|
|
79
|
+
| `read.json` | how far you've read in each chat, so unread counts survive restarts |
|
|
80
|
+
| `activity.json` | each chat's last activity time and name, used to keep the list order |
|
|
81
|
+
| `open-<pid>` | briefly, while a notification click asks the running app to open a chat |
|
|
82
|
+
| `debug.log` | only with `ZALO_TUI_DEBUG=1`: why each message did or didn't notify (no names or text) |
|
|
83
|
+
|
|
84
|
+
Set `ZALO_TUI_HOME` to use a different folder.
|
|
85
|
+
|
|
86
|
+
## Limitations
|
|
87
|
+
|
|
88
|
+
- Zalo allows one web session at a time. Opening Zalo Web or PC elsewhere disconnects the app; press `r` in the chat list to reconnect.
|
|
89
|
+
- On connect, Zalo returns only recent messages (usually the last few days). Older history isn't available.
|
|
90
|
+
- Stickers show as `[sticker]` and can't be sent. Voice, video and polls show as placeholders.
|
|
91
|
+
- Clipboard images can't be pasted; save them as a file first.
|
|
92
|
+
- Search only covers messages the app has loaded; Zalo has no message search API.
|
|
93
|
+
|
|
94
|
+
## Development
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
pnpm start # run from source
|
|
98
|
+
pnpm test # unit tests
|
|
99
|
+
pnpm typecheck
|
|
100
|
+
pnpm build # bundle to dist/
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Releasing
|
|
104
|
+
|
|
105
|
+
Add a section for the new version to `CHANGELOG.md`, set the same `version` in `package.json`, and push to `main`. The Release workflow checks that the two match, runs the checks, publishes to npm with provenance, and creates a GitHub release from that changelog section. It does nothing if that version is already on npm.
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
package/bin/zalo-tui.js
ADDED