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.
🧩 18 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 Code, Cursor, VS Code, etc.).
📦 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.
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
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 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.
antd design.md # design.md for the detected version
antd design.md --version 6.4.0 # design.md for a specific version
antd design.md --format json # { doc }
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.
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 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.
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
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, usage, performance. Deprecation rules are derived from metadata at runtime, so they’re always version-accurate.
usage checks include antd-specific prop/API mistakes such as Form.Item conflicts, Upload controlled value conflicts, static feedback APIs that should use App.useApp() in v5+, and v5+ Select children APIs that should use options.
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.
Use --diff [base] to lint changed git files only. By default it compares with origin/main‘s merge-base, falling back to HEAD; pass a base ref such as main to override it. Use --staged to lint only staged files.
Files that cannot be read or parsed are reported as skipped instead of being silently ignored. JSON output includes skippedFiles, partial, and summary.skipped; text and markdown output include a skipped-files section.
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.
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.).
antd mcp # start with auto-detected version
antd mcp --version 5.20.0 --lang zh # pin version and language
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.
antd setup --client claude # write .mcp.json
antd setup --client cursor # write .cursor/mcp.json
antd setup --client vscode # write .vscode/mcp.json
antd setup --client codex # install Codex project skill
antd setup --client github-actions # write .github/workflows/antd-cli.yml
antd setup --client claude --dry-run # preview without writing files
antd setup --client claude --project ./my-app
antd setup --client claude --version 5.29.3 --lang zh
antd setup --client claude --check # verify existing config
antd setup --client claude --mode skill # install Claude skill and write instructions
antd setup --client claude --mode both # write MCP config, install skill, and write instructions
antd setup --client claude --write-instructions
Modes:
Mode
Behavior
mcp
Writes the client MCP config only. This is the default.
skill
Installs the bundled Ant Design guidance for the selected client and writes a managed instruction block.
both
Writes MCP config, installs the skill or skill reference, and writes the managed instruction block.
ci
Writes a GitHub Actions workflow. This mode is only supported by --client github-actions.
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.
Codex setup currently supports skill installation only. Use antd setup --client codex --mode skill, or omit --mode because Codex defaults to skill.
GitHub Actions setup writes an advisory pull-request workflow that runs npm ci, npm run build, npx -y @ant-design/cli doctor --format json, and npx -y @ant-design/cli lint ./src --format json. Use --check to verify that the workflow matches the generated content.
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.
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.
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.
Ant Design CLI
Ant Design on your command line.
Query component knowledge, analyze project usage, and guide migrations — fully offline.
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.
✨ Highlights
antd@5.3.0, not just “latest v5”.--format jsonon every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.--lang zh.Buttn? The CLI suggestsButtonusing Levenshtein distance, with first-letter preference.antd mcpstarts a stdio server for native IDE integration (Claude Code, Cursor, VS Code, etc.).📦 Install
Other package managers
🤖 Agent Integration
The CLI ships with a skill file that teaches code agents when and how to use each command:
Or simply tell your code agent:
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:
Or if you have the CLI installed globally (
npm i -g @ant-design/cli):To pin a specific antd version, add
"--version", "5.20.0"to theargsarray.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.🚀 Quick Start
📖 Commands
📚 Knowledge Query
antd listsinceversionsantd info <Component>since, and deprecated statusantd doc <Component>antd demo <Component> [name]antd token [Component]antd design.mddesign.md) for AI design toolsantd semantic <Component>classNames/stylesstructure with usage examplesantd changelog🔍 Project Analysis
antd doctorantd env [dir]antd usage [dir]Form.Item), non-component exportsantd lint [target]antd migrate <from> <to>--applyagent prompt🐛 Issue Reporting
antd bugantd bug-cli🔧 CLI Management
antd mcpantd setupantd upgradeantd listExample output
antd info <Component>Example output
antd doc <Component>antd demo <Component> [name]antd token [Component]antd design.mdOutput the antd design-language document (
design.md) — a curated description of antd’s default light theme, conformant with the google-labs-code/design.md spec. Whereantd tokenlists individual token names,antd design.mddescribes 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.design.mdis major-grained (antd rewrites it only across major releases), so it is resolved by major version. Adesign.mdis currently published only for antd v6 — requesting a major without one (v3/v4/v5) returnsUNSUPPORTED_VERSION_FEATURE. It mirrors the canonicalDESIGN.mdpublished athttps://ant.design/design.md.antd semantic <Component>Example output
antd changelog [v1] [v2] [component]antd doctorRuns 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.
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.Example output
antd usage [dir]antd lint [target]Four rule categories:
deprecated,a11y,usage,performance. Deprecation rules are derived from metadata at runtime, so they’re always version-accurate.usagechecks include antd-specific prop/API mistakes such as Form.Item conflicts, Upload controlled value conflicts, static feedback APIs that should useApp.useApp()in v5+, and v5+ Select children APIs that should useoptions.Use
--antd-alias <source>to treat additional package names as aliases ofantd. Repeat the flag for multiple wrapper packages;antdremains enabled by default.Use
--diff [base]to lint changed git files only. By default it compares withorigin/main‘s merge-base, falling back toHEAD; pass a base ref such asmainto override it. Use--stagedto lint only staged files.Files that cannot be read or parsed are reported as skipped instead of being silently ignored. JSON output includes
skippedFiles,partial, andsummary.skipped; text and markdown output include a skipped-files section.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.
Example output
antd bugantd bug-cliantd mcpStart 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.).
Configuration:
MCP Tools (8):
antd_list,antd_info,antd_doc,antd_demo,antd_token,antd_design_md,antd_semantic,antd_changelogMCP Prompts (2):
antd-expert,antd-page-generatorantd setupConfigure a local AI agent project with Ant Design MCP and/or the bundled
skills/antdguidance. The command can write the client-specific MCP config file, install a client-appropriate skill or skill reference, and add managed instructions for agents.Modes:
mcpskillbothci--client github-actions.Supported clients:
claude.mcp.jsonmcpServers.claude/skills/antd/CLAUDE.mdcursor.cursor/mcp.jsonmcpServers.agents/skills/antd/shared skillAGENTS.mdvscode.vscode/mcp.jsonservers.agents/skills/antd/shared skillAGENTS.mdcodex.agents/skills/antd/shared skillAGENTS.mdgithub-actions.github/workflows/antd-cli.ymlGenerated server entry:
Skill instructions are written to the selected client’s instruction file: Claude uses
CLAUDE.md; Cursor, VS Code, and Codex useAGENTS.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.Codex setup currently supports skill installation only. Use
antd setup --client codex --mode skill, or omit--modebecause Codex defaults toskill.GitHub Actions setup writes an advisory pull-request workflow that runs
npm ci,npm run build,npx -y @ant-design/cli doctor --format json, andnpx -y @ant-design/cli lint ./src --format json. Use--checkto verify that the workflow matches the generated content.Use
--checkto validate an existing setup without writing files. It exits with code0when the selected mode is configured, and1when config, skill files, or instructions are missing or different.Use
--write-instructionswith the defaultmcpmode to also add an idempotent managed block to the selected agent instructions file, telling agents to use the configuredantdMCP server before generating Ant Design code. With--check, it also verifies that instruction block.antd upgradeUpgrade 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.
Example output
⚙️ Global Flags
--format json|text|markdowntext--version <v>5.20.0)--lang en|zhen--detailfalse-V, --cli-versionVersion auto-detection:
--versionflag →node_modules/antd→package.jsondependencies → fallback5.24.0Environment Variables
ANTD_NO_AUTO_REPORT=1NO_UPDATE_CHECK=1CI=1NO_UPDATE_CHECK=1)📄 License
MIT © Ant Design