Skip to main content

ZT 接口管理平台 CLI

Project description

zt-fop-cli

FOP/ARK 接口查询命令行工具,用于登录并搜索接口、查看接口详情与响应说明。

环境要求

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

安装

开发安装(源码)

pip install -e .

打包发布

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

快速开始

1) 登录并缓存 Token

首次运行会打开浏览器,请完成登录。成功后会从 localStorage 读取 micro-gosAdmin-Token 并缓存到本地。

zt-fop-cli login

也可跳过手动登录,直接执行 interface search / interface detail; 鉴权失败时会自动打开浏览器(或凭 SSO 环境变量无头登录)并重试。

2) 搜索接口

zt-fop-cli interface search -k 库存

3) 查看接口详情(含响应说明)

zt-fop-cli interface detail 123456

全局参数

  • -o, --output:输出格式,支持:
    • json(默认)
    • human(表格)

示例:

zt-fop-cli -o human interface search -k 订单

说明:interface detail 输出为一个合并对象,包含:

  • interface_detail:接口详情
  • interface_resp:接口响应说明

配置说明

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

  • Token 缓存:~/.zt-fop-cli/fop_bearer_token.txt
  • 配置文件:~/.zt-fop-cli/config.yaml

可选配置项示例:

browser_channel: chromium

环境变量(可选)

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

  • ZT_SSO_USERNAME
  • ZT_SSO_PASSWORD

未设置时可在浏览器中手动完成登录。

命令一览

  • zt-fop-cli login
    • 浏览器登录并缓存 Token
  • zt-fop-cli interface search -k <keyword>
    • 模糊搜索接口
  • zt-fop-cli interface detail <interface_id> [--ability 1] [--customer-app-id PLM]
    • 查询接口详情并同时返回响应说明

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_fop_cli-0.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

zt_fop_cli-0.1.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file zt_fop_cli-0.1.0.tar.gz.

File metadata

  • Download URL: zt_fop_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 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_fop_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4ed5eb022e5d79bd84fffb3d26a75d2ce53e5b9540750699f0831fff58480028
MD5 041b587ea8dcae0dcacd0dc8fac9767d
BLAKE2b-256 5396661a962056b91dcff7c021d9b56a45c3ca2c65a6134bab87484199908d59

See more details on using hashes here.

File details

Details for the file zt_fop_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zt_fop_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.6 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_fop_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd3c11b033bd8d5cd173a1d3c3a5c4d483a0261868ea889d5399f57e4a0904fa
MD5 91442c68b82406aa6a84a84ad9c82967
BLAKE2b-256 353be88e416adcc875da2dce6b8ff85ed49ab844caa2add8a790e1282cd117df

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