Skip to main content

zt-zlp-cli

ZLP 日志管理平台 命令行工具,用于登录并查询实例、库、表结构与 SQL 结果。

环境要求

  • Python >=3.10
  • 可用浏览器(首次登录会自动打开)

安装

开发安装(源码)

pip install -e .

打包发布

python -m pip install --upgrade build twine
python -m build
twine upload dist/*

快速开始

已设置 SSO 环境变量时可使用默认无头登录:

zt-zlp-cli login

需要人工完成 SSO 或验证码登录时使用:

zt-zlp-cli login --headed

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 discover systems

查看版本:

zt-zlp-cli --version

退出码

退出码 含义
0 成功
1 未分类运行错误
2 命令行参数错误
3 认证失败或需要人工登录
4 网络请求失败
5 接口或业务响应错误

配置说明

默认配置目录:~/.zt-zlp-cli

  • Cookie 缓存:~/.zt-zlp-cli/cookies.json
  • 配置文件:~/.zt-zlp-cli/config.yaml

环境变量(可选)

支持通过环境变量自动填充登录页账号密码(如 SSO 页面字段可用):

  • ZT_SSO_USERNAME
  • ZT_SSO_PASSWORD

未设置时请执行 zt-zlp-cli login --headed,在浏览器中手动完成登录。

Metadata

Release files for zt-zlp-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zt-zlp-cli 0.1.1
File Size Uploaded Provenance Actions
zt_zlp_cli-0.1.1.tar.gz 15.1 kB Without provenance Details for zt_zlp_cli-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zt-zlp-cli 0.1.1
File Interpreter ABI Platform Actions
zt_zlp_cli-0.1.1-py3-none-any.whl Python 3 none any Details for zt_zlp_cli-0.1.1-py3-none-any.whl

Total release size: 28.8 kB

Release files / zt_zlp_cli-0.1.1.tar.gz

Download URL zt_zlp_cli-0.1.1.tar.gz
Size 15.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1fe5fde2f15656ec89de08fc1a13433e79c075c481557c2985c7baa85d490735
BLAKE2b-256 checksum
How to use checksums
5121ca96e400ec61bcc5a9306bc983fb58e30e6f3447720fcd47c361fcf07efb
Upload date
Uploaded using Trusted Publishing?
What is 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}

Release files / zt_zlp_cli-0.1.1-py3-none-any.whl

Download URL zt_zlp_cli-0.1.1-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
30d1f8bc9a3831af3176a282877051c45796f4f098489cf4fb5239c1f3fa30a2
BLAKE2b-256 checksum
How to use checksums
a8db1645f2ae04ea44ae789554677eb70f930ee3029b0beb34a2df7095a4b204
Upload date
Uploaded using Trusted Publishing?
What is 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}

Security for zt-zlp-cli 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page