@bettercms-ai/install

中文文档
0.5.0发布于 2026/11/05MITES Module近 30 天下载 5572

Install BetterCMS agent skills into Claude Code, Cursor, Codex and other coding agents. Offline, receipt-driven, and it removes only what it wrote.

原始使用文档
文档目录6 节
  1. Why this installer
  2. Options
  3. What gets written where
  4. Receipts, upgrades, uninstall
  5. --mcp
  6. Development

@bettercms-ai/install

Installs the BetterCMS agent skills into the coding agents on your machine.

npx @bettercms-ai/install

In a terminal it asks at most two things, each with the likely answer already picked, so pressing Enter through it is a normal install:

┌  BetterCMS agent setup v0.4.44
│
◇  Where do you want to install the BetterCMS skills?
│  Globally
│
◇  Configure BetterCMS MCP and agent skills for these editors?
│  Claude Code, Codex CLI, Cursor, Zed
│
◆  MCP configured for Claude Code, Codex CLI, Cursor and Zed
│
◆  BetterCMS agent skills installed (24):
│    ~/.claude/skills  24 installed
│      Claude Code /bettercms
│    ~/.codex/skills  24 installed
│      Codex CLI $bettercms
│    ~/.cursor/skills  24 installed
│      Cursor /bettercms
│
└  Restart Claude Code, Codex CLI, Cursor and Zed and type "set up BetterCMS for this site" in the chat.
  • Where: "This project" is offered first inside a project (a folder with package.json, .git or an agent folder). A project with no agent folder yet gets the agents you have installed, and their folders are created. In your home directory, "Globally" is offered first.
  • Editors: one question covers both the skills and the MCP. Claude Code, Codex CLI, Cursor, VS Code and Zed are always offered; the ones found on your machine are ticked. Untested agents are listed when installed, and labelled.
  • Skills: all of them. Name skill ids as arguments to install fewer.
  • MCP: the hosted BetterCMS MCP goes into each editor's user-level config (--no-mcp skips it). It never overwrites an existing bettercms entry and never writes a credential. You sign in the first time your agent uses it.

Scripted, the same install is:

npx @bettercms-ai/install --global          # every detected agent, in your home directory
npx @bettercms-ai/install --project -y      # agent folders inside the current project
npx @bettercms-ai/install -g --agents claude,cursor,vscode,zed --mcp

Why this installer

  • Offline. The skills ship inside the package. Installing makes no network request and needs no account or token.
  • Knows what it wrote. A receipt lists every file with its sha256, so a re-run reports unchanged instead of rewriting, an upgrade prunes what a new version dropped, and --remove deletes exactly what it wrote and nothing else.
  • Shows before it writes. The guided flow lists every folder and config it will touch; --dry-run does the same in a script.

Options

OptionMeaning
[skill-ids...]Install only these skills, by id (bettercms, bettercms-migrate, bettercms-abm); the ids are the folders under packages/skills. The default is all three.
--global, -gUse the agent roots under your home directory.
--projectUse the agent roots under the current directory.
--agents a,bChoose the agents. By default, every agent whose directory already exists is used.
--mcpAlso register the BetterCMS MCP server (see below).
--api <rung|url>The API that --mcp points at: prod (default), dev, local, or a full https:// URL. Any other value exits 2.
--removeDelete what an earlier install wrote. Removes every skill, or only the ids you give.
-y, --yesSkip the confirmation prompt.
--dry-runPrint the outcome lines without writing anything.

Without a terminal (CI, a pipe) or with -y, nothing is asked. With no --global or --project, a project folder (one with an agent folder, or a package.json or .git while some agent is installed for you) means --project; anywhere else the command exits 2 rather than guessing. -y never connects the MCP: that takes --mcp.

In a scripted run, each agent/skill pair prints one line: installed, updated, unchanged, removed, exists-unmanaged, skipped: <reason> or failed: <reason>. exists-unmanaged means a bettercms-<id> folder is already there and no receipt lists it. The installer writes nothing into that folder and carries on with the other skills. The exit code is 0 when nothing failed, 1 when anything failed or was exists-unmanaged, and 2 for a usage error. A build with no skills bundled also exits 2.

What gets written where

Each skill is copied to <root>/bettercms-<id>/. Skill ids that already start with bettercms- keep their name as is.

Agent--global root--project rootTested
Claude Code~/.claude/skills.claude/skillsyes
Codex CLI~/.codex/skills.agents/skillsyes
Cursor~/.cursor/skills.agents/skillsyes
VS Code (Copilot)~/.copilot/skills.agents/skillsyes
Zed(no skills folder: MCP only)yes
Amp~/.config/amp/skills.agents/skillsno
Gemini CLI~/.gemini/skills.agents/skillsno
OpenCode~/.config/opencode/skills.agents/skillsno
Pi~/.pi/agent/skills.pi/skillsno
Antigravity~/.gemini/antigravity/skills.gemini/antigravity/skillsno
Windsurf~/.codeium/windsurf/memories/global_rules.md.windsurf/rules/bettercms-<id>.mdno

Project roots follow vercel-labs/skills: the agents that read the shared .agents/skills get one copy there, not one each.

"Untested" means the root follows the convention other skill installers use, but nobody has checked that the agent actually loads skills from it. These rows are marked with * in the output.

Windsurf has no skills folder:

  • Global: each skill's SKILL.md body goes into global_rules.md between <!-- bettercms:<id>:begin v=<version> --> and <!-- bettercms:<id>:end -->. A re-run replaces the whole block, so you never end up with two copies. Anything you wrote outside the markers stays as it was.
  • Project: each skill becomes one rule file.

In both cases only SKILL.md is carried over. Reference files are not.

Without --mcp, the installer writes only inside the agent roots above.

Receipts, upgrades, uninstall

Each root gets a .bettercms-skills.json receipt. It lists every file the installer wrote, with its sha256.

  • Re-running the same version changes nothing. Files are only written when their bytes differ, and the receipt is only rewritten when its contents change.
  • Upgrading writes the new files. Files the new version no longer ships are deleted, and so are skills that were renamed or retired.
  • --remove deletes exactly the files listed in the receipt, then any directories that left empty, then the receipt entry. The receipt file itself goes once it is empty. Anything not in the receipt is never deleted, including files you added inside a bettercms-* folder.

Before anything is written, the installer checks the bundled manifest and every file hash. Every write and delete path must resolve inside the chosen root, and the installer refuses to go through a symlink below the root.

--mcp

--mcp connects the hosted BetterCMS MCP (https://mcp.bettercms.ai; --api dev uses https://mcp.bettercms.dev, any other API its own /mcp). The entry goes into each editor's user-level config, in that editor's own shape:

EditorWhereEntry
Claude Codeclaude mcp add --transport http -s user bettercms <url> (JSON printed if the claude CLI is not on your PATH)
Codex CLI~/.codex/config.toml[mcp_servers.bettercms] url = "<url>"
Cursor~/.cursor/mcp.jsonmcpServers.bettercms: { url }
VS Code (Copilot)the user mcp.json (~/.config/Code/User, ~/Library/Application Support/Code/User, %APPDATA%\Code\User)servers.bettercms: { type: "http", url }
Zed~/.config/zed/settings.jsoncontext_servers.bettercms: { url }
Gemini CLI~/.gemini/settings.jsonmcpServers.bettercms: { httpUrl }
Other agentsJSON snippet printed

If a bettercms entry already exists, the result is skipped: exists. The installer never overwrites or merges into that entry, and never writes a token or credential. A config file that is not plain JSON (Zed's settings allow comments) is left untouched, and the snippet is printed for you to paste. You sign in on the first tool call, in the browser.

Development

prepack runs scripts/build-manifest.mjs. It copies every packages/skills/<id>/ that contains a SKILL.md into skills/, and writes manifest.json plus .claude-plugin/{plugin.json,marketplace.json}. The build fails on a skill with no name or description, on a symlink, and on any unsafe path. The generated files are gitignored.

bun test test/install.test.js
bun test test/build-manifest.test.js

版本与发布记录

@bettercms-ai/install 共发布 60 个版本,首次发布于 2026/09/16;过去 12 个月发布了 60 个版本。

版本发布日期距今
0.5.0latest2026/11/052 天前
0.4.532026/11/026 天前
0.4.522026/11/017 天前
0.4.512026/10/2811 天前
0.4.502026/10/2712 天前
0.4.492026/10/2712 天前

关于 @bettercms-ai/install 的常见问题

@bettercms-ai/install 是什么?

Install BetterCMS agent skills into Claude Code, Cursor, Codex and other coding agents. Offline, receipt-driven, and it removes only what it wrote.

如何安装 @bettercms-ai/install?

在项目目录运行 npm install @bettercms-ai/install,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 bettercms-install,可以用 npx bettercms-install 直接运行。

@bettercms-ai/install 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bettercms-ai__install 是否存在。

@bettercms-ai/install 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@bettercms-ai/install 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@bettercms-ai/install 可以商用吗?

@bettercms-ai/install 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@bettercms-ai/install 的下载量有多少?

根据 npm 官方下载统计,@bettercms-ai/install 在 2026/10/08 – 2026/11/06 这 30 天内被下载 5,572 次,日均约 186 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@bettercms-ai/install 还在维护吗?

最新版本 0.5.0 发布于 2026/11/05(2 天前);至今共发布 60 个版本,其中过去 12 个月发布了 60 个;首次发布于 2026/09/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。