@fastmoss/cli 0.1.6 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -186
- package/README.zh-CN.md +131 -178
- package/bin/fastmoss.js +12 -7
- package/lib/runtime.js +56 -461
- package/lib/targets.js +65 -0
- package/package.json +22 -9
- package/bin/install-skill.js +0 -34
- package/bin/postinstall.js +0 -12
- package/skills/fastmoss-cli/SKILL.md +0 -70
- package/skills/fastmoss-cli/agents/openai.yaml +0 -3
- package/skills/fastmoss-cli/data/tools.json +0 -4014
- package/skills/fastmoss-cli/references/cli.md +0 -70
- package/skills/fastmoss-cli/references/tool-call.md +0 -103
- package/skills/fastmoss-cli/references/tools-advertising.md +0 -48
- package/skills/fastmoss-cli/references/tools-agency.md +0 -145
- package/skills/fastmoss-cli/references/tools-auxiliary-knowledge.md +0 -200
- package/skills/fastmoss-cli/references/tools-creator.md +0 -197
- package/skills/fastmoss-cli/references/tools-market.md +0 -69
- package/skills/fastmoss-cli/references/tools-product.md +0 -230
- package/skills/fastmoss-cli/references/tools-shop.md +0 -200
- package/skills/fastmoss-cli/references/tools.md +0 -26
package/README.zh-CN.md
CHANGED
|
@@ -1,218 +1,171 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @fastmoss/cli
|
|
2
2
|
|
|
3
3
|
[English](./README.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`@fastmoss/cli` 只安装 `fastmoss` 命令。npm 包会解析精确同版本的平台包,安装时和运行时都不会下载二进制文件。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- `@fastmoss/cli` 安装 `fastmoss` 命令,用于真正执行工具调用。
|
|
10
|
-
- `npx skills add FastMoss/cli` 安装 Agent Skill,让你的 Agent 知道有哪些 FastMoss 工具、什么时候使用、怎么调用。
|
|
7
|
+
<!-- FASTMOSS_INSTALLATION_START -->
|
|
8
|
+
## 安装
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
CLI 与 Agent Skill 相互独立,安装其中一个不会自动安装另一个。
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
npm install -g @fastmoss/cli
|
|
16
|
-
```
|
|
12
|
+
### npm
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
只安装 CLI:
|
|
19
15
|
|
|
20
16
|
```bash
|
|
21
|
-
|
|
22
|
-
npx skills add FastMoss/cli --agent claude-code
|
|
23
|
-
# 如果你的 skills CLI 支持 --client:
|
|
24
|
-
npx skills add FastMoss/cli --client claude
|
|
17
|
+
npm install -g @fastmoss/cli@latest
|
|
25
18
|
```
|
|
26
19
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
[FastMoss](https://www.fastmoss.com/) 是面向全球 TikTok 品牌、商家、服务商、创作者和运营团队的数据分析平台。FastMoss 帮助用户洞察大盘趋势、发现爆品和品类机会、寻找达人与机构、监控竞店、分析广告投放,并研究直播生态。
|
|
30
|
-
|
|
31
|
-
FastMoss 主要提供以 TikTok 和 TikTok Shop 为核心的大数据分析服务,覆盖直播、商品、店铺、达人、广告、视频、音乐、标签等版块,涵盖美国、英国、印尼、越南、菲律宾、泰国、马来西亚、西班牙、墨西哥、法国、德国、巴西等主要 TikTok 商业化国家和区域的数据。
|
|
32
|
-
|
|
33
|
-
## 安装
|
|
34
|
-
|
|
35
|
-
不安装,直接通过 npx 运行:
|
|
20
|
+
不做全局安装,临时运行 CLI:
|
|
36
21
|
|
|
37
22
|
```bash
|
|
38
|
-
npx @fastmoss/cli
|
|
23
|
+
npx -y @fastmoss/cli@latest
|
|
39
24
|
```
|
|
40
25
|
|
|
41
|
-
|
|
26
|
+
只安装或更新 Agent Skill:
|
|
42
27
|
|
|
43
28
|
```bash
|
|
44
|
-
|
|
45
|
-
fastmoss
|
|
29
|
+
npx -y @fastmoss/skill@latest
|
|
46
30
|
```
|
|
47
31
|
|
|
48
|
-
|
|
32
|
+
Skill 命令全程非交互,可以直接发送到 Agent 聊天框由 Agent 执行。默认会把 `fastmoss-cli` 安装到 Codex、Claude 和通用 Agents 三个目录,并输出实际 `SKILL.md` 路径和当前会话加载提示。
|
|
49
33
|
|
|
50
|
-
|
|
34
|
+
指定 Agent 或卸载:
|
|
51
35
|
|
|
52
36
|
```bash
|
|
53
|
-
|
|
37
|
+
npx -y @fastmoss/skill@latest --agent codex
|
|
38
|
+
npx -y @fastmoss/skill@latest --agent claude
|
|
39
|
+
npx -y @fastmoss/skill@latest --agent agents
|
|
40
|
+
npx -y @fastmoss/skill@latest --agent all
|
|
41
|
+
npx -y @fastmoss/skill@latest uninstall --agent all
|
|
54
42
|
```
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
FastMoss 工具调用需要 API Key,并会消耗积分。访问 [FastMoss 开发者平台](https://developers.fastmoss.com/mcp/overview.html) 登录、创建 MCP API Key、查看用量并管理积分。
|
|
44
|
+
设置 `FASTMOSS_SKILL_DIR` 后只安装到一个自定义 skills 根目录。npm 安装只使用用户配置的 npm registry,不会从 GitHub 下载文件。
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
### GitHub clone
|
|
61
47
|
|
|
62
48
|
```bash
|
|
63
|
-
|
|
64
|
-
|
|
49
|
+
git clone --depth 1 https://github.com/FastMoss/cli.git
|
|
50
|
+
cd cli
|
|
51
|
+
./install.sh --cli
|
|
52
|
+
./install.sh --skill
|
|
53
|
+
./install.sh --all
|
|
65
54
|
```
|
|
66
55
|
|
|
67
|
-
|
|
56
|
+
Windows PowerShell:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
git clone --depth 1 https://github.com/FastMoss/cli.git
|
|
60
|
+
cd cli
|
|
61
|
+
.\install.ps1 -Cli
|
|
62
|
+
.\install.ps1 -Skill
|
|
63
|
+
.\install.ps1 -All
|
|
64
|
+
```
|
|
68
65
|
|
|
69
|
-
|
|
66
|
+
`--all` 和 `-All` 只是依次执行两个独立安装动作。clone 或下载 GitHub Release 离线包后,安装过程只读取本地文件,不调用 npm,也不继续下载其他文件。
|
|
67
|
+
<!-- FASTMOSS_INSTALLATION_END -->
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
## 使用
|
|
72
70
|
|
|
73
71
|
```bash
|
|
74
72
|
fastmoss --version
|
|
75
73
|
fastmoss help
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
登录和本地配置:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
74
|
fastmoss login --api-key <your-api-key>
|
|
82
|
-
fastmoss logout
|
|
83
|
-
fastmoss whoami
|
|
84
|
-
fastmoss set api-key <your-api-key>
|
|
85
|
-
fastmoss clear api-key
|
|
86
|
-
fastmoss set language zh
|
|
87
|
-
fastmoss set language en
|
|
88
|
-
fastmoss show config
|
|
89
|
-
fastmoss show auth
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
发现工具:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
75
|
fastmoss tools
|
|
96
|
-
fastmoss tools --json
|
|
97
|
-
fastmoss tools --search <tool_name>
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
调用工具:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
76
|
fastmoss call --tool <tool_name> --args '<json>' --output mcp
|
|
104
|
-
fastmoss <tool_name> --args '<json>' --output mcp
|
|
105
77
|
```
|
|
106
78
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
|
|
|
125
|
-
|
|
|
126
|
-
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
|
131
|
-
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
|
146
|
-
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
|
163
|
-
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
FASTMOSS_CACHE_DIR=/custom/cache/dir npx @fastmoss/cli
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## 支持平台
|
|
205
|
-
|
|
206
|
-
- macOS `amd64`
|
|
207
|
-
- macOS `arm64`
|
|
208
|
-
- Linux `amd64`
|
|
209
|
-
- Linux `arm64`
|
|
210
|
-
- Windows `amd64`
|
|
211
|
-
|
|
212
|
-
wrapper 会根据当前平台请求以下资产之一:
|
|
213
|
-
|
|
214
|
-
- `fastmoss-darwin-amd64`
|
|
215
|
-
- `fastmoss-darwin-arm64`
|
|
216
|
-
- `fastmoss-linux-amd64`
|
|
217
|
-
- `fastmoss-linux-arm64`
|
|
218
|
-
- `fastmoss-windows-amd64.exe`
|
|
79
|
+
## CLI Tool Catalog
|
|
80
|
+
|
|
81
|
+
### Advertising Tools
|
|
82
|
+
|
|
83
|
+
| Tool | Description |
|
|
84
|
+
|---|---|
|
|
85
|
+
| `ad_data_overview` | Use when the user has a video_id and wants ad spend, ROAS, play, engagement, follower, and commerce performance over a date range. |
|
|
86
|
+
| `ad_search` | Use when the user wants active ad creatives or needs to filter ads by country, category, landing page, spend, ROAS, plays, or run days. Returns ad, creator, shop, products, and performance sections. |
|
|
87
|
+
|
|
88
|
+
### Agency Tools
|
|
89
|
+
|
|
90
|
+
| Tool | Description |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `agency_creator_analysis` | Use when the user wants agency creator structure, follower tiers, and individual collaborators. Returns distributions and a paginated creator list. |
|
|
93
|
+
| `agency_product_analysis` | Use for agency product-category and price-band structure. Use agency_product_list for individual products. |
|
|
94
|
+
| `agency_product_list` | Use when the user wants individual products promoted through an agency. Supports category, price, period, sorting, and pagination. |
|
|
95
|
+
| `agency_profile_overview` | Use when the user wants an agency profile, historical performance, and recent 7/28/90-day data overview. |
|
|
96
|
+
| `agency_rank_top` | Use when the user wants leading MCN agencies in a market. Returns weekly or monthly agency rankings and period performance. |
|
|
97
|
+
| `agency_search` | Use when the user has an agency name or market clue but no agency_id. Returns matching agencies and recent 7-day performance. |
|
|
98
|
+
| `agency_shop_analysis` | Use when the user wants agency collaborating-shop totals and individual shop performance. |
|
|
99
|
+
|
|
100
|
+
### Creator Tools
|
|
101
|
+
|
|
102
|
+
| Tool | Description |
|
|
103
|
+
|---|---|
|
|
104
|
+
| `creator_cargo_summary` | Use when the user wants a creator video-vs-live selling split and main promoted categories. |
|
|
105
|
+
| `creator_data_trends` | Use when the user asks about creator follower, engagement, or commerce trends. Select field_type; returns daily series and period totals. |
|
|
106
|
+
| `creator_fans_distribution` | Use when the user wants to check whether a creator audience matches a target market. Returns age, gender, location, and top segments. |
|
|
107
|
+
| `creator_product_list` | Use when the user wants a creator showcase product list. Returns product GMV, units sold, category, price, commission, shop info, and time_range_days. |
|
|
108
|
+
| `creator_profile_overview` | Use when the user wants a creator snapshot or partnership check. Returns profile and performance_overview; GMV/rankings are mostly historical cumulative, so use creator_search day28_gmv for current activity. |
|
|
109
|
+
| `creator_rank_top_ecommerce` | Use when the user wants top ecommerce creators. Returns creator and ranking_metrics; date_value is returned as YYYY-Www for weekly rankings. |
|
|
110
|
+
| `creator_rank_top_growth` | Use when the user wants fast-growing creators. Returns creator and growth_metrics; date_value is returned as YYYY-Www for weekly rankings. |
|
|
111
|
+
| `creator_rank_top_potential` | Use when the user wants creators with ecommerce potential. Returns creator, potential_metrics, and audience_summary; date_value is returned as YYYY-Www for weekly rankings. |
|
|
112
|
+
| `creator_search` | Use when the user has no UID and provides a nickname, keyword, niche, or region. Returns creator, commerce_summary, and audience_summary; day28_gmv is the key current-activity metric for tiering; has_email as a boolean, not the email address itself. |
|
|
113
|
+
| `creator_video_analysis` | Use when the user wants creator content direction, tags, and selling videos. Returns video_tag_summary and video_list with interaction_rate_percent and linked_products so the model does not confuse video performance with product performance. |
|
|
114
|
+
|
|
115
|
+
### Product Tools
|
|
116
|
+
|
|
117
|
+
| Tool | Description |
|
|
118
|
+
|---|---|
|
|
119
|
+
| `product_category_info` | Use when the user needs the product category tree or category levels. Prefer search_category_by_words for natural-language category terms. |
|
|
120
|
+
| `product_creator_analysis` | Use when the user wants who sells a product or the creator structure. Returns creator_summary with follower_tier_distribution and creator_category_distribution, plus linked_creators with creator, product_contribution, creator_cumulative_performance, and audience_summary. |
|
|
121
|
+
| `product_detail_info` | Use when the user wants product basics, shop, price, rating, logistics, images, or ad status. Returns product and shop; detail_url points to TikTok. |
|
|
122
|
+
| `product_investment` | Use when the user asks about product ads, spend, ROAS, or daily paid-traffic changes. Returns ad_performance_summary and daily_ad_performance_trend; ad_gmv is ad-attributed. |
|
|
123
|
+
| `product_overview` | Use when the user wants product channel attribution, lifecycle/momentum, or ad-vs-organic structure. Returns period_summary, daily_trend, ads_distribution, channel_distribution, and content_distribution. |
|
|
124
|
+
| `product_rank_new_listed` | Use when the user wants recently listed hot products. Returns FastMoss new-product ranking, first_3d_gmv/units_sold, and total_gmv/units_sold; new means listed within 30 days. |
|
|
125
|
+
| `product_rank_top_selling` | Use when the user wants bestsellers or top products. Returns period_gmv/units_sold, total_gmv/units_sold, and units_sold_growth_rate_percent. |
|
|
126
|
+
| `product_review_list` | Use when the user wants product reviews or buyer feedback. Returns review list and count; supports time_range_days and rating/create_time/review_id sorting. |
|
|
127
|
+
| `product_sales_trend` | Use when the user wants a product GMV/units trend or traction check. Returns period_summary and daily_trend with period_gmv, period_units_sold, daily_gmv, and daily_units_sold. |
|
|
128
|
+
| `product_search` | Use when the user has no product_id and provides a name, keyword, price band, category, bestseller clue, or new-product clue. Returns product, sales_summary, distribution_summary, and shop. |
|
|
129
|
+
| `product_sku` | Use when the user wants SKU sales share, inventory share, or SKU health. Returns SKU-level sales and inventory shares. |
|
|
130
|
+
| `product_video_list` | Use when the user wants videos selling a product, high-play videos, or paid-vs-organic video traffic. Filter with is_ad; returns GMV, plays, video_desc, and fastmoss_url. |
|
|
131
|
+
|
|
132
|
+
### Shop Tools
|
|
133
|
+
|
|
134
|
+
| Tool | Description |
|
|
135
|
+
|---|---|
|
|
136
|
+
| `shop_base_info` | Use when the user wants a shop snapshot, store type, rating, or profile. Returns cumulative GMV/units, ranks, age, product count, and creator/video/live counts. |
|
|
137
|
+
| `shop_creator_analysis` | Use when the user wants shop collaborators, creator tiers, or video-vs-live selling structure. Returns creator list and distributions. |
|
|
138
|
+
| `shop_data_trends` | Use when the user wants recent shop GMV, units, creator, live, video, or active-product trends. Returns daily trends. |
|
|
139
|
+
| `shop_investment_analysis` | Use when the user asks about shop ads, spend, ROAS, ad GMV, or promoted assets. Returns ad estimates and daily changes. |
|
|
140
|
+
| `shop_live_analysis` | Use when the user wants shop live performance, shop-live vs affiliate-live structure, or live sessions. |
|
|
141
|
+
| `shop_product_analysis` | Use when the user wants shop categories, price bands, product mix, or product details. Returns distributions and product list. |
|
|
142
|
+
| `shop_rank_top_selling` | Use when the user wants top shops in a market or category. Returns shop ranking and ecommerce metrics. |
|
|
143
|
+
| `shop_sale_analysis` | Use when the user wants shop sales by short video, live, product card, creator, or self-operated channels. Returns channel_distribution and content_distribution. |
|
|
144
|
+
| `shop_search` | Use when the user has no seller_id and provides a shop name, keyword, or region. Returns matching shops. |
|
|
145
|
+
| `shop_video_analysis` | Use when the user wants shop selling videos, video performance, or ad status. |
|
|
146
|
+
|
|
147
|
+
### Market Insight Tools
|
|
148
|
+
|
|
149
|
+
| Tool | Description |
|
|
150
|
+
|---|---|
|
|
151
|
+
| `market_category_analysis` | Use when the user wants category size, growth, competition, or opportunity. analysis_type basic_metrics returns category, scale_metrics, growth_metrics, concentration_metrics; sales_trends returns trend_series; price_distribution returns sales_price_distribution with left-open right-closed price bands and sub_category_units_sold_total. |
|
|
152
|
+
| `market_category_author_sales_matrix` | Use when the user wants category sales contribution by creator follower_tier. Returns creator_count, category_gmv, gmv_share_percent, units_sold, and avg_creator_gmv. |
|
|
153
|
+
| `market_category_ranking` | Use when the user wants category ranking, growth, or concentration. Returns ranking_scope and ranked_categories; no category_id means level-1 category ranking, and a level-1 category_id means level-2 subcategory ranking. |
|
|
154
|
+
|
|
155
|
+
### Auxiliary and Knowledge Base Tools
|
|
156
|
+
|
|
157
|
+
| Tool | Description |
|
|
158
|
+
|---|---|
|
|
159
|
+
| `fastmoss_detail_url_examples` | Use when the AI needs FastMoss detail-page links. Takes no arguments and returns product, creator, shop, video, and live URL templates. |
|
|
160
|
+
| `live_detail_analysis` | Use when the user wants one live session info, creator, key performance, and category breakdown. |
|
|
161
|
+
| `live_products_list` | Use when the user wants products sold in a live session or high GMV/units within this live session. Returns live_units_sold, live_gmv, commission_rate_percent, sales_timeline only when pagesize <= 10, and shop_cumulative_units_sold. |
|
|
162
|
+
| `live_search` | Use when the user has no room_id and provides a live title, host, or shop. Returns live, creator, and performance_summary. |
|
|
163
|
+
| `search_category_by_words` | Use when the user knows a product/category term but does not have the category_id yet. Returns matched TikTok product category IDs and Chinese category paths. |
|
|
164
|
+
| `search_fastmoss_documents` | Use when the user asks about FastMoss rules, features, terms, or operations rather than real-time business data. Returns knowledge snippets and documents. |
|
|
165
|
+
| `video_data_trends` | Use when the user wants one video play, like, comment, or share trends. Returns daily interaction trends. |
|
|
166
|
+
| `video_detail_analysis` | Use when the user wants one video basics, plays, engagement, interaction rate, IPM, and linked products. |
|
|
167
|
+
| `video_script_info` | Use when the user wants video subtitles or line-by-line spoken copy. Returns start/end time and text; empty subtitles can fall back to video_desc. |
|
|
168
|
+
| `video_search` | Use when the user has no video_id and provides video keywords, title, or creator. Returns matching videos. |
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
这个包只负责 CLI。需要让 Agent 知道如何、何时调用 CLI 时,请单独安装 `@fastmoss/skill`。
|
package/bin/fastmoss.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
const packageJSON = require("../package.json");
|
|
4
4
|
const { runCLI } = require("../lib/runtime");
|
|
5
5
|
|
|
6
|
-
runCLI({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
runCLI({ version: packageJSON.version })
|
|
7
|
+
.then(({ code, signal }) => {
|
|
8
|
+
if (signal) {
|
|
9
|
+
process.kill(process.pid, signal);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
process.exitCode = code == null ? 1 : code;
|
|
13
|
+
})
|
|
14
|
+
.catch((error) => {
|
|
15
|
+
process.stderr.write(`fastmoss wrapper error: ${error.message}\n`);
|
|
16
|
+
process.exitCode = 1;
|
|
17
|
+
});
|