@cloudbase/cli 2.8.0-beta.6 → 2.8.0-beta.7
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.
|
@@ -6,7 +6,7 @@ const { spawn } = require('child_process')
|
|
|
6
6
|
|
|
7
7
|
// 获取内置包的路径并拼接 CLI 路径
|
|
8
8
|
const mcpPackagePath = require.resolve('@cloudbase/cloudbase-mcp')
|
|
9
|
-
const mcpCliPath = path.join(path.dirname(mcpPackagePath), 'cli.
|
|
9
|
+
const mcpCliPath = path.join(path.dirname(mcpPackagePath), 'cli.cjs')
|
|
10
10
|
|
|
11
11
|
// 执行内置的 MCP CLI
|
|
12
12
|
const child = spawn('node', [mcpCliPath, ...process.argv.slice(2)], {
|
package/lib/utils/ai/const.js
CHANGED
package/lib/utils/ai/router.js
CHANGED
|
@@ -202,13 +202,13 @@ class AICommandRouter {
|
|
|
202
202
|
name: 'templateType',
|
|
203
203
|
message: '选择要下载的模板类型:',
|
|
204
204
|
choices: [
|
|
205
|
+
{ name: '🟦 微信小程序 + CloudBase', value: 'miniprogram' },
|
|
205
206
|
{ name: '🚀 Web 应用 - React + CloudBase', value: 'react' },
|
|
206
207
|
{ name: '🟢 Web 应用 - Vue + CloudBase', value: 'vue' },
|
|
207
|
-
{ name: '🟦 微信小程序 + CloudBase', value: 'miniprogram' },
|
|
208
208
|
{ name: '🌈 跨端应用 - UniApp + CloudBase', value: 'uniapp' },
|
|
209
209
|
{ name: '🧩 只下载 AI 规则和配置', value: 'rules' }
|
|
210
210
|
],
|
|
211
|
-
default: '
|
|
211
|
+
default: 'miniprogram'
|
|
212
212
|
}
|
|
213
213
|
]);
|
|
214
214
|
const shouldCheckOverwrite = yield this.shouldCheckOverwrite(templateType);
|
|
@@ -989,6 +989,9 @@ class AICommandRouter {
|
|
|
989
989
|
if (argsStr.includes('npm-global-exec@latest') && argsStr.includes('@cloudbase/cloudbase-mcp@latest')) {
|
|
990
990
|
result.command = 'cloudbase-mcp';
|
|
991
991
|
result.args = [];
|
|
992
|
+
result.env = {
|
|
993
|
+
INTEGRATION_IDE: process.env.INTEGRATION_IDE || 'CloudBaseCLI'
|
|
994
|
+
};
|
|
992
995
|
modified = true;
|
|
993
996
|
log.debug(`修改配置文件 ${filePath}: npx -> cloudbase-mcp`);
|
|
994
997
|
}
|
|
@@ -1030,6 +1033,9 @@ class AICommandRouter {
|
|
|
1030
1033
|
if (argsStr.includes('@cloudbase/cloudbase-mcp@latest')) {
|
|
1031
1034
|
result.command = 'cloudbase-mcp';
|
|
1032
1035
|
result.args = [];
|
|
1036
|
+
result.env = {
|
|
1037
|
+
INTEGRATION_IDE: process.env.INTEGRATION_IDE || 'CloudBaseCLI'
|
|
1038
|
+
};
|
|
1033
1039
|
modified = true;
|
|
1034
1040
|
log.debug(`修改配置文件 ${filePath}: npx -> cloudbase-mcp`);
|
|
1035
1041
|
}
|
package/lib/utils/ai/setup.js
CHANGED
|
@@ -236,6 +236,7 @@ class AISetupWizard {
|
|
|
236
236
|
choices: [
|
|
237
237
|
{ name: 'Kimi - https://api.moonshot.cn/anthropic', value: 'https://api.moonshot.cn/anthropic' },
|
|
238
238
|
{ name: '智谱 - https://open.bigmodel.cn/api/anthropic', value: 'https://open.bigmodel.cn/api/anthropic' },
|
|
239
|
+
{ name: 'Anthropic - https://api.anthropic.com', value: 'https://api.anthropic.com' },
|
|
239
240
|
{ name: '🛠️ 自定义 URL', value: 'custom' }
|
|
240
241
|
],
|
|
241
242
|
default: 'https://api.moonshot.cn/anthropic'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/cli",
|
|
3
|
-
"version": "2.8.0-beta.
|
|
3
|
+
"version": "2.8.0-beta.7",
|
|
4
4
|
"description": "cli tool for cloudbase",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"bin": {
|
|
23
23
|
"cloudbase": "bin/cloudbase.js",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"cloudbase-mcp": "bin/cloudbase-mcp.cjs",
|
|
25
|
+
"tcb": "bin/tcb.js"
|
|
26
26
|
},
|
|
27
27
|
"husky": {
|
|
28
28
|
"hooks": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"license": "ISC",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@cloudbase/cloud-api": "^0.5.5",
|
|
36
|
-
"@cloudbase/cloudbase-mcp": "^1.8.
|
|
36
|
+
"@cloudbase/cloudbase-mcp": "^1.8.28",
|
|
37
37
|
"@cloudbase/framework-core": "^1.9.7",
|
|
38
38
|
"@cloudbase/functions-framework": "1.16.0",
|
|
39
39
|
"@cloudbase/iac-core": "0.0.3-alpha.11",
|
package/post-install.js
CHANGED
|
@@ -4,17 +4,19 @@ const { execSync } = require('child_process')
|
|
|
4
4
|
|
|
5
5
|
const isWin32 = process.platform === 'win32'
|
|
6
6
|
|
|
7
|
-
const print =
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const print =
|
|
8
|
+
(color = null) =>
|
|
9
|
+
(str = '') => {
|
|
10
|
+
const terminalCols = retrieveCols()
|
|
11
|
+
const strLength = str.replace(/\u001B\[[0-9]{2}m/g, '').length
|
|
12
|
+
const leftPaddingLength = Math.floor((terminalCols - strLength) / 2)
|
|
13
|
+
const leftPadding = ' '.repeat(Math.max(leftPaddingLength, 0))
|
|
14
|
+
if (color) {
|
|
15
|
+
str = chalk[color](str)
|
|
16
|
+
}
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
+
console.log(leftPadding, str)
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
const retrieveCols = (() => {
|
|
20
22
|
let result = false
|
|
@@ -52,7 +54,7 @@ function printFooter() {
|
|
|
52
54
|
print()(
|
|
53
55
|
' '.repeat(15) +
|
|
54
56
|
`${chalk.bold(emoji('👉'))} ${chalk.underline(
|
|
55
|
-
'https://docs.cloudbase.net/cli-v1/quick-start
|
|
57
|
+
'https://docs.cloudbase.net/cli-v1/quick-start'
|
|
56
58
|
)}`
|
|
57
59
|
)
|
|
58
60
|
emptyLine()
|
|
@@ -304,7 +304,7 @@ export declare const CLOUDBASE_PROVIDERS: readonly [{
|
|
|
304
304
|
readonly models: readonly ["deepseek-v3"];
|
|
305
305
|
readonly transformer: "deepseek";
|
|
306
306
|
}, {
|
|
307
|
-
readonly name: "
|
|
307
|
+
readonly name: "Kimi";
|
|
308
308
|
readonly value: "kimi";
|
|
309
309
|
readonly models: readonly ["Kimi-K2-Instruct-Online-128K"];
|
|
310
310
|
readonly transformer: any;
|