Skip to content

Commit 9349267

Browse files
author
逍为
committed
docs: add readme for cli usage
1 parent 46333ee commit 9349267

1 file changed

Lines changed: 51 additions & 2 deletions

File tree

README.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ npx skills add antvis/chart-visualization-skills
5050

5151
`AntV S2 Expert` helps users develop with the S2 multi-dimensional cross-analysis table engine. It provides comprehensive guidance on `@antv/s2` core engine, `@antv/s2-react` and `@antv/s2-vue` framework bindings, `@antv/s2-react-components` advanced analysis components, and `@antv/s2-ssr` server-side rendering. Covers pivot tables, table sheets, custom cells, theming, events, interactions, sorting, totals, tooltips, frozen rows/columns, icons, pagination, and more.
5252

53-
- 📈 **g2-chart**: G2 v5 chart code generator. Use when users need to generate G2 charts — bar charts, line charts, pie charts, scatter plots, area charts, heatmaps, and any statistical data visualization with the G2 library.
53+
- 📈 **antv-g2-chart**: G2 v5 chart code generator. Use when users need to generate G2 charts — bar charts, line charts, pie charts, scatter plots, area charts, heatmaps, and any statistical data visualization with the G2 library.
5454

55-
`G2 Chart` generates accurate, runnable G2 v5 code following Spec Mode best practices. It covers 30+ chart types (interval, line, area, point, rect, cell, treemap, sankey, chord, wordCloud, gauge, and more), data transforms (stackY, dodgeX, binX, fold, etc.), coordinate systems (cartesian, polar, theta, radial), scales, interactions (brush, slider, legend filter), components (axis, legend, tooltip, annotation), and multi-view compositions. Built-in guard rails prevent common v4→v5 migration pitfalls such as using deprecated chain APIs, invalid palette names, or referencing `d3` in user code.
55+
`AntV G2 Chart` generates accurate, runnable G2 v5 code following Spec Mode best practices. It covers 30+ chart types (interval, line, area, point, rect, cell, treemap, sankey, chord, wordCloud, gauge, and more), data transforms (stackY, dodgeX, binX, fold, etc.), coordinate systems (cartesian, polar, theta, radial), scales, interactions (brush, slider, legend filter), components (axis, legend, tooltip, annotation), and multi-view compositions. Built-in guard rails prevent common v4→v5 migration pitfalls such as using deprecated chain APIs, invalid palette names, or referencing `d3` in user code.
5656

5757
**Evaluation Results**
5858

@@ -71,6 +71,55 @@ The results show that Harness Engineering enables LLMs to achieve near-productio
7171
> [!TIP]
7272
> More skills are coming soon.
7373
74+
## CLI Usage
75+
76+
We also provide a CLI tool for easy usage in your terminal, Install globally:
77+
78+
```bash
79+
npm install -g chart-visualization-skills
80+
```
81+
82+
**Retrieve or list skills by query**:
83+
84+
```bash
85+
# Retrieve skills by query
86+
chart-visualization-cli retrieve "bar chart" --library g2 --topk 10
87+
88+
# List all available skills
89+
chart-visualization-cli list --library g2 --category core
90+
```
91+
92+
** Usage for the command**:
93+
94+
```
95+
Usage: chart-visualization-cli [options] [command]
96+
97+
CLI tool for AntV chart visualization skills retrieval
98+
99+
Options:
100+
-V, --version output the version number
101+
-h, --help display help for command
102+
103+
Commands:
104+
retrieve [options] <query> Search for skills matching a query
105+
list [options] List all available skills
106+
help [command] display help for command
107+
```
108+
109+
## API Usage
110+
111+
```typescript
112+
import { retrieve } from 'chart-visualization-skills';
113+
114+
const skills = retrieve('bar chart', 'g2', 5);
115+
```
116+
117+
| Parameter | Type | Default | Description |
118+
| :--- | :--- | :--- | :--- |
119+
| `query` | `string` || Search query |
120+
| `library` | `string` | `'g2'` | Library filter (`g2` or `g6`) |
121+
| `topk` | `number` | `7` | Number of results |
122+
74123
## License
75124

76125
MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)