| name | antdv |
| description | Use when the user's task involves antdv-next — writing antdv-next components, debugging antdv-next issues, querying antdv-next props/events/slot/tokens/demos, migrating between antdv-next versions, or analyzing antdv-next usage in a project. Triggers on antdv-next-related code, imports from 'antdv-next', or explicit antdv-next questions.
|
| allowed-tools | ["Bash(antdv *)","Bash(antdv bug*)","Bash(antdv bug-cli*)","Bash(npm install -g @antdv-next/cli*)","Bash(which antdv)"] |
Ant Design CLI
You can visit @antdv-next/cli - a local cli tool that contains metadata about the current, latest version of antdv-next. Use it to query component knowledge, analyze projects, and guide migrations. All data is offline and does not require a network.
Setup
Before first use, check if the CLI is installed. If not, install it automatically:
which antdv || npm install -g @antdv-next/cli
After running any command, if the output contains an "Update available" notice, run antdv upgrade to update before continuing.
Always use --format json for structured output you can parse programmatically.
Scenarios
1. Writing antd component code
Before writing any antd component code, look up its API first — don't rely on memory.
antdv info Button --format json
antdv demo Button basic --format json
antdv semantic Button --format json
antdv token Button --format json
antdv design.md --format json
Workflow: antdv info → understand props/event/slot → antdv demo → grab a working example → write code.
2. Looking up full documentation
When you need comprehensive component docs (not just props):
antdv doc Table --format json
antdv doc Table --lang zh
3. Debugging antd issues
When code isn't working as expected or the user reports an antdv bug:
antdv env --format json
antdv info Select --version 5.12.0 --format json
antdv lint ./src/components/MyForm.tsx --format json
antdv doctor --format json
Workflow: antdv env → capture full environment → antdv doctor → check configuration → antdv info --ver X → verify API against the user's exact version → antdv lint → find deprecated or incorrect usage.
4. Analyzing project antd usage
When the user wants to understand how antd is used in their project:
antdv usage ./src --format json
antdv usage ./src --filter Form --format json
antdv lint ./src --format json
antdv lint ./src --only deprecated --format json
antdv lint ./src --only a11y --format json
antdv lint ./src --only performance --format json
5. Comparing component APIs between versions
When the user asks what component APIs changed between versions:
antdv changelog 1.2.2 1.5.2 --format json
antdv changelog 1.2.2 1.5.2 Select --format json
6. Exploring available components
When the user is choosing which component to use:
antdv list --format json
antdv list --version 5.0.0 --format json
7. Collecting environment info
When you need to understand the project's antdv-next setup, or prepare info for a bug report:
antdv env
anvtd env --format json
antdv env ./my-project --format json
Collects: OS, Node, package managers (npm/pnpm/yarn/bun/utoo), npm registry, browsers, core deps (antdv-next/vue/dayjs), all @antdv-next/* packages, and build tools (vite/typescript/etc.).
8. Reporting antd bugs
When the user asks you to report an antdv bug:
antdv env --format json
antdv bug --title "DatePicker crashes when selecting date" \
--reproduction "https://codesandbox.io/s/xxx" \
--steps "1. Open DatePicker 2. Click a date" \
--expected "Date is selected" \
--actual "Component crashes with error" \
--format json
antdv bug --title "DatePicker crashes when selecting date" \
--reproduction "https://codesandbox.io/s/xxx" \
--steps "1. Open DatePicker 2. Click a date" \
--expected "Date is selected" \
--actual "Component crashes with error" \
--submit
9. Reporting CLI issues
When the user asks you to report a CLI bug, or explicitly requests help filing one:
antdv bug-cli --title "antdv info Button returns wrong props for v1.5.1" \
--description "When querying Button info for version 1.5.1, the output includes props that don't exist in that version" \
--steps "1. Run: antdv info Button --ver 1.5.1 --format json" \
--expected "Props matching antdv-next 1.5.0 Button API" \
--actual "Props include 'classes' which was added in 1.5.1" \
--format json
Show the report to the user and confirm before submitting:
antdv bug-cli --title "antdv info Button returns wrong props for v1.5.1" \
--description "..." \
--steps "..." \
--expected "..." \
--actual "..." \
--submit
Opt-out: If the environment variable ANTDV_NO_AUTO_REPORT=1 is set, skip all bug-reporting suggestions entirely — do not suggest antdv bug or antdv bug-cli unless the user directly asks.
10. Upgrading the CLI
When the user wants to update @antdv-next/cli to the latest version, or when an "Update available" notice appears:
antdv upgrade
The command detects which package manager installed the CLI (npm, yarn, pnpm, bun) and runs the appropriate upgrade command. If detection fails, it suggests the manual command.
11. Using as MCP server
If working in an IDE that supports MCP (Claude Desktop, Cursor, etc.), the CLI can also run as an MCP server, exposing all knowledge-query tools directly:
{
"mcpServers": {
"antdv": {
"command": "antdv",
"args": ["mcp", "--version", "1.5.0"]
}
}
}
This provides 8 tools (antdv_list, antdv_info, antdv_doc, antdv_demo, antdv_token, antdv_design_md, antdv_semantic) and 2 prompts (antdv-expert, antdv-page-generator) via MCP protocol.
Global Flags
| Flag | Purpose |
|---|
--format <format> | Output format: json, text, or markdown (agents should prefer json) |
--ver | Target a specific antd version (e.g. 1.5.0) |
--detail | Include extra fields (description, since, deprecated, FAQ) |
-V, --version | Print CLI version and exit |
Key Rules
- Always query before writing — Don't guess antd APIs from memory. Run
antdv info first.
- Match the user's version — Knowledge queries (
list/info/doc/demo/token/semantic/changelog) support antdv-next v1.x.
- Use
--format json — Every command supports it. Parse the JSON output rather than regex-matching text output.
- Check before suggesting migration — Run
antdv changelog <v1> <v2> and antdv migrate before advising on version upgrades.
- Lint after changes — After writing or modifying antd code, run
antdv lint on the changed files to catch deprecated or problematic usage.
- Report antdv-next bugs — When the user asks to report an antd bug, use
antdv bug. Always preview first, get user confirmation, then submit.
- Report CLI issues — When the user asks about a CLI problem, use
antdv bug-cli to help them file a report. Always preview first, get user confirmation, then submit.