@ant-design/cli 6.4.3 → 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 +145 -5
- package/README.zh-CN.md +130 -3
- package/data/bug-versions.json.gz +0 -0
- package/data/design-v6.md +288 -0
- package/data/v3.26.20.json.gz +0 -0
- package/data/v3.json.gz +0 -0
- package/data/v4.0.4.json.gz +0 -0
- package/data/v4.1.5.json.gz +0 -0
- package/data/v4.10.3.json.gz +0 -0
- package/data/v4.11.3.json.gz +0 -0
- package/data/v4.12.3.json.gz +0 -0
- package/data/v4.13.1.json.gz +0 -0
- package/data/v4.14.1.json.gz +0 -0
- package/data/v4.15.6.json.gz +0 -0
- package/data/v4.16.13.json.gz +0 -0
- package/data/v4.17.4.json.gz +0 -0
- package/data/v4.18.9.json.gz +0 -0
- package/data/v4.19.5.json.gz +0 -0
- package/data/v4.2.5.json.gz +0 -0
- package/data/v4.20.7.json.gz +0 -0
- package/data/v4.21.7.json.gz +0 -0
- package/data/v4.22.8.json.gz +0 -0
- package/data/v4.23.6.json.gz +0 -0
- package/data/v4.24.16.json.gz +0 -0
- package/data/v4.3.5.json.gz +0 -0
- package/data/v4.4.3.json.gz +0 -0
- package/data/v4.5.4.json.gz +0 -0
- package/data/v4.6.6.json.gz +0 -0
- package/data/v4.7.3.json.gz +0 -0
- package/data/v4.8.6.json.gz +0 -0
- package/data/v4.9.4.json.gz +0 -0
- package/data/v4.json.gz +0 -0
- package/data/v5.0.7.json.gz +0 -0
- package/data/v5.1.7.json.gz +0 -0
- package/data/v5.10.3.json.gz +0 -0
- package/data/v5.11.5.json.gz +0 -0
- package/data/v5.12.8.json.gz +0 -0
- package/data/v5.13.3.json.gz +0 -0
- package/data/v5.14.2.json.gz +0 -0
- package/data/v5.15.4.json.gz +0 -0
- package/data/v5.16.5.json.gz +0 -0
- package/data/v5.17.4.json.gz +0 -0
- package/data/v5.18.3.json.gz +0 -0
- package/data/v5.19.4.json.gz +0 -0
- package/data/v5.2.3.json.gz +0 -0
- package/data/v5.20.6.json.gz +0 -0
- package/data/v5.21.6.json.gz +0 -0
- package/data/v5.22.7.json.gz +0 -0
- package/data/v5.23.4.json.gz +0 -0
- package/data/v5.24.9.json.gz +0 -0
- package/data/v5.25.4.json.gz +0 -0
- package/data/v5.26.7.json.gz +0 -0
- package/data/v5.27.6.json.gz +0 -0
- package/data/v5.28.1.json.gz +0 -0
- package/data/v5.29.3.json.gz +0 -0
- package/data/v5.3.3.json.gz +0 -0
- package/data/v5.4.7.json.gz +0 -0
- package/data/v5.5.2.json.gz +0 -0
- package/data/v5.6.4.json.gz +0 -0
- package/data/v5.7.3.json.gz +0 -0
- package/data/v5.8.6.json.gz +0 -0
- package/data/v5.9.4.json.gz +0 -0
- package/data/v5.json.gz +0 -0
- package/data/v6.0.1.json.gz +0 -0
- package/data/v6.1.4.json.gz +0 -0
- package/data/v6.2.3.json.gz +0 -0
- package/data/v6.3.7.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 +19694 -18391
- package/package.json +7 -8
- package/skills/antd/SKILL.md +18 -3
- package/data/v6.4.3.json.gz +0 -0
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="Ant Design" width="72">
|
|
6
6
|
|
|
7
|
-
<h1
|
|
7
|
+
<h1>Ant Design CLI</h1>
|
|
8
8
|
|
|
9
9
|
**Ant Design on your command line.**<br>
|
|
10
10
|
Query component knowledge, analyze project usage, and guide migrations — fully offline.
|
|
@@ -41,8 +41,8 @@ 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
|
-
- 🧩 **
|
|
45
|
-
- 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude
|
|
44
|
+
- 🧩 **18 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
|
|
45
|
+
- 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude Code, Cursor, VS Code, etc.).
|
|
46
46
|
|
|
47
47
|
<br>
|
|
48
48
|
|
|
@@ -84,6 +84,19 @@ Works with [Claude Code](https://claude.ai/code), [Cursor](https://cursor.sh), [
|
|
|
84
84
|
|
|
85
85
|
For IDEs that support [Model Context Protocol](https://modelcontextprotocol.io), the CLI can run as an MCP server:
|
|
86
86
|
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"mcpServers": {
|
|
90
|
+
"antd": {
|
|
91
|
+
"command": "npx",
|
|
92
|
+
"args": ["-y", "@ant-design/cli", "mcp"]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Or if you have the CLI installed globally (`npm i -g @ant-design/cli`):
|
|
99
|
+
|
|
87
100
|
```json
|
|
88
101
|
{
|
|
89
102
|
"mcpServers": {
|
|
@@ -97,7 +110,7 @@ For IDEs that support [Model Context Protocol](https://modelcontextprotocol.io),
|
|
|
97
110
|
|
|
98
111
|
To pin a specific antd version, add `"--version", "5.20.0"` to the `args` array.
|
|
99
112
|
|
|
100
|
-
This exposes
|
|
113
|
+
This exposes 8 tools (`antd_list`, `antd_info`, `antd_doc`, `antd_demo`, `antd_token`, `antd_design_md`, `antd_semantic`, `antd_changelog`) and 2 prompts (`antd-expert`, `antd-page-generator`) for native IDE integration.
|
|
101
114
|
|
|
102
115
|
<br>
|
|
103
116
|
|
|
@@ -109,6 +122,7 @@ antd info Button # Component props, types, defaults
|
|
|
109
122
|
antd doc Button # Full markdown documentation
|
|
110
123
|
antd demo Select basic # Runnable demo source code
|
|
111
124
|
antd token DatePicker # Design Token values (v5+)
|
|
125
|
+
antd design.md # Design-language document (design.md)
|
|
112
126
|
antd semantic Table # classNames / styles structure
|
|
113
127
|
antd changelog 4.24.0 5.0.0 Select # API diff across versions
|
|
114
128
|
antd doctor # Diagnose project issues
|
|
@@ -117,6 +131,9 @@ antd usage ./src # Analyze antd imports in project
|
|
|
117
131
|
antd lint ./src # Check deprecated APIs & best practices
|
|
118
132
|
antd migrate 3 4 # v3 → v4 migration guide
|
|
119
133
|
antd migrate 4 5 --apply ./src # Agent-ready migration prompt
|
|
134
|
+
antd mcp # Start MCP server for IDE integration
|
|
135
|
+
antd setup --client claude # Set up MCP/Skill for AI agents
|
|
136
|
+
antd upgrade # Upgrade CLI to latest version
|
|
120
137
|
```
|
|
121
138
|
|
|
122
139
|
<br>
|
|
@@ -132,6 +149,7 @@ antd migrate 4 5 --apply ./src # Agent-ready migration prompt
|
|
|
132
149
|
| [`antd doc <Component>`](#antd-doc-component) | Full markdown documentation for a component |
|
|
133
150
|
| [`antd demo <Component> [name]`](#antd-demo-component-name) | Runnable demo source code (TSX) |
|
|
134
151
|
| [`antd token [Component]`](#antd-token-component) | Global or component-level Design Tokens |
|
|
152
|
+
| [`antd design.md`](#antd-designmd) | Design-language document (`design.md`) for AI design tools |
|
|
135
153
|
| [`antd semantic <Component>`](#antd-semantic-component) | Semantic `classNames` / `styles` structure with usage examples |
|
|
136
154
|
| [`antd changelog`](#antd-changelog-v1-v2-component) | Changelog entries, version ranges, or cross-version API diff |
|
|
137
155
|
|
|
@@ -152,6 +170,14 @@ antd migrate 4 5 --apply ./src # Agent-ready migration prompt
|
|
|
152
170
|
| [`antd bug`](#antd-bug) | File a bug to ant-design/ant-design with auto-collected environment info |
|
|
153
171
|
| [`antd bug-cli`](#antd-bug-cli) | File a bug to ant-design/ant-design-cli |
|
|
154
172
|
|
|
173
|
+
### 🔧 CLI Management
|
|
174
|
+
|
|
175
|
+
| Command | Description |
|
|
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 |
|
|
179
|
+
| [`antd upgrade`](#antd-upgrade) | Upgrade the CLI to the latest version |
|
|
180
|
+
|
|
155
181
|
<br>
|
|
156
182
|
|
|
157
183
|
---
|
|
@@ -233,6 +259,18 @@ antd token # global tokens (colorPrimary, borderRadius,
|
|
|
233
259
|
antd token Button # component-level tokens
|
|
234
260
|
```
|
|
235
261
|
|
|
262
|
+
### `antd design.md`
|
|
263
|
+
|
|
264
|
+
Output the antd **design-language document** (`design.md`) — a curated description of antd's default light theme, conformant with the [google-labs-code/design.md](https://github.com/google-labs-code/design.md) spec. Where `antd token` lists individual token names, `antd design.md` describes the design language as a whole (color/typography/spacing/radius values plus the principles behind them), so AI design tools (Figma Make, Stitch, etc.) and agents can consume antd's design language directly.
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
antd design.md # design.md for the detected version
|
|
268
|
+
antd design.md --version 6.4.0 # design.md for a specific version
|
|
269
|
+
antd design.md --format json # { doc }
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
`design.md` is **major-grained** (antd rewrites it only across major releases), so it is resolved by major version. A `design.md` is currently published only for **antd v6** — requesting a major without one (v3/v4/v5) returns `UNSUPPORTED_VERSION_FEATURE`. It mirrors the canonical `DESIGN.md` published at [`https://ant.design/design.md`](https://ant.design/design.md).
|
|
273
|
+
|
|
236
274
|
### `antd semantic <Component>`
|
|
237
275
|
|
|
238
276
|
```bash
|
|
@@ -271,7 +309,7 @@ antd changelog 4.24.0 5.0.0 Select # API diff for Select only
|
|
|
271
309
|
|
|
272
310
|
### `antd doctor`
|
|
273
311
|
|
|
274
|
-
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.
|
|
275
313
|
|
|
276
314
|
```bash
|
|
277
315
|
antd doctor
|
|
@@ -389,6 +427,108 @@ antd bug-cli --title "info command crashes on v4"
|
|
|
389
427
|
antd bug-cli --title "..." --submit
|
|
390
428
|
```
|
|
391
429
|
|
|
430
|
+
### `antd mcp`
|
|
431
|
+
|
|
432
|
+
Start an MCP (Model Context Protocol) stdio server for IDE agent integration. Exposes 8 tools and 2 prompts for native IDE integration (Claude Code, Cursor, VS Code, Codex, etc.).
|
|
433
|
+
|
|
434
|
+
```bash
|
|
435
|
+
antd mcp # start with auto-detected version
|
|
436
|
+
antd mcp --version 5.20.0 --lang zh # pin version and language
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Configuration:
|
|
440
|
+
|
|
441
|
+
```json
|
|
442
|
+
{
|
|
443
|
+
"mcpServers": {
|
|
444
|
+
"antd": {
|
|
445
|
+
"command": "npx",
|
|
446
|
+
"args": ["-y", "@ant-design/cli", "mcp"]
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
**MCP Tools (8):** `antd_list`, `antd_info`, `antd_doc`, `antd_demo`, `antd_token`, `antd_design_md`, `antd_semantic`, `antd_changelog`
|
|
453
|
+
|
|
454
|
+
**MCP Prompts (2):** `antd-expert`, `antd-page-generator`
|
|
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
|
+
|
|
512
|
+
### `antd upgrade`
|
|
513
|
+
|
|
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.
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
antd upgrade # upgrade to latest version
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
<details>
|
|
521
|
+
<summary>Example output</summary>
|
|
522
|
+
|
|
523
|
+
```text
|
|
524
|
+
Upgrading @ant-design/cli: v6.4.3 → v6.4.4
|
|
525
|
+
Running: npm install -g @ant-design/cli@latest
|
|
526
|
+
... (passthrough package manager output) ...
|
|
527
|
+
Successfully upgraded to v6.4.4
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
</details>
|
|
531
|
+
|
|
392
532
|
<br>
|
|
393
533
|
|
|
394
534
|
## ⚙️ Global Flags
|
package/README.zh-CN.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
<img src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" alt="Ant Design" width="72">
|
|
6
6
|
|
|
7
|
-
<h1
|
|
7
|
+
<h1>Ant Design CLI</h1>
|
|
8
8
|
|
|
9
9
|
**命令行上的 Ant Design。**<br>
|
|
10
10
|
查询组件知识、分析项目用量、指导版本迁移 — 完全离线。
|
|
@@ -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>
|
|
@@ -95,7 +95,7 @@ Agent 会自动完成 `npm install`、`npx skills add`,并开始使用 CLI。
|
|
|
95
95
|
|
|
96
96
|
如需固定 antd 版本,在 `args` 数组中添加 `"--version", "5.20.0"`。
|
|
97
97
|
|
|
98
|
-
提供
|
|
98
|
+
提供 8 个工具(`antd_list`、`antd_info`、`antd_doc`、`antd_demo`、`antd_token`、`antd_design_md`、`antd_semantic`、`antd_changelog`)和 2 个提示词(`antd-expert`、`antd-page-generator`)。
|
|
99
99
|
|
|
100
100
|
支持 [Claude Code](https://claude.ai/code)、[Cursor](https://cursor.sh)、[Codex](https://openai.com/codex)、[Gemini CLI](https://github.com/google-gemini/gemini-cli) 等所有兼容 [skills](https://github.com/nicepkg/agent-skills) 协议的 Agent。
|
|
101
101
|
|
|
@@ -109,6 +109,7 @@ antd info Button # 组件 Props、类型、默认值
|
|
|
109
109
|
antd doc Button # 完整 Markdown 文档
|
|
110
110
|
antd demo Select basic # 可运行的 Demo 源码
|
|
111
111
|
antd token DatePicker # Design Token 值(v5+)
|
|
112
|
+
antd design.md # 设计语言文档(design.md)
|
|
112
113
|
antd semantic Table # classNames / styles 结构
|
|
113
114
|
antd changelog 4.24.0 5.0.0 Select # 跨版本 API 差异对比
|
|
114
115
|
antd doctor # 诊断项目配置问题
|
|
@@ -117,6 +118,9 @@ antd usage ./src # 分析项目中的 antd 导入
|
|
|
117
118
|
antd lint ./src # 检查废弃 API 和最佳实践
|
|
118
119
|
antd migrate 3 4 # v3 → v4 迁移指南
|
|
119
120
|
antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
|
|
121
|
+
antd mcp # 启动 MCP 服务,供 IDE 集成
|
|
122
|
+
antd setup --client claude # 为 AI Agent 接入 MCP/Skill
|
|
123
|
+
antd upgrade # 升级 CLI 到最新版本
|
|
120
124
|
```
|
|
121
125
|
|
|
122
126
|
<br>
|
|
@@ -132,6 +136,7 @@ antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
|
|
|
132
136
|
| [`antd doc <Component>`](#antd-doc-component) | 组件完整 Markdown 文档 |
|
|
133
137
|
| [`antd demo <Component> [name]`](#antd-demo-component-name) | 可运行的 Demo 源码(TSX) |
|
|
134
138
|
| [`antd token [Component]`](#antd-token-component) | 全局或组件级 Design Token |
|
|
139
|
+
| [`antd design.md`](#antd-designmd) | 设计语言文档(`design.md`),供 AI 设计工具消费 |
|
|
135
140
|
| [`antd semantic <Component>`](#antd-semantic-component) | 语义化 `classNames` / `styles` 结构及用法示例 |
|
|
136
141
|
| [`antd changelog`](#antd-changelog-v1-v2-component) | Changelog 条目、版本范围或跨版本 API 对比 |
|
|
137
142
|
|
|
@@ -152,6 +157,14 @@ antd migrate 4 5 --apply ./src # 生成 Agent 迁移提示
|
|
|
152
157
|
| [`antd bug`](#antd-bug) | 向 ant-design/ant-design 报告 Bug,自动收集环境信息 |
|
|
153
158
|
| [`antd bug-cli`](#antd-bug-cli) | 向 ant-design/ant-design-cli 报告 Bug |
|
|
154
159
|
|
|
160
|
+
### 🔧 CLI 管理
|
|
161
|
+
|
|
162
|
+
| 命令 | 说明 |
|
|
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 |
|
|
166
|
+
| [`antd upgrade`](#antd-upgrade) | 升级 CLI 到最新版本 |
|
|
167
|
+
|
|
155
168
|
<br>
|
|
156
169
|
|
|
157
170
|
---
|
|
@@ -233,6 +246,18 @@ antd token # 全局 Token(colorPrimary、borderRadius
|
|
|
233
246
|
antd token Button # 组件级 Token
|
|
234
247
|
```
|
|
235
248
|
|
|
249
|
+
### `antd design.md`
|
|
250
|
+
|
|
251
|
+
输出 antd **设计语言文档**(`design.md`)—— 对 antd 默认 Light 主题的精心编写的描述,遵循 [google-labs-code/design.md](https://github.com/google-labs-code/design.md) 规范。`antd token` 列举单个 Token 名称,而 `antd design.md` 整体描述设计语言(颜色 / 字体 / 间距 / 圆角的取值及其背后的设计原则),可被 AI 设计工具(Figma Make、Stitch 等)和 Agent 直接消费。
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
antd design.md # 输出当前检测版本的 design.md
|
|
255
|
+
antd design.md --version 6.4.0 # 指定版本的 design.md
|
|
256
|
+
antd design.md --format json # { doc }
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
`design.md` 按**大版本**区分(antd 只在大版本升级时重写它),因此按 major 解析。目前**仅 antd v6** 提供 `design.md` —— 查询没有该文档的大版本(v3/v4/v5)会返回 `UNSUPPORTED_VERSION_FEATURE`。它与发布在 [`https://ant.design/design.md`](https://ant.design/design.md) 的官方 `DESIGN.md` 保持一致。
|
|
260
|
+
|
|
236
261
|
### `antd semantic <Component>`
|
|
237
262
|
|
|
238
263
|
```bash
|
|
@@ -389,6 +414,108 @@ antd bug-cli --title "info 命令在 v4 组件上崩溃"
|
|
|
389
414
|
antd bug-cli --title "..." --submit
|
|
390
415
|
```
|
|
391
416
|
|
|
417
|
+
### `antd mcp`
|
|
418
|
+
|
|
419
|
+
启动 MCP(Model Context Protocol)stdio 服务,供 IDE Agent 集成。提供 8 个工具和 2 个提示词,支持 Claude Desktop、Cursor 等 IDE 原生集成。
|
|
420
|
+
|
|
421
|
+
```bash
|
|
422
|
+
antd mcp # 使用自动检测的版本启动
|
|
423
|
+
antd mcp --version 5.20.0 --lang zh # 指定版本和语言
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
IDE 配置(`claude_desktop_config.json`):
|
|
427
|
+
|
|
428
|
+
```json
|
|
429
|
+
{
|
|
430
|
+
"mcpServers": {
|
|
431
|
+
"antd": {
|
|
432
|
+
"command": "antd",
|
|
433
|
+
"args": ["mcp"]
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
**MCP 工具(8 个):** `antd_list`、`antd_info`、`antd_doc`、`antd_demo`、`antd_token`、`antd_design_md`、`antd_semantic`、`antd_changelog`
|
|
440
|
+
|
|
441
|
+
**MCP 提示词(2 个):** `antd-expert`、`antd-page-generator`
|
|
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
|
+
|
|
499
|
+
### `antd upgrade`
|
|
500
|
+
|
|
501
|
+
升级 CLI 自身到 npm 上发布的最新版本。自动检测安装 CLI 的包管理器(npm、yarn、pnpm、bun、cnpm、utoo)并执行对应的升级命令。
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
antd upgrade # 升级到最新版本
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
<details>
|
|
508
|
+
<summary>示例输出</summary>
|
|
509
|
+
|
|
510
|
+
```text
|
|
511
|
+
正在升级 @ant-design/cli: v6.4.3 → v6.4.4
|
|
512
|
+
执行: npm install -g @ant-design/cli@latest
|
|
513
|
+
... (包管理器输出透传) ...
|
|
514
|
+
成功升级到 v6.4.4
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
</details>
|
|
518
|
+
|
|
392
519
|
<br>
|
|
393
520
|
|
|
394
521
|
## ⚙️ 全局参数
|
|
Binary file
|