ZLP CLI
Project description
zt-zlp-cli
ZLP 日志管理平台 命令行工具,用于登录并查询实例、库、表结构与 SQL 结果。
环境要求
- Python
>=3.10 - 可用浏览器(首次登录会自动打开)
安装
开发安装(源码)
pip install -e .
打包发布
python -m pip install --upgrade build twine
python -m build
twine upload dist/*
快速开始
1) 登录并缓存 Cookie
首次运行会打开浏览器,请完成登录。成功后会缓存 Cookie 到本地。
zt-zlp-cli login
2) 获取系统列表
zt-zlp-cli discover systems
3) 获取服务列表
zt-zlp-cli discover services --system LMS --log-type json
4) 获取表结构
zt-zlp-cli discover fields \
--log-type json \
--system LMS \
--service fbu-lms-tracking-outgoing-pro-json \
--start-time "2026-04-14 20:18:22" \
--end-time "2026-04-14 20:33:22" \
--query-statement ""
5) 日志搜索
zt-zlp-cli discover logs \
--system LMS \
--service fbu-lms-labelservice-pro-json \
--log-type json \
--custom-sql "select topic,ClientIp,PrintMethod from \$table limit 10" \
--query-statement "SiteName = 'CN'" \
--start-time "2026-04-12 00:00:00" \
--end-time "2026-04-14 23:59:59"
全局参数
-o, --output:输出格式,支持:json(默认)human(表格)
示例:
zt-zlp-cli -o human sql instances
配置说明
默认配置目录:~/.zt-zlp-cli
- Cookie 缓存:
~/.zt-zlp-cli/cookies.json - 配置文件:
~/.zt-zlp-cli/config.yaml
环境变量(可选)
支持通过环境变量自动填充登录页账号密码(如 SSO 页面字段可用):
ZT_SSO_USERNAMEZT_SSO_PASSWORD
未设置时可在浏览器中手动完成登录。
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zt_zlp_cli-0.0.2.tar.gz
(8.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file zt_zlp_cli-0.0.2.tar.gz.
File metadata
- Download URL: zt_zlp_cli-0.0.2.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae96beaa918a760337c7be401a6f14ff10681357088b543d5f878e88fcd5ea78
|
|
| MD5 |
6f9dfa86009bf8e7185d397819d79249
|
|
| BLAKE2b-256 |
6f2118847ec3761688cc6860cf9974d26bd8e2efb0c41cf8850935b8766339d1
|
File details
Details for the file zt_zlp_cli-0.0.2-py3-none-any.whl.
File metadata
- Download URL: zt_zlp_cli-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a46f40a23494e03299c875f95b72360a04c3607393b6b1cdd2ac2bddc1b69bd7
|
|
| MD5 |
9d5aa1f0e63129048ec6ece8ffc5d7e4
|
|
| BLAKE2b-256 |
6afe481b310cdd3dce3689e6cf6674b91cdbf1ed818524e5ed56ce5522a55f94
|