Skip to main content

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_USERNAME
  • ZT_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.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zt_archery_cli-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file zt_archery_cli-0.2.0.tar.gz.

File metadata

  • Download URL: zt_archery_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for zt_archery_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 03d4556a9a18633609e58c31ee511ec3d3fd68900a6bfec7f6bba3741f7225f1
MD5 9097f66e487167a658dfd277204393eb
BLAKE2b-256 b33ce7f4474a16e05d019548b2dfa619b4a8b67296940f6d965cc61ebec1b379

See more details on using hashes here.

File details

Details for the file zt_archery_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: zt_archery_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for zt_archery_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 80d3051df58eaca5d485a9482c6c5f6ff3906a283af009cff4750de7f8720709
MD5 c9f7e08d7ca09e7f089a9332ecfe0440
BLAKE2b-256 82e42b5981bb39996105d9088343a25a841be87a93672846946f835f8eee7e4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page