@playcraft/cli 0.0.49 → 0.0.52
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 +65 -44
- package/REMIX.md +760 -0
- package/dist/commands/login.js +82 -32
- package/dist/commands/remix.js +1210 -176
- package/dist/utils/playcraft-http-client.js +172 -0
- package/dist/utils/remix-image-attachments.js +125 -0
- package/package.json +8 -3
- package/dist/agent/cloud-connection.test.js +0 -67
- package/dist/agent/local-backend.test.js +0 -52
- package/dist/commands/fix-ids.test.js +0 -264
- package/dist/commands/tools-research.test.js +0 -216
- package/dist/prad/check.test.js +0 -49
- package/dist/sync/sync-manager.test.js +0 -80
package/README.md
CHANGED
|
@@ -78,15 +78,32 @@ npx @playcraft/cli build
|
|
|
78
78
|
npx @playcraft/cli build --platform facebook --format html --output ./dist
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
### 5. 创建并继续编辑 Remix
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# 交互式选择团队和模板并创建 Remix
|
|
85
|
+
playcraft remix run
|
|
86
|
+
|
|
87
|
+
# 之后启动或复用沙箱,并打开 Remix Editor
|
|
88
|
+
playcraft remix start \
|
|
89
|
+
--project-id <project-id> \
|
|
90
|
+
--branch <remix-branch> \
|
|
91
|
+
--open
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
完整的 Remix 子命令、参数、图片传输、自动化输出及故障处理说明见:
|
|
95
|
+
|
|
96
|
+
- [PlayCraft CLI Remix 完整命令参考](./REMIX.md)
|
|
97
|
+
|
|
81
98
|
## 🔐 鉴权说明
|
|
82
99
|
|
|
83
100
|
PlayCraft CLI 支持三种鉴权方式,按优先级依次生效:
|
|
84
101
|
|
|
85
|
-
| 优先级 | 方式
|
|
86
|
-
|
|
87
|
-
| 1
|
|
88
|
-
| 2
|
|
89
|
-
| 3
|
|
102
|
+
| 优先级 | 方式 | 适用场景 |
|
|
103
|
+
| ------ | ----------------------------- | ------------------------------------------------------------------------ |
|
|
104
|
+
| 1 | **`playcraft login`**(推荐) | 交互式登录后自动保存 PAT 到 `~/.playcraft/config.json`,所有命令开箱即用 |
|
|
105
|
+
| 2 | **`.playcraft.json`** | 项目目录下的配置文件,适合 CI/沙箱环境(支持沙箱 JWT) |
|
|
106
|
+
| 3 | **环境变量** | `PLAYCRAFT_TOKEN`(PAT)或 `PLAYCRAFT_SANDBOX_TOKEN`(沙箱 JWT) |
|
|
90
107
|
|
|
91
108
|
### 快速登录
|
|
92
109
|
|
|
@@ -119,59 +136,59 @@ echo '{"token":"<sandbox-jwt>","apiUrl":"https://..."}' > .playcraft.json
|
|
|
119
136
|
|
|
120
137
|
### 开发相关
|
|
121
138
|
|
|
122
|
-
| 命令
|
|
123
|
-
|
|
124
|
-
| `login`
|
|
125
|
-
| `init`
|
|
126
|
-
| `start`
|
|
127
|
-
| `stop`
|
|
128
|
-
| `status`
|
|
129
|
-
| `logs`
|
|
130
|
-
| `config`
|
|
131
|
-
| `inspect` | 检测项目类型与结构
|
|
139
|
+
| 命令 | 说明 | 示例 |
|
|
140
|
+
| --------- | ----------------------------- | -------------------------------------- |
|
|
141
|
+
| `login` | 登录账号,保存 PAT 到全局配置 | `playcraft login` |
|
|
142
|
+
| `init` | 交互式创建配置文件 | `playcraft init` |
|
|
143
|
+
| `start` | 启动本地开发服务 | `playcraft start --project <id>` |
|
|
144
|
+
| `stop` | 停止运行中的服务 | `playcraft stop --project <id>` |
|
|
145
|
+
| `status` | 查看服务运行状态 | `playcraft status` |
|
|
146
|
+
| `logs` | 查看服务日志 | `playcraft logs --follow` |
|
|
147
|
+
| `config` | 读取/修改配置项 | `playcraft config get --key projectId` |
|
|
148
|
+
| `inspect` | 检测项目类型与结构 | `playcraft inspect .` |
|
|
132
149
|
|
|
133
150
|
### 平台 API(需登录或配置鉴权)
|
|
134
151
|
|
|
135
152
|
> 运行 `playcraft login` 后所有子命令均可直接使用。
|
|
136
153
|
|
|
137
|
-
| 命令
|
|
138
|
-
|
|
139
|
-
| `tools generate-image`
|
|
140
|
-
| `tools generate-sfx`
|
|
141
|
-
| `tools generate-bgm`
|
|
142
|
-
| `tools list-image-models` | 列出可用生图模型
|
|
143
|
-
| `tools list-remixes`
|
|
144
|
-
| `tools save-to-git`
|
|
145
|
-
| `tools build-project`
|
|
146
|
-
| `recommend similar`
|
|
147
|
-
| `recommend improvements`
|
|
148
|
-
| `recommend random`
|
|
154
|
+
| 命令 | 说明 | 示例 |
|
|
155
|
+
| ------------------------- | ------------------- | --------------------------------------------------------------------- |
|
|
156
|
+
| `tools generate-image` | AI 生成图片 | `playcraft tools generate-image --prompt "pixel art sky"` |
|
|
157
|
+
| `tools generate-sfx` | AI 生成音效 | `playcraft tools generate-sfx --prompt "UI click"` |
|
|
158
|
+
| `tools generate-bgm` | AI 生成 BGM | `playcraft tools generate-bgm --prompt "casual game music"` |
|
|
159
|
+
| `tools list-image-models` | 列出可用生图模型 | `playcraft tools list-image-models` |
|
|
160
|
+
| `tools list-remixes` | 查看 Remix 项目列表 | `playcraft tools list-remixes` |
|
|
161
|
+
| `tools save-to-git` | 同步沙箱内容到 Git | `playcraft tools save-to-git --project-id <id> --message "feat: ..."` |
|
|
162
|
+
| `tools build-project` | 在沙箱中执行构建 | `playcraft tools build-project --project-id <id>` |
|
|
163
|
+
| `recommend similar` | 相似 Creative 推荐 | `playcraft recommend similar --channel Applovin` |
|
|
164
|
+
| `recommend improvements` | Tag 改进建议 | `playcraft recommend improvements --channel Facebook` |
|
|
165
|
+
| `recommend random` | 随机 Tag 组合推荐 | `playcraft recommend random --channel Google` |
|
|
149
166
|
|
|
150
167
|
### 构建相关
|
|
151
168
|
|
|
152
|
-
| 命令
|
|
153
|
-
|
|
154
|
-
| `build`
|
|
155
|
-
| `build-base`
|
|
169
|
+
| 命令 | 说明 | 示例 |
|
|
170
|
+
| ---------------- | ---------------------------------------- | ------------------------------------------------------ |
|
|
171
|
+
| `build` | 完整打包(阶段1 + 阶段2) | `playcraft build --platform facebook` |
|
|
172
|
+
| `build-base` | 仅执行阶段1(生成多文件产物) | `playcraft build-base ./src --output ./build` |
|
|
156
173
|
| `build-playable` | 仅执行阶段2(从多文件产物生成 Playable) | `playcraft build-playable ./build --platform facebook` |
|
|
157
|
-
| `analyze`
|
|
174
|
+
| `analyze` | 生成打包分析报告 | `playcraft analyze --platform facebook` |
|
|
158
175
|
|
|
159
176
|
## 🎯 支持的平台
|
|
160
177
|
|
|
161
178
|
现已支持 **10 个主流广告平台**:
|
|
162
179
|
|
|
163
|
-
| 平台
|
|
164
|
-
|
|
165
|
-
| **Facebook**
|
|
166
|
-
| **Snapchat**
|
|
167
|
-
| **ironSource**
|
|
168
|
-
| **AppLovin**
|
|
169
|
-
| **Google Ads**
|
|
170
|
-
| **TikTok/Pangle** | ZIP
|
|
171
|
-
| **Unity Ads**
|
|
172
|
-
| **Liftoff**
|
|
173
|
-
| **Moloco**
|
|
174
|
-
| **BIGO Ads**
|
|
180
|
+
| 平台 | 格式 | 大小限制 | SDK/API |
|
|
181
|
+
| ----------------- | -------- | ---------------------------------- | ------------ |
|
|
182
|
+
| **Facebook** | HTML/ZIP | HTML: 5MB / ZIP: 5MB(HTML < 2MB) | FbPlayableAd |
|
|
183
|
+
| **Snapchat** | ZIP | 5MB | MRAID 2.0 |
|
|
184
|
+
| **ironSource** | HTML | 5MB | MRAID + dapi |
|
|
185
|
+
| **AppLovin** | HTML | 5MB | MRAID 2.0 |
|
|
186
|
+
| **Google Ads** | ZIP | 5MB | ExitApi |
|
|
187
|
+
| **TikTok/Pangle** | ZIP | 5MB | Pangle SDK |
|
|
188
|
+
| **Unity Ads** | HTML | 5MB | MRAID 2.0 |
|
|
189
|
+
| **Liftoff** | ZIP | 5MB | MRAID |
|
|
190
|
+
| **Moloco** | HTML | 5MB | FbPlayableAd |
|
|
191
|
+
| **BIGO Ads** | ZIP | 5MB | BIGO SDK |
|
|
175
192
|
|
|
176
193
|
## 💡 使用示例
|
|
177
194
|
|
|
@@ -279,6 +296,7 @@ playcraft build --platform facebook
|
|
|
279
296
|
```
|
|
280
297
|
|
|
281
298
|
**交互界面**:
|
|
299
|
+
|
|
282
300
|
```
|
|
283
301
|
🎬 检测到 20 个场景
|
|
284
302
|
💡 提示: 只打包选中的场景可以显著减小文件大小(通常可减小 30-60%)
|
|
@@ -292,11 +310,13 @@ playcraft build --platform facebook
|
|
|
292
310
|
```
|
|
293
311
|
|
|
294
312
|
**优化效果**:
|
|
313
|
+
|
|
295
314
|
- 🎯 单场景:减小 40-60%
|
|
296
315
|
- 🎯 2-3 个场景:减小 30-50%
|
|
297
316
|
- 🎯 自动过滤未使用的资源
|
|
298
317
|
|
|
299
318
|
**命令行模式**:
|
|
319
|
+
|
|
300
320
|
```bash
|
|
301
321
|
# 指定单个场景
|
|
302
322
|
playcraft build --platform facebook --scenes MainScene
|
|
@@ -309,6 +329,7 @@ playcraft build --platform facebook --scenes "MainScene,Gameplay"
|
|
|
309
329
|
|
|
310
330
|
## 🔗 相关链接
|
|
311
331
|
|
|
332
|
+
- [Remix 完整命令参考](./REMIX.md)
|
|
312
333
|
- [PlayCraft 项目](https://github.com/your-org/playcraft)
|
|
313
334
|
- [完整文档](../../docs/cli/README.md)
|
|
314
335
|
- [快速开始指南](../../docs/cli/quick-start.md)
|