Token导航 LogoToken导航

Agent Skill · 开发

cloud-functions(云功能)

cloud-functions 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cloud-functions 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 13,262。

总安装 955周安装 39GitHub Stars 997下载 309核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cloud-functions(云功能)
来源仓库:https://github.com/tencentcloudbase/cloudbase-mcp
仓库路径:skills/cloud-functions
安装命令:
npx skills add https://github.com/tencentcloudbase/cloudbase-mcp --skill cloud-functions
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tencentcloudbase/cloudbase-mcp --skill cloud-functions

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

cloud-functions 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

通过 npx skills add 命令从指定 GitHub 仓库安装,需结合原始 README 核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。当前分类为开发,暂无更多功能细节可参考。

来源仓库内路径:skills/cloud-functions

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tencentcloudbase/cloudbase-mcp --skill cloud-f…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cloud-functions 怎么安装?

在终端执行 npx skills add https://github.com/tencentcloudbase/cloudbase-mcp --skill cloud-functions。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cloud-functions 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cloud-functions 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

cloud-functions 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

cloud-functions 用的人多吗?

公开数据是累计安装 955 次,近一周安装 39 次,下载 309 次,GitHub 997 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cloud-functions 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
cloud-functions

云功能 · 本页

955997接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Cloud Functions Development

Use this skill when developing, deploying, and managing CloudBase cloud functions. CloudBase supports two types of cloud functions:

  • Event Functions (普通云函数): Traditional serverless functions triggered by events (SDK calls, timers)
  • HTTP Functions (HTTP 云函数): Web service functions triggered by HTTP requests, supporting multiple languages

When to use this skill

Use this skill for cloud function operations when you need to:

  • Create and deploy Event Functions (Node.js)
  • Create and deploy HTTP Functions (Node.js/Python/Go/Java)
  • Understand runtime limitations and selection
  • Query function logs and monitor execution
  • Invoke cloud functions from applications
  • Configure HTTP access for cloud functions
  • Implement SSE (Server-Sent Events) or WebSocket

Do NOT use for:

  • CloudRun backend services (use cloudrun-development skill)
  • Complex container-based services (use cloudrun-development skill)
  • Database operations (use database skills)

How to use this skill (for a coding agent)

  1. Choose the right function type

- Event Function: For SDK calls, scheduled tasks, event-driven scenarios - HTTP Function: For Web APIs, REST services, SSE/WebSocket, multi-language support

  1. Understand runtime limitations

- Runtime CANNOT be changed after function creation - Must select correct runtime during initial creation - If runtime needs to change, must delete and recreate function

  1. Deploy functions correctly

- MCP Tool: Use createFunction with type: "Event" or type: "HTTP" - CLI: Use tcb fn deploy (Event) or tcb fn deploy --httpFn (HTTP) - HTTP Functions require scf_bootstrap file in the function directory - Provide correct functionRootPath (parent directory of function folder)

  1. Query logs properly

- Use getFunctionLogs for log list (basic info) - Use getFunctionLogDetail with RequestId for detailed logs - Note time range limitations (max 1 day interval)


Function Types Comparison

FeatureEvent Function (普通云函数)HTTP Function (HTTP 云函数)
TriggerEvent-driven (SDK, timer)HTTP request
Entry Pointexports.main = async (event, context) => {}Web Server (Express/Flask/Gin etc.)
PortNo port requiredMust listen on port 9000
BootstrapNot requiredRequires scf_bootstrap
ConnectionShort connectionSupports long connection
LanguagesNode.js onlyNode.js, Python, Go, Java
ProtocolsN/AHTTP, SSE, WebSocket
Use CasesEvent processing, scheduled tasksWeb APIs, REST services, real-time streaming

Core Knowledge - Event Functions

Runtime Environment

⚠️ CRITICAL: Runtime cannot be modified after function creation

Once a cloud function is created with a specific runtime, the runtime cannot be changed. If you need a different runtime:

  1. Delete the existing function
  2. Create a new function with the desired runtime

Supported Node.js Runtimes:

  • Nodejs18.15 (Default, Recommended)
  • Nodejs16.13
  • Nodejs14.18
  • Nodejs12.16
  • Nodejs10.15
  • Nodejs8.9

Runtime Selection Guidelines:

  • Use Nodejs18.15 for new projects (default, most modern)
  • Choose older versions only if dependencies require specific Node.js versions
  • Consider security updates and support lifecycle
  • Test thoroughly with selected runtime before deployment

Event Function Structure

Event functions require:

  1. Function Directory: Contains function code

- Must have index.js (or specified entry file) - Must export handler: exports.main = async (event, context) => {} - Include package.json with dependencies

  1. Function Root Path: Parent directory containing function directories

- Example: If function is at /project/cloudfunctions/myFunction/ - functionRootPath should be /project/cloudfunctions/ - Important: Do NOT include function name in root path

  1. Entry Point: Default is index.js with exports.main

- Can be customized via handler parameter

Event Function Deployment

Creating New Functions:

Use createFunction tool (see MCP tool documentation for full parameter list):

  • Important: Always specify func.runtime explicitly (defaults to Nodejs18.15)
  • Provide functionRootPath as parent directory of function folders (absolute path)
  • Use force=true to overwrite existing function

Updating Function Code:

Use updateFunctionCode tool:

  • ⚠️ Note: Only updates code, cannot change runtime
  • If runtime needs to change, delete and recreate function

Deployment Best Practices:

  1. Always specify runtime explicitly when creating functions
  2. Use absolute paths for functionRootPath
  3. Don't upload node_modules - dependencies installed automatically
  4. Test locally before deployment when possible
  5. Use environment variables for configuration, not hardcoded values

Core Knowledge - HTTP Functions

HTTP Function Overview

HTTP Functions are optimized for Web service scenarios, supporting standard HTTP request/response patterns.

Key Characteristics:

  • Must listen on port 9000 (platform requirement)
  • Requires scf_bootstrap startup script
  • Supports multiple languages: Node.js, Python, Go, Java
  • Supports HTTP, SSE, WebSocket protocols

scf_bootstrap Startup Script

⚠️ CRITICAL: HTTP Functions require scf_bootstrap file

RequirementDescription
File nameMust be exactly scf_bootstrap (no extension)
PermissionMust have execute permission (chmod +x scf_bootstrap)
PortMust start server on port 9000
Line endingsMust use LF (Unix), not CRLF (Windows)

Examples:

# Node.js
#!/bin/bash
node index.js

# Python
#!/bin/bash
export PYTHONPATH="./third_party:$PYTHONPATH"
/var/lang/python310/bin/python3.10 app.py

# Go
#!/bin/bash
./main

# Java
#!/bin/bash
java -jar *.jar

HTTP Function Structure & Example

my-http-function/
├── scf_bootstrap      # Required: startup script
├── package.json       # Dependencies
└── index.js           # Application code

Node.js Example (Express):

const express = require('express');
const app = express();

app.get('/', (req, res) => res.json({ message: 'Hello!' }));
app.listen(9000);  // Must be port 9000

HTTP Function Deployment

MCP Tool:

createFunction({
  func: {
    name: "myHttpFunction",
    type: "HTTP",           // Required for HTTP Function
    protocolType: "HTTP",   // "HTTP" (default) or "WS" (WebSocket)
    timeout: 60
  },
  functionRootPath: "/path/to/functions",
  force: false
})

CLI:

tcb fn deploy <name> --httpFn        # HTTP Function
tcb fn deploy <name> --httpFn --ws   # With WebSocket

⚠️ Notes:

  • Function type cannot be changed after creation
  • HTTP Functions do NOT auto-install dependencies; include node_modules or use layers

Invoking HTTP Functions

Method 1: HTTP API (with Access Token)

curl -L 'https://{envId}.api.tcloudbasegateway.com/v1/functions/{name}?webfn=true' \
  -H 'Authorization: Bearer <TOKEN>'

⚠️ Must include webfn=true parameter

Method 2: HTTP Access Service (Custom Domain)

Use createFunctionHTTPAccess MCP tool to configure HTTP access:

createFunctionHTTPAccess({
  name: "myHttpFunction",
  type: "HTTP",           // "HTTP" for HTTP Function
  path: "/api/hello",     // Trigger path
  // domain: "your-domain.com"  // Optional custom domain
})
# Access via default domain
curl https://{envId}.{region}.app.tcloudbase.com/{path}

# Access via custom domain
curl https://your-domain.com/{path}
MethodAuth RequiredUse Case
HTTP API (?webfn=true)Yes (Bearer Token)Server-to-server
HTTP Access ServiceOptionalBrowser, public APIs

SSE & WebSocket Support

SSE (Server-Sent Events): Enabled by default, for server-to-client streaming (AI chat, progress updates).

// Server
res.setHeader('Content-Type', 'text/event-stream');
res.write(`data: ${JSON.stringify({ content: 'Hello' })}\n\n`);

// Client
const es = new EventSource('https://your-domain/stream');
es.onmessage = (e) => console.log(JSON.parse(e.data));

WebSocket: Enable via protocolType: "WS" in createFunction. For bidirectional real-time communication.

LimitValue
Idle timeout10 - 7200 seconds
Max message size256KB
const wss = new WebSocket.Server({ port: 9000 });
wss.on('connection', (ws) => {
  ws.on('message', (msg) => ws.send(`Echo: ${msg}`));
});

Function Logs

Querying Logs:

Primary Method: Use getFunctionLogs and getFunctionLogDetail tools (see MCP tool documentation).

Alternative Method (Plan B): If tools unavailable, use callCloudApi:

  1. Get Log List - Use GetFunctionLogs action:
callCloudApi({
  service: "tcb",
  action: "GetFunctionLogs",
  params: {
    EnvId: "{envId}",
    FunctionName: "functionName",
    Offset: 0,
    Limit: 10,
    StartTime: "2024-01-01 00:00:00",
    EndTime: "2024-01-01 23:59:59",
    LogRequestId: "optional-request-id",
    Qualifier: "$LATEST"
  }
})
  1. Get Log Details - Use GetFunctionLogDetail action (requires LogRequestId from step 1):
callCloudApi({
  service: "tcb",
  action: "GetFunctionLogDetail",
  params: {
    StartTime: "2024-01-01 00:00:00",
    EndTime: "2024-01-01 23:59:59",
    LogRequestId: "request-id-from-log-list"
  }
})

Log Query Limitations:

  • Offset + Limit cannot exceed 10000
  • StartTime and EndTime interval cannot exceed 1 day
  • Use pagination for large time ranges

Log Query Best Practices:

  1. Query logs within 1-day windows
  2. Use RequestId for specific invocation debugging
  3. Combine list and detail queries for comprehensive debugging
  4. Check logs after deployment to verify function behavior

Invoking Event Functions

From Web Applications:

import cloudbaseSDK from "@cloudbase/js-sdk";

const cloudbase = cloudbaseSDK.init({
  env: 'your-env-id',
  region: 'ap-shanghai',
  accessKey: 'your-access-key'
});

// Call event function
const result = await cloudbase.callFunction({
  name: "functionName",
  data: { /* function parameters */ }
});

From Mini Programs:

wx.cloud.callFunction({
  name: "functionName",
  data: { /* function parameters */ }
}).then(res => {
  console.log(res.result);
});

From Node.js Backend:

const cloudbase = require("@cloudbase/node-sdk");

const app = cloudbase.init({
  env: "your-env-id"
});

const result = await app.callFunction({
  name: "functionName",
  data: { /* function parameters */ }
});

From HTTP API:

Use CloudBase HTTP API to invoke event functions:

  • Endpoint: https://{envId}.api.tcloudbasegateway.com/v1/functions/{functionName}
  • Requires authentication token (Bearer Token)
  • See http-api skill for details

HTTP Access Configuration (for Event Functions)

HTTP Access vs HTTP API:

  • HTTP API: Uses CloudBase API endpoint with authentication token
  • HTTP Access: Creates direct HTTP/HTTPS endpoint for standard REST API access without SDK

Creating HTTP Access:

Primary Method: Use createFunctionHTTPAccess tool (see MCP tool documentation).

Alternative Method (Plan B): If tool unavailable, use callCloudApi with CreateCloudBaseGWAPI:

callCloudApi({
  service: "tcb",
  action: "CreateCloudBaseGWAPI",
  params: {
    EnableUnion: true,
    Path: "/api/users",
    ServiceId: "{envId}",
    Type: 6,
    Name: "functionName",
    AuthSwitch: 2,
    PathTransmission: 2,
    EnableRegion: true,
    Domain: "*"  // Use "*" for default domain, or custom domain name
  }
})

Key Parameters:

  • Type: 6 - Cloud Function type (required)
  • AuthSwitch: 2 - No auth (1 = with auth)
  • Domain: "*" - Default domain, or specify custom domain

Access URL: https://{envId}.{region}.app.tcloudbase.com/{path} or https://{domain}/{path}

Function Configuration

Environment Variables:

Set via func.envVariables when creating/updating:

{
  envVariables: {
    "DATABASE_URL": "mysql://...",
    "API_KEY": "secret-key"
  }
}

⚠️ CRITICAL: Environment Variable Update Constraint

When updating environment variables for existing functions:

  1. MUST first query current environment variables using getFunctionList with action=detail to get the function's current configuration
  2. MUST merge new environment variables with existing ones
  3. DO NOT directly overwrite - this will delete existing environment variables not included in the update

Correct Update Pattern:

// 1. First, get current function details
const currentFunction = await getFunctionList({
  action: "detail",
  name: "functionName"
});

// 2. Merge existing envVariables with new ones
const mergedEnvVariables = {
  ...currentFunction.EnvVariables,  // Existing variables
  ...newEnvVariables                 // New/updated variables
};

// 3. Update with merged variables
await updateFunctionConfig({
  funcParam: {
    name: "functionName",
    envVariables: mergedEnvVariables
  }
});

Why This Matters:

  • Direct overwrite will delete all environment variables not included in the update
  • This can break function functionality if critical variables are removed
  • Always preserve existing configuration when making partial updates

Timeout Configuration:

Set via func.timeout (in seconds):

  • Default timeout varies by runtime
  • Maximum timeout depends on runtime version
  • Consider function execution time when setting

Timer Triggers:

Configure via func.triggers:

  • Type: timer (only supported type)
  • Config: Cron expression (7 fields: second minute hour day month week year)
  • Examples:

- "0 0 2 1 * * *" - 2:00 AM on 1st of every month - "0 30 9 * * * *" - 9:30 AM every day

VPC Configuration:

For accessing VPC resources:

{
  vpc: {
    vpcId: "vpc-xxxxx",
    subnetId: "subnet-xxxxx"
  }
}

MCP Tools Reference

Function Management:

  • getFunctionList - List functions or get function details
  • createFunction - Create cloud function (supports both Event and HTTP types via type parameter)

- type: "Event" - Event Function (default) - type: "HTTP" - HTTP Function - protocolType: "WS" - Enable WebSocket for HTTP Function

  • updateFunctionCode - Update function code (runtime cannot change)
  • updateFunctionConfig - Update function configuration (⚠️ when updating envVariables, must first query and merge with existing values to avoid overwriting)

Logging:

  • getFunctionLogs - Get function log list (basic info)
  • getFunctionLogDetail - Get detailed log content by RequestId
  • callCloudApi (Plan B) - Use GetFunctionLogs and GetFunctionLogDetail actions if direct tools unavailable

HTTP Access:

  • createFunctionHTTPAccess - Create HTTP access for function (supports both Event and HTTP types via type parameter)
  • callCloudApi (Plan B) - Use CreateCloudBaseGWAPI action if direct tool unavailable

Triggers:

  • manageFunctionTriggers - Create or delete function triggers

CLI Commands:

  • tcb fn deploy <name> - Deploy Event Function
  • tcb fn deploy <name> --httpFn - Deploy HTTP Function
  • tcb fn deploy <name> --httpFn --ws - Deploy HTTP Function with WebSocket
  • tcb fn deploy --all - Deploy all functions in config

Common Patterns

Error Handling

exports.main = async (event, context) => {
  try {
    // Function logic
    return {
      code: 0,
      message: "Success",
      data: result
    };
  } catch (error) {
    return {
      code: -1,
      message: error.message,
      data: null
    };
  }
};

Environment Variable Usage

exports.main = async (event, context) => {
  const apiKey = process.env.API_KEY;
  const dbUrl = process.env.DATABASE_URL;

  // Use environment variables
};

Database Operations

const cloudbase = require("@cloudbase/node-sdk");

const app = cloudbase.init({
  env: process.env.ENV_ID
});

exports.main = async (event, context) => {
  const db = app.database();
  const result = await db.collection("users").get();
  return result;
};

Best Practices

General Best Practices

  1. Runtime Selection: Always specify runtime explicitly, use Nodejs18.15 for new projects
  2. Code Organization: Keep functions focused and single-purpose
  3. Error Handling: Always implement proper error handling
  4. Environment Variables: Use env vars for configuration, never hardcode secrets
  5. Logging: Add meaningful logs for debugging
  6. Testing: Test functions locally when possible before deployment
  7. Security: Implement authentication/authorization for HTTP access
  8. Performance: Optimize cold start time, use connection pooling for databases
  9. Monitoring: Regularly check logs and monitor function performance
  10. Documentation: Document function parameters and return values

HTTP Function Specific Best Practices

  1. Port Configuration: Always listen on port 9000
  2. scf_bootstrap: Ensure correct file permissions and LF line endings
  3. Health Check: Add /health endpoint for monitoring
  4. CORS: Configure CORS headers for browser access
  5. Graceful Shutdown: Handle process signals properly
  6. Dependencies: Include node_modules in package or use layers (no auto-install for HTTP Functions)
  7. Timeout: Set appropriate timeout for long-running SSE/WebSocket connections
  8. Error Responses: Return proper HTTP status codes and error messages

Choosing Between Event and HTTP Functions

ScenarioRecommended Type
SDK/Mini Program callsEvent Function
Scheduled tasks (cron)Event Function
REST API / Web servicesHTTP Function
SSE streaming (AI chat)HTTP Function
WebSocket real-timeHTTP Function
File upload/downloadHTTP Function
Multi-language supportHTTP Function

Related Skills

  • cloudrun-development - For container-based backend services
  • http-api - For HTTP API invocation patterns
  • cloudbase-platform - For general CloudBase platform knowledge

平台分布

Claude Code

26.86%
按下载量换算83

Antigravity

24.74%
按下载量换算76

Codex

18.32%
按下载量换算57

trae

13.54%
按下载量换算42

OpenCode

7.31%
按下载量换算23

Gemini CLI

3.56%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills