@ant-design/cli
Advanced tools
Sorry, the diff of this file is not supported yet
@@ -62,3 +62,3 @@ { | ||
| "v6": { | ||
| "6.3": "6.3.4", | ||
| "6.3": "6.3.5", | ||
| "6.0": "6.0.1", | ||
@@ -65,0 +65,0 @@ "6.1": "6.1.4", |
+5
-3
| { | ||
| "name": "@ant-design/cli", | ||
| "version": "6.3.5-beta.0", | ||
| "version": "6.3.5", | ||
| "description": "CLI tool for querying antd knowledge and analyzing antd usage in projects", | ||
@@ -46,8 +46,10 @@ "type": "module", | ||
| "dependencies": { | ||
| "@modelcontextprotocol/sdk": "^1.27.1", | ||
| "commander": "~13.1.0", | ||
| "oxc-parser": "^0.121.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@modelcontextprotocol/sdk": "^1.27.1", | ||
| "@types/node": "^25.5.0", | ||
| "@vitest/coverage-v8": "^3.2.4", | ||
| "commander": "~13.1.0", | ||
| "envinfo": "^7.21.0", | ||
| "gray-matter": "^4.0.3", | ||
@@ -54,0 +56,0 @@ "tsup": "^8.4.0", |
+52
-1
@@ -17,2 +17,3 @@ <div align="center"> | ||
| [](https://github.com/ant-design/ant-design-cli/actions/workflows/ci.yml) | ||
| [](https://codecov.io/gh/ant-design/ant-design-cli) | ||
| [](https://packagephobia.com/result?p=@ant-design/cli) | ||
@@ -44,3 +45,3 @@ [](./LICENSE) | ||
| - 🔮 **Smart matching** — Typo `Buttn`? The CLI suggests `Button` using Levenshtein distance, with first-letter preference. | ||
| - 🧩 **14 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing. | ||
| - 🧩 **15 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing. | ||
| - 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude Desktop, Cursor). | ||
@@ -139,2 +140,3 @@ | ||
| | [`antd doctor`](#antd-doctor) | 10 diagnostic checks: React compat, duplicates, peer deps, SSR, babel plugins | | ||
| | [`antd env [dir]`](#antd-env-dir) | Collect all antd-related environment info for bug reporting or AI diagnosis | | ||
| | [`antd usage [dir]`](#antd-usage-dir) | Import stats, sub-component breakdown (`Form.Item`), non-component exports | | ||
@@ -277,2 +279,51 @@ | [`antd lint [target]`](#antd-lint-target) | Deprecated APIs, accessibility gaps, performance issues, best practices | | ||
| ### `antd env [dir]` | ||
| Collect all antd-related environment information — system, Node, package managers, browsers, dependencies, ecosystem packages (`@ant-design/*`, `rc-*`), and build tools — in one shot. | ||
| ```bash | ||
| antd env # text output (paste into GitHub Issues) | ||
| antd env --format json # structured JSON for AI consumption | ||
| antd env --format markdown # markdown tables | ||
| antd env ./my-project # scan a specific project directory | ||
| ``` | ||
| <details> | ||
| <summary>Example output</summary> | ||
| ```text | ||
| Environment | ||
| System: | ||
| OS macOS 15.3 | ||
| Binaries: | ||
| Node 20.11.0 | ||
| pnpm 9.1.0 | ||
| Registry https://registry.npmmirror.com/ | ||
| Browsers: | ||
| Chrome 131.0.6778.86 | ||
| Safari 18.3 | ||
| Dependencies: | ||
| antd 5.22.0 | ||
| react 18.3.1 | ||
| react-dom 18.3.1 | ||
| dayjs 1.11.13 | ||
| @ant-design/cssinjs 1.22.1 | ||
| @ant-design/icons 5.5.2 | ||
| Ecosystem: | ||
| @ant-design/pro-components 2.8.1 | ||
| rc-field-form 2.7.0 | ||
| Build Tools: | ||
| umi 4.3.0 | ||
| typescript 5.6.3 | ||
| less 4.2.0 | ||
| ``` | ||
| </details> | ||
| ### `antd usage [dir]` | ||
@@ -279,0 +330,0 @@ |
+52
-1
@@ -17,2 +17,3 @@ <div align="center"> | ||
| [](https://github.com/ant-design/ant-design-cli/actions/workflows/ci.yml) | ||
| [](https://codecov.io/gh/ant-design/ant-design-cli) | ||
| [](https://packagephobia.com/result?p=@ant-design/cli) | ||
@@ -44,3 +45,3 @@ [](./LICENSE) | ||
| - 🔮 **智能纠错** — 输入 `Buttn`?CLI 基于 Levenshtein 距离建议 `Button`,优先匹配首字母相同的候选。 | ||
| - 🧩 **14 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。 | ||
| - 🧩 **15 条命令** — 从 Prop 查询到项目级 Lint,从 Design Token 到跨版本 API 对比。 | ||
| - 🔌 **MCP 服务** — `antd mcp` 启动 stdio 服务,原生集成 Claude Desktop、Cursor 等 IDE。 | ||
@@ -139,2 +140,3 @@ | ||
| | [`antd doctor`](#antd-doctor) | 10 项诊断检查:React 兼容性、重复安装、peer 依赖、SSR、babel 插件 | | ||
| | [`antd env [dir]`](#antd-env-dir) | 一键收集 antd 相关环境信息,用于 Bug 报告或 AI 辅助诊断 | | ||
| | [`antd usage [dir]`](#antd-usage-dir) | 导入统计、子组件分布(`Form.Item`)、非组件导出 | | ||
@@ -277,2 +279,51 @@ | [`antd lint [target]`](#antd-lint-target) | 废弃 API、无障碍缺陷、性能问题、最佳实践 | | ||
| ### `antd env [dir]` | ||
| 一键收集 antd 相关的所有环境信息 — 系统、Node、包管理器、浏览器、依赖包、生态包(`@ant-design/*`、`rc-*`)和构建工具。 | ||
| ```bash | ||
| antd env # 文本输出(粘贴到 GitHub Issue) | ||
| antd env --format json # 结构化 JSON,供 AI 消费 | ||
| antd env --format markdown # Markdown 表格输出 | ||
| antd env ./my-project # 扫描指定项目目录 | ||
| ``` | ||
| <details> | ||
| <summary>示例输出</summary> | ||
| ```text | ||
| Environment | ||
| System: | ||
| OS macOS 15.3 | ||
| Binaries: | ||
| Node 20.11.0 | ||
| pnpm 9.1.0 | ||
| Registry https://registry.npmmirror.com/ | ||
| Browsers: | ||
| Chrome 131.0.6778.86 | ||
| Safari 18.3 | ||
| Dependencies: | ||
| antd 5.22.0 | ||
| react 18.3.1 | ||
| react-dom 18.3.1 | ||
| dayjs 1.11.13 | ||
| @ant-design/cssinjs 1.22.1 | ||
| @ant-design/icons 5.5.2 | ||
| Ecosystem: | ||
| @ant-design/pro-components 2.8.1 | ||
| rc-field-form 2.7.0 | ||
| Build Tools: | ||
| umi 4.3.0 | ||
| typescript 5.6.3 | ||
| less 4.2.0 | ||
| ``` | ||
| </details> | ||
| ### `antd usage [dir]` | ||
@@ -279,0 +330,0 @@ |
+29
-5
@@ -69,2 +69,5 @@ --- | ||
| ```bash | ||
| # Collect full environment snapshot (system, deps, browsers, build tools) | ||
| antd env --format json | ||
| # Check if the prop exists for the user's antd version | ||
@@ -80,3 +83,3 @@ antd info Select --version 5.12.0 --format json | ||
| **Workflow:** `antd doctor` → check environment → `antd info --version X` → verify API against the user's exact version → `antd lint` → find deprecated or incorrect usage. | ||
| **Workflow:** `antd env` → capture full environment → `antd doctor` → check configuration → `antd info --version X` → verify API against the user's exact version → `antd lint` → find deprecated or incorrect usage. | ||
@@ -147,7 +150,28 @@ ### 4. Migrating between versions | ||
| ### 8. Reporting antd bugs | ||
| ### 8. Collecting environment info | ||
| When you need to understand the project's antd setup, or prepare info for a bug report: | ||
| ```bash | ||
| # Full environment snapshot (text — paste into GitHub Issues) | ||
| antd env | ||
| # Structured JSON for programmatic use | ||
| antd env --format json | ||
| # Scan a specific project directory | ||
| antd env ./my-project --format json | ||
| ``` | ||
| Collects: OS, Node, package managers (npm/pnpm/yarn/bun/utoo), npm registry, browsers, core deps (antd/react/dayjs), all `@ant-design/*` and `rc-*` packages, and build tools (umi/vite/webpack/typescript/etc.). | ||
| ### 9. Reporting antd bugs | ||
| When you encounter a confirmed antd component bug that can't be resolved locally: | ||
| ```bash | ||
| # Step 0: Collect environment info for reference (optional — antd bug already embeds basic env) | ||
| # Use the output to cross-check versions or attach extra details to the bug report | ||
| antd env --format json | ||
| # Step 1: Preview for user review | ||
@@ -172,3 +196,3 @@ antd bug --title "DatePicker crashes when selecting date" \ | ||
| ### 9. Auto-reporting CLI issues | ||
| ### 10. Auto-reporting CLI issues | ||
@@ -212,3 +236,3 @@ **IMPORTANT: Whenever you use any `antd` CLI command and notice something wrong, you should proactively initiate a bug report using `antd bug-cli`.** | ||
| ### 10. Using as MCP server | ||
| ### 11. Using as MCP server | ||
@@ -246,3 +270,3 @@ If working in an IDE that supports MCP (Claude Desktop, Cursor, etc.), the CLI can also run as an MCP server, exposing all knowledge-query tools directly: | ||
| 5. **Lint after changes** — After writing or modifying antd code, run `antd lint` on the changed files to catch deprecated or problematic usage. | ||
| 6. **Report antd bugs** — When you encounter an antd component bug, use `antd bug` to report it. Always preview first, get user confirmation, then submit. | ||
| 6. **Report antd bugs** — First run `antd env` to capture the full environment, then use `antd bug` to report. Always preview first, get user confirmation, then submit. | ||
| 7. **Auto-report CLI issues** — If any `antd` command crashes, returns wrong data, or behaves inconsistently, proactively use `antd bug-cli` to report it. You are the quality feedback loop for the CLI — don't silently work around issues. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
26971677
5.74%1
-66.67%32094
818.28%0
-100%402
14.53%0
-100%1
-50%10
66.67%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed