{"slug": "show-hn-ant-design-cli-offline-cli-for-ant-design-docs-lint-and-migration", "title": "Show HN: Ant-design/CLI – Offline CLI for Ant Design docs, lint and migration", "summary": "Ant Design released an offline CLI tool that provides instant access to component documentation, migration guides, and linting for antd versions 3 through 6. The tool bundles all metadata locally, supports 16 commands including prop lookup and cross-version API diffing, and integrates with AI coding agents through a skills protocol and MCP server for IDE support.", "body_md": "**Ant Design on your command line.**\n\nQuery component knowledge, analyze project usage, and guide migrations — fully offline.\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 v3 / v4 / v5 / v6**, bundled locally, queryable in milliseconds.\n\n```\nnpx skills add ant-design/ant-design-cli    # install as an agent skill\n```\n\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 v3/v4/v5/v6. Query the exact API surface of`antd@5.3.0`\n\n, not just \"latest v5\". - 🤖\n**Agent-optimized**—`--format json`\n\non 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\n. - 🔮\n**Smart matching**— Typo`Buttn`\n\n? The CLI suggests`Button`\n\nusing Levenshtein distance, with first-letter preference. - 🧩\n**16 commands**— From prop lookup to project-wide lint, from design token queries to cross-version API diffing. - 🔌\n**MCP server**—`antd mcp`\n\nstarts a stdio server for native IDE integration (Claude Desktop, Cursor).\n\n```\nnpm install -g @ant-design/cli\n```\n\n## Other package managers\n\n```\npnpm add -g @ant-design/cli\nbun add -g @ant-design/cli\n```\n\nThe CLI ships with a [skill file](/ant-design/ant-design-cli/blob/main/skills/antd/SKILL.md) that teaches code agents *when* and *how* to use each command:\n\n```\nnpx skills add ant-design/ant-design-cli\n```\n\nOr simply tell your code agent:\n\nInstall\n\n`@ant-design/cli`\n\nand the antd skill from`ant-design/ant-design-cli`\n\nThe agent will handle `npm install`\n\n, `npx skills add`\n\n, 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\nFor IDEs that support [Model Context Protocol](https://modelcontextprotocol.io), the CLI can run as an MCP server:\n\n```\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\"`\n\nto the `args`\n\narray.\n\nThis exposes 7 tools (`antd_list`\n\n, `antd_info`\n\n, `antd_doc`\n\n, `antd_demo`\n\n, `antd_token`\n\n, `antd_semantic`\n\n, `antd_changelog`\n\n) and 2 prompts (`antd-expert`\n\n, `antd-page-generator`\n\n) for native IDE integration.\n\n```\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 & best practices\nantd migrate 3 4                    # v3 → v4 migration guide\nantd migrate 4 5 --apply ./src      # Agent-ready migration prompt\nantd mcp                            # Start MCP server for IDE integration\nantd upgrade                        # Upgrade CLI to latest version\n```\n\n| Command | Description |\n|---|---|\n`antd list` |\n\n`since`\n\nversions`antd info <Component>`\n\n`since`\n\n, and deprecated status`antd doc <Component>`\n\n`antd demo <Component> [name]`\n\n`antd token [Component]`\n\n`antd semantic <Component>`\n\n`classNames`\n\n/ `styles`\n\nstructure with usage examples`antd changelog`\n\n| Command | Description |\n|---|---|\n`antd doctor` |\n\n`antd env [dir]`\n\n`antd usage [dir]`\n\n`Form.Item`\n\n), non-component exports`antd lint [target]`\n\n`antd migrate <from> <to>`\n\n`--apply`\n\nagent prompt| Command | Description |\n|---|---|\n`antd bug` |\n\n`antd bug-cli`\n\n| Command | Description |\n|---|---|\n`antd mcp` |\n\n`antd upgrade`\n\n```\nantd list                           # all components\nantd list --version 5.0.0           # components available in v5.0.0\n```\n\n## Example output\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...\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## Example output\n\n```\nButton (按钮) — To trigger an operation.\n\nProperty         Type                                          Default   Since\n---------------  --------------------------------------------  --------  ------\nautoInsertSpace  boolean                                       true      5.17.0\nblock            boolean                                       false     -\nclassNames       Record<SemanticDOM, string>                   -         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) => void             -         -\nantd doc Button                     # full markdown docs to stdout\nantd doc Button --format json       # { name, doc }\nantd doc Button --lang zh           # Chinese documentation\nantd demo Button                    # list all available demos\nantd demo Button basic              # get demo source code\nantd token                          # global tokens (colorPrimary, borderRadius, ...)\nantd token Button                   # component-level tokens\nantd semantic Table\n```\n\n## Example output\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  <Table classNames={{ header: 'my-header' }} />\n  <Table styles={{ header: { background: '#fff' } }} />\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\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```\nantd doctor\nantd doctor --format json\n```\n\nCollect all antd-related environment information — system, Node, package managers, browsers, dependencies, ecosystem packages (`@ant-design/*`\n\n, `rc-*`\n\n), and build tools — in one shot.\n\n```\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## Example output\n\n```\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\nantd usage                          # scan current directory\nantd usage ./src                    # scan specific directory\nantd usage -f Button                # filter to one component\n```\n\nFour rule categories: `deprecated`\n\n, `a11y`\n\n, `performance`\n\n, `best-practice`\n\n. Deprecation rules are derived from metadata at runtime, so they're always version-accurate.\n\n```\nantd lint ./src\nantd lint ./src --only deprecated\nantd lint ./src --only a11y\nantd lint ./src --only deprecated --format json --antd-alias @shared-components\n```\n\nUse `--antd-alias <source>`\n\nto treat additional package names as aliases of `antd`\n\n. Repeat the flag for multiple wrapper packages; `antd`\n\nremains enabled by default.\n\nv3→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.\n\n```\nantd migrate 3 4                    # v3 → v4 migration\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## Example output\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)\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\nantd bug-cli --title \"info command crashes on v4\"\nantd bug-cli --title \"...\" --submit\n```\n\nStart 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.).\n\n```\nantd mcp                                # start with auto-detected version\nantd mcp --version 5.20.0 --lang zh     # pin version and language\n```\n\nIDE configuration (`claude_desktop_config.json`\n\n):\n\n```\n{\n  \"mcpServers\": {\n    \"antd\": {\n      \"command\": \"antd\",\n      \"args\": [\"mcp\"]\n    }\n  }\n}\n```\n\n**MCP Tools (7):** `antd_list`\n\n, `antd_info`\n\n, `antd_doc`\n\n, `antd_demo`\n\n, `antd_token`\n\n, `antd_semantic`\n\n, `antd_changelog`\n\n**MCP Prompts (2):** `antd-expert`\n\n, `antd-page-generator`\n\nUpgrade 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.\n\n```\nantd upgrade                        # upgrade to latest version\n```\n\n## Example output\n\n```\nUpgrading @ant-design/cli: v6.4.3 → v6.4.4\nRunning: npm install -g @ant-design/cli@latest\n... (passthrough package manager output) ...\nSuccessfully upgraded to v6.4.4\n```\n\n| Flag | Description | Default |\n|---|---|---|\n`--format json|text|markdown` |\nOutput format | `text` |\n`--version <v>` |\nTarget antd version (e.g. `5.20.0` ) |\nauto-detect |\n`--lang en|zh` |\nOutput language | `en` |\n`--detail` |\nInclude extended information | `false` |\n`-V, --cli-version` |\nPrint CLI version | — |\n\n**Version auto-detection**: `--version`\n\nflag → `node_modules/antd`\n\n→ `package.json`\n\ndependencies → fallback `5.24.0`\n\n| Variable | Description |\n|---|---|\n`ANTD_NO_AUTO_REPORT=1` |\nDisable bug-reporting suggestions from AI agents (see\n|\n\n`NO_UPDATE_CHECK=1`\n\n`CI=1`\n\n`NO_UPDATE_CHECK=1`\n\n)", "url": "https://wpnews.pro/news/show-hn-ant-design-cli-offline-cli-for-ant-design-docs-lint-and-migration", "canonical_source": "https://github.com/ant-design/ant-design-cli", "published_at": "2026-06-03 11:27:40+00:00", "updated_at": "2026-06-03 11:47:28.741089+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "ai-products", "ai-infrastructure", "ai-research"], "entities": ["Ant Design", "Claude Code", "Codex", "Gemini CLI", "Claude Desktop", "Cursor"], "alternates": {"html": "https://wpnews.pro/news/show-hn-ant-design-cli-offline-cli-for-ant-design-docs-lint-and-migration", "markdown": "https://wpnews.pro/news/show-hn-ant-design-cli-offline-cli-for-ant-design-docs-lint-and-migration.md", "text": "https://wpnews.pro/news/show-hn-ant-design-cli-offline-cli-for-ant-design-docs-lint-and-migration.txt", "jsonld": "https://wpnews.pro/news/show-hn-ant-design-cli-offline-cli-for-ant-design-docs-lint-and-migration.jsonld"}}