惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
Google Developers Blog
J
Java Code Geeks
爱范儿
爱范儿
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队
人人都是产品经理
人人都是产品经理
Martin Fowler
Martin Fowler
IT之家
IT之家
博客园_首页
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
B
Blog
U
Unit 42
Apple Machine Learning Research
Apple Machine Learning Research
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
N
Netflix TechBlog - Medium
T
Tailwind CSS Blog
博客园 - 聂微东
腾讯CDC
A
About on SuperTechFans

Echo JS

GitHub - evoluteur/cymatics: Play a frequency and watch the sand settle into its Chladni figure, computed from the wave equation. Memdeklaro - The Basics of Decentralized Identity (DID) and Self-Sovereign Identity (SSI) How Railmid Works GitHub - evoluteur/platonic-solids: Turn the five Platonic solids in 3D, show their duals, read their measurements, and print the nets to fold your own. Sharing Application State in a URL GitHub - evoluteur/sacred-geometry: Sacred Geometry Generator: draw, tune, and export Vesica Piscis, Seed of Life, Flower of Life, Metatron's Cube, and the Golden Spiral as SVG Best of Self-Sovereign Identity: Digitalcourage, World Passport and Memdeklaro Reads Are Subscriptions - Migrating from Zustand to Coaction GitHub - evoluteur/binaural-beats: Simple web page to play binaural beats for sleep, meditation, relaxation, and focus: Delta, Theta, Alpha, Beta, and Gamma brainwave frequencies, with an optional pink or brown noise bed. toast-queue — Accessible, customizable toast notifications Building a High-Performance Data Grid in React, Vue, and Svelte I built a flight recorder for AI sessions React Authentication With JWT, Zustand, and Axios | JavaScript Tools Blog My idempotency library had one job. A dropped connection made it run the payment twice. "half-open" twice is not the same state: the bug that shaped breakwater 1.0 GitHub - evoluteur/evolutility-server-node: Framework for building REST APIs for CRUD with models rather than code (using Node.js, Express, and PostgreSQL). React Router v8 in Action: Lazy Loading and Nested Routes One $ for every environment | Xec My test suite had 100% coverage. Mutation testing still found real bugs. The type-safe data layer for Kysely | Kysera What JavaScript Obfuscation in the AI Era | JavaScript Tools Blog Using Mongoose Studio with Apache Cassandra via Data API GitHub - trekhleb/yesbrainer: 🧠 A council of AI models for the decisions that aren't no-brainers — they answer in parallel, debate to consensus, or get judged to a verdict. Browser-only, open source, bring your own keys (BYOK), no backend. Node.js has plenty of circuit breakers. So why did I build another one? My Redis library said the write succeeded. Redis was down. GitHub - Techthos/gadget: Prebuilt, interactive HTML widgets for MCP Apps in Go — data tables and forms, self-contained in a single binary, host-themed, spec-compliant. GitHub - evoluteur/react-morph-charts: React component for bubble chart, bar chart, and pie chart, with animated morphing transitions between charts, on hover, and on window resize. Interactive Metaballs Tutorial GitHub - mutativejs/travels: A fast, framework-agnostic undo/redo core powered by Mutative JSON Patch
GitHub - ant-design/ant-design-cli: Ant Design on your co...
afc163 · 2026-06-03 · via Echo JS

Ant Design

Ant Design on your command line.
Query component knowledge, analyze project usage, and guide migrations — fully offline.

npm version npm downloads CI codecov install size License: MIT

English · 中文 · Changelog

🤔 Why

Code agents (Claude Code, Codex, Gemini CLI) write better antd code when they have instant access to the right API data. This CLI gives them exactly that — every prop, token, demo, and changelog entry for antd v3 / v4 / v5 / v6, bundled locally, queryable in milliseconds.

npx skills add ant-design/ant-design-cli    # install as an agent skill

✨ Highlights

  • 📦 Fully offline — All metadata ships with the package. No network calls, no latency, no API keys.
  • 🎯 Version-accurate — 55+ per-minor snapshots across v3/v4/v5/v6. Query the exact API surface of antd@5.3.0, not just "latest v5".
  • 🤖 Agent-optimized--format json on every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.
  • 🌍 Bilingual — Every component name, description, and doc has both English and Chinese. Switch with --lang zh.
  • 🔮 Smart matching — Typo Buttn? The CLI suggests Button using Levenshtein distance, with first-letter preference.
  • 🧩 16 commands — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.
  • 🔌 MCP serverantd mcp starts a stdio server for native IDE integration (Claude Desktop, Cursor).

📦 Install

npm install -g @ant-design/cli
Other package managers
pnpm add -g @ant-design/cli
bun add -g @ant-design/cli

🤖 Agent Integration

The CLI ships with a skill file that teaches code agents when and how to use each command:

npx skills add ant-design/ant-design-cli

Or simply tell your code agent:

Install @ant-design/cli and the antd skill from ant-design/ant-design-cli

The agent will handle npm install, npx skills add, and start using the CLI automatically.

Works with Claude Code, Cursor, Codex, Gemini CLI, and any agent supporting the skills protocol.

MCP Server

For IDEs that support Model Context Protocol, the CLI can run as an MCP server:

{
  "mcpServers": {
    "antd": {
      "command": "antd",
      "args": ["mcp"]
    }
  }
}

To pin a specific antd version, add "--version", "5.20.0" to the args array.

This exposes 7 tools (antd_list, antd_info, antd_doc, antd_demo, antd_token, antd_semantic, antd_changelog) and 2 prompts (antd-expert, antd-page-generator) for native IDE integration.

🚀 Quick Start

antd list                           # All components with versions
antd info Button                    # Component props, types, defaults
antd doc Button                     # Full markdown documentation
antd demo Select basic              # Runnable demo source code
antd token DatePicker               # Design Token values (v5+)
antd semantic Table                 # classNames / styles structure
antd changelog 4.24.0 5.0.0 Select  # API diff across versions
antd doctor                         # Diagnose project issues
antd env                            # Collect env info for bug reports
antd usage ./src                    # Analyze antd imports in project
antd lint ./src                     # Check deprecated APIs & best practices
antd migrate 3 4                    # v3 → v4 migration guide
antd migrate 4 5 --apply ./src      # Agent-ready migration prompt
antd mcp                            # Start MCP server for IDE integration
antd upgrade                        # Upgrade CLI to latest version

📖 Commands

📚 Knowledge Query

Command Description
antd list List all components with bilingual names, categories, and since versions
antd info <Component> Props table with types, defaults, since, and deprecated status
antd doc <Component> Full markdown documentation for a component
antd demo <Component> [name] Runnable demo source code (TSX)
antd token [Component] Global or component-level Design Tokens
antd semantic <Component> Semantic classNames / styles structure with usage examples
antd changelog Changelog entries, version ranges, or cross-version API diff

🔍 Project Analysis

Command Description
antd doctor 10 diagnostic checks: React compat, duplicates, peer deps, SSR, babel plugins
antd env [dir] Collect all antd-related environment info for bug reporting or AI diagnosis
antd usage [dir] Import stats, sub-component breakdown (Form.Item), non-component exports
antd lint [target] Deprecated APIs, accessibility gaps, performance issues, best practices
antd migrate <from> <to> Migration checklist with auto-fixable/manual split and --apply agent prompt

🐛 Issue Reporting

Command Description
antd bug File a bug to ant-design/ant-design with auto-collected environment info
antd bug-cli File a bug to ant-design/ant-design-cli

🔧 CLI Management

Command Description
antd mcp Start MCP stdio server for IDE agent integration
antd upgrade Upgrade the CLI to the latest version


antd list

antd list                           # all components
antd list --version 5.0.0           # components available in v5.0.0
Example output
Component       组件名     Description                                                Since
--------------  -------  -------------------------------------------------------  ------
Button          按钮       To trigger an operation.                                  4.0.0
Table           表格       A table displays rows of data.                            4.0.0
Form            表单       High performance Form component with data scope management. 4.0.0
Select          选择器      Select component to select value from options.            4.0.0
Modal           对话框      Modal dialogs.                                            4.0.0
ColorPicker     颜色选择器   Used for color selection.                                 5.5.0
...

antd info <Component>

antd info Button                    # props table
antd info Button --detail           # + descriptions, since, deprecated, FAQ
antd info Button --version 4.24.0   # v4 API snapshot
Example output
Button (按钮) — To trigger an operation.

Property         Type                                          Default   Since
---------------  --------------------------------------------  --------  ------
autoInsertSpace  boolean                                       true      5.17.0
block            boolean                                       false     -
classNames       Record<SemanticDOM, string>                   -         5.4.0
disabled         boolean                                       false     -
href             string                                        -         -
icon             ReactNode                                     -         -
loading          boolean | { delay: number, icon: ReactNode }  false     -
size             large | middle | small                        middle    -
type             primary | default | dashed | text | link      default   -
variant          outlined | dashed | solid | filled | text     -         5.13.0
onClick          (event: React.MouseEvent) => void             -         -

antd doc <Component>

antd doc Button                     # full markdown docs to stdout
antd doc Button --format json       # { name, doc }
antd doc Button --lang zh           # Chinese documentation

antd demo <Component> [name]

antd demo Button                    # list all available demos
antd demo Button basic              # get demo source code

antd token [Component]

antd token                          # global tokens (colorPrimary, borderRadius, ...)
antd token Button                   # component-level tokens

antd semantic <Component>

Example output
Table Semantic Structure:
├── header    # Table header area
├── body      # Table body area
├── footer    # Table footer area
├── cell      # Table cell
├── row       # Table row
└── wrapper   # Outer wrapper

Usage:
  <Table classNames={{ header: 'my-header' }} />
  <Table styles={{ header: { background: '#fff' } }} />

antd changelog [v1] [v2] [component]

antd changelog 5.22.0               # single version
antd changelog 5.21.0..5.24.0       # version range (inclusive)
antd changelog 4.24.0 5.0.0         # API diff between two versions
antd changelog 4.24.0 5.0.0 Select  # API diff for Select only

antd doctor

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.

antd doctor
antd doctor --format json

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.

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
Example output
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

antd usage [dir]

antd usage                          # scan current directory
antd usage ./src                    # scan specific directory
antd usage -f Button                # filter to one component

antd lint [target]

Four rule categories: deprecated, a11y, performance, best-practice. Deprecation rules are derived from metadata at runtime, so they're always version-accurate.

antd lint ./src
antd lint ./src --only deprecated
antd lint ./src --only a11y
antd lint ./src --only deprecated --format json --antd-alias @shared-components

Use --antd-alias <source> to treat additional package names as aliases of antd. Repeat the flag for multiple wrapper packages; antd remains enabled by default.

antd migrate <from> <to>

v3→v4 covers 15+ migration steps; v4→v5 covers 25+ migration steps; v5→v6 covers 30+. Each step includes component name, breaking flag, search pattern, and before/after code.

antd migrate 3 4                    # v3 → v4 migration
antd migrate 4 5                    # full checklist
antd migrate 4 5 --component Select # component-specific
antd migrate 4 5 --apply ./src      # generate agent migration prompt
Example output
Migration Guide: v4 → v5

  Select:
    🔧 [BREAKING] Prop `dropdownClassName` renamed to `popupClassName`
    🔧 [BREAKING] Prop `dropdownMatchSelectWidth` renamed to `popupMatchSelectWidth`

Total: 2 steps (2 auto-fixable, 0 manual)

antd bug

antd bug --title "DatePicker crashes with dayjs 2.0"
antd bug --title "..." --steps "1. Click" --expected "Works" --actual "Crashes"
antd bug --title "..." --submit     # submit via gh CLI

antd bug-cli

antd bug-cli --title "info command crashes on v4"
antd bug-cli --title "..." --submit

antd mcp

Start an MCP (Model Context Protocol) stdio server for IDE agent integration. Exposes 7 tools and 2 prompts for native IDE integration (Claude Desktop, Cursor, etc.).

antd mcp                                # start with auto-detected version
antd mcp --version 5.20.0 --lang zh     # pin version and language

IDE configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "antd": {
      "command": "antd",
      "args": ["mcp"]
    }
  }
}

MCP Tools (7): antd_list, antd_info, antd_doc, antd_demo, antd_token, antd_semantic, antd_changelog

MCP Prompts (2): antd-expert, antd-page-generator

antd upgrade

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.

antd upgrade                        # upgrade to latest version
Example output
Upgrading @ant-design/cli: v6.4.3 → v6.4.4
Running: npm install -g @ant-design/cli@latest
... (passthrough package manager output) ...
Successfully upgraded to v6.4.4

⚙️ Global Flags

Flag Description Default
--format json|text|markdown Output format text
--version <v> Target antd version (e.g. 5.20.0) auto-detect
--lang en|zh Output language en
--detail Include extended information false
-V, --cli-version Print CLI version

Version auto-detection: --version flag → node_modules/antdpackage.json dependencies → fallback 5.24.0

Environment Variables

Variable Description
ANTD_NO_AUTO_REPORT=1 Disable bug-reporting suggestions from AI agents (see #82)
NO_UPDATE_CHECK=1 Skip the silent version update check
CI=1 Skip the silent version update check (same as NO_UPDATE_CHECK=1)

📄 License

MIT © Ant Design