Clink2 命令行客户端,封装 OpenAPI 接口,与 智慧服务平台开发者中心 中参数与响应一致,适合脚本化集成与 Agent 调用。
当前版本: 0.0.4
PyPI: https://pypi.org/project/tinet-clink2-cli/
功能概览
| 子命令 | 说明 |
|---|---|
config |
本地凭证管理 |
auto-task |
自动外呼任务管理 |
cdr-auto-task |
任务呼叫记录查询 |
cdr-bot |
机器人话单查询 |
cdr-ib |
呼入通话记录查询 |
cdr-internal |
内部呼叫记录查询 |
cdr-ob |
外呼通话记录查询 |
ivr |
语音导航查询 |
voicemail |
留言箱设置查询 |
所有出站 HTTP 请求自动附加:
X-Trace-Id: {UUID}X-Clink2-CLI-Version: {CLI 版本}
环境要求
- Python ≥ 3.10
- 运行时需访问公有云接入地址,例如
https://api-bj.clink.cn/https://api-sh.clink.cn - 需在管理后台获取 AccessKeyId / AccessKeySecret(系统管理 → 安全设置 → 接口密钥)
安装
从 PyPI 安装(推荐):
pip install tinet-clink2-cli
tinet-clink2-cli --version # 0.0.4
tinet-clink2-cli --help
指定版本或升级:
pip install 'tinet-clink2-cli==0.0.4'
pip install --upgrade tinet-clink2-cli
macOS 等受限环境可使用 pipx:
pipx install tinet-clink2-cli
配置凭证
配置文件: ~/.clink2/config.json
配置示例:
tinet-clink2-cli config set \
--access-key-id your_access_key_id \
--access-key-secret your_access_key_secret \
--endpoint https://api-bj.clink.cn \
--expires 60 \
--log true
tinet-clink2-cli config show
默认接入地址为北京:https://api-bj.clink.cn。config show 会对 AccessKeySecret 脱敏。
快速示例
# config
tinet-clink2-cli config show
# ivr
tinet-clink2-cli ivr nodes --ivr-name your_ivr_name
tinet-clink2-cli --json ivr list
# 自动外呼任务
tinet-clink2-cli --json auto-task list
tinet-clink2-cli --json auto-task get --task-id 34
tinet-clink2-cli --dry-run --json auto-task create \
--name demo --customer-clids-category 5 --customer-clids-group crn-xxx
tinet-clink2-cli auto-task import-tel --help # 查看 CSV 表头说明
# CDR(未传时间参数时使用服务端默认时间窗)
tinet-clink2-cli --json cdr-ib list
tinet-clink2-cli --json cdr-ib detail --main-unique-id medias_1-xxx
tinet-clink2-cli --json cdr-ob list --cnos 0001,0002
tinet-clink2-cli --json cdr-auto-task list
tinet-clink2-cli --json cdr-bot ib-list
tinet-clink2-cli --json cdr-internal list
# dry-run:仅校验入参与配置,不调用服务端(是否写日志取决于 config.log)
tinet-clink2-cli --dry-run ivr list
tinet-clink2-cli --dry-run voicemail list --offset 0 --limit 10
tinet-clink2-cli --dry-run cdr-ib list
tinet-clink2-cli --dry-run --json auto-task start --task-id 1
# verbose:向 stderr 打印 url / method / 版本 Header / TraceId / result(不含 body)
tinet-clink2-cli --verbose --json voicemail list
tinet-clink2-cli --verbose --dry-run cdr-ob list
tinet-clink2-cli --verbose --dry-run auto-task list
全局选项:
--json:机器可读 stdout--dry-run:本地校验与预览,不发请求(写操作可预览组装后的body)--verbose:stderr 排障(不含 body / Secret / 明文 Signature)
安全提示
- 勿将 AccessKeySecret 写入仓库、截图或日志外发渠道
auto-task含写操作,可能触发真实外呼或删除任务/号码,请谨慎在生产租户使用- 勿将含真实客户号码的 CSV 提交到仓库
帮助与 API 文档
tinet-clink2-cli --help
tinet-clink2-cli config --help
tinet-clink2-cli auto-task --help
tinet-clink2-cli cdr-auto-task --help
tinet-clink2-cli cdr-bot --help
tinet-clink2-cli cdr-ib --help
tinet-clink2-cli cdr-internal --help
tinet-clink2-cli cdr-ob --help
tinet-clink2-cli ivr --help
tinet-clink2-cli voicemail --help
OpenAPI 契约与字段说明见 智慧服务平台开发者中心。
Metadata
Release files for tinet-clink2-cli 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tinet_clink2_cli-0.0.4.tar.gz | 26.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tinet_clink2_cli-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.2 kB
Release files / tinet_clink2_cli-0.0.4.tar.gz
| Download URL | tinet_clink2_cli-0.0.4.tar.gz |
|---|---|
| Size | 26.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
596fa56f9602ef9b15d9164ed6169d7f2745d2f1ed1445baf113354c8842fd2f
|
|
BLAKE2b-256 checksum How to use checksums |
ae8df27d854f6125dc131666c78b89998b540235f8244e374a75108b815c2167
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / tinet_clink2_cli-0.0.4-py3-none-any.whl
| Download URL | tinet_clink2_cli-0.0.4-py3-none-any.whl |
|---|---|
| Size | 28.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
27dddbe4380d939808ca0d57048ba97a19182b5834d5091fdc96ff8598471ee4
|
|
BLAKE2b-256 checksum How to use checksums |
8ab671d1589c67ee032f2cc3d8b59376a928aa5c6199352462460f1714816d8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for tinet-clink2-cli 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.