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.3.0.tar.gz (8.4 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.3.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zt_archery_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 8.4 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

Hashes for zt_archery_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c5bd2b128d5ba5ad50230446c26c2d5910961ef86da1dc054a6cbd399454abd0
MD5 2cb7b578b0ed09ad0aeb1e2e4210011c
BLAKE2b-256 0998bf46dcf3cc55f22a6858f8785f30f1248cb184d256cc58d07af4fdf18d58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zt_archery_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 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

Hashes for zt_archery_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4390c798b19b367e48fc9a5b84713429e24232c3950b2d47015c98f50f6c3383
MD5 ff9e3a73595b6e9fcd32480a63d9bb9c
BLAKE2b-256 e7dfab6ed6eae05b4d3abcfb5142650d470685929b0ce2a8fcd49c631024f39a

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