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"

全局参数

  • -p, --project:项目 ID(默认读取配置中的 default_project
  • -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

可选配置项示例:

default_project: your_project_id
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.1.3.tar.gz (7.9 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.1.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: zt_archery_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 7.9 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.1.3.tar.gz
Algorithm Hash digest
SHA256 0d364a42e7b8dd0aad90cbc0a6cd766ce91791c2e356cfc824b6f9ace63ebd81
MD5 3344799521b8f84b16f01bd95d097f92
BLAKE2b-256 276bb004aa67a7f7d7ac08d3c498d931d6caf3fa776a768a2097ac4175c8009d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: zt_archery_cli-0.1.3-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

Hashes for zt_archery_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c1ceab8d9e121bfd31c242eedba3dd6cbedbe34ffe8e406c8d8dfbd2f6d1f59b
MD5 24ca489dad974d02d0f4a5569b64df94
BLAKE2b-256 a792bd6d89b420dd2f011cd1a6b9301aca8cb5e2c8336f2c6b434ebf8eb09dc0

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