@demogo-cn/cli 0.2.8 → 0.2.10
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 +4 -5
- package/bin/demogo.js +8 -7
- package/lib/core.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ DemoGo CLI lets AI coding tools publish a local project to DemoGo and return a s
|
|
|
6
6
|
|
|
7
7
|
Current MVP delivery uses a local install package.
|
|
8
8
|
|
|
9
|
-
1. Unzip `demogo-cli-v0.2.
|
|
9
|
+
1. Unzip `demogo-cli-v0.2.10.zip`.
|
|
10
10
|
2. Open a terminal in the extracted folder.
|
|
11
11
|
3. Run:
|
|
12
12
|
|
|
@@ -37,7 +37,7 @@ Run the command from a clean project folder. Do not run it directly from Desktop
|
|
|
37
37
|
Use without installing:
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
npx --yes @demogo-cn/cli deploy
|
|
40
|
+
npx --yes @demogo-cn/cli deploy --api https://demogo.cn --token <DemoGo AI publish token>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
Or use the installed command:
|
|
@@ -54,7 +54,7 @@ demogo deploy --dir <project-folder> --name <project-name>
|
|
|
54
54
|
|
|
55
55
|
If you only have one HTML file, put that file in a clean folder and publish that folder. You do not need to rename the file to `index.html`.
|
|
56
56
|
|
|
57
|
-
Project names are used for display in the DemoGo workbench.
|
|
57
|
+
Project names are used for display in the DemoGo workbench. Every first publish receives an automatically assigned trial link path. Lite and Pro users can later customize the `/d/...` path in the workbench. Pro users can apply for a `xxx.demogo.cn` subdomain.
|
|
58
58
|
|
|
59
59
|
## Current Boundary
|
|
60
60
|
|
|
@@ -65,7 +65,7 @@ DemoGo supports static pages, single HTML pages, built frontend output, and fron
|
|
|
65
65
|
AI coding tools can run:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npx --yes @demogo-cn/cli deploy
|
|
68
|
+
npx --yes @demogo-cn/cli deploy --api https://demogo.cn --token <DemoGo AI publish token>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Or install it globally:
|
|
@@ -78,4 +78,3 @@ demogo deploy
|
|
|
78
78
|
The package name is `@demogo-cn/cli`; the installed command remains `demogo`.
|
|
79
79
|
If an AI coding tool cannot run `demogo` or `npx @demogo-cn/cli`, it should explain why and then use DemoGo MCP or the Agent API fallback.
|
|
80
80
|
|
|
81
|
-
|
package/bin/demogo.js
CHANGED
|
@@ -108,16 +108,16 @@ async function handleDeploy(args) {
|
|
|
108
108
|
if (!apiBase) {
|
|
109
109
|
fail([
|
|
110
110
|
"缺少 DemoGo 平台地址。",
|
|
111
|
-
"
|
|
112
|
-
"demogo
|
|
111
|
+
"可以直接运行:",
|
|
112
|
+
"demogo deploy --api <DemoGo平台地址> --token <你的AI发布口令>"
|
|
113
113
|
].join("\n"));
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
if (!token) {
|
|
117
117
|
fail([
|
|
118
118
|
"缺少 DemoGo AI 发布口令。",
|
|
119
|
-
"
|
|
120
|
-
`demogo
|
|
119
|
+
"可以直接运行:",
|
|
120
|
+
`demogo deploy --api ${apiBase || "<DemoGo平台地址>"} --token <你的AI发布口令>`
|
|
121
121
|
].join("\n"));
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -128,7 +128,7 @@ async function handleDeploy(args) {
|
|
|
128
128
|
|
|
129
129
|
const archivePath = path.join(await mkdtemp(path.join(os.tmpdir(), "demogo-cli-")), `${safeArchiveName(projectName)}.tar.gz`);
|
|
130
130
|
try {
|
|
131
|
-
console.log("DemoGo
|
|
131
|
+
console.log("DemoGo 正在准备当前项目...");
|
|
132
132
|
printProjectSummary(summarizeProject(projectDir, fileList));
|
|
133
133
|
console.log("DemoGo 正在打包项目...");
|
|
134
134
|
await createProjectArchive(projectDir, fileList, archivePath);
|
|
@@ -218,8 +218,7 @@ function printDeployResult(result) {
|
|
|
218
218
|
function printProjectSummary(summary) {
|
|
219
219
|
console.log(`项目目录:${summary.projectDir}`);
|
|
220
220
|
console.log(`准备上传:${summary.fileCount} 个文件,约 ${formatBytes(summary.totalBytes)}`);
|
|
221
|
-
|
|
222
|
-
if (summary.hasPackageJson) console.log("源码项目:已发现 package.json");
|
|
221
|
+
if (summary.hasPackageJson) console.log("DemoGo 会自动判断是否需要生成网页版本。");
|
|
223
222
|
}
|
|
224
223
|
|
|
225
224
|
function maskToken(token) {
|
|
@@ -238,6 +237,7 @@ DemoGo CLI ${VERSION}
|
|
|
238
237
|
demogo config clear
|
|
239
238
|
demogo doctor
|
|
240
239
|
demogo deploy
|
|
240
|
+
demogo deploy --api <DemoGo地址> --token <AI发布口令>
|
|
241
241
|
demogo deploy --name <项目名称> --dir <项目目录>
|
|
242
242
|
|
|
243
243
|
本地安装:
|
|
@@ -250,6 +250,7 @@ DemoGo CLI ${VERSION}
|
|
|
250
250
|
|
|
251
251
|
示例:
|
|
252
252
|
demogo config set --api https://your-demogo.example.com --token dmg_xxx_xxx
|
|
253
|
+
demogo deploy --api https://your-demogo.example.com --token dmg_xxx_xxx
|
|
253
254
|
demogo deploy --name 我的报名页
|
|
254
255
|
`.trim());
|
|
255
256
|
}
|
package/lib/core.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
|
|
5
|
-
export const VERSION = "0.2.
|
|
5
|
+
export const VERSION = "0.2.10";
|
|
6
6
|
export const MAX_FILES = 800;
|
|
7
7
|
export const MAX_BYTES = 50 * 1024 * 1024;
|
|
8
8
|
|
|
@@ -352,5 +352,5 @@ function readableHttpError(status, text) {
|
|
|
352
352
|
if (status === 400) return "项目暂时不能发布,请根据 DemoGo 返回的提示修改后再试。";
|
|
353
353
|
if (text?.trim().startsWith("<")) return "服务器返回了异常页面,本次发布没有完成。";
|
|
354
354
|
return `DemoGo 发布失败:HTTP ${status}`;
|
|
355
|
-
}
|
|
355
|
+
}
|
|
356
356
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@demogo-cn/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "DemoGo CLI for generating shareable trial links from AI-built pages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
"node": ">=18.0.0"
|
|
15
15
|
},
|
|
16
16
|
"license": "UNLICENSED"
|
|
17
|
-
}
|
|
17
|
+
}
|