connect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Connect

连接

Connect Codex to any app using the Composio CLI. Stop generating text about what you could do - actually do it from the shell.
使用Composio CLI将Codex连接至任意应用。别再生成关于操作的描述文本——直接在Shell中执行实际操作。

When to Use This Skill

何时使用该Skill

Use this skill when you need Codex to:
  • Send that email instead of drafting it
  • Create that issue instead of describing it
  • Post that message instead of suggesting it
  • Update that database instead of explaining how
当你需要Codex完成以下操作时,使用该Skill:
  • 直接发送邮件而非草拟邮件
  • 直接创建工单而非描述工单
  • 直接发布消息而非建议发布内容
  • 直接更新数据库而非解释操作步骤

What Changes

差异对比

Without ConnectWith Connect
"Here's a draft email..."Sends the email
"You should create an issue..."Creates the issue
"Post this to Slack..."Posts it
"Add this to Notion..."Adds it
未使用Connect使用Connect
"这是一封草拟的邮件..."直接发送邮件
"你应该创建一个工单..."直接创建工单
"把这个发布到Slack..."直接发布内容
"把这个添加到Notion..."直接添加内容

Supported Apps

支持的应用

1000+ integrations including:
  • Email: Gmail, Outlook, SendGrid
  • Chat: Slack, Discord, Teams, Telegram
  • Dev: GitHub, GitLab, Jira, Linear
  • Docs: Notion, Google Docs, Confluence
  • Data: Sheets, Airtable, PostgreSQL
  • CRM: HubSpot, Salesforce, Pipedrive
  • Storage: Drive, Dropbox, S3
  • Social: Twitter, LinkedIn, Reddit
1000+集成服务包括:
  • 邮件类: Gmail、Outlook、SendGrid
  • 聊天类: Slack、Discord、Teams、Telegram
  • 开发类: GitHub、GitLab、Jira、Linear
  • 文档类: Notion、Google Docs、Confluence
  • 数据类: Sheets、Airtable、PostgreSQL
  • CRM类: HubSpot、Salesforce、Pipedrive
  • 存储类: Drive、Dropbox、S3
  • 社交类: Twitter、LinkedIn、Reddit

Setup

配置步骤

1. Install the Composio CLI

1. 安装Composio CLI

bash
curl -fsSL https://composio.dev/install | bash
bash
curl -fsSL https://composio.dev/install | bash

2. Log In

2. 登录账号

bash
composio login
composio whoami
This opens a browser for authentication and lets you pick your default org and project. Use
-y
to skip prompts in automated flows.
bash
composio login
composio whoami
此命令会打开浏览器进行身份验证,让你选择默认组织和项目。在自动化流程中可使用
-y
参数跳过提示。

3. Link the Toolkits You Need

3. 关联所需工具包

bash
composio link github
composio link gmail
composio link slack
Each command walks through OAuth once, then the connection persists.
Done. Codex can now drive any connected app from the shell.
bash
composio link github
composio link gmail
composio link slack
每个命令会引导完成一次OAuth验证,验证完成后连接将持续生效。
配置完成。现在Codex可通过Shell驱动任意已连接的应用。

Core Workflow

核心工作流

  1. Know the tool slug?
    composio execute
  2. Don't know the slug?
    composio search
  3. Need clarification on inputs?
    composio execute --get-schema
    or
    --dry-run
  4. Toolkit not connected?
    composio link <toolkit>
    and retry
  5. Multiple steps needed?
    composio run
    for workflows,
    composio proxy
    for raw API calls
  1. 知道工具标识? → 执行
    composio execute
  2. 不知道工具标识? → 执行
    composio search
  3. 需要明确输入参数? → 执行
    composio execute --get-schema
    --dry-run
  4. 未连接工具包? → 执行
    composio link <toolkit>
    后重试
  5. 需要多步骤操作? → 使用
    composio run
    执行工作流,使用
    composio proxy
    调用原始API

Examples

示例

Discover a Tool

查找工具

bash
composio search "create a github issue"
composio search "send an email" --toolkits gmail
bash
composio search "create a github issue"
composio search "send an email" --toolkits gmail

Inspect Inputs Before Calling

调用前检查输入参数

bash
composio tools info GITHUB_CREATE_ISSUE
composio execute GITHUB_CREATE_ISSUE --get-schema
composio execute GITHUB_CREATE_ISSUE --dry-run -d '{"owner":"acme","repo":"app","title":"Bug"}'
bash
composio tools info GITHUB_CREATE_ISSUE
composio execute GITHUB_CREATE_ISSUE --get-schema
composio execute GITHUB_CREATE_ISSUE --dry-run -d '{"owner":"acme","repo":"app","title":"Bug"}'

Send an Email

发送邮件

bash
composio execute GMAIL_SEND_EMAIL -d '{
  "recipient_email": "sarah@acme.com",
  "subject": "Shipped!",
  "body": "v2.0 is live, let me know if issues"
}'
bash
composio execute GMAIL_SEND_EMAIL -d '{
  "recipient_email": "sarah@acme.com",
  "subject": "已发布!",
  "body": "v2.0已上线,如有问题请告知"
}'

Create a GitHub Issue

创建GitHub工单

bash
composio execute GITHUB_CREATE_ISSUE -d '{
  "owner": "my-org",
  "repo": "repo",
  "title": "Mobile timeout bug",
  "labels": ["bug"]
}'
bash
composio execute GITHUB_CREATE_ISSUE -d '{
  "owner": "my-org",
  "repo": "repo",
  "title": "移动端超时bug",
  "labels": ["bug"]
}'

Post to Slack

发布Slack消息

bash
composio execute SLACK_SEND_MESSAGE -d '{
  "channel": "engineering",
  "text": "Deploy complete - v2.4.0 live"
}'
bash
composio execute SLACK_SEND_MESSAGE -d '{
  "channel": "engineering",
  "text": "部署完成 - v2.4.0已上线"
}'

Run Calls in Parallel

并行执行调用

bash
composio execute --parallel \
  GMAIL_FETCH_EMAILS -d '{"max_results": 2}' \
  GITHUB_GET_THE_AUTHENTICATED_USER -d '{}'
bash
composio execute --parallel \
  GMAIL_FETCH_EMAILS -d '{"max_results": 2}' \
  GITHUB_GET_THE_AUTHENTICATED_USER -d '{}'

Chain Actions with
composio run

使用
composio run
串联操作

bash
composio run '
  const issues = await search("github issues labeled bug this week");
  const summary = issues.map(i => `- ${i.title}`).join("\n");
  await execute("SLACK_SEND_MESSAGE", {
    channel: "bugs",
    text: `This week’s bugs:\n${summary}`
  });
'
Load reusable workflows from a file:
bash
composio run --file ./workflow.ts -- --repo composiohq/composio
bash
composio run '
  const issues = await search("github issues labeled bug this week");
  const summary = issues.map(i => `- ${i.title}`).join("\n");
  await execute("SLACK_SEND_MESSAGE", {
    channel: "bugs",
    text: `本周bug汇总:\n${summary}`
  });
'
从文件加载可复用工作流:
bash
composio run --file ./workflow.ts -- --repo composiohq/composio

Raw API Access (
proxy
)

原始API访问(
proxy

When no dedicated tool exists, hit the authenticated API directly:
bash
composio proxy https://gmail.googleapis.com/gmail/v1/users/me/profile \
  --toolkit gmail

composio proxy https://gmail.googleapis.com/gmail/v1/users/me/drafts \
  --toolkit gmail -X POST -H 'content-type: application/json' \
  -d '{"message":{"raw":"..."}}'
当没有专用工具时,直接调用已验证的API:
bash
composio proxy https://gmail.googleapis.com/gmail/v1/users/me/profile \
  --toolkit gmail

composio proxy https://gmail.googleapis.com/gmail/v1/users/me/drafts \
  --toolkit gmail -X POST -H 'content-type: application/json' \
  -d '{"message":{"raw":"..."}}'

How It Works

工作原理

  1. You ask Codex to do something
  2. Codex picks a slug via
    composio search
    or prior knowledge
  3. CLI checks connection, prompts
    composio link
    if missing
  4. Action executes against the real API and returns JSON to stdout
  1. 你发起请求:要求Codex执行某项操作
  2. Codex选择标识:通过
    composio search
    或已有知识确定工具标识
  3. CLI检查连接:如果未连接,提示执行
    composio link
  4. 执行操作:调用真实API执行操作,并将JSON结果返回至标准输出

Configuration

配置选项

Global flags:
  • --log-level <all|trace|debug|info|warning|error|fatal|none>
  • --help
    for per-command docs
Environment variables:
  • COMPOSIO_API_KEY
    - auth credential (set for non-interactive use)
  • COMPOSIO_BASE_URL
    - custom API endpoint
  • COMPOSIO_SESSION_DIR
    - override artifact storage
  • COMPOSIO_DISABLE_TELEMETRY=true
    - opt out of telemetry
全局标志:
  • --log-level <all|trace|debug|info|warning|error|fatal|none>
  • --help
    :查看各命令文档
环境变量:
  • COMPOSIO_API_KEY
    :身份验证凭证(非交互式场景设置)
  • COMPOSIO_BASE_URL
    :自定义API端点
  • COMPOSIO_SESSION_DIR
    :覆盖产物存储路径
  • COMPOSIO_DISABLE_TELEMETRY=true
    :选择退出遥测

Type-Safe SDK (Optional)

类型安全SDK(可选)

Generate typed client code when you want to call tools from an app rather than the shell:
bash
composio generate ts    # TypeScript types
composio generate py    # Python types
Flags:
-o <dir>
,
--toolkits <list>
,
--compact
,
--transpiled
,
--type-tools
.
当你需要从应用而非Shell调用工具时,生成类型化客户端代码:
bash
composio generate ts    # TypeScript类型定义
composio generate py    # Python类型定义
可选标志:
-o <dir>
--toolkits <list>
--compact
--transpiled
--type-tools

Troubleshooting

故障排查

  • Not logged in
    → run
    composio login
  • Connection required for <toolkit>
    → run
    composio link <toolkit>
  • Unknown slug
    composio search "<what you want>"
    or
    composio tools list <toolkit>
  • Bad inputs
    composio execute <SLUG> --get-schema
    then
    --dry-run
  • Action failed → check permissions in the target app

<p align="center"> <b>Join 20,000+ developers building agents that ship</b> </p> <p align="center"> <a href="https://platform.composio.dev/?utm_source=Github&utm_content=AwesomeSkills"> <img src="https://img.shields.io/badge/Get_Started_Free-4F46E5?style=for-the-badge" alt="Get Started"/> </a> </p>
  • Not logged in
    → 执行
    composio login
  • Connection required for <toolkit>
    → 执行
    composio link <toolkit>
  • 未知标识 → 执行
    composio search "<你要执行的操作>"
    composio tools list <toolkit>
  • 输入参数错误 → 先执行
    composio execute <SLUG> --get-schema
    ,再用
    --dry-run
    测试
  • 操作失败 → 检查目标应用中的权限设置
完整参考文档:docs.composio.dev/docs/cli

<p align="center"> <b>加入20000+开发者行列,构建可落地的Agent</b> </p> <p align="center"> <a href="https://platform.composio.dev/?utm_source=Github&utm_content=AwesomeSkills"> <img src="https://img.shields.io/badge/Get_Started_Free-4F46E5?style=for-the-badge" alt="Get Started"/> </a> </p>