{"id":48690538,"url":"https://github.com/ant-design/ant-design-cli","last_synced_at":"2026-04-11T05:16:39.581Z","repository":{"id":346557025,"uuid":"1182878675","full_name":"ant-design/ant-design-cli","owner":"ant-design","description":"  Ant Design on your command line. Query component knowledge, analyze project usage, and guide migrations — fully offline.","archived":false,"fork":false,"pushed_at":"2026-04-02T10:59:33.000Z","size":21725,"stargazers_count":151,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T15:52:29.851Z","etag":null,"topics":["ant-design","antd","cli"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/@ant-design/cli","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ant-design.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-16T03:36:05.000Z","updated_at":"2026-04-02T15:44:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ant-design/ant-design-cli","commit_stats":null,"previous_names":["ant-design/ant-design-cli"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ant-design/ant-design-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ant-design%2Fant-design-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ant-design%2Fant-design-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ant-design%2Fant-design-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ant-design%2Fant-design-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ant-design","download_url":"https://codeload.github.com/ant-design/ant-design-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ant-design%2Fant-design-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31669316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant-design","antd","cli"],"created_at":"2026-04-11T05:16:38.993Z","updated_at":"2026-04-11T05:16:39.575Z","avatar_url":"https://github.com/ant-design.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cbr\u003e\n\n\u003cimg src=\"https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg\" alt=\"Ant Design\" width=\"72\"\u003e\n\n\u003ch1\u003e@ant-design/cli\u003c/h1\u003e\n\n**Ant Design on your command line.**\u003cbr\u003e\nQuery component knowledge, analyze project usage, and guide migrations — fully offline.\n\n\u003cbr\u003e\n\n[![npm version](https://img.shields.io/npm/v/@ant-design/cli?color=blue\u0026label=npm)](https://www.npmjs.com/package/@ant-design/cli)\n[![npm downloads](https://img.shields.io/npm/dm/@ant-design/cli?color=blue)](https://www.npmjs.com/package/@ant-design/cli)\n[![CI](https://github.com/ant-design/ant-design-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/ant-design/ant-design-cli/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/ant-design/ant-design-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/ant-design/ant-design-cli)\n[![install size](https://packagephobia.com/badge?p=@ant-design/cli)](https://packagephobia.com/result?p=@ant-design/cli)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n\n[English](./README.md) · [中文](./README.zh-CN.md) · [Changelog](./CHANGELOG.md)\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n## 🤔 Why\n\nCode 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 v4 / v5 / v6**, bundled locally, queryable in milliseconds.\n\n```bash\nnpx skills add ant-design/ant-design-cli    # install as an agent skill\n```\n\n\u003cbr\u003e\n\n## ✨ Highlights\n\n- 📦 **Fully offline** — All metadata ships with the package. No network calls, no latency, no API keys.\n- 🎯 **Version-accurate** — 55+ per-minor snapshots across v4/v5/v6. Query the exact API surface of `antd@5.3.0`, not just \"latest v5\".\n- 🤖 **Agent-optimized** — `--format json` on every command. Structured errors with codes and suggestions. Clean stdout/stderr separation.\n- 🌍 **Bilingual** — Every component name, description, and doc has both English and Chinese. Switch with `--lang zh`.\n- 🔮 **Smart matching** — Typo `Buttn`? The CLI suggests `Button` using Levenshtein distance, with first-letter preference.\n- 🧩 **15 commands** — From prop lookup to project-wide lint, from design token queries to cross-version API diffing.\n- 🔌 **MCP server** — `antd mcp` starts a stdio server for native IDE integration (Claude Desktop, Cursor).\n\n\u003cbr\u003e\n\n## 📦 Install\n\n```bash\nnpm install -g @ant-design/cli\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eOther package managers\u003c/summary\u003e\n\n```bash\npnpm add -g @ant-design/cli\nbun add -g @ant-design/cli\n```\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## 🤖 Agent Integration\n\nThe CLI ships with a [skill file](./skills/antd/SKILL.md) that teaches code agents *when* and *how* to use each command:\n\n```bash\nnpx skills add ant-design/ant-design-cli\n```\n\nOr simply tell your code agent:\n\n\u003e Install `@ant-design/cli` and the antd skill from `ant-design/ant-design-cli`\n\nThe agent will handle `npm install`, `npx skills add`, and start using the CLI automatically.\n\nWorks with [Claude Code](https://claude.ai/code), [Cursor](https://cursor.sh), [Codex](https://openai.com/codex), [Gemini CLI](https://github.com/google-gemini/gemini-cli), and any agent supporting the [skills](https://github.com/nicepkg/agent-skills) protocol.\n\n### MCP Server\n\nFor IDEs that support [Model Context Protocol](https://modelcontextprotocol.io), the CLI can run as an MCP server:\n\n```json\n{\n  \"mcpServers\": {\n    \"antd\": {\n      \"command\": \"antd\",\n      \"args\": [\"mcp\"]\n    }\n  }\n}\n```\n\nTo pin a specific antd version, add `\"--version\", \"5.20.0\"` to the `args` array.\n\nThis 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.\n\n\u003cbr\u003e\n\n## 🚀 Quick Start\n\n```bash\nantd list                           # All components with versions\nantd info Button                    # Component props, types, defaults\nantd doc Button                     # Full markdown documentation\nantd demo Select basic              # Runnable demo source code\nantd token DatePicker               # Design Token values (v5+)\nantd semantic Table                 # classNames / styles structure\nantd changelog 4.24.0 5.0.0 Select  # API diff across versions\nantd doctor                         # Diagnose project issues\nantd env                            # Collect env info for bug reports\nantd usage ./src                    # Analyze antd imports in project\nantd lint ./src                     # Check deprecated APIs \u0026 best practices\nantd migrate 4 5 --apply ./src      # Agent-ready migration prompt\n```\n\n\u003cbr\u003e\n\n## 📖 Commands\n\n### 📚 Knowledge Query\n\n| Command | Description |\n|---|---|\n| [`antd list`](#antd-list) | List all components with bilingual names, categories, and `since` versions |\n| [`antd info \u003cComponent\u003e`](#antd-info-component) | Props table with types, defaults, `since`, and deprecated status |\n| [`antd doc \u003cComponent\u003e`](#antd-doc-component) | Full markdown documentation for a component |\n| [`antd demo \u003cComponent\u003e [name]`](#antd-demo-component-name) | Runnable demo source code (TSX) |\n| [`antd token [Component]`](#antd-token-component) | Global or component-level Design Tokens |\n| [`antd semantic \u003cComponent\u003e`](#antd-semantic-component) | Semantic `classNames` / `styles` structure with usage examples |\n| [`antd changelog`](#antd-changelog-v1-v2-component) | Changelog entries, version ranges, or cross-version API diff |\n\n### 🔍 Project Analysis\n\n| Command | Description |\n|---|---|\n| [`antd doctor`](#antd-doctor) | 10 diagnostic checks: React compat, duplicates, peer deps, SSR, babel plugins |\n| [`antd env [dir]`](#antd-env-dir) | Collect all antd-related environment info for bug reporting or AI diagnosis |\n| [`antd usage [dir]`](#antd-usage-dir) | Import stats, sub-component breakdown (`Form.Item`), non-component exports |\n| [`antd lint [target]`](#antd-lint-target) | Deprecated APIs, accessibility gaps, performance issues, best practices |\n| [`antd migrate \u003cfrom\u003e \u003cto\u003e`](#antd-migrate-from-to) | Migration checklist with auto-fixable/manual split and `--apply` agent prompt |\n\n### 🐛 Issue Reporting\n\n| Command | Description |\n|---|---|\n| [`antd bug`](#antd-bug) | File a bug to ant-design/ant-design with auto-collected environment info |\n| [`antd bug-cli`](#antd-bug-cli) | File a bug to ant-design/ant-design-cli |\n\n\u003cbr\u003e\n\n---\n\n### `antd list`\n\n```bash\nantd list                           # all components\nantd list --version 5.0.0           # components available in v5.0.0\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n```\nComponent       组件名     Description                                                Since\n--------------  -------  -------------------------------------------------------  ------\nButton          按钮       To trigger an operation.                                  4.0.0\nTable           表格       A table displays rows of data.                            4.0.0\nForm            表单       High performance Form component with data scope management. 4.0.0\nSelect          选择器      Select component to select value from options.            4.0.0\nModal           对话框      Modal dialogs.                                            4.0.0\nColorPicker     颜色选择器   Used for color selection.                                 5.5.0\n...\n```\n\n\u003c/details\u003e\n\n### `antd info \u003cComponent\u003e`\n\n```bash\nantd info Button                    # props table\nantd info Button --detail           # + descriptions, since, deprecated, FAQ\nantd info Button --version 4.24.0   # v4 API snapshot\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n```\nButton (按钮) — To trigger an operation.\n\nProperty         Type                                          Default   Since\n---------------  --------------------------------------------  --------  ------\nautoInsertSpace  boolean                                       true      5.17.0\nblock            boolean                                       false     -\nclassNames       Record\u003cSemanticDOM, string\u003e                   -         5.4.0\ndisabled         boolean                                       false     -\nhref             string                                        -         -\nicon             ReactNode                                     -         -\nloading          boolean | { delay: number, icon: ReactNode }  false     -\nsize             large | middle | small                        middle    -\ntype             primary | default | dashed | text | link      default   -\nvariant          outlined | dashed | solid | filled | text     -         5.13.0\nonClick          (event: React.MouseEvent) =\u003e void             -         -\n```\n\n\u003c/details\u003e\n\n### `antd doc \u003cComponent\u003e`\n\n```bash\nantd doc Button                     # full markdown docs to stdout\nantd doc Button --format json       # { name, doc }\nantd doc Button --lang zh           # Chinese documentation\n```\n\n### `antd demo \u003cComponent\u003e [name]`\n\n```bash\nantd demo Button                    # list all available demos\nantd demo Button basic              # get demo source code\n```\n\n### `antd token [Component]`\n\n```bash\nantd token                          # global tokens (colorPrimary, borderRadius, ...)\nantd token Button                   # component-level tokens\n```\n\n### `antd semantic \u003cComponent\u003e`\n\n```bash\nantd semantic Table\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n```\nTable Semantic Structure:\n├── header    # Table header area\n├── body      # Table body area\n├── footer    # Table footer area\n├── cell      # Table cell\n├── row       # Table row\n└── wrapper   # Outer wrapper\n\nUsage:\n  \u003cTable classNames={{ header: 'my-header' }} /\u003e\n  \u003cTable styles={{ header: { background: '#fff' } }} /\u003e\n```\n\n\u003c/details\u003e\n\n### `antd changelog [v1] [v2] [component]`\n\n```bash\nantd changelog 5.22.0               # single version\nantd changelog 5.21.0..5.24.0       # version range (inclusive)\nantd changelog 4.24.0 5.0.0         # API diff between two versions\nantd changelog 4.24.0 5.0.0 Select  # API diff for Select only\n```\n\n---\n\n### `antd doctor`\n\nRuns 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.\n\n```bash\nantd doctor\nantd doctor --format json\n```\n\n### `antd env [dir]`\n\nCollect all antd-related environment information — system, Node, package managers, browsers, dependencies, ecosystem packages (`@ant-design/*`, `rc-*`), and build tools — in one shot.\n\n```bash\nantd env                            # text output (paste into GitHub Issues)\nantd env --format json              # structured JSON for AI consumption\nantd env --format markdown          # markdown tables\nantd env ./my-project               # scan a specific project directory\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n```text\nEnvironment\n\n  System:\n    OS        macOS 15.3\n\n  Binaries:\n    Node      20.11.0\n    pnpm      9.1.0\n    Registry  https://registry.npmmirror.com/\n\n  Browsers:\n    Chrome    131.0.6778.86\n    Safari    18.3\n\n  Dependencies:\n    antd                 5.22.0\n    react                18.3.1\n    react-dom            18.3.1\n    dayjs                1.11.13\n    @ant-design/cssinjs  1.22.1\n    @ant-design/icons    5.5.2\n\n  Ecosystem:\n    @ant-design/pro-components  2.8.1\n    rc-field-form               2.7.0\n\n  Build Tools:\n    umi         4.3.0\n    typescript  5.6.3\n    less        4.2.0\n```\n\n\u003c/details\u003e\n\n### `antd usage [dir]`\n\n```bash\nantd usage                          # scan current directory\nantd usage ./src                    # scan specific directory\nantd usage -f Button                # filter to one component\n```\n\n### `antd lint [target]`\n\nFour rule categories: `deprecated`, `a11y`, `performance`, `best-practice`. Deprecation rules are derived from metadata at runtime, so they're always version-accurate.\n\n```bash\nantd lint ./src\nantd lint ./src --only deprecated\nantd lint ./src --only a11y\n```\n\n### `antd migrate \u003cfrom\u003e \u003cto\u003e`\n\nv4→v5 covers 25+ migration steps; v5→v6 covers 30+. Each step includes component name, breaking flag, search pattern, and before/after code.\n\n```bash\nantd migrate 4 5                    # full checklist\nantd migrate 4 5 --component Select # component-specific\nantd migrate 4 5 --apply ./src      # generate agent migration prompt\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eExample output\u003c/summary\u003e\n\n```\nMigration Guide: v4 → v5\n\n  Select:\n    🔧 [BREAKING] Prop `dropdownClassName` renamed to `popupClassName`\n    🔧 [BREAKING] Prop `dropdownMatchSelectWidth` renamed to `popupMatchSelectWidth`\n\nTotal: 2 steps (2 auto-fixable, 0 manual)\n```\n\n\u003c/details\u003e\n\n### `antd bug`\n\n```bash\nantd bug --title \"DatePicker crashes with dayjs 2.0\"\nantd bug --title \"...\" --steps \"1. Click\" --expected \"Works\" --actual \"Crashes\"\nantd bug --title \"...\" --submit     # submit via gh CLI\n```\n\n### `antd bug-cli`\n\n```bash\nantd bug-cli --title \"info command crashes on v4\"\nantd bug-cli --title \"...\" --submit\n```\n\n\u003cbr\u003e\n\n## ⚙️ Global Flags\n\n| Flag | Description | Default |\n|---|---|---|\n| `--format json\\|text\\|markdown` | Output format | `text` |\n| `--version \u003cv\u003e` | Target antd version (e.g. `5.20.0`) | auto-detect |\n| `--lang en\\|zh` | Output language | `en` |\n| `--detail` | Include extended information | `false` |\n| `-V, --cli-version` | Print CLI version | — |\n\n**Version auto-detection**: `--version` flag → `node_modules/antd` → `package.json` dependencies → fallback `5.24.0`\n\n\u003cbr\u003e\n\n## 📄 License\n\n[MIT](./LICENSE) © [Ant Design](https://ant.design)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fant-design%2Fant-design-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fant-design%2Fant-design-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fant-design%2Fant-design-cli/lists"}