composio
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWhen to Apply
适用场景
- User wants to access or interact with external apps (Gmail, Slack, GitHub, Notion, etc.)
- User wants to automate a task using an external service (send email, create issue, post message)
- Building an AI agent or app that integrates with external tools
- Multi-user apps that need per-user connections to external services
- 用户想要访问或与外部应用(Gmail、Slack、GitHub、Notion等)进行交互
- 用户想要借助外部服务自动化完成任务(发送邮件、创建Issue、发布消息)
- 构建与外部工具集成的AI Agent或应用
- 需要为每位用户建立外部服务连接的多用户应用
Setup
设置步骤
Check if the CLI is installed; if not, install it:
bash
curl -fsSL https://composio.dev/install | bashAfter installation, restart your terminal or source your shell config, then authenticate:
bash
composio login # OAuth; interactive org/project picker (use -y to skip)
composio whoami # verify org_id, project_id, user_idFor agents without direct browser access: to get URL/key, share URL with user, then once they complete login.
composio login --no-wait | jqcomposio login --key <cli_key> --no-wait检查CLI是否已安装;若未安装,请执行以下命令安装:
bash
curl -fsSL https://composio.dev/install | bash安装完成后,重启终端或加载shell配置文件,然后进行身份验证:
bash
composio login # OAuth;交互式组织/项目选择器(使用-y参数跳过)
composio whoami # 验证org_id、project_id、user_id对于无法直接访问浏览器的Agent:执行获取URL/密钥,将URL分享给用户,待用户完成登录后执行。
composio login --no-wait | jqcomposio login --key <cli_key> --no-wait1. Use Apps via Composio CLI
1. 通过Composio CLI使用应用
Use this when: The user wants to take action on an external app directly — no code writing needed. The agent uses the CLI to search, connect, and execute tools on behalf of the user.
Key commands (new top-level aliases):
- — find tools by use case
composio search "<query>" - — execute a tool
composio execute "<TOOL_SLUG>" -d '{...<input params>}' - — connect a user account to an app (agents: always use
composio link [toolkit]for non-interactive mode)--no-wait - — listen for real-time trigger events
composio listen
Typical workflow: search → link (if needed) → execute
Full reference: Composio CLI Guide
适用场景: 用户想要直接对外部应用执行操作——无需编写代码。Agent可借助CLI代表用户搜索、连接并执行工具。
核心命令(新增顶级别名):
- —— 根据使用场景查找工具
composio search "<query>" - —— 执行工具
composio execute "<TOOL_SLUG>" -d '{...<input params>}' - —— 将用户账户与应用连接(Agent:非交互模式下请始终使用
composio link [toolkit]参数)--no-wait - —— 监听实时触发事件
composio listen
典型工作流:搜索 → 连接(如需) → 执行
完整参考文档:Composio CLI指南
2. Building Apps and Agents with Composio
2. 使用Composio构建应用与Agent
Use this when: Writing code — an AI agent, app, or backend service that integrates with external tools via the Composio SDK.
Run this first inside the project directory to set up the API key:
bash
composio initFull reference: Building with Composio
适用场景: 编写代码时——构建通过Composio SDK与外部工具集成的AI Agent、应用或后端服务。
首先在项目目录内执行以下命令设置API密钥:
bash
composio init完整参考文档:使用Composio构建应用