@nocobase/cli 2.2.0-beta.9 → 2.2.0-test.15

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.
Files changed (39) hide show
  1. package/assets/env-proxy/nginx/snippets/uploads-location.conf +4 -1
  2. package/dist/commands/app/start.js +21 -1
  3. package/dist/commands/config/set.js +1 -0
  4. package/dist/commands/env/info.js +11 -1
  5. package/dist/commands/init.js +131 -4
  6. package/dist/commands/install.js +129 -6
  7. package/dist/commands/portal/create.js +105 -0
  8. package/dist/commands/portal/deploy.js +81 -0
  9. package/dist/commands/portal/destroy.js +104 -0
  10. package/dist/commands/portal/dev.js +71 -0
  11. package/dist/commands/portal/index.js +20 -0
  12. package/dist/commands/portal/info.js +82 -0
  13. package/dist/commands/portal/list.js +98 -0
  14. package/dist/commands/portal/pull.js +77 -0
  15. package/dist/commands/portal/push.js +79 -0
  16. package/dist/commands/source/dev.js +1 -1
  17. package/dist/commands/source/download.js +2 -2
  18. package/dist/lib/auth-store.js +3 -1
  19. package/dist/lib/cli-config.js +23 -2
  20. package/dist/lib/env-config.js +3 -0
  21. package/dist/lib/env-proxy.js +102 -3
  22. package/dist/lib/managed-init-env.js +6 -1
  23. package/dist/lib/portal-command-env.js +31 -0
  24. package/dist/lib/portal-create.js +488 -0
  25. package/dist/lib/portal-deploy.js +275 -0
  26. package/dist/lib/portal-destroy.js +100 -0
  27. package/dist/lib/portal-dev.js +79 -0
  28. package/dist/lib/portal-env-files.js +53 -0
  29. package/dist/lib/portal-info.js +31 -0
  30. package/dist/lib/portal-list.js +197 -0
  31. package/dist/lib/portal-source.js +416 -0
  32. package/dist/lib/portal-template.js +190 -0
  33. package/dist/lib/prompt-catalog-terminal.js +32 -19
  34. package/dist/lib/prompt-web-ui.js +13 -2
  35. package/dist/lib/run-npm.js +17 -16
  36. package/dist/lib/ui.js +28 -1
  37. package/dist/locale/en-US.json +191 -37
  38. package/dist/locale/zh-CN.json +191 -37
  39. package/package.json +5 -3
@@ -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
  }
@@ -168,6 +168,126 @@
168
168
  "refusal": "Refusing to run against env \"{{requestedEnv}}\" because the current env is \"{{currentEnv}}\" and interactive confirmation is unavailable in the current agent session.\n\nFor safety, the agent will not switch envs automatically and will not add --yes on your behalf.\n\nTo continue:\n- run `nb env use {{requestedEnv}}` yourself and then re-run the command, or\n- re-run the same command with `--env {{requestedEnv}} --yes` to confirm this one-off cross-env operation."
169
169
  }
170
170
  },
171
+ "portalCreate": {
172
+ "errors": {
173
+ "envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
174
+ "noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
175
+ "templateInvalidDirectory": "Portal template \"{{source}}\" is invalid: expected a directory.",
176
+ "localTemplateMissing": "Portal template directory does not exist: {{source}}",
177
+ "templateUnresolved": "Portal template \"{{source}}\" could not be resolved. {{details}}",
178
+ "templateDownloadFailed": "Failed to download Portal template \"{{source}}\" with npm pack. {{details}}",
179
+ "templateExtractFailed": "Failed to extract Portal template \"{{source}}\": {{details}}",
180
+ "templateMissingPackageJson": "Portal template \"{{source}}\" is invalid: package.json is missing.",
181
+ "npmPackNoTarball": "npm pack did not produce a local tarball for {{source}}.",
182
+ "npmPackMultipleTarballs": "npm pack produced multiple tarballs for {{source}}.",
183
+ "invalidPortalName": "Invalid Portal name \"{{value}}\". Use lowercase letters, numbers, underscores, or hyphens, and start with a lowercase letter or number.",
184
+ "invalidPortalAppName": "Invalid Portal app name \"{{value}}\" from apiBaseUrl. Use letters, numbers, underscores, or hyphens, and start with a letter or number.",
185
+ "missingApiBaseUrl": "Cannot create a Portal workspace because the selected env has no apiBaseUrl.",
186
+ "outsideParent": "Refusing to modify a Portal workspace outside {{parentDir}}: {{portalDir}}",
187
+ "sshUnsupported": "Cannot create a Portal workspace for ssh envs in the first version.",
188
+ "workspaceExists": "Portal workspace already exists: {{portalDir}}\nPass --force to delete it and create a new workspace."
189
+ },
190
+ "messages": {
191
+ "skipInstall": "Skipped pnpm install because package.json was not found in {{portalDir}}.",
192
+ "created": "Portal \"{{portal}}\" created at {{portalDir}}.",
193
+ "app": "App: {{app}}",
194
+ "base": "Base: {{base}}"
195
+ }
196
+ },
197
+ "portalDeploy": {
198
+ "errors": {
199
+ "envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
200
+ "noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
201
+ "workspaceMissing": "Portal workspace does not exist: {{portalDir}}\nRun `nb portal create {{portal}}` first.",
202
+ "packageJsonMissing": "Portal workspace is invalid: package.json is missing in {{portalDir}}.",
203
+ "distMissing": "Portal build did not produce {{distDir}}/index.html.",
204
+ "unsupportedEnvKind": "Cannot deploy a Portal workspace for {{kind}} envs in the first version.",
205
+ "uploadFailed": "Portal dist upload failed with status {{status}}\n{{details}}",
206
+ "recordSyncFailed": "Portal record sync failed with status {{status}}\n{{details}}"
207
+ },
208
+ "messages": {
209
+ "deployed": "Portal \"{{portal}}\" deployed.",
210
+ "mode": "Mode: {{mode}}",
211
+ "app": "App: {{app}}",
212
+ "base": "Base: {{base}}",
213
+ "record": "Record: synced",
214
+ "dist": "Dist: {{dist}}",
215
+ "localDist": "Local dist: {{dist}}",
216
+ "serverDist": "Server dist: {{dist}}"
217
+ }
218
+ },
219
+ "portalList": {
220
+ "errors": {
221
+ "envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
222
+ "noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
223
+ "unsupportedEnvKind": "Cannot list Portal workspaces for {{kind}} envs in the first version.",
224
+ "listFailed": "Portal list failed with status {{status}}\n{{details}}"
225
+ },
226
+ "messages": {
227
+ "empty": "No Portal records found."
228
+ },
229
+ "table": {
230
+ "name": "Name",
231
+ "url": "URL",
232
+ "developmentMode": "Development mode",
233
+ "path": "Local path",
234
+ "enabled": "Enabled",
235
+ "localSynced": "Local synced"
236
+ }
237
+ },
238
+ "portalInfo": {
239
+ "errors": {
240
+ "envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
241
+ "noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
242
+ "notFound": "Portal \"{{portal}}\" was not found."
243
+ },
244
+ "fields": {
245
+ "name": "Name",
246
+ "url": "URL",
247
+ "developmentMode": "Development mode",
248
+ "path": "Local path",
249
+ "enabled": "Enabled",
250
+ "localSynced": "Local synced"
251
+ }
252
+ },
253
+ "portalDestroy": {
254
+ "errors": {
255
+ "envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
256
+ "noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
257
+ "confirmationRequired": "Refusing to destroy a Portal in non-interactive mode without --yes.",
258
+ "outsideParent": "Refusing to delete a Portal workspace outside {{parentDir}}: {{portalDir}}",
259
+ "workspaceMissing": "Portal workspace does not exist: {{portalDir}}\nPass --force to ignore missing local files.",
260
+ "unsupportedEnvKind": "Cannot destroy a Portal workspace for {{kind}} envs in the first version.",
261
+ "recordDestroyFailed": "Portal record destroy failed with status {{status}}\n{{details}}"
262
+ },
263
+ "prompts": {
264
+ "confirm": "Destroy Portal \"{{portal}}\" and delete its storage directory?"
265
+ },
266
+ "messages": {
267
+ "destroyed": "Portal \"{{portal}}\" destroyed.",
268
+ "mode": "Mode: {{mode}}",
269
+ "app": "App: {{app}}",
270
+ "base": "Base: {{base}}",
271
+ "record": "Record: {{status}}",
272
+ "workspace": "Workspace: {{status}} ({{dir}})"
273
+ }
274
+ },
275
+ "portalDev": {
276
+ "errors": {
277
+ "envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
278
+ "noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
279
+ "workspaceMissing": "Portal workspace does not exist: {{portalDir}}\nRun `nb portal create {{portal}}` first.",
280
+ "packageJsonMissing": "Portal workspace is invalid: package.json is missing in {{portalDir}}.",
281
+ "sshUnsupported": "Cannot start a Portal workspace in dev mode for ssh envs in the first version."
282
+ },
283
+ "messages": {
284
+ "starting": "Starting Portal \"{{portal}}\"...",
285
+ "mode": "Mode: {{mode}}",
286
+ "app": "App: {{app}}",
287
+ "base": "Base: {{base}}",
288
+ "dir": "Dir: {{dir}}"
289
+ }
290
+ },
171
291
  "license": {
172
292
  "activate": {
173
293
  "interactive": {
@@ -179,7 +299,7 @@
179
299
  },
180
300
  "prompts": {
181
301
  "provideMethod": {
182
- "message": "How do you want to provide the license key?",
302
+ "message": "License key input method",
183
303
  "keyOption": "Paste the license key",
184
304
  "fileOption": "Read the key from a file"
185
305
  },
@@ -252,7 +372,7 @@
252
372
  },
253
373
  "prompts": {
254
374
  "source": {
255
- "message": "How would you like to get NocoBase?",
375
+ "message": "NocoBase install source",
256
376
  "dockerLabel": "Docker install (Recommended)",
257
377
  "dockerHint": "Best for no-code and low-maintenance setups. You can upgrade later by pulling a newer image and restarting the app.",
258
378
  "npmLabel": "create-nocobase-app install",
@@ -261,7 +381,7 @@
261
381
  "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
382
  },
263
383
  "version": {
264
- "message": "Which version would you like to use?",
384
+ "message": "NocoBase version",
265
385
  "latestLabel": "latest",
266
386
  "latestHint": "Stable release. Best for production use and the most predictable experience.",
267
387
  "betaLabel": "beta",
@@ -272,15 +392,15 @@
272
392
  "otherHint": "Enter another package version, Docker tag, or Git ref manually, such as a branch name."
273
393
  },
274
394
  "otherVersion": {
275
- "message": "Enter the version, Docker tag, or Git ref you want to use.",
395
+ "message": "Custom version, Docker tag, or Git ref",
276
396
  "placeholder": "For example: fix/cli-v2"
277
397
  },
278
398
  "dockerRegistry": {
279
- "message": "Which Docker registry would you like to use? The image tag is set separately in Version.",
399
+ "message": "Docker registry (image tag is set in Version)",
280
400
  "placeholder": "nocobase/nocobase"
281
401
  },
282
402
  "dockerPlatform": {
283
- "message": "Which Docker image platform should be used?",
403
+ "message": "Architecture",
284
404
  "autoLabel": "Auto",
285
405
  "autoHint": "Use Docker default for this machine"
286
406
  },
@@ -323,79 +443,94 @@
323
443
  },
324
444
  "prompts": {
325
445
  "env": {
326
- "message": "What would you like to call this app?",
446
+ "message": "App environment identifier",
327
447
  "placeholder": "local"
328
448
  },
329
449
  "lang": {
330
- "message": "Which language would you like to use for the app?"
450
+ "message": "App language"
331
451
  },
332
452
  "appPath": {
333
- "message": "Where should this app be stored? (relative to {{root}})",
453
+ "message": "App directory (relative to {{root}})",
334
454
  "placeholder": "./<env>/"
335
455
  },
336
456
  "appPort": {
337
- "message": "Which port should this app use?",
457
+ "message": "App port",
338
458
  "placeholder": "13000"
339
459
  },
340
460
  "appPublicPath": {
341
- "message": "What is the app subpath? (for example, /nocobase/)",
461
+ "message": "App subpath (for example, /nocobase/)",
342
462
  "placeholder": "/ or /nocobase/"
343
463
  },
464
+ "developmentMode": {
465
+ "message": "Who will lead development?",
466
+ "noCodeLabel": "Human-led development",
467
+ "noCodeHint": "Build your application using configuration and low-code tools, with AI as your assistant.",
468
+ "vibeCodingLabel": "AI-led development",
469
+ "vibeCodingHint": "You describe what you need, and AI writes the code and builds the application for you."
470
+ },
471
+ "portalName": {
472
+ "message": "Initial portal name",
473
+ "placeholder": "admin"
474
+ },
475
+ "portalTemplate": {
476
+ "message": "Starter template (copied to ./storage/portals/)",
477
+ "placeholder": "git@github.com:nocobase/admin-starter.git"
478
+ },
344
479
  "storagePath": {
345
- "message": "Where should uploads and local files be stored?",
480
+ "message": "Uploads and local files directory",
346
481
  "placeholder": "./<env>/storage/"
347
482
  },
348
483
  "dbDialect": {
349
- "message": "Which database would you like to use?"
484
+ "message": "Database type"
350
485
  },
351
486
  "builtinDb": {
352
- "message": "Would you like to use the built-in database?"
487
+ "message": "Use built-in database"
353
488
  },
354
489
  "builtinDbImage": {
355
- "message": "Which Docker image should be used for the built-in database?",
490
+ "message": "Built-in database Docker image",
356
491
  "placeholder": "postgres:16"
357
492
  },
358
493
  "dbHost": {
359
- "message": "What is the database host?",
494
+ "message": "Database host",
360
495
  "placeholder": "127.0.0.1"
361
496
  },
362
497
  "dbPort": {
363
- "message": "What is the database port?",
498
+ "message": "Database port",
364
499
  "placeholder": "5432"
365
500
  },
366
501
  "dbDatabase": {
367
- "message": "What is the database name?"
502
+ "message": "Database name"
368
503
  },
369
504
  "dbUser": {
370
- "message": "What is the database username?"
505
+ "message": "Database username"
371
506
  },
372
507
  "dbPassword": {
373
- "message": "What is the database password?"
508
+ "message": "Database password"
374
509
  },
375
510
  "dbSchema": {
376
- "message": "What is the database schema? (PostgreSQL only, optional)",
511
+ "message": "Database schema (PostgreSQL/KingbaseES only, optional)",
377
512
  "placeholder": "Leave empty to use the default schema"
378
513
  },
379
514
  "dbTablePrefix": {
380
- "message": "What table prefix should be used? (optional)",
515
+ "message": "Database table prefix (optional)",
381
516
  "placeholder": "For example: nb_"
382
517
  },
383
518
  "dbUnderscored": {
384
- "message": "Use underscored names for database tables and columns?"
519
+ "message": "Use underscored names for database tables and columns"
385
520
  },
386
521
  "rootUsername": {
387
- "message": "Choose the initial admin username",
522
+ "message": "Initial admin username",
388
523
  "placeholder": "nocobase"
389
524
  },
390
525
  "rootEmail": {
391
- "message": "What is the initial admin email?",
526
+ "message": "Initial admin email",
392
527
  "placeholder": "admin@nocobase.com"
393
528
  },
394
529
  "rootPassword": {
395
- "message": "Choose the initial admin password"
530
+ "message": "Initial admin password"
396
531
  },
397
532
  "rootNickname": {
398
- "message": "What display name should the initial admin use?",
533
+ "message": "Initial admin display name",
399
534
  "placeholder": "Super Admin"
400
535
  }
401
536
  }
@@ -419,11 +554,11 @@
419
554
  },
420
555
  "prompts": {
421
556
  "appName": {
422
- "message": "What should this environment use for `--env`?",
557
+ "message": "Unique app environment identifier (used by the CLI to locate and manage this environment)",
423
558
  "placeholder": "local"
424
559
  },
425
560
  "setupMode": {
426
- "message": "How would you like to set up this environment?",
561
+ "message": "App environment setup method",
427
562
  "installNewLabel": "Install a new app",
428
563
  "installNewHint": "Install a brand-new app from scratch. Best for first-time setup, evaluation, or a fresh local environment.",
429
564
  "manageLocalLabel": "Manage an app already on this machine",
@@ -432,7 +567,7 @@
432
567
  "connectRemoteHint": "Save only the remote app connection. Nothing will be installed or taken over on this machine."
433
568
  },
434
569
  "installSkills": {
435
- "message": "Install NocoBase AI coding skills (nocobase/skills)?"
570
+ "message": "Install NocoBase AI coding skills (nocobase/skills)"
436
571
  },
437
572
  "apiBaseUrl": {
438
573
  "message": "API base URL",
@@ -440,6 +575,21 @@
440
575
  },
441
576
  "skipDownload": {
442
577
  "message": "Skip downloading NocoBase and reuse existing local app files or Docker images"
578
+ },
579
+ "developmentMode": {
580
+ "message": "Who will lead development?",
581
+ "noCodeLabel": "Human-led development",
582
+ "noCodeHint": "Build your application using configuration and low-code tools, with AI as your assistant.",
583
+ "vibeCodingLabel": "AI-led development",
584
+ "vibeCodingHint": "You describe what you need, and AI writes the code and builds the application for you."
585
+ },
586
+ "portalName": {
587
+ "message": "Initial portal name",
588
+ "placeholder": "admin"
589
+ },
590
+ "portalTemplate": {
591
+ "message": "Starter template (copied to ./storage/portals/)",
592
+ "placeholder": "git@github.com:nocobase/admin-starter.git"
443
593
  }
444
594
  },
445
595
  "webUi": {
@@ -462,6 +612,10 @@
462
612
  "title": "App source and version",
463
613
  "description": "Choose how to get the app and which source and version to use."
464
614
  },
615
+ "developmentMode": {
616
+ "title": "Development approach",
617
+ "description": "Choose the development approach for your application."
618
+ },
465
619
  "configureDatabase": {
466
620
  "title": "Configure the database",
467
621
  "description": "Use built-in or custom."