@ant-design/cli 6.4.4 → 6.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -2
- package/README.zh-CN.md +59 -1
- package/data/bug-versions.json.gz +0 -0
- package/data/v6.4.5.json.gz +0 -0
- package/data/v6.json.gz +0 -0
- package/data/versions.json +1 -1
- package/dist/index.js +16800 -16256
- package/package.json +6 -7
- package/data/v6.4.4.json.gz +0 -0
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ npx skills add ant-design/ant-design-cli # install as an agent skill
|
|
|
41
41
|
- 🤖 **Agent-optimized** — `--format json` on every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.
|
|
42
42
|
- 🌍 **Bilingual** — Every component name, description, and doc has both English and Chinese. Switch with `--lang zh`.
|
|
43
43
|
- 🔮 **Smart matching** — Typo `Buttn`? The CLI suggests `Button` using Levenshtein distance, with first-letter preference.
|
|
44
|
-
- 🧩 **
|
|
44
|
+
- 🧩 **18 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
|
|
45
45
|
- 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude Code, Cursor, VS Code, etc.).
|
|
46
46
|
|
|
47
47
|
<br>
|
|
@@ -132,6 +132,7 @@ antd lint ./src # Check deprecated APIs & best practices
|
|
|
132
132
|
antd migrate 3 4 # v3 → v4 migration guide
|
|
133
133
|
antd migrate 4 5 --apply ./src # Agent-ready migration prompt
|
|
134
134
|
antd mcp # Start MCP server for IDE integration
|
|
135
|
+
antd setup --client claude # Set up MCP/Skill for AI agents
|
|
135
136
|
antd upgrade # Upgrade CLI to latest version
|
|
136
137
|
```
|
|
137
138
|
|
|
@@ -174,6 +175,7 @@ antd upgrade # Upgrade CLI to latest version
|
|
|
174
175
|
| Command | Description |
|
|
175
176
|
|---|---|
|
|
176
177
|
| [`antd mcp`](#antd-mcp) | Start MCP stdio server for IDE agent integration |
|
|
178
|
+
| [`antd setup`](#antd-setup) | Write local MCP config or install skills for Claude Code, Cursor, VS Code, or Codex |
|
|
177
179
|
| [`antd upgrade`](#antd-upgrade) | Upgrade the CLI to the latest version |
|
|
178
180
|
|
|
179
181
|
<br>
|
|
@@ -307,7 +309,7 @@ antd changelog 4.24.0 5.0.0 Select # API diff for Select only
|
|
|
307
309
|
|
|
308
310
|
### `antd doctor`
|
|
309
311
|
|
|
310
|
-
Runs 10 checks against your project: antd installed, React version compat, duplicate antd/dayjs/cssinjs installs, peer dependency satisfaction, theme config, babel-plugin-import usage, and CSS-in-JS setup.
|
|
312
|
+
Runs 10 checks against your project: antd installed and bundled known-bug version data, React version compat, duplicate antd/dayjs/cssinjs installs, peer dependency satisfaction, theme config, babel-plugin-import usage, and CSS-in-JS setup. All checks use bundled/local data and do not make network calls.
|
|
311
313
|
|
|
312
314
|
```bash
|
|
313
315
|
antd doctor
|
|
@@ -451,6 +453,62 @@ Configuration:
|
|
|
451
453
|
|
|
452
454
|
**MCP Prompts (2):** `antd-expert`, `antd-page-generator`
|
|
453
455
|
|
|
456
|
+
### `antd setup`
|
|
457
|
+
|
|
458
|
+
Configure a local AI agent project with Ant Design MCP and/or the bundled `skills/antd` guidance. The command can write the client-specific MCP config file, install a client-appropriate skill or skill reference, and add managed instructions for agents.
|
|
459
|
+
|
|
460
|
+
```bash
|
|
461
|
+
antd setup --client claude # write .mcp.json
|
|
462
|
+
antd setup --client cursor # write .cursor/mcp.json
|
|
463
|
+
antd setup --client vscode # write .vscode/mcp.json
|
|
464
|
+
antd setup --client codex # install Codex project skill
|
|
465
|
+
antd setup --client claude --dry-run # preview without writing files
|
|
466
|
+
antd setup --client claude --project ./my-app
|
|
467
|
+
antd setup --client claude --version 5.29.3 --lang zh
|
|
468
|
+
antd setup --client claude --check # verify existing config
|
|
469
|
+
antd setup --client claude --mode skill # install Claude skill and write instructions
|
|
470
|
+
antd setup --client claude --mode both # write MCP config, install skill, and write instructions
|
|
471
|
+
antd setup --client claude --write-instructions
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
Modes:
|
|
475
|
+
|
|
476
|
+
| Mode | Behavior |
|
|
477
|
+
|---|---|
|
|
478
|
+
| `mcp` | Writes the client MCP config only. This is the default. |
|
|
479
|
+
| `skill` | Installs the bundled Ant Design guidance for the selected client and writes a managed instruction block. |
|
|
480
|
+
| `both` | Writes MCP config, installs the skill or skill reference, and writes the managed instruction block. |
|
|
481
|
+
|
|
482
|
+
Supported clients:
|
|
483
|
+
|
|
484
|
+
| Client | Config file | Server key | Skill target | Instructions file |
|
|
485
|
+
|---|---|---|---|---|
|
|
486
|
+
| `claude` | `.mcp.json` | `mcpServers` | `.claude/skills/antd/` | `CLAUDE.md` |
|
|
487
|
+
| `cursor` | `.cursor/mcp.json` | `mcpServers` | `.agents/skills/antd/` shared skill | `AGENTS.md` |
|
|
488
|
+
| `vscode` | `.vscode/mcp.json` | `servers` | `.agents/skills/antd/` shared skill | `AGENTS.md` |
|
|
489
|
+
| `codex` | - | - | `.agents/skills/antd/` shared skill | `AGENTS.md` |
|
|
490
|
+
|
|
491
|
+
Generated server entry:
|
|
492
|
+
|
|
493
|
+
```json
|
|
494
|
+
{
|
|
495
|
+
"mcpServers": {
|
|
496
|
+
"antd": {
|
|
497
|
+
"command": "npx",
|
|
498
|
+
"args": ["-y", "@ant-design/cli", "mcp", "--version", "5.29.3", "--lang", "zh"]
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
Skill instructions are written to the selected client's instruction file: Claude uses `CLAUDE.md`; Cursor, VS Code, and Codex use `AGENTS.md`. Claude gets a native project skill under `.claude/skills/antd/`; Cursor, VS Code, and Codex get the same bundled guidance under `.agents/skills/antd/` and an instruction block telling agents when to use it.
|
|
505
|
+
|
|
506
|
+
Codex setup currently supports skill installation only. Use `antd setup --client codex --mode skill`, or omit `--mode` because Codex defaults to `skill`.
|
|
507
|
+
|
|
508
|
+
Use `--check` to validate an existing setup without writing files. It exits with code `0` when the selected mode is configured, and `1` when config, skill files, or instructions are missing or different.
|
|
509
|
+
|
|
510
|
+
Use `--write-instructions` with the default `mcp` mode to also add an idempotent managed block to the selected agent instructions file, telling agents to use the configured `antd` MCP server before generating Ant Design code. With `--check`, it also verifies that instruction block.
|
|
511
|
+
|
|
454
512
|
### `antd upgrade`
|
|
455
513
|
|
|
456
514
|
Upgrade the CLI itself to the latest version published on npm. Automatically detects which package manager installed the CLI (npm, yarn, pnpm, bun, cnpm, utoo) and runs the corresponding upgrade command.
|
package/README.zh-CN.md
CHANGED
|
@@ -41,7 +41,7 @@ npx skills add ant-design/ant-design-cli # 安装为 Agent Skill
|
|
|
41
41
|
- 🤖 **Agent 优化** — 所有命令支持 `--format json`。结构化错误码与修复建议。stdout/stderr 严格分离。
|
|
42
42
|
- 🌍 **双语输出** — 每个组件名、描述和文档均有中英文。通过 `--lang zh` 切换。
|
|
43
43
|
- 🔮 **智能纠错** — 输入 `Buttn`?CLI 基于 Levenshtein 距离建议 `Button`,优先匹配首字母相同的候选。
|
|
44
|
-
- 🧩 **
|
|
44
|
+
- 🧩 **18 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。
|
|
45
45
|
- 🔌 **MCP 服务** — `antd mcp` 启动 stdio 服务,原生集成 Claude Desktop、Cursor 等 IDE。
|
|
46
46
|
|
|
47
47
|
<br>
|
|
@@ -119,6 +119,7 @@ antd lint ./src # 检查废弃 API 和最佳实践
|
|
|
119
119
|
antd migrate 3 4 # v3 → v4 迁移指南
|
|
120
120
|
antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
|
|
121
121
|
antd mcp # 启动 MCP 服务,供 IDE 集成
|
|
122
|
+
antd setup --client claude # 为 AI Agent 接入 MCP/Skill
|
|
122
123
|
antd upgrade # 升级 CLI 到最新版本
|
|
123
124
|
```
|
|
124
125
|
|
|
@@ -161,6 +162,7 @@ antd upgrade # 升级 CLI 到最新版本
|
|
|
161
162
|
| 命令 | 说明 |
|
|
162
163
|
|---|---|
|
|
163
164
|
| [`antd mcp`](#antd-mcp) | 启动 MCP stdio 服务,供 IDE Agent 集成 |
|
|
165
|
+
| [`antd setup`](#antd-setup) | 为 Claude Code、Cursor、VS Code 或 Codex 接入 Ant Design MCP/Skill |
|
|
164
166
|
| [`antd upgrade`](#antd-upgrade) | 升级 CLI 到最新版本 |
|
|
165
167
|
|
|
166
168
|
<br>
|
|
@@ -438,6 +440,62 @@ IDE 配置(`claude_desktop_config.json`):
|
|
|
438
440
|
|
|
439
441
|
**MCP 提示词(2 个):** `antd-expert`、`antd-page-generator`
|
|
440
442
|
|
|
443
|
+
### `antd setup`
|
|
444
|
+
|
|
445
|
+
为本地 AI Agent 项目接入 Ant Design MCP 和/或内置的 `skills/antd` 指南。该命令可以写入对应客户端的 MCP 配置、安装适配客户端的技能或技能参考,并为 Agent 写入托管指令。
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
antd setup --client claude # 写入 .mcp.json
|
|
449
|
+
antd setup --client cursor # 写入 .cursor/mcp.json
|
|
450
|
+
antd setup --client vscode # 写入 .vscode/mcp.json
|
|
451
|
+
antd setup --client codex # 安装 Codex 项目技能
|
|
452
|
+
antd setup --client claude --dry-run # 预览配置,不写入文件
|
|
453
|
+
antd setup --client claude --project ./my-app
|
|
454
|
+
antd setup --client claude --version 5.29.3 --lang zh
|
|
455
|
+
antd setup --client claude --check # 校验已有配置
|
|
456
|
+
antd setup --client claude --mode skill # 安装 Claude 技能并写入指令
|
|
457
|
+
antd setup --client claude --mode both # 写入 MCP 配置、安装技能并写入指令
|
|
458
|
+
antd setup --client claude --write-instructions
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
模式:
|
|
462
|
+
|
|
463
|
+
| 模式 | 行为 |
|
|
464
|
+
|---|---|
|
|
465
|
+
| `mcp` | 只写入客户端 MCP 配置。这是默认模式。 |
|
|
466
|
+
| `skill` | 为所选客户端安装内置 Ant Design 指南,并写入托管指令。 |
|
|
467
|
+
| `both` | 写入 MCP 配置、安装技能或技能参考,并写入托管指令。 |
|
|
468
|
+
|
|
469
|
+
支持的客户端:
|
|
470
|
+
|
|
471
|
+
| 客户端 | 配置文件 | 服务字段 | 技能位置 | 指令文件 |
|
|
472
|
+
|---|---|---|---|---|
|
|
473
|
+
| `claude` | `.mcp.json` | `mcpServers` | `.claude/skills/antd/` | `CLAUDE.md` |
|
|
474
|
+
| `cursor` | `.cursor/mcp.json` | `mcpServers` | `.agents/skills/antd/` 共享技能 | `AGENTS.md` |
|
|
475
|
+
| `vscode` | `.vscode/mcp.json` | `servers` | `.agents/skills/antd/` 共享技能 | `AGENTS.md` |
|
|
476
|
+
| `codex` | - | - | `.agents/skills/antd/` 共享技能 | `AGENTS.md` |
|
|
477
|
+
|
|
478
|
+
生成的服务项:
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{
|
|
482
|
+
"mcpServers": {
|
|
483
|
+
"antd": {
|
|
484
|
+
"command": "npx",
|
|
485
|
+
"args": ["-y", "@ant-design/cli", "mcp", "--version", "5.29.3", "--lang", "zh"]
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
技能指令会写入所选客户端对应的指令文件:Claude 使用 `CLAUDE.md`,Cursor、VS Code 和 Codex 使用 `AGENTS.md`。Claude 会获得 `.claude/skills/antd/` 下的项目级原生技能;Cursor、VS Code 和 Codex 会获得同一份 `.agents/skills/antd/` 共享技能,并通过指令区块告诉 Agent 何时使用。
|
|
492
|
+
|
|
493
|
+
Codex setup 目前只支持技能安装。请使用 `antd setup --client codex --mode skill`,也可以省略 `--mode`,因为 Codex 默认使用 `skill` 模式。
|
|
494
|
+
|
|
495
|
+
使用 `--check` 可以只校验已有配置,不写入文件。当所选模式已正确配置时退出码为 `0`,配置、技能文件或指令缺失/不一致时退出码为 `1`。
|
|
496
|
+
|
|
497
|
+
在默认 `mcp` 模式下使用 `--write-instructions`,可以额外向选中的 Agent 指令文件写入一个可重复更新的托管区块,提示 Agent 在生成 Ant Design 代码前优先使用已配置的 `antd` MCP 服务。与 `--check` 一起使用时,也会校验该指令区块。
|
|
498
|
+
|
|
441
499
|
### `antd upgrade`
|
|
442
500
|
|
|
443
501
|
升级 CLI 自身到 npm 上发布的最新版本。自动检测安装 CLI 的包管理器(npm、yarn、pnpm、bun、cnpm、utoo)并执行对应的升级命令。
|
|
Binary file
|
|
Binary file
|
package/data/v6.json.gz
CHANGED
|
Binary file
|