@nocobase/cli 2.1.18 → 2.1.20

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.
@@ -9,14 +9,17 @@
9
9
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
10
10
  import path from 'node:path';
11
11
  import { dockerContainerExists, dockerContainerIsRunning, startDockerContainer, stopDockerContainer, } from './app-runtime.js';
12
+ import { loadAuthConfig } from './auth-store.js';
12
13
  import { CADDY_PROXY_DRIVER_OPTIONS, DEFAULT_CADDY_PROXY_DRIVER, getCliConfigValue, normalizeCaddyProxyDriver, resolveDockerContainerPrefix, setCliConfigValue, } from './cli-config.js';
13
14
  import { resolveCliHomeRoot } from './cli-home.js';
14
15
  import { applyEnvProxyAppEntryOptions, buildManualEnvProxyCaddyBundle, buildEnvProxyCaddyBundle, buildEnvProxyMainConfig, mapProxyPathFromCliRoot, resolveEnvProxyMainOutputPath, } from './env-proxy.js';
15
- import { run } from './run-npm.js';
16
+ import { normalizeEnvProxyConfig } from './env-proxy-config.js';
17
+ import { commandOutput, run } from './run-npm.js';
16
18
  const DOCKER_CADDY_PROXY_CONTAINER_SUFFIX = 'caddy-proxy';
17
19
  const DOCKER_CADDY_PROXY_IMAGE = 'caddy:latest';
18
20
  const DOCKER_CADDY_PROXY_RUNTIME_ROOT = '/apps';
19
21
  const DOCKER_CADDY_PROXY_CONF_DESTINATION = '/etc/caddy/Caddyfile';
22
+ const DEFAULT_DOCKER_CADDY_PROXY_PUBLISHED_PORTS = [80, 443];
20
23
  async function readOptionalTextFile(filePath) {
21
24
  try {
22
25
  return await readFile(filePath, 'utf8');
@@ -171,11 +174,16 @@ async function reloadLocalCaddyProxy(runtimeContext) {
171
174
  }
172
175
  async function ensureDockerCaddyProxyContainer(runtimeContext) {
173
176
  const containerName = await resolveCaddyProxyContainerName();
177
+ const mainConfigPath = await ensureCaddyProxyMainConfig(runtimeContext);
178
+ const publishedPorts = await resolveDockerCaddyPublishedPorts();
174
179
  if (await dockerContainerExists(containerName)) {
175
- return;
180
+ if (await dockerCaddyProxyContainerMatchesPublishedPorts(containerName, publishedPorts)) {
181
+ return;
182
+ }
183
+ await removeDockerCaddyProxyContainer(containerName);
176
184
  }
177
185
  const hostCliRoot = String(process.env.NB_CLI_ROOT ?? resolveCliHomeRoot()).trim() || resolveCliHomeRoot();
178
- const mainConfigPath = await ensureCaddyProxyMainConfig(runtimeContext);
186
+ const dockerPortArgs = publishedPorts.flatMap((port) => ['-p', `${port}:${port}`]);
179
187
  await run('docker', [
180
188
  'run',
181
189
  '-d',
@@ -183,8 +191,7 @@ async function ensureDockerCaddyProxyContainer(runtimeContext) {
183
191
  containerName,
184
192
  '--add-host',
185
193
  'host.docker.internal:host-gateway',
186
- '-p',
187
- '80:80',
194
+ ...dockerPortArgs,
188
195
  '-v',
189
196
  `${hostCliRoot}:${DOCKER_CADDY_PROXY_RUNTIME_ROOT}`,
190
197
  '-v',
@@ -195,14 +202,53 @@ async function ensureDockerCaddyProxyContainer(runtimeContext) {
195
202
  stdio: 'ignore',
196
203
  });
197
204
  }
205
+ async function resolveDockerCaddyPublishedPorts() {
206
+ const config = await loadAuthConfig();
207
+ const ports = new Set(DEFAULT_DOCKER_CADDY_PROXY_PUBLISHED_PORTS);
208
+ for (const envConfig of Object.values(config.envs)) {
209
+ const port = normalizeEnvProxyConfig(envConfig.proxy)?.port;
210
+ if (port !== undefined) {
211
+ ports.add(port);
212
+ }
213
+ }
214
+ return Array.from(ports).sort((left, right) => left - right);
215
+ }
216
+ async function readDockerCaddyPublishedPorts(containerName) {
217
+ const output = await commandOutput('docker', ['inspect', '--format', '{{json .HostConfig.PortBindings}}', containerName], { errorName: 'docker inspect' });
218
+ const parsed = JSON.parse(output.trim() || '{}');
219
+ const ports = new Set();
220
+ for (const bindings of Object.values(parsed)) {
221
+ if (!Array.isArray(bindings)) {
222
+ continue;
223
+ }
224
+ for (const binding of bindings) {
225
+ const port = Number.parseInt(String(binding?.HostPort ?? '').trim(), 10);
226
+ if (Number.isInteger(port) && port > 0) {
227
+ ports.add(port);
228
+ }
229
+ }
230
+ }
231
+ return Array.from(ports).sort((left, right) => left - right);
232
+ }
233
+ async function dockerCaddyProxyContainerMatchesPublishedPorts(containerName, expectedPorts) {
234
+ const currentPorts = await readDockerCaddyPublishedPorts(containerName);
235
+ return currentPorts.length === expectedPorts.length && currentPorts.every((port, index) => port === expectedPorts[index]);
236
+ }
237
+ async function removeDockerCaddyProxyContainer(containerName) {
238
+ await run('docker', ['rm', '-f', containerName], {
239
+ errorName: 'docker rm',
240
+ stdio: 'ignore',
241
+ });
242
+ }
198
243
  async function startDockerCaddyProxy(runtimeContext) {
199
244
  const containerName = await resolveCaddyProxyContainerName();
200
245
  await ensureCaddyProxyMainConfig(runtimeContext);
201
- if (await dockerContainerExists(containerName)) {
246
+ const existedBeforeEnsure = await dockerContainerExists(containerName);
247
+ await ensureDockerCaddyProxyContainer(runtimeContext);
248
+ if (existedBeforeEnsure && (await dockerContainerExists(containerName))) {
202
249
  const state = await startDockerContainer(containerName, { stdio: 'ignore' });
203
250
  return state === 'already-running' ? 'already-running' : 'started';
204
251
  }
205
- await ensureDockerCaddyProxyContainer(runtimeContext);
206
252
  return 'started';
207
253
  }
208
254
  async function stopDockerCaddyProxy() {
@@ -9,14 +9,17 @@
9
9
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
10
10
  import path from 'node:path';
11
11
  import { dockerContainerExists, dockerContainerIsRunning, startDockerContainer, stopDockerContainer, } from './app-runtime.js';
12
+ import { loadAuthConfig } from './auth-store.js';
12
13
  import { DEFAULT_NGINX_PROXY_DRIVER, getCliConfigValue, NGINX_PROXY_DRIVER_OPTIONS, normalizeNginxProxyDriver, resolveDockerContainerPrefix, setCliConfigValue, } from './cli-config.js';
13
14
  import { resolveCliHomeRoot } from './cli-home.js';
14
15
  import { applyEnvProxyAppEntryOptions, appConfigHasManagedNginxBlock, buildManualEnvProxyNginxBundle, buildEnvProxyMainConfig, buildEnvProxyNginxBundle, extractManagedNginxConfigBlock, installEnvProxyProvider, mapProxyPathFromCliRoot, reloadEnvProxyProvider, resolveEnvProxyMainOutputPath, replaceManagedNginxConfigBlock, syncEnvProxyNginxSnippets, } from './env-proxy.js';
15
- import { run } from './run-npm.js';
16
+ import { normalizeEnvProxyConfig } from './env-proxy-config.js';
17
+ import { commandOutput, run } from './run-npm.js';
16
18
  const DOCKER_NGINX_PROXY_CONTAINER_SUFFIX = 'nginx-proxy';
17
19
  const DOCKER_NGINX_PROXY_IMAGE = 'nginx:latest';
18
20
  const DOCKER_NGINX_PROXY_RUNTIME_ROOT = '/apps';
19
21
  const DOCKER_NGINX_PROXY_CONF_DESTINATION = '/etc/nginx/conf.d/default.conf';
22
+ const DEFAULT_DOCKER_NGINX_PROXY_PUBLISHED_PORTS = [80, 443];
20
23
  async function readOptionalTextFile(filePath) {
21
24
  try {
22
25
  return await readFile(filePath, 'utf8');
@@ -231,11 +234,16 @@ async function reloadLocalNginxProxy(runtimeContext) {
231
234
  }
232
235
  async function ensureDockerNginxProxyContainer(runtimeContext) {
233
236
  const containerName = await resolveNginxProxyContainerName();
237
+ const mainConfigPath = await ensureNginxProxyMainConfig(runtimeContext);
238
+ const publishedPorts = await resolveDockerNginxPublishedPorts();
234
239
  if (await dockerContainerExists(containerName)) {
235
- return;
240
+ if (await dockerNginxProxyContainerMatchesPublishedPorts(containerName, publishedPorts)) {
241
+ return;
242
+ }
243
+ await removeDockerNginxProxyContainer(containerName);
236
244
  }
237
245
  const hostCliRoot = String(process.env.NB_CLI_ROOT ?? resolveCliHomeRoot()).trim() || resolveCliHomeRoot();
238
- const mainConfigPath = await ensureNginxProxyMainConfig(runtimeContext);
246
+ const dockerPortArgs = publishedPorts.flatMap((port) => ['-p', `${port}:${port}`]);
239
247
  await run('docker', [
240
248
  'run',
241
249
  '-d',
@@ -243,8 +251,7 @@ async function ensureDockerNginxProxyContainer(runtimeContext) {
243
251
  containerName,
244
252
  '--add-host',
245
253
  'host.docker.internal:host-gateway',
246
- '-p',
247
- '80:80',
254
+ ...dockerPortArgs,
248
255
  '-v',
249
256
  `${hostCliRoot}:${DOCKER_NGINX_PROXY_RUNTIME_ROOT}`,
250
257
  '-v',
@@ -255,14 +262,53 @@ async function ensureDockerNginxProxyContainer(runtimeContext) {
255
262
  stdio: 'ignore',
256
263
  });
257
264
  }
265
+ async function resolveDockerNginxPublishedPorts() {
266
+ const config = await loadAuthConfig();
267
+ const ports = new Set(DEFAULT_DOCKER_NGINX_PROXY_PUBLISHED_PORTS);
268
+ for (const envConfig of Object.values(config.envs)) {
269
+ const port = normalizeEnvProxyConfig(envConfig.proxy)?.port;
270
+ if (port !== undefined) {
271
+ ports.add(port);
272
+ }
273
+ }
274
+ return Array.from(ports).sort((left, right) => left - right);
275
+ }
276
+ async function readDockerNginxPublishedPorts(containerName) {
277
+ const output = await commandOutput('docker', ['inspect', '--format', '{{json .HostConfig.PortBindings}}', containerName], { errorName: 'docker inspect' });
278
+ const parsed = JSON.parse(output.trim() || '{}');
279
+ const ports = new Set();
280
+ for (const bindings of Object.values(parsed)) {
281
+ if (!Array.isArray(bindings)) {
282
+ continue;
283
+ }
284
+ for (const binding of bindings) {
285
+ const port = Number.parseInt(String(binding?.HostPort ?? '').trim(), 10);
286
+ if (Number.isInteger(port) && port > 0) {
287
+ ports.add(port);
288
+ }
289
+ }
290
+ }
291
+ return Array.from(ports).sort((left, right) => left - right);
292
+ }
293
+ async function dockerNginxProxyContainerMatchesPublishedPorts(containerName, expectedPorts) {
294
+ const currentPorts = await readDockerNginxPublishedPorts(containerName);
295
+ return currentPorts.length === expectedPorts.length && currentPorts.every((port, index) => port === expectedPorts[index]);
296
+ }
297
+ async function removeDockerNginxProxyContainer(containerName) {
298
+ await run('docker', ['rm', '-f', containerName], {
299
+ errorName: 'docker rm',
300
+ stdio: 'ignore',
301
+ });
302
+ }
258
303
  async function startDockerNginxProxy(runtimeContext) {
259
304
  const containerName = await resolveNginxProxyContainerName();
260
305
  await ensureNginxProxyMainConfig(runtimeContext);
261
- if (await dockerContainerExists(containerName)) {
306
+ const existedBeforeEnsure = await dockerContainerExists(containerName);
307
+ await ensureDockerNginxProxyContainer(runtimeContext);
308
+ if (existedBeforeEnsure && (await dockerContainerExists(containerName))) {
262
309
  const state = await startDockerContainer(containerName, { stdio: 'ignore' });
263
310
  return state === 'already-running' ? 'already-running' : 'started';
264
311
  }
265
- await ensureDockerNginxProxyContainer(runtimeContext);
266
312
  return 'started';
267
313
  }
268
314
  async function stopDockerNginxProxy() {
@@ -93,20 +93,20 @@
93
93
  "envAdd": {
94
94
  "prompts": {
95
95
  "name": {
96
- "message": "What would you like to call this environment?",
96
+ "message": "App environment identifier",
97
97
  "placeholder": "default"
98
98
  },
99
99
  "scope": {
100
- "message": "Where should this connection be saved?",
100
+ "message": "Connection save location",
101
101
  "globalLabel": "Global",
102
102
  "globalHint": "user-level config"
103
103
  },
104
104
  "apiBaseUrl": {
105
- "message": "What is the API base URL?",
105
+ "message": "API base URL",
106
106
  "placeholder": "https://demo.example.com/api or https://demo.example.com/api/__app/<subapp>"
107
107
  },
108
108
  "authType": {
109
- "message": "Which authentication method would you like to use?",
109
+ "message": "Authentication method",
110
110
  "basicLabel": "Basic authentication (username + password)",
111
111
  "basicHint": "uses your credentials to fetch a token after save",
112
112
  "oauthLabel": "OAuth (browser authentication)",
@@ -114,14 +114,14 @@
114
114
  "tokenLabel": "API token / API key"
115
115
  },
116
116
  "username": {
117
- "message": "Enter the username for basic login",
117
+ "message": "Basic login username",
118
118
  "placeholder": "admin"
119
119
  },
120
120
  "password": {
121
- "message": "Enter the password for basic login"
121
+ "message": "Basic login password"
122
122
  },
123
123
  "accessToken": {
124
- "message": "Enter an API token or API key",
124
+ "message": "API token or API key",
125
125
  "placeholder": "Enter your API token / API key"
126
126
  }
127
127
  }
@@ -179,7 +179,7 @@
179
179
  },
180
180
  "prompts": {
181
181
  "provideMethod": {
182
- "message": "How do you want to provide the license key?",
182
+ "message": "License key input method",
183
183
  "keyOption": "Paste the license key",
184
184
  "fileOption": "Read the key from a file"
185
185
  },
@@ -252,7 +252,7 @@
252
252
  },
253
253
  "prompts": {
254
254
  "source": {
255
- "message": "How would you like to get NocoBase?",
255
+ "message": "NocoBase install source",
256
256
  "dockerLabel": "Docker install (Recommended)",
257
257
  "dockerHint": "Best for no-code and low-maintenance setups. You can upgrade later by pulling a newer image and restarting the app.",
258
258
  "npmLabel": "create-nocobase-app install",
@@ -261,7 +261,7 @@
261
261
  "gitHint": "Best when you want to try the latest unreleased changes, contribute code, or debug and modify NocoBase source directly. This option is more developer-oriented."
262
262
  },
263
263
  "version": {
264
- "message": "Which version would you like to use?",
264
+ "message": "NocoBase version",
265
265
  "latestLabel": "latest",
266
266
  "latestHint": "Stable release. Best for production use and the most predictable experience.",
267
267
  "betaLabel": "beta",
@@ -272,15 +272,15 @@
272
272
  "otherHint": "Enter another package version, Docker tag, or Git ref manually, such as a branch name."
273
273
  },
274
274
  "otherVersion": {
275
- "message": "Enter the version, Docker tag, or Git ref you want to use.",
275
+ "message": "Custom version, Docker tag, or Git ref",
276
276
  "placeholder": "For example: fix/cli-v2"
277
277
  },
278
278
  "dockerRegistry": {
279
- "message": "Which Docker registry would you like to use? The image tag is set separately in Version.",
279
+ "message": "Docker registry (image tag is set in Version)",
280
280
  "placeholder": "nocobase/nocobase"
281
281
  },
282
282
  "dockerPlatform": {
283
- "message": "Which Docker image platform should be used?",
283
+ "message": "Architecture",
284
284
  "autoLabel": "Auto",
285
285
  "autoHint": "Use Docker default for this machine"
286
286
  },
@@ -323,79 +323,79 @@
323
323
  },
324
324
  "prompts": {
325
325
  "env": {
326
- "message": "What would you like to call this app?",
326
+ "message": "App environment identifier",
327
327
  "placeholder": "local"
328
328
  },
329
329
  "lang": {
330
- "message": "Which language would you like to use for the app?"
330
+ "message": "App language"
331
331
  },
332
332
  "appPath": {
333
- "message": "Where should this app be stored? (relative to {{root}})",
333
+ "message": "App directory (relative to {{root}})",
334
334
  "placeholder": "./<env>/"
335
335
  },
336
336
  "appPort": {
337
- "message": "Which port should this app use?",
337
+ "message": "App port",
338
338
  "placeholder": "13000"
339
339
  },
340
340
  "appPublicPath": {
341
- "message": "What is the app subpath? (for example, /nocobase/)",
341
+ "message": "App subpath (for example, /nocobase/)",
342
342
  "placeholder": "/ or /nocobase/"
343
343
  },
344
344
  "storagePath": {
345
- "message": "Where should uploads and local files be stored?",
345
+ "message": "Uploads and local files directory",
346
346
  "placeholder": "./<env>/storage/"
347
347
  },
348
348
  "dbDialect": {
349
- "message": "Which database would you like to use?"
349
+ "message": "Database type"
350
350
  },
351
351
  "builtinDb": {
352
- "message": "Would you like to use the built-in database?"
352
+ "message": "Use built-in database"
353
353
  },
354
354
  "builtinDbImage": {
355
- "message": "Which Docker image should be used for the built-in database?",
355
+ "message": "Built-in database Docker image",
356
356
  "placeholder": "postgres:16"
357
357
  },
358
358
  "dbHost": {
359
- "message": "What is the database host?",
359
+ "message": "Database host",
360
360
  "placeholder": "127.0.0.1"
361
361
  },
362
362
  "dbPort": {
363
- "message": "What is the database port?",
363
+ "message": "Database port",
364
364
  "placeholder": "5432"
365
365
  },
366
366
  "dbDatabase": {
367
- "message": "What is the database name?"
367
+ "message": "Database name"
368
368
  },
369
369
  "dbUser": {
370
- "message": "What is the database username?"
370
+ "message": "Database username"
371
371
  },
372
372
  "dbPassword": {
373
- "message": "What is the database password?"
373
+ "message": "Database password"
374
374
  },
375
375
  "dbSchema": {
376
- "message": "What is the database schema? (PostgreSQL only, optional)",
376
+ "message": "Database schema (PostgreSQL/KingbaseES only, optional)",
377
377
  "placeholder": "Leave empty to use the default schema"
378
378
  },
379
379
  "dbTablePrefix": {
380
- "message": "What table prefix should be used? (optional)",
380
+ "message": "Database table prefix (optional)",
381
381
  "placeholder": "For example: nb_"
382
382
  },
383
383
  "dbUnderscored": {
384
- "message": "Use underscored names for database tables and columns?"
384
+ "message": "Use underscored names for database tables and columns"
385
385
  },
386
386
  "rootUsername": {
387
- "message": "Choose the initial admin username",
387
+ "message": "Initial admin username",
388
388
  "placeholder": "nocobase"
389
389
  },
390
390
  "rootEmail": {
391
- "message": "What is the initial admin email?",
391
+ "message": "Initial admin email",
392
392
  "placeholder": "admin@nocobase.com"
393
393
  },
394
394
  "rootPassword": {
395
- "message": "Choose the initial admin password"
395
+ "message": "Initial admin password"
396
396
  },
397
397
  "rootNickname": {
398
- "message": "What display name should the initial admin use?",
398
+ "message": "Initial admin display name",
399
399
  "placeholder": "Super Admin"
400
400
  }
401
401
  }
@@ -419,11 +419,11 @@
419
419
  },
420
420
  "prompts": {
421
421
  "appName": {
422
- "message": "What should this environment use for `--env`?",
422
+ "message": "Unique app environment identifier (used by the CLI to locate and manage this environment)",
423
423
  "placeholder": "local"
424
424
  },
425
425
  "setupMode": {
426
- "message": "How would you like to set up this environment?",
426
+ "message": "App environment setup method",
427
427
  "installNewLabel": "Install a new app",
428
428
  "installNewHint": "Install a brand-new app from scratch. Best for first-time setup, evaluation, or a fresh local environment.",
429
429
  "manageLocalLabel": "Manage an app already on this machine",
@@ -432,7 +432,7 @@
432
432
  "connectRemoteHint": "Save only the remote app connection. Nothing will be installed or taken over on this machine."
433
433
  },
434
434
  "installSkills": {
435
- "message": "Install NocoBase AI coding skills (nocobase/skills)?"
435
+ "message": "Install NocoBase AI coding skills (nocobase/skills)"
436
436
  },
437
437
  "apiBaseUrl": {
438
438
  "message": "API base URL",
@@ -93,20 +93,20 @@
93
93
  "envAdd": {
94
94
  "prompts": {
95
95
  "name": {
96
- "message": "你想如何命名这个环境?",
96
+ "message": "应用环境标识",
97
97
  "placeholder": "default"
98
98
  },
99
99
  "scope": {
100
- "message": "这个连接要保存到哪里?",
100
+ "message": "连接保存位置",
101
101
  "globalLabel": "全局",
102
102
  "globalHint": "保存在用户级配置中"
103
103
  },
104
104
  "apiBaseUrl": {
105
- "message": "API 基础地址是什么?",
105
+ "message": "API 基础地址",
106
106
  "placeholder": "https://demo.example.com/api 或 https://demo.example.com/api/__app/<subapp>"
107
107
  },
108
108
  "authType": {
109
- "message": "你想使用哪种认证方式?",
109
+ "message": "认证方式",
110
110
  "basicLabel": "Basic 认证(用户名 + 密码)",
111
111
  "basicHint": "保存后会用用户名和密码换取 Token",
112
112
  "oauthLabel": "OAuth(浏览器认证)",
@@ -114,14 +114,14 @@
114
114
  "tokenLabel": "API Token / API Key"
115
115
  },
116
116
  "username": {
117
- "message": "请输入 Basic 登录用户名",
117
+ "message": "Basic 登录用户名",
118
118
  "placeholder": "admin"
119
119
  },
120
120
  "password": {
121
- "message": "请输入 Basic 登录密码"
121
+ "message": "Basic 登录密码"
122
122
  },
123
123
  "accessToken": {
124
- "message": "请输入 API Token 或 API Key",
124
+ "message": "API Token 或 API Key",
125
125
  "placeholder": "请输入你的 API Token / API Key"
126
126
  }
127
127
  }
@@ -179,7 +179,7 @@
179
179
  },
180
180
  "prompts": {
181
181
  "provideMethod": {
182
- "message": "你想通过哪种方式提供 license key?",
182
+ "message": "License key 提供方式",
183
183
  "keyOption": "直接粘贴 license key",
184
184
  "fileOption": "从文件读取 key"
185
185
  },
@@ -252,7 +252,7 @@
252
252
  },
253
253
  "prompts": {
254
254
  "source": {
255
- "message": "你想通过哪种方式获取 NocoBase?",
255
+ "message": "NocoBase 获取方式",
256
256
  "dockerLabel": "Docker 安装(推荐)",
257
257
  "dockerHint": "适合无代码或低维护成本场景。后续升级时,拉取新镜像并重启应用即可。",
258
258
  "npmLabel": "create-nocobase-app 安装",
@@ -261,7 +261,7 @@
261
261
  "gitHint": "适合体验最新未发布版本、参与贡献,或直接修改和调试 NocoBase 源码。这个方式更偏向开发者使用。"
262
262
  },
263
263
  "version": {
264
- "message": "你想使用哪个版本?",
264
+ "message": "NocoBase 版本",
265
265
  "latestLabel": "latest",
266
266
  "latestHint": "稳定版。适合生产环境和希望获得稳定体验的场景。",
267
267
  "betaLabel": "beta",
@@ -272,15 +272,15 @@
272
272
  "otherHint": "手动填写其他版本号、Docker tag 或 Git ref,例如分支名。"
273
273
  },
274
274
  "otherVersion": {
275
- "message": "请输入你想使用的版本号、Docker tag 或 Git ref",
275
+ "message": "自定义版本号、Docker tag 或 Git ref",
276
276
  "placeholder": "例如:fix/cli-v2"
277
277
  },
278
278
  "dockerRegistry": {
279
- "message": "你想使用哪个 Docker registry?镜像 tag 请单独在 Version 中填写。",
279
+ "message": "Docker registry(镜像 tag 在版本中单独设置)",
280
280
  "placeholder": "registry.cn-shanghai.aliyuncs.com/nocobase/nocobase"
281
281
  },
282
282
  "dockerPlatform": {
283
- "message": "要使用哪个 Docker 镜像平台?",
283
+ "message": "架构",
284
284
  "autoLabel": "自动",
285
285
  "autoHint": "由 Docker 根据当前机器自动选择"
286
286
  },
@@ -323,79 +323,79 @@
323
323
  },
324
324
  "prompts": {
325
325
  "env": {
326
- "message": "你想如何命名这个应用?",
326
+ "message": "应用环境标识",
327
327
  "placeholder": "local"
328
328
  },
329
329
  "lang": {
330
- "message": "你希望应用使用哪种语言?"
330
+ "message": "应用语言"
331
331
  },
332
332
  "appPath": {
333
- "message": "应用要放到哪里?(相对路径基于 {{root}})",
333
+ "message": "应用目录(相对路径基于 {{root}})",
334
334
  "placeholder": "./<env>/"
335
335
  },
336
336
  "appPort": {
337
- "message": "应用要使用哪个端口?",
337
+ "message": "应用端口",
338
338
  "placeholder": "13000"
339
339
  },
340
340
  "appPublicPath": {
341
- "message": "应用的子路径是什么?(例如 /nocobase/)",
341
+ "message": "应用子路径(例如 /nocobase/)",
342
342
  "placeholder": "/ 或 /nocobase/"
343
343
  },
344
344
  "storagePath": {
345
- "message": "上传文件和本地存储目录要放到哪里?",
345
+ "message": "上传文件和本地存储目录",
346
346
  "placeholder": "./<env>/storage/"
347
347
  },
348
348
  "dbDialect": {
349
- "message": "你想使用哪种数据库?"
349
+ "message": "数据库类型"
350
350
  },
351
351
  "builtinDb": {
352
- "message": "是否使用内置数据库?"
352
+ "message": "使用内置数据库"
353
353
  },
354
354
  "builtinDbImage": {
355
- "message": "内置数据库要使用哪个 Docker 镜像?",
355
+ "message": "内置数据库 Docker 镜像",
356
356
  "placeholder": "postgres:16"
357
357
  },
358
358
  "dbHost": {
359
- "message": "数据库主机地址是什么?",
359
+ "message": "数据库主机地址",
360
360
  "placeholder": "127.0.0.1"
361
361
  },
362
362
  "dbPort": {
363
- "message": "数据库端口是什么?",
363
+ "message": "数据库端口",
364
364
  "placeholder": "5432"
365
365
  },
366
366
  "dbDatabase": {
367
- "message": "数据库名称是什么?"
367
+ "message": "数据库名称"
368
368
  },
369
369
  "dbUser": {
370
- "message": "数据库用户名是什么?"
370
+ "message": "数据库用户名"
371
371
  },
372
372
  "dbPassword": {
373
- "message": "数据库密码是什么?"
373
+ "message": "数据库密码"
374
374
  },
375
375
  "dbSchema": {
376
- "message": "数据库 schema 是什么?(仅 PostgreSQL,可选)",
376
+ "message": "数据库 schema(仅 PostgreSQL/KingbaseES,可选)",
377
377
  "placeholder": "留空则使用默认 schema"
378
378
  },
379
379
  "dbTablePrefix": {
380
- "message": "要使用什么数据表前缀?(可选)",
380
+ "message": "数据表前缀(可选)",
381
381
  "placeholder": "例如:nb_"
382
382
  },
383
383
  "dbUnderscored": {
384
- "message": "数据库表名和字段名是否使用下划线风格?"
384
+ "message": "数据库表名和字段名使用下划线风格"
385
385
  },
386
386
  "rootUsername": {
387
- "message": "设置初始管理员用户名",
387
+ "message": "初始管理员用户名",
388
388
  "placeholder": "nocobase"
389
389
  },
390
390
  "rootEmail": {
391
- "message": "初始管理员邮箱是什么?",
391
+ "message": "初始管理员邮箱",
392
392
  "placeholder": "admin@nocobase.com"
393
393
  },
394
394
  "rootPassword": {
395
- "message": "设置初始管理员密码"
395
+ "message": "初始管理员密码"
396
396
  },
397
397
  "rootNickname": {
398
- "message": "初始管理员显示名称是什么?",
398
+ "message": "初始管理员显示名称",
399
399
  "placeholder": "Super Admin"
400
400
  }
401
401
  }
@@ -419,11 +419,11 @@
419
419
  },
420
420
  "prompts": {
421
421
  "appName": {
422
- "message": "这个环境要使用什么 `--env` 标识?",
422
+ "message": "应用环境唯一标识(CLI 将通过该标识定位并操作对应环境)",
423
423
  "placeholder": "local"
424
424
  },
425
425
  "setupMode": {
426
- "message": "你想用哪种方式配置这个环境?",
426
+ "message": "应用环境配置方式",
427
427
  "installNewLabel": "新安装",
428
428
  "installNewHint": "从零安装一个新的应用,适合首次部署、试用或新建本地开发环境。",
429
429
  "manageLocalLabel": "本机接管",
@@ -432,7 +432,7 @@
432
432
  "connectRemoteHint": "只保存远程应用的连接信息,不在本机安装或接管应用。"
433
433
  },
434
434
  "installSkills": {
435
- "message": "是否安装 NocoBase AI coding skills(nocobase/skills)?"
435
+ "message": "安装 NocoBase AI coding skills(nocobase/skills"
436
436
  },
437
437
  "apiBaseUrl": {
438
438
  "message": "API 基础地址",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "2.1.18",
3
+ "version": "2.1.20",
4
4
  "description": "NocoBase Command Line Tool",
5
5
  "type": "module",
6
6
  "main": "dist/generated/command-registry.js",
@@ -144,5 +144,5 @@
144
144
  "type": "git",
145
145
  "url": "git+https://github.com/nocobase/nocobase.git"
146
146
  },
147
- "gitHead": "2234b42b21c96d22a4b65a1f16a65ae61f434779"
147
+ "gitHead": "ca646ba28bb11da083e3436866552932ed780b6f"
148
148
  }