contributors
This guide explains how to use @ant-design/cli to query Ant Design component knowledge, analyze project usage, and guide migrations from the command line.
@ant-design/cli is an official command-line tool that brings Ant Design knowledge to your terminal. It ships all metadata locally — every prop, token, demo, and changelog entry for antd v4 / v5 / v6 — queryable in milliseconds, fully offline.
--format json on every command. Structured errors with codes and suggestions.--lang zh.Buttn? The CLI suggests Button using Levenshtein distance.npm install -g @ant-design/cli
antd info Button # Component props, types, defaultsantd demo Select basic # Runnable demo source codeantd token DatePicker # Design Token values (v5+)antd semantic Table # classNames / styles structureantd changelog 4.24.0 5.0.0 Select # API diff across versionsantd doctor # Diagnose project issuesantd lint ./src # Check deprecated APIs & best practicesantd migrate 4 5 --apply ./src # Agent-ready migration prompt
| 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 [v1] [v2] [component] | Changelog entries, version ranges, or cross-version API diff |
| Command | Description |
|---|---|
antd doctor | 10 diagnostic checks: React compat, duplicates, peer deps, SSR, babel plugins |
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 |
| 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 |
The CLI ships with a built-in skill file that teaches code agents when and how to use each command:
npx skills add ant-design/ant-design-cli
| Tool | Description |
|---|---|
| Claude Code | Install as agent skill or use antd commands directly in terminal. Documentation |
| Cursor | Install skill, the agent will call CLI commands automatically. Documentation |
| Codex | Install skill to enable agent access. Documentation |
| Gemini CLI | Install skill for automatic command invocation. Documentation |
Works with any agent supporting the skills protocol.