@icyfenix-dmla/cli 2026.4.18-957 → 2026.4.19-39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icyfenix-dmla/cli",
3
- "version": "2026.4.18-957",
3
+ "version": "2026.4.19-39",
4
4
  "description": "DMLA 沙箱服务命令行工具",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -17,7 +17,8 @@
17
17
  "enquirer": "^2.4.1",
18
18
  "dockerode": "^4.0.2",
19
19
  "express": "^4.21.2",
20
- "cors": "^2.8.5"
20
+ "cors": "^2.8.5",
21
+ "@icyfenix-dmla/install": "*"
21
22
  },
22
23
  "devDependencies": {
23
24
  "jest": "^29.7.0"
@@ -19,7 +19,7 @@ const CONFIG = {
19
19
  imageCpu: 'dmla-sandbox:cpu',
20
20
  imageGpu: 'dmla-sandbox:gpu',
21
21
  dockerhubRegistry: 'icyfenix',
22
- tcrRegistry: 'ccr.ccs.tencentyun.com/icyfenix',
22
+ acrRegistry: 'crpi-aani1ibpows293b8.cn-hangzhou.personal.cr.aliyuncs.com/fenixsoft',
23
23
  imageName: 'dmla-sandbox',
24
24
  defaultPort: 3001
25
25
  }
@@ -28,8 +28,8 @@ const CONFIG = {
28
28
  * 获取镜像仓库地址
29
29
  */
30
30
  function getRegistryUrl(registry) {
31
- if (registry === 'tcr') {
32
- return `${CONFIG.tcrRegistry}/${CONFIG.imageName}`
31
+ if (registry === 'acr') {
32
+ return `${CONFIG.acrRegistry}/${CONFIG.imageName}`
33
33
  }
34
34
  return `${CONFIG.dockerhubRegistry}/${CONFIG.imageName}`
35
35
  }
@@ -40,7 +40,7 @@ function getRegistryUrl(registry) {
40
40
  export async function installImages(types, registry = 'dockerhub') {
41
41
  const registryUrl = getRegistryUrl(registry)
42
42
 
43
- console.log(chalk.gray(` 从 ${registry === 'tcr' ? '腾讯云 TCR' : 'Docker Hub'} 拉取镜像`))
43
+ console.log(chalk.gray(` 从 ${registry === 'acr' ? '阿里云 ACR' : 'Docker Hub'} 拉取镜像`))
44
44
 
45
45
  for (const type of types) {
46
46
  console.log()
@@ -289,13 +289,13 @@ export async function runDoctor() {
289
289
  console.log(chalk.yellow(' ⚠️ Docker Hub 连接超时或受限'))
290
290
  }
291
291
 
292
- // 测试 TCR
293
- console.log(chalk.gray(' 测试腾讯云 TCR 连接...'))
292
+ // 测试 ACR
293
+ console.log(chalk.gray(' 测试阿里云 ACR 连接...'))
294
294
  try {
295
- execSync('docker pull ccr.ccs.tencentyun.com/icyfenix/dmla-sandbox:cpu --quiet', { timeout: 10000 })
296
- console.log(chalk.green(' ✅ TCR 连接正常'))
295
+ execSync('docker pull crpi-aani1ibpows293b8.cn-hangzhou.personal.cr.aliyuncs.com/fenixsoft/dmla-sandbox:cpu --quiet', { timeout: 10000 })
296
+ console.log(chalk.green(' ✅ ACR 连接正常'))
297
297
  } catch {
298
- console.log(chalk.yellow(' ⚠️ TCR 连接超时或受限'))
298
+ console.log(chalk.yellow(' ⚠️ ACR 连接超时或受限'))
299
299
  }
300
300
 
301
301
  console.log()
package/src/index.js CHANGED
@@ -5,7 +5,8 @@
5
5
  import { program } from 'commander'
6
6
  import chalk from 'chalk'
7
7
  import { startServer, stopServer, getStatus } from './commands/server.js'
8
- import { installImages, updateAll, runDoctor } from './commands/manage.js'
8
+ import { updateAll, runDoctor } from './commands/manage.js'
9
+ import { runInstallTUI } from '@icyfenix-dmla/install'
9
10
 
10
11
  const VERSION = '0.0.0' // 将在发布时由 workflow 更新
11
12
 
@@ -58,24 +59,9 @@ program
58
59
  // ─────────────────────────────────────────────────────────────
59
60
  program
60
61
  .command('install')
61
- .description('安装 Docker 镜像')
62
- .option('--cpu', '仅安装 CPU 版本')
63
- .option('--gpu', '仅安装 GPU 版本')
64
- .option('--all', '安装所有镜像(默认)')
65
- .option('-r, --registry <type>', '镜像仓库 (dockerhub/tcr)', 'dockerhub')
66
- .action(async (options) => {
67
- const registry = options.registry
68
- let types = []
69
-
70
- if (options.cpu) types.push('cpu')
71
- if (options.gpu) types.push('gpu')
72
- if (types.length === 0 || options.all) types = ['cpu', 'gpu']
73
-
74
- console.log(chalk.blue('📦 安装 DMLA Docker 镜像...'))
75
- console.log(chalk.gray(` 仓库: ${registry}`))
76
- console.log(chalk.gray(` 类型: ${types.join(', ')}`))
77
-
78
- await installImages(types, registry)
62
+ .description('启动安装向导')
63
+ .action(async () => {
64
+ await runInstallTUI()
79
65
  })
80
66
 
81
67
  // ─────────────────────────────────────────────────────────────
@@ -84,7 +70,7 @@ program
84
70
  program
85
71
  .command('update')
86
72
  .description('更新 npm 包和 Docker 镜像')
87
- .option('-r, --registry <type>', '镜像仓库 (dockerhub/tcr)', 'dockerhub')
73
+ .option('-r, --registry <type>', '镜像仓库 (dockerhub/acr)', 'dockerhub')
88
74
  .action(async (options) => {
89
75
  console.log(chalk.blue('🔄 更新 DMLA...'))
90
76
  await updateAll(options.registry)
Binary file