integrate-anything
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSelf-Integration
自集成
Connect to any external app and perform actions on it. Uses the Membrane CLI.
连接任意外部应用并在其上执行操作,使用Membrane CLI实现。
Authentication
认证
Authenticate with the Membrane CLI:
bash
npx @membranehq/cli login --tenantAlternatively, you can install the membrane CLI globally () and use instead.
npm i -g @membranehq/cli@latestmembrane login --tenantAlways use to get a tenant-scoped token — this authenticates on behalf of a specific tenant (workspace + customer) in Membrane, so you don't need to pass and on every subsequent command.
--tenant--workspaceKey--tenantKeyThis will either open a browser for authentication or print an authorization URL to the console, depending on whether interactive mode is available. The user authenticates in Membrane, then selects a workspace and tenant (user inside workspace).
When login process is completed, the credentials are stored locally in and used in subsequent commands automatically.
~/.membrane/credentials.json通过Membrane CLI完成认证:
bash
npx @membranehq/cli login --tenant你也可以全局安装Membrane CLI(),改用命令。
npm i -g @membranehq/cli@latestmembrane login --tenant请始终使用参数获取租户范围的令牌——它会代表Membrane中的特定租户(工作区+客户)完成认证,后续所有命令无需再传递和参数。
--tenant--workspaceKey--tenantKey该命令会根据交互式模式是否可用,要么打开浏览器完成认证,要么在控制台打印授权URL。用户在Membrane完成认证后,选择对应的工作区和租户(工作区内的用户)即可。
登录流程完成后,凭证会存储在本地文件中,后续命令会自动调用。
~/.membrane/credentials.jsonNon-interactive Authentication
非交互式认证
If interactive browser login is not possible (e.g. remote/headless environment) the command will print an authorization URL to the terminal. The user can then open the URL in their browser and complete the login process.
membrane loginIf this is the case, ask the user to enter the code they see in the browser after completing the login process.
When user enters the code, complete the login process with:
bash
npx @membranehq/cli login complete <code>All commands below use (or just if installed globally). Add to any command for machine-readable JSON output to stdout. Command without flag will print the result in a human-readable (and often shorter) format.
npx @membranehq/climembrane--json--json如果无法使用交互式浏览器登录(例如远程/无界面环境),命令会在终端打印授权URL,用户可以在浏览器中打开该URL完成登录流程。
membrane login如果是这种情况,请提示用户输入完成登录流程后浏览器中显示的验证码。
用户输入验证码后,使用以下命令完成登录流程:
bash
npx @membranehq/cli login complete <code>以下所有命令均使用(如果全局安装了可直接用)。任意命令都可以添加参数,让标准输出返回机器可读的JSON格式;不带参数的命令会返回人类可读(通常更简洁)的结果格式。
npx @membranehq/climembrane--json--jsonWorkflow
工作流程
Step 1: Get a Connection
步骤1:获取连接
A connection is an authenticated link to an external app (e.g. a user's Slack workspace, a HubSpot account). You need one before you can run actions.
连接是指向外部应用的已认证链路(例如用户的Slack工作区、HubSpot账户),执行动作前你需要先获取连接。
1a. Find or create a connection
1a. 查找或创建连接
Use to automatically search existing connections, integrations, connectors, and apps — and return the best match or create a new one:
connection ensurebash
npx @membranehq/cli connection ensure "Slack" --jsonThis is the fastest way to get a connection. It searches in priority order: existing connections > integrations > connectors > external apps. If nothing is found, it creates a new connection and starts building a connector automatically.
If the returned connection has , skip to Step 2.
state: "READY"使用自动搜索现有连接、集成、连接器和应用,返回最佳匹配结果或自动创建新连接:
connection ensurebash
npx @membranehq/cli connection ensure "Slack" --json这是获取连接最快的方式,搜索优先级为:现有连接 > 集成 > 连接器 > 外部应用。如果没有找到匹配项,它会创建新连接并自动开始构建连接器。
如果返回的连接,直接跳转到步骤2。
state: "READY"1b. Wait for the connection to be ready
1b. 等待连接就绪
If the connection is in state, poll until it's ready:
BUILDINGbash
npx @membranehq/cli connection get <id> --wait --jsonThe flag long-polls (up to seconds, default 30) until the state changes. Keep polling until is no longer .
--wait--timeoutstateBUILDINGThe resulting state tells you what to do next:
-
— connection is fully set up. Skip to Step 2.
READY -
— the user or agent needs to do something. The
CLIENT_ACTION_REQUIREDobject describes the required action:clientAction- — the kind of action needed:
clientAction.type- — user needs to authenticate (OAuth, API key, etc.). This covers initial authentication and re-authentication for disconnected connections.
"connect" - — more information is needed (e.g. which app to connect to).
"provide-input"
- — human-readable explanation of what's needed.
clientAction.description - (optional) — URL to a pre-built UI where the user can complete the action. Show this to the user when present.
clientAction.uiUrl - (optional) — instructions for the AI agent on how to proceed programmatically.
clientAction.agentInstructions
After the user completes the action (e.g. authenticates in the browser), poll again withto check if the state moved toconnection get <id> --json.READY -
or
CONFIGURATION_ERROR— something went wrong. Check theSETUP_FAILEDfield for details.error
如果连接处于状态,轮询查询直到状态变更:
BUILDINGbash
npx @membranehq/cli connection get <id> --wait --json--wait--timeoutstateBUILDING返回的状态会指示下一步操作:
-
—— 连接已完全配置完成,跳转到步骤2。
READY -
—— 需要用户或Agent执行操作,
CLIENT_ACTION_REQUIRED对象描述了所需操作:clientAction- —— 需要的操作类型:
clientAction.type- —— 用户需要完成认证(OAuth、API密钥等),覆盖首次认证和断开连接的重认证场景。
"connect" - —— 需要补充更多信息(例如要连接的具体应用)。
"provide-input"
- —— 所需操作的人类可读说明。
clientAction.description - (可选)—— 预制UI页面的URL,用户可在该页面完成操作,存在时请展示给用户。
clientAction.uiUrl - (可选)—— 给AI Agent的程序化操作指引。
clientAction.agentInstructions
用户完成操作后(例如在浏览器中完成认证),再次调用轮询检查状态是否变为connection get <id> --json。READY -
或
CONFIGURATION_ERROR—— 出现错误,查看SETUP_FAILED字段获取详情。error
Alternative: Create a connection with more control
替代方案:更可控地创建连接
If you need more control over the connection creation, you can use instead:
connection createbash
npx @membranehq/cli connection create "Connect to Slack" --jsonThis creates a new connection with an intent and starts building in the background. Then follow step 1b to wait for it.
如果你需要对连接创建过程有更多控制,可以改用命令:
connection createbash
npx @membranehq/cli connection create "Connect to Slack" --json该命令会根据指定意图创建新连接并在后台开始构建,之后按照步骤1b等待连接就绪即可。
Step 2: Get an Action
步骤2:获取动作
An action is an operation you can perform on a connected app (e.g. "Create task", "Send message", "List contacts").
动作是你可以在已连接应用上执行的操作(例如“创建任务”、“发送消息”、“列出联系人”)。
2a. Search for actions
2a. 搜索动作
Search using a natural language description of what you want to do:
bash
npx @membranehq/cli action list --connectionId abc123 --intent "send a message" --limit 10 --jsonYou should always search for actions in the context of a specific connection.
Each result includes , , , (what parameters the action accepts), and (what it returns).
idnamedescriptioninputSchemaoutputSchemaIf no suitable action exists, go to step 2b.
使用自然语言描述你要执行的操作进行搜索:
bash
npx @membranehq/cli action list --connectionId abc123 --intent "send a message" --limit 10 --json请始终在指定连接的上下文中搜索动作。
每个搜索结果包含、、、(动作接受的参数定义)和(动作返回的结果定义)。
idnamedescriptioninputSchemaoutputSchema如果没有找到合适的动作,跳转到步骤2b。
2b. Create an action (if none exists)
2b. 创建动作(如果不存在合适的动作)
Describe what you want the action to do — Membrane will build it automatically using an agent:
bash
npx @membranehq/cli action create "send a message in a channel" --connectionId abc123 --jsonThis returns an action object. The action starts in state while Membrane builds it in the background.
BUILDING描述你需要的动作功能,Membrane会使用Agent自动构建该动作:
bash
npx @membranehq/cli action create "send a message in a channel" --connectionId abc123 --json该命令会返回动作对象,动作初始状态为,Membrane会在后台完成构建。
BUILDING2c. Wait for the action to be ready
2c. 等待动作就绪
Poll until the action leaves the state:
BUILDINGbash
npx @membranehq/cli action get <id> --wait --jsonThe flag long-polls (up to seconds, default 30) until the state changes. Keep polling until is no longer .
--wait--timeoutstateBUILDINGThe resulting state tells you what to do next:
- — action is fully built. Proceed to Step 3.
READY - or
CONFIGURATION_ERROR— something went wrong. Check theSETUP_FAILEDfield for details.error
After the action is built, you can also search for it again (step 2a) to confirm.
轮询查询直到动作离开状态:
BUILDINGbash
npx @membranehq/cli action get <id> --wait --json--wait--timeoutstateBUILDING返回的状态会指示下一步操作:
- —— 动作已完全构建完成,前往步骤3。
READY - 或
CONFIGURATION_ERROR—— 出现错误,查看SETUP_FAILED字段获取详情。error
动作构建完成后,你也可以重新执行步骤2a的搜索确认动作可用。
Step 3: Run an Action
步骤3:执行动作
Execute the action using the action ID from step 2 and the connection ID from step 1:
bash
npx @membranehq/cli action run <actionId> --connectionId abc123 --input '{"channel": "#general", "text": "Hello!"}' --jsonProvide matching the action's .
--inputinputSchemaThe result is in the field of the response.
output使用步骤2获取的动作ID和步骤1获取的连接ID执行动作:
bash
npx @membranehq/cli action run <actionId> --connectionId abc123 --input '{"channel": "#general", "text": "Hello!"}' --json请提供与动作匹配的参数。
inputSchema--input执行结果会包含在响应的字段中。
outputCLI Reference
CLI参考
All commands support for structured JSON output to stdout. Add and to override project defaults.
--json--workspaceKey <key>--tenantKey <key>所有命令都支持参数返回结构化JSON标准输出,可添加和参数覆盖项目默认值。
--json--workspaceKey <key>--tenantKey <key>connection
connection
bash
npx @membranehq/cli connection ensure <intent> [--name <name>] [--json] # Find or create connection (recommended)
npx @membranehq/cli connection list [--json] # List all connections
npx @membranehq/cli connection get <id> [--wait] [--timeout <n>] [--json] # Get connection (--wait to long-poll)
npx @membranehq/cli connection create <intent> [--name <name>] [--json] # Create connection with intentbash
npx @membranehq/cli connection ensure <intent> [--name <name>] [--json] # 查找或创建连接(推荐)
npx @membranehq/cli connection list [--json] # 列出所有连接
npx @membranehq/cli connection get <id> [--wait] [--timeout <n>] [--json] # 获取连接(--wait启用长轮询)
npx @membranehq/cli connection create <intent> [--name <name>] [--json] # 根据意图创建连接action
action
bash
npx @membranehq/cli action list [--connectionId <id>] [--intent <text>] [--limit <n>] [--json] # List/search actions
npx @membranehq/cli action create <intent> --connectionId <id> [--name <name>] [--json] # Create action with intent
npx @membranehq/cli action get <id> [--wait] [--timeout <n>] [--json] # Get action (--wait to long-poll)
npx @membranehq/cli action run <actionId> --connectionId <id> [--input <json>] [--json] # Run an actionbash
npx @membranehq/cli action list [--connectionId <id>] [--intent <text>] [--limit <n>] [--json] # 列出/搜索动作
npx @membranehq/cli action create <intent> --connectionId <id> [--name <name>] [--json] # 根据意图创建动作
npx @membranehq/cli action get <id> [--wait] [--timeout <n>] [--json] # 获取动作(--wait启用长轮询)
npx @membranehq/cli action run <actionId> --connectionId <id> [--input <json>] [--json] # 执行动作search
search
bash
npx @membranehq/cli search <query> [--elementType <type>] [--limit <n>] [--json] # Search connectors, integrations, etc.bash
npx @membranehq/cli search <query> [--elementType <type>] [--limit <n>] [--json] # 搜索连接器、集成等资源Fallback: Raw API
备选方案:原生API
If the CLI is not available, you can make direct API requests.
Base URL:
Auth header:
https://api.getmembrane.comAuthorization: Bearer $MEMBRANE_TOKENGet the API token from the Membrane dashboard.
| CLI Command | API Equivalent |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
如果无法使用CLI,你可以直接发起API请求。
基础URL:
认证头:
https://api.getmembrane.comAuthorization: Bearer $MEMBRANE_TOKEN你可以从Membrane控制台获取API令牌。
| CLI命令 | 对应API |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
External Endpoints
外部端点
All requests go to the Membrane API. No other external services are contacted directly by this skill.
| Endpoint | Data Sent |
|---|---|
| Auth credentials, connection parameters, action inputs, agent prompts |
所有请求都会发送到Membrane API,该技能不会直接调用其他外部服务。
| 端点 | 发送的数据 |
|---|---|
| 认证凭证、连接参数、动作输入、Agent提示词 |
Security & Privacy
安全与隐私
- All data is sent to the Membrane API over HTTPS.
- CLI credentials are stored locally in with restricted file permissions.
~/.membrane/ - Connection authentication (OAuth, API keys) is handled by Membrane — credentials for external apps are stored by the Membrane service, not locally.
- Action inputs and outputs pass through the Membrane API to the connected external app.
By using this skill, data is sent to Membrane. Only install if you trust Membrane with access to your connected apps.
- 所有数据通过HTTPS传输到Membrane API。
- CLI凭证存储在本地目录下,文件权限做了限制。
~/.membrane/ - 连接认证(OAuth、API密钥)由Membrane处理,外部应用的凭证由Membrane服务存储,不会保存在本地。
- 动作的输入和输出会通过Membrane API转发到已连接的外部应用。
使用该技能意味着数据会发送到Membrane,仅当你信任Membrane可以访问你连接的应用时再安装使用。