feat: add htsy CLI tool for Haitun private domain API

This commit is contained in:
dcsunny
2026-07-01 10:11:06 +08:00
commit 9e9ae38858
8 changed files with 1142 additions and 0 deletions
+37
View File
@@ -0,0 +1,37 @@
# htsy-cli
海豚私域接口命令行工具。
## 使用
```bash
./htsy-cli login --username USER --password PASS
./htsy-cli status
./htsy-cli call /api/account/user/info -d '{}'
./htsy-cli call /api/bot/wx/list -d '{"page":1,"pageSize":20,"botType":1}'
```
Windows 下二进制文件名是 `htsy-cli.exe`,命令示例里的 `./htsy-cli` 对应替换为 `htsy-cli.exe`
`login` 会按用户名是否包含 `@` 自动分流:
- `ldc@18030042216` -> `/api/account/user/login/in`
- `18030042216` -> `/api/account/login/in`
登录成功后,CLI 会把登录信息保存到当前用户主目录下的 `~/.htsy/config.json`。Linux、macOS、Windows 均支持。
## 构建
```bash
make build
make release VERSION=v0.1.0
```
`make release` 会构建:
- `linux/amd64`
- `linux/arm64`
- `darwin/amd64`
- `darwin/arm64`
- `windows/amd64`
- `windows/arm64`