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.1.0.tar.gz
(10.5 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.1.0.tar.gz.
File metadata
- Download URL: zt_zlp_cli-0.1.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52aee566b46de3533aa0611c32275707e37457be0e0f198a846825b49cabfc2b
|
|
| MD5 |
36c7f669501969eef53af617c57457fc
|
|
| BLAKE2b-256 |
c4a9a58292ec015ecb893ebc3007e8ac05c2f5d59f284741ac0b93c903979f50
|
File details
Details for the file zt_zlp_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: zt_zlp_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8585b29d4056bfa861fe69cfd0085c9e3a62ddec548c53bc1015799f7e4d89b9
|
|
| MD5 |
ad4f4bd7573b37cd294165ede28d9b82
|
|
| BLAKE2b-256 |
1eb5ec82a80a44e906b7ffe05cfddd1b1ed6afb2429ab0c0413e03b4f47f981b
|