cli-hub — Unified CLI Gateway
One Skill to search and invoke all enterprise and AI creation tools (WeCom / DingTalk / Lark / Dreamina), covering 91+ tools.
Installation
Recommended (from PyPI, package signatures verified):
CODEBLOCK0
PyPI: https://pypi.org/project/agent-cli-hub/
Source: https://github.com/agentrix-ai/clihub (MIT License)
Alternative (convenience script, internally runs pip from PyPI):
CODEBLOCK1
After installation, cli-hub is available as a command.
Mandatory Rules
- 1. Never guess commands — Always
cli-hub search to find the tool ID first. - Check params before calling — Always
cli-hub info <id> to confirm the parameter schema. - On error, consult the "Error Handling" table below.
Standard Workflow
Follow Steps 1 → 2 → 3 → 4 strictly in order.
Step 1: Check Environment (required on first use)
CODEBLOCK2
Based on output:
- -
not installed → install the CLI - INLINECODE4 but not authenticated → run auth
- All OK → skip to Step 2
Install underlying CLIs:
CODEBLOCK3
Authenticate (interactive, requires browser):
CODEBLOCK4
Step 2: Search Tools
CODEBLOCK5
Step 3: Check Parameters
CODEBLOCK6
Shows: parameter name, type, required (*), example, command template.
Step 4: Invoke Tool
Method A — JSON arguments (WeCom style):
CODEBLOCK7
Method B — Flag arguments (DingTalk / Lark / Dreamina style):
CODEBLOCK8
How to choose? cli-hub info <id> Example field shows the underlying CLI's argument style.
Utility Commands
| Command | Purpose |
|---|
| INLINECODE7 | List all providers |
| INLINECODE8 |
List all Lark tools |
|
cli-hub list dingtalk --category todo | Filter by category |
|
cli-hub refresh | Refresh schemas from installed CLIs |
|
cli-hub add <binary> --display "Name" | Add a new CLI provider |
Decision Tree
CODEBLOCK9
Error Handling
| Error | Cause | Fix |
|---|
| INLINECODE12 | CLI not installed | INLINECODE13 |
| INLINECODE14 |
Not authenticated |
cli-hub auth <provider> |
|
Operation not found | Typo in ID |
cli-hub search to find correct ID |
|
No adapter registered | Wrong provider name |
cli-hub list to see available names |
|
timed out after Ns | Timeout | Retry with
--timeout 300 |
|
Invalid JSON | Malformed --args JSON | Check quotes and escaping |
| Underlying CLI error | Wrong params or insufficient permissions |
cli-hub info <id> to check params |
Supported Platforms
| Platform | Provider | Tools | Coverage |
|---|
| WeCom (企业微信) | wecom | 28 | Contacts, Todos, Meetings, Messages, Calendars, Docs, Smart Sheets |
| DingTalk (钉钉) |
dingtalk | 23 | Contacts, Groups, Calendar, Todos, Approvals, Attendance, Logs, Smart Sheets |
| Lark/Feishu (飞书) | lark | 28 | Calendar, Messages, Docs, Drive, Bitable, Spreadsheets, Tasks, Wiki, Email, Meetings |
| Dreamina (即梦) | dreamina | 12 | Text-to-Image, Text-to-Video, Image-to-Video, Multimodal Video, Upscale, Seedance 2.0 |
Notes
- - Authentication is interactive; the agent should prompt the user to complete browser authorization
- For Dreamina, use
dreamina login --headless (terminal QR code); generation consumes credits — warn the user - Dreamina tasks are async: after submit, use
query_result --submit_id=<id> to check results - Search results are ranked by relevance; prefer the highest-scored tool
- Invoke tools one at a time and confirm results before proceeding
cli-hub — 统一CLI网关
一个技能即可搜索并调用所有企业及AI创作工具(企业微信/钉钉/飞书/即梦),覆盖91+工具。
安装
推荐方式(从PyPI安装,包签名已验证):
bash
pip install agent-cli-hub # pip
pipx install agent-cli-hub # pipx(隔离环境)
uv tool install agent-cli-hub # uv
PyPI:https://pypi.org/project/agent-cli-hub/
源码:https://github.com/agentrix-ai/clihub(MIT许可证)
备选方式(便捷脚本,内部通过PyPI运行pip):
bash
curl -sSL https://raw.githubusercontent.com/agentrix-ai/clihub/main/install.sh | bash
安装完成后,cli-hub即可作为命令使用。
强制规则
- 1. 切勿猜测命令 — 始终使用 cli-hub search 先查找工具ID。
- 调用前检查参数 — 始终使用 cli-hub info 确认参数模式。
- 出错时,请参考下方错误处理表格。
标准工作流程
严格按照步骤1→2→3→4的顺序执行。
步骤1:检查环境(首次使用必需)
bash
cli-hub doctor
根据输出:
- - not installed(未安装)→ 安装CLI
- installed(已安装)但未认证 → 运行认证
- 全部正常 → 跳至步骤2
安装底层CLI:
bash
cli-hub install wecom # 企业微信
cli-hub install dingtalk # 钉钉
cli-hub install lark # 飞书
cli-hub install dreamina # 即梦AI
cli-hub install --all # 所有提供商
cli-hub install lark --timeout 300 # 针对慢网络增加超时时间
认证(交互式,需浏览器):
bash
cli-hub auth wecom
cli-hub auth dingtalk
cli-hub auth lark
cli-hub auth dreamina # 即梦(终端二维码登录)
cli-hub auth --status # 检查所有认证状态
步骤2:搜索工具
bash
cli-hub search 发送消息
cli-hub search 创建待办 --provider lark
cli-hub search 生成视频 --provider dreamina
cli-hub search 会议 --json # 推荐用于智能体:带input_schema的JSON格式
步骤3:检查参数
bash
cli-hub info wecom.msg.send_message # 表格格式
cli-hub info wecom.msg.send_message --json # 推荐用于智能体:完整JSON Schema
显示:参数名称、类型、是否必需(*)、示例、命令模板。
步骤4:调用工具
方式A — JSON参数(企业微信风格):
bash
cli-hub run wecom.msg.sendmessage --args {chattype:1,chatid:user1,msgtype:text,text:{content:你好}}
方式B — 标志参数(钉钉/飞书/即梦风格):
bash
cli-hub run lark.im.messagessend --chat-id ocxxx --text 你好
cli-hub run dingtalk.todo.task_create --title 撰写报告 --executors userId
cli-hub run dreamina.generate.text2image --prompt 一只猫的肖像 --ratio 1:1
如何选择? cli-hub info 的示例字段会显示底层CLI的参数风格。
实用命令
| 命令 | 用途 |
|---|
| cli-hub list | 列出所有提供商 |
| cli-hub list lark |
列出所有飞书工具 |
| cli-hub list dingtalk --category todo | 按类别筛选 |
| cli-hub refresh | 从已安装的CLI刷新模式 |
| cli-hub add
--display 名称 | 添加新的CLI提供商 |
决策树
用户意图
├── 不确定使用哪个平台 → cli-hub search <描述>
├── 知道平台,不知道工具 → cli-hub list <提供商>
├── 找到工具ID → cli-hub info → cli-hub run [参数]
├── 未安装 → cli-hub install <提供商>
├── 未认证 → cli-hub auth <提供商>
├── 未找到操作 → 重新运行 cli-hub search
├── 超时 → cli-hub install <提供商> --timeout 300
└── 不确定环境状态 → cli-hub doctor
错误处理
| 错误 | 原因 | 修复方法 |
|---|
| not installed(未安装) | CLI未安装 | cli-hub install <提供商> |
| not authenticated(未认证) |
未认证 | cli-hub auth <提供商> |
| Operation not found(未找到操作) | ID拼写错误 | cli-hub search 查找正确ID |
| No adapter registered(未注册适配器) | 提供商名称错误 | cli-hub list 查看可用名称 |
| timed out after Ns(N秒后超时) | 超时 | 使用 --timeout 300 重试 |
| Invalid JSON(无效JSON) | --args JSON格式错误 | 检查引号和转义 |
| 底层CLI错误 | 参数错误或权限不足 | cli-hub info 检查参数 |
支持的平台
| 平台 | 提供商 | 工具数 | 覆盖范围 |
|---|
| 企业微信 | wecom | 28 | 联系人、待办、会议、消息、日历、文档、智能表格 |
| 钉钉 |
dingtalk | 23 | 联系人、群组、日历、待办、审批、考勤、日志、智能表格 |
| 飞书 | lark | 28 | 日历、消息、文档、云盘、多维表格、电子表格、任务、知识库、邮箱、会议 |
| 即梦 | dreamina | 12 | 文生图、文生视频、图生视频、多模态视频、超分辨率、Seedance 2.0 |
注意事项
- - 认证为交互式操作;智能体应提示用户完成浏览器授权
- 对于即梦,使用 dreamina login --headless(终端二维码);生成会消耗积分——请提醒用户
- 即梦任务为异步操作:提交后,使用 queryresult --submitid= 检查结果
- 搜索结果按相关性排序;优先选择评分最高的工具
- 每次调用一个工具,确认结果后再继续