cloudbase-init

cloudbase-init is a command for Claude Code from TencentCloudBase/CloudBase-AI-Toolkit. It costs 30 tokens per session (1,778 once invoked), scanned A, original, MIT.

A setup command for starting a new Tencent CloudBase project from a template. It selects a project type, downloads the matching files, chooses a CloudBase environment, and creates the project configuration.

In plain words
What is it for?
Use it to initialize a web project, WeChat mini-program, or CloudBase Run service, generate `cloudbaserc.json`, and receive next-step guidance for the selected setup.
Why use it?
Starting with the right template and environment configuration avoids manual setup mistakes. The command also checks whether the target directory is empty and explains the risk of copying into an existing project.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: names the AskUserQuestion tool.

Part of the cloudbase plugin — 4 commands, 2 agents shipped together

Good fit Use it to initialize a web project, WeChat mini-program, or CloudBase Run service, generate cloudbaserc.json, and receive next-step guidance for the selected setup.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init
About the project

CloudBase AI Toolkit is an integration layer that lets AI coding tools use Tencent CloudBase as an application backend, including databases, authentication, functions, storage, and deployments. Developers use it to have coding agents build and operate CloudBase-backed applications through skills, plugins, commands, and chat-accessible tools. The catalogue entries are the toolkit’s own skills, agents, hooks, plugins, rules, instructions, and MCP tools.

TencentCloudBase/CloudBase-AI-Toolkit · 1,138 stars · on GitHub · docs.cloudbase.net

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/TencentCloudBase/CloudBase-AI-Toolkit

Made for: Claude Code.

Or install cloudbase, the plugin that ships this one along with the rest of its 4 commands, 2 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cloudbase-init

README.md
[![agentmods](https://agentmods.dev/badge/commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init/github.svg)](https://agentmods.dev/commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init)
Your own site
<a href="https://agentmods.dev/commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init"><img src="https://agentmods.dev/badge/commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cloudbase-init

Your own site · 80×15
<a href="https://agentmods.dev/commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init"><img src="https://agentmods.dev/badge/commands/tencentcloudbase/cloudbase-ai-toolkit/cloudbase-init.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,778 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00030 $0.01778
Opus 5.5 $0.00012 $0.00711
Sonnet 5.5 $0.00006 $0.00356
Haiku 4.5 $0.00003 $0.00178

Measured 1mo ago against content hash e133802a1aa2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cloudbase-init scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/cloudbase/commands/cloudbase-init.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

初始化 CloudBase 项目

为新项目下载 CloudBase 模板、配置环境 ID、生成 cloudbaserc.json,并按场景类型给出后续指引。适合从零开始的项目。

Preflight

运行以下检查,失败时停止并给出可执行指引。

  1. MCP 连接检查 — 确认 cloudbase-mcp server 已连接。

    • 调用 queryEnv({action:"list"}) 验证连接。若失败,提示用户完成授权。
  2. 目录空检查 — 检查当前工作目录是否为空(或仅包含 .git 等无关文件)。

    • 若目录非空:提示用户当前目录已有文件,模板可能覆盖现有文件。询问是否切换到新目录或继续。
    • 推荐做法:创建新子目录(如 mkdir my-cloudbase-app && cd my-cloudbase-app)。
  3. 场景选择 — 使用 AskUserQuestion 工具让用户选择项目场景:

    场景 模板类型 说明
    Web 项目 web React/Vue/原生 JS 前端项目,使用静态托管
    微信小程序 miniprogram 小程序云开发项目,使用云函数 + 数据库
    云托管 cloudrun CloudBase Run 后端服务,支持 Java/Go/Python/Node.js 等
  4. 环境选择 — 若用户有多个环境,调用 queryEnv({action:"list"}) 让用户选择目标环境,用于后续 cloudbaserc.json 配置。

Plan

根据用户选择的场景执行:

  1. 下载模板 — 调用 downloadTemplate 下载对应场景的项目模板。
  2. 复制文件 — 将模板内容复制到当前目录(含隐藏文件,如 .gitignore、.env.example)。
  3. 生成配置 — 使用 queryEnv 获取的 EnvId 生成 cloudbaserc.json。
  4. 小程序场景 — 检查 project.config.json 的 appid 字段,缺失则询问用户。
  5. 生成 README — 生成包含项目结构、CloudBase 资源说明的 README.md。

无破坏性操作(仅创建文件,不修改已有项目),但目录非空时需确认覆盖风险。

Commands

1. 下载模板

根据用户选择的场景调用模板下载:

downloadTemplate({
  templateName: "<scenario-template-name>"
})

模板类型映射:

  • Web 项目 → 对应 web 模板名
  • 微信小程序 → 对应 miniprogram 模板名
  • 云托管 → 对应 cloudrun 模板名

下载完成后,将模板文件复制到当前目录。注意包含隐藏文件(如 .gitignore、.env.example、.editorconfig 等),这些文件对项目正常运行至关重要。

复制脚本示例(当 downloadTemplate 下载到临时目录时):

# 复制所有文件,包括隐藏文件
cp -a /tmp/template/. ./

2. 生成 cloudbaserc.json

使用 queryEnv({action:"info"}) 获取的 EnvId 生成配置文件:

{
  "envId": "<当前环境 ID>",
  "functionRoot": "cloudfunctions",
  "framework": "<框架名>",
  "version": "1.0.0"
}
  • envId — 自动填入查询到的环境 ID,无需用户手动替换
  • functionRoot — 云函数目录路径(小程序/云托管场景)
  • framework — 根据模板类型自动设置

3. 小程序场景检查

若场景为微信小程序,检查 project.config.json 中的 appid 字段:

# 检查 appid 是否已配置
node -e "const c = require('./project.config.json'); console.log(c.appid || 'MISSING')"

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed e133802a1aa2
  2. 1mo ago First seen · 174 lines · 30 tokens per session scan A 3fc14462b3e7

Subscribe to this mod's changes

cloudbase-init is a command published in the GitHub repository TencentCloudBase/CloudBase-AI-Toolkit (1,138 stars, last pushed today), licensed MIT. It adds 30 tokens to every session and 1,778 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.