Skip to main content

CTICloud / Clink2 命令行客户端,封装 OpenAPI 接口,适合脚本化集成与 Agent 调用。

当前版本: 0.1.9
PyPI: https://pypi.org/project/tinet-cticloud-cli/

功能概览

子命令 说明
config 本地凭证管理
profile 多配置管理(支持多企业/环境/平台切换)
agent 座席管理与座席操作
agent-login 座席服务端登录鉴权(区别于座席上线)
agent-report 座席报表查询
agent-status 座席实时状态查询
agent-tel 座席电话管理
area-code 号码归属地查询
asr ASR 转写结果查询
cdr 任务话单/来电/外呼/webcall/sip/预测外呼等通话记录查询
data-manager 缓存数据管理
enterprise 企业信息查询
enterprise-hotline 企业号码列表查询
enterprise-setting 企业配置管理
enterprise-voice 企业语音文件管理
exten 分机管理
hybrid-group 号码池管理
investigation 满意度调查记录查询
ivr-router 呼入路由设置列表查询
monitor 平台监控与实时统计:座席/队列/话机/业务/中继监控;座席/满意度/队列实时统计
rasr RASR 机器人对话事件查询
record 录音试听/下载
report 数据报表
skill 技能与座席/队列关系查询
stat 统计报表
task 外呼任务全生命周期管理
webcall 发起 webcall 呼叫

所有出站 HTTP 请求自动附加:

  • X-CtiCloud-CLI-Version: {版本号}
  • X-Trace-Id: {UUID}

环境要求

  • Python ≥ 3.10
  • 通过 endpoint 访问平台 API(CtiCloud 如 https://api-1.cticloud.cn;Clink2 如 https://api-bj.clink.cn
  • 鉴权方式按平台区分(二者不可混用):
    • CtiCloudvalidateType + 企业编号(或部门编号)+ token,请求侧计算 MD5 sign
    • Clink2AccessKeyId + AccessKeySecret(+ Expires),请求侧计算 HMAC-SHA1 Signature

安装

PyPI 安装(推荐):

pip install tinet-cticloud-cli
tinet-cticloud-cli --version   # 0.1.9
tinet-cticloud-cli --help

指定版本或升级:

pip install 'tinet-cticloud-cli==0.1.9'
pip install --upgrade tinet-cticloud-cli

macOS 等受限环境可使用 pipx

pipx install tinet-cticloud-cli

配置凭证

配置文件:

# CtiCloud(--validate-type:1 部门编号验证 2 企业编号验证)
tinet-cticloud-cli config set \
  --platform-type cticloud \
  --endpoint https://api-1.cticloud.cn \
  --validate-type 2 \
  --enterprise-id your_enterprise_id \
  --token your_token

# Clink2
tinet-cticloud-cli config set \
  --platform-type clink2 \
  --endpoint https://api-bj.clink.cn \
  --access-key-id your_ak \
  --access-key-secret your_sk \
  --expires 60

多配置(profile):

--profile可选全局参数。凭证解析优先级:

场景 使用的配置
不传 --profile(默认) ~/.cticloud/config.json
传入 --profile <name> ~/.cticloud/profile.json 中的指定 profile
# 创建 CtiCloud profile
tinet-cticloud-cli profile set --name prod \
  --platform-type cticloud \
  --endpoint https://api-1.cticloud.cn \
  --validate-type 2 \
  --enterprise-id your_enterprise_id \
  --token your_token

# 创建 Clink2 profile
tinet-cticloud-cli profile set --name clink-bj \
  --platform-type clink2 \
  --endpoint https://api-bj.clink.cn \
  --access-key-id your_ak \
  --access-key-secret your_sk

tinet-cticloud-cli profile list
tinet-cticloud-cli --profile prod task query --type 1
tinet-cticloud-cli task query --type 1
tinet-cticloud-cli profile use prod
tinet-cticloud-cli profile delete prod

profile 保存在 ~/.cticloud/profile.json,命名规则:^[a-z][a-z0-9-]{0,63}$

快速示例

# config
tinet-cticloud-cli config show

# profile
tinet-cticloud-cli profile set --name staging \
  --platform-type cticloud \
  --endpoint https://api-5.cticloud.cn \
  --enterprise-id E002 --token tok
tinet-cticloud-cli profile list
tinet-cticloud-cli profile use staging
tinet-cticloud-cli task query --type 1
tinet-cticloud-cli --profile staging task query --type 1

# task 
tinet-cticloud-cli task get --task-id 34
tinet-cticloud-cli task query --type 1 --limit 10
tinet-cticloud-cli --profile clink-bj task query --type 2
tinet-cticloud-cli task list-tel --task-id 34
tinet-cticloud-cli task list-file --task-id 34
tinet-cticloud-cli task get-file --task-id 34 --file-id 59

# agent
tinet-cticloud-cli agent query --limit 10
tinet-cticloud-cli agent get --cno 2000
tinet-cticloud-cli agent login --cno 2000 --bind-tel 13800000001 --bind-type 1
tinet-cticloud-cli agent create --cno 9001 --name 张三 --area-code 010
tinet-cticloud-cli agent update --cno 9001 --comment 备注
tinet-cticloud-cli agent preview-outcall --cno 9001 --tel your_tel
tinet-cticloud-cli agent preview-outcall-cancel --cno 9001

# agent-login / agent-report / agent-status / agent-tel
tinet-cticloud-cli agent-login authenticate --cno 9001 --pwd your_password
tinet-cticloud-cli agent-report agent-duration \
  --time-range-type 1 \
  --start-time 2026-07-01 --end-time 2026-07-01
tinet-cticloud-cli agent-status get --cno 9001
tinet-cticloud-cli agent-tel tel-list --cno 9001

# area-code / asr
tinet-cticloud-cli --json area-code get --tel 13800138000
tinet-cticloud-cli --json asr get --call-type 4 --main-unique-id sip-xxx

# cdr
tinet-cticloud-cli --json cdr ib-query --start-time 1700000000 --end-time 1700086400

# data-manager / enterprise*
tinet-cticloud-cli --json data-manager --method get --key your_key
tinet-cticloud-cli --json enterprise get
tinet-cticloud-cli --json enterprise-hotline list-page --limit 10
tinet-cticloud-cli --json enterprise-setting list
tinet-cticloud-cli --json exten get --exten 8001
tinet-cticloud-cli --json hybrid-group list
tinet-cticloud-cli --json investigation query --limit 10
tinet-cticloud-cli --json ivr-router list

# monitor
tinet-cticloud-cli --json monitor agent --limit 10
tinet-cticloud-cli --json monitor enterprise-call-latest
tinet-cticloud-cli --json monitor queue --queue-monitor-fields queueParams --qnos 1000
tinet-cticloud-cli --json monitor statistics-queue

# rasr / record / skill / webcall
tinet-cticloud-cli --json rasr query --unique-id your-unique-id
tinet-cticloud-cli record get-info --record-file your-record-file.mp3
tinet-cticloud-cli --json record get-url --record-file your-record-file.mp3
tinet-cticloud-cli --json record get-batch-url --record-type record --record-file a.mp3,b.mp3
tinet-cticloud-cli --json skill list-relation --relation-type cno --name your-skill
tinet-cticloud-cli webcall --tel your_tel

# task
tinet-cticloud-cli task monitor-tasks --status 2

全局 --json 输出 Wiki 原始 JSON;默认人类可读摘要,并对手机号、password / encryptPassword 等敏感字段脱敏。

写操作可用全局 --dry-run 做本地校验与预览(不发写请求、不写本地配置),详见 --help

帮助与 API 文档

tinet-cticloud-cli --help
tinet-cticloud-cli config --help
tinet-cticloud-cli config set --help
tinet-cticloud-cli profile --help
tinet-cticloud-cli task --help

CtiCloud OpenAPI 契约与字段说明见 CTICloud Wiki,Clink2 契约与字段说明见 开发者中心

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinet_cticloud_cli-0.1.9.tar.gz (84.7 kB view details)

Uploaded Source

Built Distribution

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

tinet_cticloud_cli-0.1.9-py3-none-any.whl (123.4 kB view details)

Uploaded Python 3

File details

Details for the file tinet_cticloud_cli-0.1.9.tar.gz.

File metadata

  • Download URL: tinet_cticloud_cli-0.1.9.tar.gz
  • Upload date:
  • Size: 84.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for tinet_cticloud_cli-0.1.9.tar.gz
Algorithm Hash digest
SHA256 491db7d724833c282d2ce2461c2c19ed20a20d9fe9697ddaf150d664a329e7a6
MD5 cba7829f7457db562343ec240cd0cd40
BLAKE2b-256 5b07b1977171997d4562b18a8525497b80af4c3495e6d31c49bf5fea652e153a

See more details on using hashes here.

File details

Details for the file tinet_cticloud_cli-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for tinet_cticloud_cli-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9d9b88517e6adcb130c7e7759488eb6169c29f46bc2c8495298a260dc77fa7e6
MD5 8e4316316b703f6e7c994ffb365956f2
BLAKE2b-256 fd81712999e75ea47c54a57e7b228fd8ec9932109b004ff04448ecc441e7fe75

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.0

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page