@nocobase/plugin-ai 2.1.0-beta.44 → 2.1.0-beta.46

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 (104) hide show
  1. package/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +127 -132
  2. package/dist/ai/docs/nocobase/ai-dev/capabilities.md +1 -1
  3. package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
  4. package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +1 -1
  5. package/dist/ai/docs/nocobase/api/cli/app/autostart/disable.md +44 -0
  6. package/dist/ai/docs/nocobase/api/cli/app/autostart/enable.md +44 -0
  7. package/dist/ai/docs/nocobase/api/cli/app/autostart/index.md +63 -0
  8. package/dist/ai/docs/nocobase/api/cli/app/autostart/list.md +41 -0
  9. package/dist/ai/docs/nocobase/api/cli/app/autostart/run.md +50 -0
  10. package/dist/ai/docs/nocobase/api/cli/app/index.md +18 -15
  11. package/dist/ai/docs/nocobase/api/cli/app/restart.md +3 -11
  12. package/dist/ai/docs/nocobase/api/cli/app/start.md +3 -11
  13. package/dist/ai/docs/nocobase/api/cli/app/stop.md +22 -12
  14. package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +6 -6
  15. package/dist/ai/docs/nocobase/api/cli/backup/create.md +49 -0
  16. package/dist/ai/docs/nocobase/api/cli/backup/index.md +46 -0
  17. package/dist/ai/docs/nocobase/api/cli/backup/restore.md +46 -0
  18. package/dist/ai/docs/nocobase/api/cli/config/delete.md +11 -9
  19. package/dist/ai/docs/nocobase/api/cli/config/get.md +11 -8
  20. package/dist/ai/docs/nocobase/api/cli/config/index.md +28 -24
  21. package/dist/ai/docs/nocobase/api/cli/config/set.md +14 -12
  22. package/dist/ai/docs/nocobase/api/cli/db/stop.md +10 -11
  23. package/dist/ai/docs/nocobase/api/cli/env/index.md +25 -23
  24. package/dist/ai/docs/nocobase/api/cli/env/info.md +12 -10
  25. package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +108 -0
  26. package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +54 -0
  27. package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +104 -0
  28. package/dist/ai/docs/nocobase/api/cli/env/remove.md +18 -14
  29. package/dist/ai/docs/nocobase/api/cli/env/update.md +115 -14
  30. package/dist/ai/docs/nocobase/api/cli/index.md +66 -52
  31. package/dist/ai/docs/nocobase/api/cli/init.md +244 -62
  32. package/dist/ai/docs/nocobase/api/cli/license/activate.md +13 -12
  33. package/dist/ai/docs/nocobase/api/cli/license/index.md +2 -2
  34. package/dist/ai/docs/nocobase/api/cli/plugin/import.md +74 -0
  35. package/dist/ai/docs/nocobase/api/cli/plugin/index.md +4 -2
  36. package/dist/ai/docs/nocobase/get-started/deployment/how-to-deploy-nocobase-faster.mdx +384 -0
  37. package/dist/ai/docs/nocobase/get-started/install-upgrade-plugins.mdx +16 -10
  38. package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +1 -1
  39. package/dist/ai/docs/nocobase/index.md +3 -3
  40. package/dist/ai/docs/nocobase/multi-app/multi-app/app-block-and-switcher.md +68 -0
  41. package/dist/ai/docs/nocobase/multi-app/multi-app/app-sso.md +71 -0
  42. package/dist/ai/docs/nocobase/multi-app/multi-app/index.md +9 -1
  43. package/dist/ai/docs/nocobase/multi-app/multi-app/sub-app-api.md +112 -0
  44. package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +3 -3
  45. package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +1 -1
  46. package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +2 -2
  47. package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +1 -1
  48. package/dist/ai/docs/nocobase/plugin-development/client/router.md +11 -11
  49. package/dist/ai/docs/nocobase/quickstart/index.md +27 -0
  50. package/dist/ai/docs/nocobase/quickstart/installation/airgap.md +67 -0
  51. package/dist/ai/docs/nocobase/quickstart/installation/cli.md +205 -0
  52. package/dist/ai/docs/nocobase/quickstart/installation/docker-compose.md +123 -0
  53. package/dist/ai/docs/nocobase/quickstart/installation/env.md +101 -0
  54. package/dist/ai/docs/nocobase/quickstart/installation/migration.md +50 -0
  55. package/dist/ai/docs/nocobase/quickstart/operations/backup-restore.md +94 -0
  56. package/dist/ai/docs/nocobase/quickstart/operations/manage-app.md +166 -0
  57. package/dist/ai/docs/nocobase/quickstart/operations/multi-environment.md +171 -0
  58. package/dist/ai/docs/nocobase/quickstart/plugins/third-party.md +86 -0
  59. package/dist/ai/docs/nocobase/quickstart/production/index.md +163 -0
  60. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +158 -0
  61. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +100 -0
  62. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +166 -0
  63. package/dist/ai/docs/nocobase/quickstart/release-management.md +1 -0
  64. package/dist/ai/docs/nocobase/solution/all-in-one/installation.md +181 -0
  65. package/dist/ai/docs/nocobase/solution/crm/changelog.md +0 -3
  66. package/dist/ai/docs/nocobase/solution/crm/installation.md +6 -76
  67. package/dist/ai/docs/nocobase/solution/crm/v1.md +6 -35
  68. package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +0 -2
  69. package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +6 -69
  70. package/dist/ai/docs/nocobase/workflow/advanced/options.md +45 -1
  71. package/dist/client/{406.15c09d98faa2ccf1.js → 406.9a530334eae8cede.js} +1 -1
  72. package/dist/client/{428.e9f38da3b0d8b498.js → 428.431a00d29107058e.js} +1 -1
  73. package/dist/client/index.js +2 -2
  74. package/dist/client-v2/index.js +1 -1
  75. package/dist/externalVersion.js +16 -16
  76. package/dist/locale/de-DE.json +1 -0
  77. package/dist/locale/en-US.json +2 -1
  78. package/dist/locale/es-ES.json +1 -0
  79. package/dist/locale/fr-FR.json +1 -0
  80. package/dist/locale/hu-HU.json +1 -0
  81. package/dist/locale/id-ID.json +1 -0
  82. package/dist/locale/it-IT.json +1 -0
  83. package/dist/locale/ja-JP.json +1 -0
  84. package/dist/locale/ko-KR.json +1 -0
  85. package/dist/locale/nl-NL.json +1 -0
  86. package/dist/locale/pt-BR.json +1 -0
  87. package/dist/locale/ru-RU.json +1 -0
  88. package/dist/locale/tr-TR.json +1 -0
  89. package/dist/locale/uk-UA.json +1 -0
  90. package/dist/locale/vi-VN.json +1 -0
  91. package/dist/locale/zh-CN.json +2 -1
  92. package/dist/locale/zh-TW.json +1 -0
  93. package/dist/node_modules/@langchain/xai/package.json +1 -1
  94. package/dist/node_modules/fs-extra/package.json +1 -1
  95. package/dist/node_modules/jsonrepair/package.json +1 -1
  96. package/dist/node_modules/just-bash/package.json +1 -1
  97. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  98. package/dist/node_modules/openai/package.json +1 -1
  99. package/dist/node_modules/zod/package.json +1 -1
  100. package/dist/server/resource/ai.js +11 -9
  101. package/dist/server/workflow/nodes/employee/index.js +2 -4
  102. package/dist/server/workflow/nodes/employee/types.d.ts +2 -2
  103. package/package.json +2 -2
  104. package/dist/ai/docs/nocobase/api/cli/app/down.md +0 -41
@@ -1,50 +1,50 @@
1
1
  ---
2
- title: "Installation, Upgrade and Migration Guide: Using the NocoBase CLI"
3
- description: "Migrate from legacy Docker, create-nocobase-app, and Git-source installations to the new NocoBase CLI workflow."
4
- keywords: "NocoBase CLI,installation migration,upgrade migration,nb init,nb app upgrade,Docker,create-nocobase-app,Git source"
2
+ title: 'Installation and Upgrade Migration Guide: Using NocoBase CLI'
3
+ description: 'Migrate from legacy Docker, create-nocobase-app, and Git source installation upgrade methods to the new NocoBase CLI workflow.'
4
+ keywords: 'NocoBase CLI,installation migration,upgrade migration,nb init,nb app upgrade,Docker,create-nocobase-app,Git source'
5
5
  ---
6
6
 
7
- # Installation, Upgrade and Migration Guide: Using the NocoBase CLI
7
+ # Installation and Upgrade Migration Guide: Using NocoBase CLI
8
8
 
9
9
  :::danger
10
- The CLI's installation and application maintenance capabilities are still under active development. They are currently better suited for local development, test environments, and AI Agent integration scenarios. We do not recommend using them directly for production installation, upgrade, or operations.
10
+ The CLI's installation and application maintenance capabilities are still under development. At present, it is more suitable for local development, test environments, and AI Agent integration scenarios, and is not recommended for direct installation, upgrade, operation, and maintenance in production environments.
11
11
  :::
12
12
 
13
- The new NocoBase CLI (`nb`) consolidates installation, connection, start, stop, log inspection, upgrade, and cleanup into a single command set. Compared with the legacy approach, where Docker, create-nocobase-app, and Git-source installations each have their own dedicated documentation, the CLI is better suited for local development, test environment maintenance, as well as AI Agent integration and collaboration.
13
+ The new NocoBase CLI (`nb`) unifies installation, connection, startup, shutdown, log viewing, upgrade, and cleanup into one set of commands. Compared with the separate workflows in the old documentation for Docker, create-nocobase-app, and Git source, the CLI is better suited for local development, test environment maintenance, and AI Agent integration and collaboration.
14
14
 
15
- This guide is intended for the following scenarios:
15
+ This article applies to the following scenarios:
16
16
 
17
- - You are installing or upgrading NocoBase using the legacy documentation and want to switch to the new CLI workflow.
18
- - You already have a NocoBase deployment from a legacy installation method and want the CLI to manage or connect to it.
19
- - You need to prepare a connectable, maintainable NocoBase environment for an AI Agent.
17
+ - You are installing or upgrading NocoBase according to the old documentation and want to switch to the new CLI approach.
18
+ - You already have a NocoBase deployed in a legacy way and want the CLI to manage or connect to it.
19
+ - You need to prepare a connectable and maintainable NocoBase environment for an AI Agent.
20
20
 
21
- ## Differences between the legacy and new approaches
21
+ ## Differences between the old and new approaches
22
22
 
23
- The legacy approach splits documentation by installation source. Each source requires its own download, configuration, installation, startup, and upgrade commands.
23
+ The old approach splits documentation by installation source, and each source requires separate download, configuration, installation, startup, and upgrade commands.
24
24
 
25
- **Legacy installation docs**
25
+ **Old installation documentation**
26
26
 
27
27
  - [Docker installation](/get-started/installation/docker)
28
28
  - [create-nocobase-app installation](/get-started/installation/create-nocobase-app)
29
29
  - [Git source installation](/get-started/installation/git)
30
30
 
31
- **Legacy upgrade docs**
31
+ **Old upgrade documentation**
32
32
 
33
33
  - [Upgrading a Docker installation](/get-started/upgrading/docker)
34
34
  - [Upgrading a create-nocobase-app installation](/get-started/upgrading/create-nocobase-app)
35
35
  - [Upgrading a Git source installation](/get-started/upgrading/git)
36
36
 
37
- The new approach uses `nb init` as the entry point and stores the application source, runtime directory, storage directory, database, and API connection information in a single CLI env. Whether the source is Docker, npm, or Git, the same `nb app`, `nb source`, and `nb db` commands are used for maintenance whenever possible.
37
+ The new approach uses `nb init` as the entry point and records the application source, runtime directory, storage directory, database, and API connection information in a CLI env. After that, whether the source is Docker, npm, or Git, maintenance uses the same set of `nb app`, `nb source`, and `nb db` commands as much as possible.
38
38
 
39
- | Scenario | Legacy approach | New CLI approach |
40
- | --- | --- | --- |
41
- | Installation entry point | `docker compose`, `create-nocobase-app`, `git clone` | `nb init` or `nb init --ui` |
42
- | Application runtime management | Switch directories, edit compose, run yarn/pm2 commands | `nb app start/stop/restart/logs/down` |
43
- | Upgrade | Separate command set per installation method | `nb app upgrade -e <env>` |
44
- | Development mode | `yarn dev` | `nb source dev -e <env>` |
45
- | Database status | Manually inspect containers or database services | `nb db ps -e <env>` |
46
- | View environment status and details | Manually track paths, ports, and access URLs | `nb env list`, `nb env info <env>` |
47
- | Connect to existing applications | Not unified across legacy install docs | `nb init --ui` or `nb init --api-base-url` |
39
+ | Scenario | Old approach | New CLI approach |
40
+ | ----------------------------------- | --------------------------------------------------------- | ------------------------------------------------- |
41
+ | Installation entry point | `docker compose`, `create-nocobase-app`, `git clone` | `nb init` or `nb init --ui` |
42
+ | Application runtime management | Switch directories, modify compose, run yarn/pm2 commands | `nb app start/stop/restart/logs`, `nb env remove` |
43
+ | Upgrade | One set of commands per installation method | `nb app upgrade -e <env>` |
44
+ | Development mode | `yarn dev` | `nb source dev -e <env>` |
45
+ | Database status | Manually inspect containers or database services | `nb db ps -e <env>` |
46
+ | View environment status and details | Manually record paths, ports, and access URLs | `nb env list`, `nb env info <env>` |
47
+ | Access existing applications | Not covered uniformly in old installation docs | `nb init --ui` or `nb init --api-base-url` |
48
48
 
49
49
  ## Install the CLI
50
50
 
@@ -53,14 +53,14 @@ npm install -g @nocobase/cli@beta
53
53
  nb --version
54
54
  ```
55
55
 
56
- After installation, you can view help:
56
+ After installation, you can view the help:
57
57
 
58
58
  ```bash
59
59
  nb --help
60
60
  nb init --help
61
61
  ```
62
62
 
63
- ## Install NocoBase the new way
63
+ ## Install NocoBase using the new approach
64
64
 
65
65
  ### Recommended: use the visual wizard
66
66
 
@@ -68,13 +68,13 @@ nb init --help
68
68
  nb init --ui
69
69
  ```
70
70
 
71
- The wizard walks you through:
71
+ The wizard will guide you to choose:
72
72
 
73
- - Creating a new application or connecting to an existing one
74
- - Installation source: Docker, npm, or Git
73
+ - Create a new application or connect to an existing application
74
+ - Installation source: Docker, npm, Git
75
75
  - NocoBase version
76
- - Built-in or external database
77
- - Admin account and password
76
+ - Use the built-in database or an external database
77
+ - Administrator account and password
78
78
 
79
79
  ### Use the terminal interactive wizard
80
80
 
@@ -84,13 +84,13 @@ nb init
84
84
 
85
85
  ### Use non-interactive commands
86
86
 
87
- The default installation uses Docker with the built-in PostgreSQL database:
87
+ The default installation method is Docker and uses the built-in PostgreSQL database:
88
88
 
89
89
  ```bash
90
90
  nb init --yes --env app1
91
91
  ```
92
92
 
93
- Install a specific version with Docker:
93
+ Install a specified version with Docker:
94
94
 
95
95
  ```bash
96
96
  nb init --yes --env app1 --source docker --version beta
@@ -108,7 +108,7 @@ Install from Git source:
108
108
  nb init --yes --env app1 --source git --version beta
109
109
  ```
110
110
 
111
- Install from Git source with a specific built-in database type:
111
+ Install from Git source and specify the built-in database type:
112
112
 
113
113
  ```bash
114
114
  nb init --yes --env app1 --source git --version beta --db-dialect mysql
@@ -117,10 +117,10 @@ nb init --yes --env app1 --source git --version beta --db-dialect mysql
117
117
  Connect to an existing NocoBase application:
118
118
 
119
119
  ```bash
120
- # OAuth authentication is used by default
120
+ # Uses OAuth authentication by default
121
121
  nb init --yes --env app1 --api-base-url=http://next.v2.test.nocobase.com/nocobase/api
122
122
 
123
- # Use Token authentication
123
+ # Use token authentication
124
124
  nb init --yes --env app1 \
125
125
  --api-base-url=http://next.v2.test.nocobase.com/nocobase/api \
126
126
  --auth-type=token \
@@ -128,24 +128,24 @@ nb init --yes --env app1 \
128
128
  ```
129
129
 
130
130
  :::tip
131
- `--env` is the environment name within the CLI. Subsequent commands such as start, upgrade, and log viewing can target the same application via `-e app1`.
131
+ `--env` is the environment name in the CLI. Subsequent commands such as startup, upgrade, and log viewing can all specify the target application with `-e app1`.
132
132
  :::
133
133
 
134
- ## Upgrade the new way
134
+ ## Upgrade using the new approach
135
135
 
136
- In the legacy approach, Docker, create-nocobase-app, and Git source each have their own upgrade commands. The new CLI unifies them as:
136
+ In the old approach, the upgrade commands for Docker, create-nocobase-app, and Git source were different; the new CLI unifies them as:
137
137
 
138
138
  ```bash
139
139
  nb app upgrade -e app1
140
140
  ```
141
141
 
142
- If you only want to run the upgrade flow against the source code or images you already have, without pulling new code or images:
142
+ If you only want to run the upgrade process using the source code or image that has already been downloaded, without pulling new code or images:
143
143
 
144
144
  ```bash
145
145
  nb app upgrade -e app1 --skip-code-update
146
146
  ```
147
147
 
148
- Or use the shorthand:
148
+ Or use the short form:
149
149
 
150
150
  ```bash
151
151
  nb app upgrade -e app1 -s
@@ -153,48 +153,43 @@ nb app upgrade -e app1 -s
153
153
 
154
154
  ## Common maintenance commands
155
155
 
156
- | Action | Command |
157
- | --- | --- |
158
- | Start application | `nb app start -e app1` |
159
- | Stop application | `nb app stop -e app1` |
160
- | Restart application | `nb app restart -e app1` |
161
- | View logs | `nb app logs -e app1` |
162
- | View env and API authentication status | `nb env list` |
163
- | View env details | `nb env info app1` |
164
- | View built-in database status | `nb db ps -e app1` |
165
- | Upgrade application | `nb app upgrade -e app1` |
166
- | Stop and clean up runtime resources | `nb app down -e app1` |
156
+ | Operation | Command |
157
+ | -------------------------------------------------- | ------------------------------------ |
158
+ | Start application | `nb app start -e app1` |
159
+ | Stop application | `nb app stop -e app1` |
160
+ | Restart application | `nb app restart -e app1` |
161
+ | View logs | `nb app logs -e app1` |
162
+ | View env and API authentication status | `nb env list` |
163
+ | View env details | `nb env info app1` |
164
+ | View built-in database status | `nb db ps -e app1` |
165
+ | Upgrade application | `nb app upgrade -e app1` |
166
+ | Stop application and built-in database | `nb app stop -e app1 --with-db` |
167
+ | Completely remove env and locally hosted resources | `nb env remove app1 --purge --force` |
167
168
 
168
- By default, `nb app down` stops the application and removes the runtime containers and local application files managed by the CLI, while preserving storage data and the env configuration. To remove everything you must explicitly confirm:
169
+ If you just want to stop the application together with the built-in database managed by the CLI, the default is to simply use `nb app stop -e app1 --with-db`.
169
170
 
170
- ```bash
171
- nb app down -e app1 --all --yes
172
- ```
173
-
174
- :::warning
175
- `--all --yes` deletes the storage data and CLI env configuration for the env. Only use it when you are sure you have backups and no longer need this environment.
176
- :::
171
+ If you are sure this env is no longer needed, then use `nb env remove app1 --purge --force`. It will remove hosted runtime resources, storage data, and, when applicable, local app files downloaded and managed by the CLI.
177
172
 
178
173
  ## Daily development commands
179
174
 
180
- `nb source` manages local source code projects. It is mainly used for npm and Git source envs.
175
+ `nb source` is used to manage local source projects and is mainly suitable for npm and Git source envs.
181
176
 
182
- | Action | Command |
183
- | --- | --- |
184
- | Run application in development mode | `nb source dev -e app1` |
185
- | Build source | `nb source build --cwd /your/workspace/app1/source` |
186
- | Run tests | `nb source test --cwd /your/workspace/app1/source` |
187
- | Download or refresh source/images | `nb source download --source git --version beta` |
177
+ | Operation | Command |
178
+ | ----------------------------------- | --------------------------------------------------- |
179
+ | Run application in development mode | `nb source dev -e app1` |
180
+ | Build source code | `nb source build --cwd /your/workspace/app1/source` |
181
+ | Run tests | `nb source test --cwd /your/workspace/app1/source` |
182
+ | Download or refresh source/image | `nb source download --source git --version beta` |
188
183
 
189
184
  :::tip
190
- Docker envs are typically managed via `nb app start`, `nb app logs`, and `nb app upgrade`, and do not use `nb source dev`.
185
+ Docker envs are usually managed through `nb app start`, `nb app logs`, and `nb app upgrade`, and do not use `nb source dev`.
191
186
  :::
192
187
 
193
- ## NB_CLI_ROOT and directory layout
188
+ ## NB_CLI_ROOT and directory structure
194
189
 
195
- The CLI stores global configuration and local application files under the directory referenced by `NB_CLI_ROOT`.
190
+ The CLI stores global configuration and local application files in the directory corresponding to `NB_CLI_ROOT`.
196
191
 
197
- By default, `NB_CLI_ROOT` is the current user's home directory, that is, the path returned by Node.js `os.homedir()`. For example, on macOS this is typically `/Users/<user>`. So, without any extra configuration, files generated by `nb init --yes --env app1` usually live at:
192
+ By default, `NB_CLI_ROOT` is the current user's home directory, that is, the path returned by Node.js `os.homedir()`. For example, on macOS it is usually `/Users/<user>`. Therefore, without additional configuration, the files generated by `nb init --yes --env app1` are usually located at:
198
193
 
199
194
  ```text
200
195
  ~
@@ -205,13 +200,13 @@ By default, `NB_CLI_ROOT` is the current user's home directory, that is, the pat
205
200
  └── storage
206
201
  ```
207
202
 
208
- You can also specify `NB_CLI_ROOT` explicitly:
203
+ You can also explicitly specify `NB_CLI_ROOT`:
209
204
 
210
205
  ```bash
211
206
  export NB_CLI_ROOT=/your/workspace
212
207
  ```
213
208
 
214
- After that, the configuration file and default application directory are placed under that directory:
209
+ After setting it, the configuration file and default application directory will both be placed under that directory:
215
210
 
216
211
  ```text
217
212
  /your/workspace
@@ -224,79 +219,79 @@ After that, the configuration file and default application directory are placed
224
219
 
225
220
  Where:
226
221
 
227
- - `.nocobase/config.json` stores envs, the current environment, API URL, source path, storage path, database configuration, and so on.
222
+ - `.nocobase/config.json` stores information such as envs, current environment, API address, source path, storage path, and database configuration.
228
223
  - `<envName>/source` is the source code or application directory managed by the CLI.
229
224
  - `<envName>/storage` is the application storage directory managed by the CLI.
230
225
 
231
226
  :::warning
232
- Once an application has been initialized, keep using the same `NB_CLI_ROOT`. If you change `NB_CLI_ROOT` later, the CLI will look for `.nocobase/config.json` under the new directory, and any relative `appRootPath` or `storagePath` values will be resolved against the new directory, which may cause the application to be missing or read/write the wrong directory.
227
+ After initializing the same application, keep using the same `NB_CLI_ROOT`. If you later change `NB_CLI_ROOT`, the CLI will look for `.nocobase/config.json` in the new directory, and relative `appRootPath` and `storagePath` will also be resolved against the new directory, which may cause the application to not be found or to read and write to the wrong directory.
233
228
  :::
234
229
 
235
- The CLI currently uses only the global config scope. To change where configuration and local application files are stored, set `NB_CLI_ROOT`.
230
+ The CLI currently only uses the global configuration scope. If you need to adjust where configuration and local application files are stored, set `NB_CLI_ROOT`.
236
231
 
237
- When inspecting and locating applications, prefer `nb env list` and `nb env info`:
232
+ When viewing and locating applications, prefer `nb env list` and `nb env info`:
238
233
 
239
234
  ```bash
240
- # List configured envs and API authentication status
235
+ # View configured envs and API authentication status
241
236
  nb env list
242
237
 
243
- # View detailed information for a specific env
238
+ # View detailed information for an env
244
239
  nb env info app1
245
240
  ```
246
241
 
247
- `nb env list` is intended as a quick overview. The `App Status` column reflects the authentication status obtained by accessing the application API with the saved Token/OAuth credentials, and no longer shows the database status. To check the runtime status of the built-in database, use:
242
+ `nb env list` is intended for a quick overview. Here, `App Status` is the authentication status obtained by accessing the application API with the saved Token/OAuth credentials, and no longer displays database status. To view the running status of the built-in database, use:
248
243
 
249
244
  ```bash
250
245
  nb db ps -e app1
251
246
  ```
252
247
 
253
- Only switch the default env when you actually need to:
248
+ Only use this when you need to switch the default env:
254
249
 
255
250
  ```bash
256
251
  nb env use app1
257
252
  ```
258
253
 
259
- ## Migrate from the legacy approach to the CLI
254
+ ## Migrate from the old approach to CLI
260
255
 
261
- There are two migration strategies: **connect to an existing application**, or **bring a local application directory under CLI management**. If your legacy application is already running stably, we recommend starting with "connect to an existing application", which carries the lowest risk.
256
+ There are two migration strategies: **connect to an existing application**, or **bring a local application directory under CLI management**. If your old application is already running stably, it is recommended to first use "connect to an existing application", which has the lowest risk.
262
257
 
263
- ### Option 1: Connect to an existing application
258
+ ### Method 1: connect to an existing application
264
259
 
265
- Use this option when NocoBase is already running through Docker, create-nocobase-app, Git source, or a server deployment.
260
+ Suitable for NocoBase instances already running via Docker, create-nocobase-app, Git source, or server deployment.
266
261
 
267
262
  ```bash
268
- # OAuth authentication is used by default
263
+ # Uses OAuth authentication by default
269
264
  nb init --yes --env app1 --api-base-url=http://next.v2.test.nocobase.com/nocobase/api
270
265
 
271
- # Use Token authentication
266
+ # Use token authentication
272
267
  nb init --yes --env "app$RANDOM" \
273
268
  --api-base-url=http://next.v2.test.nocobase.com/nocobase/api \
274
269
  --auth-type=token \
275
270
  --access-token=<token>
276
271
  ```
277
272
 
278
- This option only stores the API connection. The CLI does not take over starting, stopping, or upgrading the legacy application, nor does it manage its source or storage directories. It is suitable for letting an AI Agent or CLI API commands connect to an existing application.
273
+ This approach only stores the API connection. The CLI will not take over startup, shutdown, upgrade, source directory, or storage directory management of the old application. It is suitable for allowing AI Agents or CLI API commands to connect to existing applications.
279
274
 
280
- To refresh authentication:
275
+ If you need to refresh authentication:
281
276
 
282
277
  ```bash
283
278
  nb env auth app1
284
279
  ```
285
280
 
286
- ### Option 2: Create a new CLI env and migrate files
281
+ ### Method 2: create a new CLI env and then migrate files
287
282
 
288
- Use this option when you want `nb app` and `nb source` to manage the local application going forward.
283
+ Suitable for scenarios where you want to use `nb app` and `nb source` to manage local applications afterward.
289
284
 
290
- Before migrating, complete the following:
285
+ Before migration, complete the following first:
291
286
 
292
- 1. Stop the legacy application.
293
- 2. Back up the legacy database.
294
- 3. Back up the legacy `storage` directory.
295
- 4. Record the key environment variables of the legacy application, such as `APP_KEY`, `TZ`, `DB_*`, and `DB_UNDERSCORED`.
287
+ 1. Stop the old application.
288
+ 2. Back up the old database.
289
+ 3. Back up the old `storage` directory.
290
+ 4. Record the key environment variables of the old application, such as `APP_KEY`, `TZ`, `DB_*`, and `DB_UNDERSCORED`.
296
291
 
297
- #### Migrating from a legacy Docker installation
292
+ #### Migrate from an old Docker installation
298
293
 
299
- A legacy Docker installation typically keeps application data in the `storage` directory inside the project:
294
+ The old Docker approach usually stores application data in the project's `storage` directory:
300
295
 
301
296
  ```text
302
297
  /old-docker-project
@@ -304,7 +299,7 @@ A legacy Docker installation typically keeps application data in the `storage` d
304
299
  └── storage
305
300
  ```
306
301
 
307
- We recommend choosing a new `NB_CLI_ROOT` first, then creating a new Docker env with the CLI. The example below assumes `NB_CLI_ROOT` is `/your/workspace`.
302
+ It is recommended to first determine the new `NB_CLI_ROOT`, then use the CLI to create a new Docker env. The following example assumes that `NB_CLI_ROOT` is `/your/workspace`.
308
303
 
309
304
  ```bash
310
305
  export NB_CLI_ROOT=/your/workspace
@@ -312,7 +307,7 @@ nb init --yes --env app2 --source docker --version beta
312
307
  nb app stop -e app2
313
308
  ```
314
309
 
315
- The new env uses the following directories by default:
310
+ The new env will use the following directories by default:
316
311
 
317
312
  ```text
318
313
  /your/workspace
@@ -321,18 +316,18 @@ The new env uses the following directories by default:
321
316
  └── storage
322
317
  ```
323
318
 
324
- Then copy the legacy `storage` to `/your/workspace/app2/storage` and make sure the database connection and `APP_KEY` match the legacy environment.
319
+ Then copy the old `storage` to `/your/workspace/app2/storage`, and make sure the database connection, `APP_KEY`, and other configurations match the old environment.
325
320
 
326
- After copying and confirming the database configuration, start the application:
321
+ After the copy is complete and the database configuration is confirmed, start the application:
327
322
 
328
323
  ```bash
329
324
  nb app start -e app2
330
325
  nb app logs -e app2
331
326
  ```
332
327
 
333
- #### Migrating from a legacy create-nocobase-app or Git source installation
328
+ #### Migrate from an old create-nocobase-app or Git source installation
334
329
 
335
- In legacy npm/Git installations, the source code, `.env`, and `storage` typically live in the same project directory:
330
+ The old npm/Git approach usually places the source code, `.env`, and `storage` in the same project directory:
336
331
 
337
332
  ```text
338
333
  /old-nocobase
@@ -342,7 +337,7 @@ In legacy npm/Git installations, the source code, `.env`, and `storage` typicall
342
337
  └── storage
343
338
  ```
344
339
 
345
- We recommend choosing a new `NB_CLI_ROOT` first, then creating a new npm or Git env. The example below assumes `NB_CLI_ROOT` is `/your/workspace`.
340
+ It is recommended to first determine the new `NB_CLI_ROOT`, then create a new npm or Git env. The following example assumes that `NB_CLI_ROOT` is `/your/workspace`.
346
341
 
347
342
  ```bash
348
343
  export NB_CLI_ROOT=/your/workspace
@@ -352,12 +347,12 @@ nb app stop -e app3
352
347
 
353
348
  Then migrate as needed:
354
349
 
355
- - Move the custom plugin source from the legacy project into the corresponding location under `/your/workspace/app3/source`.
356
- - Copy `storage` from the legacy project to `/your/workspace/app3/storage`.
357
- - Sync the key settings from the legacy `.env` into the CLI env configuration or the initialization arguments.
358
- - To keep using the original database, disable the built-in database during initialization and provide the legacy database connection details.
350
+ - Migrate custom plugin source code from the old project to the corresponding directory under `/your/workspace/app3/source`.
351
+ - Copy the old project's `storage` to `/your/workspace/app3/storage`.
352
+ - Sync key configurations from the old `.env` to the CLI env configuration or initialization parameters.
353
+ - If using the original database, disable the built-in database during initialization and fill in the old database connection information.
359
354
 
360
- Example of initializing with an external database:
355
+ Example of initialization with an external database:
361
356
 
362
357
  ```bash
363
358
  nb init --yes --env app3 --source git --version beta \
@@ -370,7 +365,7 @@ nb init --yes --env app3 --source git --version beta \
370
365
  --db-password nocobase
371
366
  ```
372
367
 
373
- Once migrated, start the application and check the logs:
368
+ After migration, start it and view the logs:
374
369
 
375
370
  ```bash
376
371
  nb app start -e app3
@@ -378,30 +373,30 @@ nb app logs -e app3
378
373
  ```
379
374
 
380
375
  :::warning
381
- Never overwrite `source` or `storage`, or run an upgrade against a production database, without backups. Always do a full dry run in a test environment before performing the actual migration.
376
+ Do not directly overwrite `source`, `storage`, or connect to the production database for upgrades without a backup. Before formal migration, it is recommended to do a full rehearsal once in a test environment.
382
377
  :::
383
378
 
384
- ## Legacy command quick reference
385
-
386
- | Legacy command | New CLI command |
387
- | --- | --- |
388
- | `docker compose up -d app` | `nb app start -e app1` |
389
- | `docker compose stop app` | `nb app stop -e app1` |
390
- | `docker compose logs -f app` | `nb app logs -e app1` |
391
- | `docker compose pull app && docker compose up -d app` | `nb app upgrade -e app1` |
392
- | `yarn create nocobase-app my-nocobase-app ...` | `nb init --yes --env app1 --source npm --version beta` |
393
- | `npx create-nocobase-app@beta my-nocobase-app ...` | `nb init --yes --env app1 --source npm --version beta` |
394
- | `git clone ... -b next --depth=1 my-nocobase` | `nb init --yes --env app1 --source git --version beta` |
395
- | `git clone ... -b develop --depth=1 my-nocobase` | `nb init --yes --env app1 --source git --version alpha` |
396
- | `yarn dev` | `nb source dev -e app1` |
397
- | `yarn nocobase upgrade` | `nb app upgrade -e app1` |
398
- | `yarn nocobase upgrade --skip-code-update` | `nb app upgrade -e app1 -s` |
399
- | Manually tracking multiple application URLs | `nb env list`, `nb env info app1` |
400
- | Manually connecting to existing applications | `nb init --yes --env app1 --api-base-url=http://next.v2.test.nocobase.com/nocobase/api` |
379
+ ## Quick reference for old command migration
380
+
381
+ | Old command | New CLI command |
382
+ | ----------------------------------------------------- | --------------------------------------------------------------------------------------- |
383
+ | `docker compose up -d app` | `nb app start -e app1` |
384
+ | `docker compose stop app` | `nb app stop -e app1` |
385
+ | `docker compose logs -f app` | `nb app logs -e app1` |
386
+ | `docker compose pull app && docker compose up -d app` | `nb app upgrade -e app1` |
387
+ | `yarn create nocobase-app my-nocobase-app ...` | `nb init --yes --env app1 --source npm --version beta` |
388
+ | `npx create-nocobase-app@beta my-nocobase-app ...` | `nb init --yes --env app1 --source npm --version beta` |
389
+ | `git clone ... -b next --depth=1 my-nocobase` | `nb init --yes --env app1 --source git --version beta` |
390
+ | `git clone ... -b develop --depth=1 my-nocobase` | `nb init --yes --env app1 --source git --version alpha` |
391
+ | `yarn dev` | `nb source dev -e app1` |
392
+ | `yarn nocobase upgrade` | `nb app upgrade -e app1` |
393
+ | `yarn nocobase upgrade --skip-code-update` | `nb app upgrade -e app1 -s` |
394
+ | Manually record multiple application addresses | `nb env list`, `nb env info app1` |
395
+ | Manually connect to an existing application | `nb init --yes --env app1 --api-base-url=http://next.v2.test.nocobase.com/nocobase/api` |
401
396
 
402
397
  ## Related links
403
398
 
404
- - [AI Agent integration guide](/ai/quick-start)
405
- - [NocoBase CLI command reference](/api/cli)
406
- - [Comparison of installation methods and versions](/get-started/quickstart)
399
+ - [AI Agent Integration Guide](/ai/quick-start)
400
+ - [NocoBase CLI Command Reference](/api/cli)
401
+ - [Installation methods and version comparison](/get-started/quickstart)
407
402
  - [Install and upgrade plugins](/get-started/install-upgrade-plugins)
@@ -18,7 +18,7 @@ Here is a list of everything AI can currently help you do. Each capability comes
18
18
 
19
19
  :::warning Note
20
20
 
21
- - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v2/` path. It is available for early access and experimentation, but is not recommended for production use.
21
+ - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v/` path. It is available for early access and experimentation, but is not recommended for production use.
22
22
  - AI-generated code may not be 100% correct. We recommend reviewing it before enabling. If you encounter issues at runtime, send the error message to AI and let it investigate and fix -- it usually takes just a few rounds of conversation to resolve.
23
23
  - We recommend using GPT or Claude series models for development, as they produce the best results. Other models can also work, but generation quality may vary.
24
24
 
@@ -33,7 +33,7 @@ Your browser will automatically open the visual configuration page, guiding you
33
33
 
34
34
  :::warning Note
35
35
 
36
- - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v2/` path. It is available for early access and experimentation, but is not recommended for production use.
36
+ - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v/` path. It is available for early access and experimentation, but is not recommended for production use.
37
37
  - AI-generated code may not be 100% correct. We recommend reviewing it before enabling. If you encounter issues at runtime, send the error message to AI and let it investigate and fix -- it usually takes just a few rounds of conversation to resolve.
38
38
  - We recommend using GPT or Claude series models for development, as they produce the best results. Other models can also work, but generation quality may vary.
39
39
 
@@ -34,7 +34,7 @@ Make sure you have:
34
34
 
35
35
  :::warning Note
36
36
 
37
- - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v2/` path. It is available for early access and experimentation, but is not recommended for production use.
37
+ - NocoBase is migrating from `client` (v1) to `client-v2`, and `client-v2` is still under development. The client code generated by AI development is based on `client-v2` and can only be used under the `/v/` path. It is available for early access and experimentation, but is not recommended for production use.
38
38
  - AI-generated code may not be 100% correct. We recommend reviewing it before enabling. If you encounter issues at runtime, send the error message to AI and let it investigate and fix -- it usually takes just a few rounds of conversation to resolve.
39
39
 
40
40
  :::
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: "nb app autostart disable"
3
+ description: "nb app autostart disable command reference: disable application autostart for one env."
4
+ keywords: "nb app autostart disable,NocoBase CLI,autostart,env"
5
+ ---
6
+
7
+ # nb app autostart disable
8
+
9
+ Disable the application autostart flag for one env.
10
+
11
+ After disabling it, the env no longer participates in `nb app autostart run`. This command does not stop an already running app by itself. If you also want to stop the current runtime, use `nb app stop` separately.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ nb app autostart disable [flags]
17
+ ```
18
+
19
+ ## Flags
20
+
21
+ | Flag | Type | Description |
22
+ | --- | --- | --- |
23
+ | `--env`, `-e` | string | CLI env name to remove from app autostart. Uses the current env when omitted |
24
+ | `--yes`, `-y` | boolean | Skip the interactive confirmation when explicit `--env` points to a different env than the current env |
25
+
26
+ ## Examples
27
+
28
+ ```bash
29
+ nb app autostart disable
30
+ nb app autostart disable --env app1
31
+ nb app autostart disable --env app1 --yes
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ This command only changes the saved autostart flag. It does not stop the app directly. If an env was not enabled for autostart before, running this command keeps it in the disabled state.
37
+
38
+ Just like `enable`, the CLI only checks for a cross-env confirmation when you explicitly pass `--env`. In non-interactive terminals or AI agent flows, add `--yes` yourself when needed.
39
+
40
+ ## Related commands
41
+
42
+ - [`nb app autostart enable`](./enable.md)
43
+ - [`nb app autostart list`](./list.md)
44
+ - [`nb app stop`](../stop.md)
@@ -0,0 +1,44 @@
1
+ ---
2
+ title: "nb app autostart enable"
3
+ description: "nb app autostart enable command reference: enable application autostart for one local or Docker env."
4
+ keywords: "nb app autostart enable,NocoBase CLI,autostart,env"
5
+ ---
6
+
7
+ # nb app autostart enable
8
+
9
+ Enable the application autostart flag for one env.
10
+
11
+ This flag only applies to `local` or `docker` envs whose runtimes are managed by the CLI on the current machine. It does not start the application immediately. Instead, it adds the env to the set that can later be started by `nb app autostart run`.
12
+
13
+ ## Usage
14
+
15
+ ```bash
16
+ nb app autostart enable [flags]
17
+ ```
18
+
19
+ ## Flags
20
+
21
+ | Flag | Type | Description |
22
+ | --- | --- | --- |
23
+ | `--env`, `-e` | string | CLI env name to add to app autostart. Uses the current env when omitted |
24
+ | `--yes`, `-y` | boolean | Skip the interactive confirmation when explicit `--env` points to a different env than the current env |
25
+
26
+ ## Examples
27
+
28
+ ```bash
29
+ nb app autostart enable
30
+ nb app autostart enable --env app1
31
+ nb app autostart enable --env app1 --yes
32
+ ```
33
+
34
+ ## Notes
35
+
36
+ The CLI only checks whether the target env differs from the current env when you explicitly pass `--env`. In interactive terminals it confirms first. In non-interactive terminals or AI agent flows, you need to add `--yes` yourself, or switch the current env with `nb env use <name>` before retrying.
37
+
38
+ If the target env is not a CLI-managed `local` or `docker` runtime on the current machine, the command fails and does not save the autostart flag.
39
+
40
+ ## Related commands
41
+
42
+ - [`nb app autostart disable`](./disable.md)
43
+ - [`nb app autostart list`](./list.md)
44
+ - [`nb app autostart run`](./run.md)