Archery CLI
Project description
zt-archery-cli
Archery SQL 审核平台命令行工具,用于登录并查询实例、库、表结构与 SQL 结果。
环境要求
- Python
>=3.10 - 可用浏览器(首次登录会自动打开)
安装
开发安装(源码)
pip install -e .
打包发布
python -m pip install --upgrade build twine
python -m build
twine upload dist/*
快速开始
1) 登录并缓存 Cookie
首次运行会打开浏览器,请完成登录。成功后会缓存 Cookie 到本地。
zt-archery-cli login
2) 查看可读实例
zt-archery-cli sql instances
3) 查询实例下数据库
zt-archery-cli sql databases -i your_instance
4) 查询数据库下表
zt-archery-cli sql tables -i your_instance -d your_database
5) 查看表结构
zt-archery-cli sql describe -i your_instance -d your_database -t your_table
6) 执行 SQL
zt-archery-cli sql query \
-i your_instance \
-d your_database \
-t your_table \
--sql "select * from your_table limit 10"
全局参数
-o, --output:输出格式,支持:json(默认)human(表格)
示例:
zt-archery-cli -o human sql instances
配置说明
默认配置目录:~/.zt-archery-cli
- Cookie 缓存:
~/.zt-archery-cli/cookies.json - 配置文件:
~/.zt-archery-cli/config.yaml
可选配置项示例:
browser_channel: chromium
环境变量(可选)
支持通过环境变量自动填充登录页账号密码(如 SSO 页面字段可用):
ZT_SSO_USERNAMEZT_SSO_PASSWORD
未设置时可在浏览器中手动完成登录。
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
zt_archery_cli-0.2.1.tar.gz
(8.0 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_archery_cli-0.2.1.tar.gz.
File metadata
- Download URL: zt_archery_cli-0.2.1.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05daba3e0900b546451dafa4ad49eafbd57a8573f622c77abb5517e2371f090f
|
|
| MD5 |
597e1701103dbea8e2eec5d7b0842ac8
|
|
| BLAKE2b-256 |
a3a4b8f904c029d50e2e31588ff6f2d3241df155a034d6fdc4e020d5c2bd53e6
|
File details
Details for the file zt_archery_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: zt_archery_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 8.6 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 |
2728e8a28e289cbea749d42369cdec7c4b206b9fc2b2db9109002043b328fb43
|
|
| MD5 |
e6317cdeb733fbb7c13fda227710efa4
|
|
| BLAKE2b-256 |
fbe9ada84d90d8271ade16ff55a18e19bffe45ec4503a575ff8d11cde1490b6c
|