@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 CHANGED
@@ -1,226 +1,171 @@
1
- # FastMoss CLI
1
+ # @fastmoss/cli
2
2
 
3
3
  [中文文档](./README.zh-CN.md)
4
4
 
5
- FastMoss CLI lets terminals and AI agents discover and call FastMoss MCP tools for TikTok Shop product research, creator discovery, shop analysis, ad analysis, market insight, video/live analysis, and FastMoss knowledge-base lookup.
5
+ `@fastmoss/cli` installs the `fastmoss` command. The npm package resolves an exact-version platform package and never downloads a binary at install time or runtime.
6
6
 
7
- Use the CLI together with the FastMoss CLI Agent Skill:
7
+ <!-- FASTMOSS_INSTALLATION_START -->
8
+ ## Installation
8
9
 
9
- - `@fastmoss/cli` installs the `fastmoss` command and executes tool calls.
10
- - `npx skills add FastMoss/cli` installs the Agent Skill so your agent knows which FastMoss tools exist, when to use them, and how to call them.
10
+ The CLI and Agent Skill are independent. Installing either one never installs the other.
11
11
 
12
- Install CLI:
12
+ ### npm
13
13
 
14
- ```bash
15
- npm install -g @fastmoss/cli
16
- ```
17
-
18
- Install Skill separately:
14
+ Install only the CLI:
19
15
 
20
16
  ```bash
21
- npx skills add FastMoss/cli -y -g
22
- npx skills add FastMoss/cli --agent claude-code
23
- # If your skills CLI supports --client:
24
- npx skills add FastMoss/cli --client claude
17
+ npm install -g @fastmoss/cli@latest
25
18
  ```
26
19
 
27
- ## About FastMoss
28
-
29
- [FastMoss](https://www.fastmoss.com/) is a TikTok data analytics platform for global TikTok brands, merchants, service providers, creators, and operation teams. It helps users understand market trends, discover bestselling categories and products, find creators and agencies, monitor competitor shops, analyze ad investment, and study the livestream ecosystem.
30
-
31
- FastMoss provides big-data analytics centered on TikTok and TikTok Shop, covering livestreams, products, shops, creators, ads, videos, music, hashtags, and more. Its data spans major TikTok commercial markets and regions including the United States, United Kingdom, Indonesia, Vietnam, the Philippines, Thailand, Malaysia, Spain, Mexico, France, Germany, Brazil, and others.
32
-
33
- ## Install
34
-
35
- Run without installing:
20
+ Run it temporarily without a global install:
36
21
 
37
22
  ```bash
38
- npx @fastmoss/cli
23
+ npx -y @fastmoss/cli@latest
39
24
  ```
40
25
 
41
- Install globally:
26
+ Install or update only the Agent Skill:
42
27
 
43
28
  ```bash
44
- npm install -g @fastmoss/cli
45
- fastmoss
29
+ npx -y @fastmoss/skill@latest
46
30
  ```
47
31
 
48
- After global installation, the command name is `fastmoss`. If your shell prints `command not found: fastmoss`, make sure your npm global bin directory is in `PATH`.
32
+ The Skill command is non-interactive, so it can be pasted into an Agent conversation for the Agent to execute. By default it installs `fastmoss-cli` for Codex, Claude, and generic Agents, then prints the installed `SKILL.md` paths and a current-conversation handoff.
49
33
 
50
- If your npm configuration blocks lifecycle scripts, allow this package's postinstall script to predownload during install:
34
+ Target or remove a specific installation:
51
35
 
52
36
  ```bash
53
- npm install -g --allow-scripts=@fastmoss/cli @fastmoss/cli
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
- ## API Key and Credits
44
+ Set `FASTMOSS_SKILL_DIR` to install into one custom skills root. npm installation uses only the configured npm registry and does not download from GitHub.
57
45
 
58
- FastMoss tool calls require an API key and consume credits. Visit the [FastMoss Developer Platform](https://developers.fastmoss.com/mcp/overview.html) to sign in, create an MCP API key, view usage, and manage credits.
59
-
60
- Typical setup:
46
+ ### GitHub clone
61
47
 
62
48
  ```bash
63
- fastmoss login --api-key <your-api-key>
64
- fastmoss whoami
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
- If your credits are insufficient, recharge or upgrade from the developer platform billing/pricing pages. Pricing and credit rules are documented in the [FastMoss MCP pricing guide](https://developers.fastmoss.com/mcp/pricing.html).
56
+ On 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
- ## Commands
66
+ `--all` and `-All` run the two independent installers in sequence. Clone and GitHub Release bundles install only from local files after download; they do not invoke npm or fetch additional files.
67
+ <!-- FASTMOSS_INSTALLATION_END -->
70
68
 
71
- Check version and help:
69
+ ## Usage
72
70
 
73
71
  ```bash
74
72
  fastmoss --version
75
73
  fastmoss help
76
- ```
77
-
78
- Authentication and local config:
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
- Discover tools:
93
-
94
- ```bash
95
75
  fastmoss tools
96
- fastmoss tools --json
97
- fastmoss tools --search <tool_name>
98
- ```
99
-
100
- Call tools:
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
- Use `--output mcp` when an LLM or agent will read the result. Use `--output data` when you want a concise payload for terminal use. Use `--output rpc` only for raw RPC debugging.
108
-
109
- Common flags for networked commands:
110
-
111
- ```bash
112
- --api-key <api-key>
113
- --base-url <url>
114
- --timeout <seconds>
115
- --insecure-skip-tls
116
- ```
117
-
118
- ## Supported Tools
119
-
120
- The packaged Agent Skill includes a static tool catalog. Run `fastmoss tools` or `fastmoss tools --json` to check the live tool list available to your account.
121
-
122
- | Category | Name | Title |
123
- |---|---|---|
124
- | Advertising | `ad_data_overview` | Ad data overview |
125
- | Advertising | `ad_search` | Ad search |
126
- | Creator | `creator_cargo_summary` | Creator ecommerce summary |
127
- | Creator | `creator_data_trends` | Creator data trends |
128
- | Creator | `creator_fans_distribution` | Creator fans distribution |
129
- | Creator | `creator_product_list` | Creator product list |
130
- | Creator | `creator_profile_overview` | Creator profile overview |
131
- | Creator | `creator_rank_top_ecommerce` | Top ecommerce creators |
132
- | Creator | `creator_rank_top_growth` | Top creator follower growth |
133
- | Creator | `creator_rank_top_potential` | Top potential creators |
134
- | Creator | `creator_search` | Creator search |
135
- | Creator | `creator_video_analysis` | Creator video analysis |
136
- | Auxiliary and knowledge | `fastmoss_detail_url_examples` | FastMoss Detail URL Examples |
137
- | Auxiliary and knowledge | `live_detail_analysis` | Live detail analysis and category breakdown |
138
- | Auxiliary and knowledge | `live_products_list` | Live promoted product list |
139
- | Auxiliary and knowledge | `live_search` | Live search |
140
- | Market insight | `market_category_analysis` | Category market analysis |
141
- | Market insight | `market_category_author_sales_matrix` | Category creator sales matrix |
142
- | Market insight | `market_category_ranking` | Category market ranking |
143
- | Product | `product_category_info` | Product category list |
144
- | Product | `product_creator_analysis` | Product creator analysis and creator list |
145
- | Product | `product_detail_info` | Product detail info |
146
- | Product | `product_investment` | Product ad investment analysis |
147
- | Product | `product_overview` | Product overview |
148
- | Product | `product_rank_new_listed` | New listed product ranking |
149
- | Product | `product_rank_top_selling` | Top selling products |
150
- | Product | `product_review_list` | Product review list |
151
- | Product | `product_sales_trend` | Product sales trend |
152
- | Product | `product_search` | Product search |
153
- | Product | `product_sku` | Product SKU analysis |
154
- | Product | `product_video_list` | Product video list |
155
- | Auxiliary and knowledge | `search_category_by_words` | Search TikTok Product Category by Keywords |
156
- | Auxiliary and knowledge | `search_fastmoss_documents` | FastMoss Knowledge Base Search |
157
- | Shop | `shop_base_info` | Shop base info |
158
- | Shop | `shop_creator_analysis` | Shop creator analysis and creator list |
159
- | Shop | `shop_data_trends` | Shop data trends |
160
- | Shop | `shop_investment_analysis` | Shop ad investment analysis |
161
- | Shop | `shop_live_analysis` | Shop live analysis and live list |
162
- | Shop | `shop_product_analysis` | Shop product analysis and product list |
163
- | Shop | `shop_rank_top_selling` | Top selling shops |
164
- | Shop | `shop_sale_analysis` | Shop sales analysis |
165
- | Shop | `shop_search` | Shop search |
166
- | Shop | `shop_video_analysis` | Shop video analysis and video list |
167
- | Auxiliary and knowledge | `video_data_trends` | Video data trends |
168
- | Auxiliary and knowledge | `video_detail_analysis` | Video detail analysis and product list |
169
- | Auxiliary and knowledge | `video_script_info` | Video subtitle script |
170
- | Auxiliary and knowledge | `video_search` | Video search |
171
-
172
- ## Binary Download
173
-
174
- This package installs the `fastmoss` command. It does not bundle the Go binary itself. Instead, it downloads the matching `fastmoss` binary from GitHub Releases, stores it in a local cache directory, and then forwards all CLI arguments to that binary.
175
-
176
- During `npm install`, the package tries to predownload the matching binary for the current platform. If the download fails, installation still completes and the wrapper will retry the download on first run with a visible download message.
177
-
178
- The package downloads the current platform's binary from the public GitHub release repository configured in `package.json`.
179
-
180
- If install-time download is blocked or fails, the first `fastmoss` run will download the binary again. You should see output similar to:
181
-
182
- ```text
183
- Downloading fastmoss 0.1.1 from https://github.com/FastMoss/cli/releases/download/...
184
- ```
185
-
186
- You can skip the install-time download and let the first run download the binary:
187
-
188
- ```bash
189
- FASTMOSS_SKIP_DOWNLOAD=1 npm install -g @fastmoss/cli
190
- ```
191
-
192
- For internal debugging or private release mirrors, override the base URL:
193
-
194
- ```bash
195
- FASTMOSS_DOWNLOAD_BASE_URL=https://downloads.example.com/releases npx @fastmoss/cli
196
- ```
197
-
198
- ## Cache Directory
199
-
200
- The downloaded binary is cached here by default:
201
-
202
- ```text
203
- ~/.fastmoss/bin/<version>/<platform>/
204
- ```
205
-
206
- Override the cache directory:
207
-
208
- ```bash
209
- FASTMOSS_CACHE_DIR=/custom/cache/dir npx @fastmoss/cli
210
- ```
211
-
212
- ## Supported Platforms
213
-
214
- - macOS `amd64`
215
- - macOS `arm64`
216
- - Linux `amd64`
217
- - Linux `arm64`
218
- - Windows `amd64`
219
-
220
- The wrapper will request one of these asset names depending on platform:
221
-
222
- - `fastmoss-darwin-amd64`
223
- - `fastmoss-darwin-arm64`
224
- - `fastmoss-linux-amd64`
225
- - `fastmoss-linux-arm64`
226
- - `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
+ This package only installs the CLI. Use `@fastmoss/skill` when you want an Agent Skill that teaches an agent how and when to call the CLI.