@fastmoss/cli 0.1.6 → 0.1.13

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,79 @@
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
+ 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.
package/README.zh-CN.md CHANGED
@@ -1,218 +1,79 @@
1
- # FastMoss CLI
1
+ # @fastmoss/cli
2
2
 
3
3
  [English](./README.md)
4
4
 
5
- FastMoss CLI 用于在终端或 AI Agent 中发现并调用 FastMoss MCP 工具,覆盖 TikTok Shop 选品、达人发现、店铺分析、广告分析、市场洞察、视频/直播分析和 FastMoss 知识库查询等场景。
5
+ `@fastmoss/cli` 只安装 `fastmoss` 命令。npm 包会解析精确同版本的平台包,安装时和运行时都不会下载二进制文件。
6
6
 
7
- CLI 需要配合 FastMoss CLI Agent Skill 一起使用:
8
-
9
- - `@fastmoss/cli` 安装 `fastmoss` 命令,用于真正执行工具调用。
10
- - `npx skills add FastMoss/cli` 安装 Agent Skill,让你的 Agent 知道有哪些 FastMoss 工具、什么时候使用、怎么调用。
7
+ <!-- FASTMOSS_INSTALLATION_START -->
8
+ ## 安装
11
9
 
12
- 安装 CLI:
10
+ CLI 与 Agent Skill 相互独立,安装其中一个不会自动安装另一个。
13
11
 
14
- ```bash
15
- npm install -g @fastmoss/cli
16
- ```
12
+ ### npm
17
13
 
18
- 单独安装 Skill
14
+ 只安装 CLI
19
15
 
20
16
  ```bash
21
- npx skills add FastMoss/cli -y -g
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
- ## 关于 FastMoss
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
- npm install -g @fastmoss/cli
45
- fastmoss
29
+ npx -y @fastmoss/skill@latest
46
30
  ```
47
31
 
48
- 全局安装后,命令名是 `fastmoss`。如果终端提示 `command not found: fastmoss`,通常是 npm 全局 bin 目录没有加入 `PATH`。
32
+ Skill 命令全程非交互,可以直接发送到 Agent 聊天框由 Agent 执行。默认会把 `fastmoss-cli` 安装到 Codex、Claude 和通用 Agents 三个目录,并输出实际 `SKILL.md` 路径和当前会话加载提示。
49
33
 
50
- 如果你的 npm 配置禁止 lifecycle scripts,可以允许本包的 postinstall 脚本在安装期预下载二进制:
34
+ 指定 Agent 或卸载:
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 和积分
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
- 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
- 如果积分不足,请在开发者平台的计费/价格页面充值或升级套餐。计费和积分规则见 [FastMoss MCP Pricing](https://developers.fastmoss.com/mcp/pricing.html)。
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
- LLM Agent 读取结果时优先使用 `--output mcp`。终端里只想看简洁结果时使用 `--output data`。只有调试原始 RPC 响应时才使用 `--output rpc`。
108
-
109
- 联网命令常用参数:
110
-
111
- ```bash
112
- --api-key <api-key>
113
- --base-url <url>
114
- --timeout <seconds>
115
- --insecure-skip-tls
116
- ```
117
-
118
- ## 支持的工具
119
-
120
- 随包发布的 Agent Skill 包含静态工具目录。你也可以执行 `fastmoss tools` 或 `fastmoss tools --json` 查看当前账号实时可用的工具列表。
121
-
122
- | 分类 | name | title |
123
- |---|---|---|
124
- | 广告工具 | `ad_data_overview` | Ad data overview |
125
- | 广告工具 | `ad_search` | Ad search |
126
- | 达人工具 | `creator_cargo_summary` | Creator ecommerce summary |
127
- | 达人工具 | `creator_data_trends` | Creator data trends |
128
- | 达人工具 | `creator_fans_distribution` | Creator fans distribution |
129
- | 达人工具 | `creator_product_list` | Creator product list |
130
- | 达人工具 | `creator_profile_overview` | Creator profile overview |
131
- | 达人工具 | `creator_rank_top_ecommerce` | Top ecommerce creators |
132
- | 达人工具 | `creator_rank_top_growth` | Top creator follower growth |
133
- | 达人工具 | `creator_rank_top_potential` | Top potential creators |
134
- | 达人工具 | `creator_search` | Creator search |
135
- | 达人工具 | `creator_video_analysis` | Creator video analysis |
136
- | 辅助和知识库工具 | `fastmoss_detail_url_examples` | FastMoss Detail URL Examples |
137
- | 辅助和知识库工具 | `live_detail_analysis` | Live detail analysis and category breakdown |
138
- | 辅助和知识库工具 | `live_products_list` | Live promoted product list |
139
- | 辅助和知识库工具 | `live_search` | Live search |
140
- | 市场洞察工具 | `market_category_analysis` | Category market analysis |
141
- | 市场洞察工具 | `market_category_author_sales_matrix` | Category creator sales matrix |
142
- | 市场洞察工具 | `market_category_ranking` | Category market ranking |
143
- | 商品工具 | `product_category_info` | Product category list |
144
- | 商品工具 | `product_creator_analysis` | Product creator analysis and creator list |
145
- | 商品工具 | `product_detail_info` | Product detail info |
146
- | 商品工具 | `product_investment` | Product ad investment analysis |
147
- | 商品工具 | `product_overview` | Product overview |
148
- | 商品工具 | `product_rank_new_listed` | New listed product ranking |
149
- | 商品工具 | `product_rank_top_selling` | Top selling products |
150
- | 商品工具 | `product_review_list` | Product review list |
151
- | 商品工具 | `product_sales_trend` | Product sales trend |
152
- | 商品工具 | `product_search` | Product search |
153
- | 商品工具 | `product_sku` | Product SKU analysis |
154
- | 商品工具 | `product_video_list` | Product video list |
155
- | 辅助和知识库工具 | `search_category_by_words` | Search TikTok Product Category by Keywords |
156
- | 辅助和知识库工具 | `search_fastmoss_documents` | FastMoss Knowledge Base Search |
157
- | 店铺工具 | `shop_base_info` | Shop base info |
158
- | 店铺工具 | `shop_creator_analysis` | Shop creator analysis and creator list |
159
- | 店铺工具 | `shop_data_trends` | Shop data trends |
160
- | 店铺工具 | `shop_investment_analysis` | Shop ad investment analysis |
161
- | 店铺工具 | `shop_live_analysis` | Shop live analysis and live list |
162
- | 店铺工具 | `shop_product_analysis` | Shop product analysis and product list |
163
- | 店铺工具 | `shop_rank_top_selling` | Top selling shops |
164
- | 店铺工具 | `shop_sale_analysis` | Shop sales analysis |
165
- | 店铺工具 | `shop_search` | Shop search |
166
- | 店铺工具 | `shop_video_analysis` | Shop video analysis and video list |
167
- | 辅助和知识库工具 | `video_data_trends` | Video data trends |
168
- | 辅助和知识库工具 | `video_detail_analysis` | Video detail analysis and product list |
169
- | 辅助和知识库工具 | `video_script_info` | Video subtitle script |
170
- | 辅助和知识库工具 | `video_search` | Video search |
171
-
172
- ## 二进制下载
173
-
174
- 本包会安装 `fastmoss` 命令。npm 包本身不内置 Go 二进制文件,而是在安装或首次运行时从 GitHub Releases 下载当前平台对应的 `fastmoss` 二进制,缓存到本地后转发所有 CLI 参数。
175
-
176
- 安装时会尝试预下载当前平台二进制。如果下载失败,npm 安装仍会完成;首次运行 `fastmoss` 时会再次下载,并显示下载地址。
177
-
178
- 你可以跳过安装期下载,让首次运行时再下载:
179
-
180
- ```bash
181
- FASTMOSS_SKIP_DOWNLOAD=1 npm install -g @fastmoss/cli
182
- ```
183
-
184
- 内部调试或私有镜像可以覆盖下载地址:
185
-
186
- ```bash
187
- FASTMOSS_DOWNLOAD_BASE_URL=https://downloads.example.com/releases npx @fastmoss/cli
188
- ```
189
-
190
- ## 缓存目录
191
-
192
- 默认缓存目录:
193
-
194
- ```text
195
- ~/.fastmoss/bin/<version>/<platform>/
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。需要让 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
- version: packageJSON.version,
8
- configuredDownloadBaseURL: packageJSON.fastmoss?.downloadBaseURL,
9
- }).catch((error) => {
10
- process.stderr.write(`fastmoss wrapper error: ${error.message}\n`);
11
- process.exit(1);
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
+ });