@nocobase/plugin-ai 2.1.0-beta.43 → 2.1.0-beta.45
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/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +127 -132
- package/dist/ai/docs/nocobase/ai-dev/capabilities.md +1 -1
- package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
- package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/app/autostart/disable.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/enable.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/index.md +63 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/list.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/run.md +50 -0
- package/dist/ai/docs/nocobase/api/cli/app/index.md +18 -15
- package/dist/ai/docs/nocobase/api/cli/app/restart.md +3 -11
- package/dist/ai/docs/nocobase/api/cli/app/start.md +3 -11
- package/dist/ai/docs/nocobase/api/cli/app/stop.md +22 -12
- package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +6 -6
- package/dist/ai/docs/nocobase/api/cli/backup/create.md +49 -0
- package/dist/ai/docs/nocobase/api/cli/backup/index.md +46 -0
- package/dist/ai/docs/nocobase/api/cli/backup/restore.md +46 -0
- package/dist/ai/docs/nocobase/api/cli/config/delete.md +11 -9
- package/dist/ai/docs/nocobase/api/cli/config/get.md +11 -8
- package/dist/ai/docs/nocobase/api/cli/config/index.md +28 -24
- package/dist/ai/docs/nocobase/api/cli/config/set.md +14 -12
- package/dist/ai/docs/nocobase/api/cli/db/stop.md +10 -11
- package/dist/ai/docs/nocobase/api/cli/env/index.md +25 -23
- package/dist/ai/docs/nocobase/api/cli/env/info.md +12 -10
- package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +108 -0
- package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +54 -0
- package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +104 -0
- package/dist/ai/docs/nocobase/api/cli/env/remove.md +18 -14
- package/dist/ai/docs/nocobase/api/cli/env/update.md +115 -14
- package/dist/ai/docs/nocobase/api/cli/index.md +66 -52
- package/dist/ai/docs/nocobase/api/cli/init.md +244 -62
- package/dist/ai/docs/nocobase/api/cli/license/activate.md +13 -12
- package/dist/ai/docs/nocobase/api/cli/license/index.md +2 -2
- package/dist/ai/docs/nocobase/api/cli/plugin/import.md +74 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/index.md +4 -2
- package/dist/ai/docs/nocobase/get-started/deployment/how-to-deploy-nocobase-faster.mdx +384 -0
- package/dist/ai/docs/nocobase/get-started/install-upgrade-plugins.mdx +16 -10
- package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +1 -1
- package/dist/ai/docs/nocobase/index.md +3 -3
- package/dist/ai/docs/nocobase/multi-app/multi-app/app-block-and-switcher.md +68 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/app-sso.md +71 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/index.md +9 -1
- package/dist/ai/docs/nocobase/multi-app/multi-app/sub-app-api.md +112 -0
- package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +3 -3
- package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +1 -1
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +2 -2
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +1 -1
- package/dist/ai/docs/nocobase/plugin-development/client/router.md +11 -11
- package/dist/ai/docs/nocobase/quickstart/index.md +27 -0
- package/dist/ai/docs/nocobase/quickstart/installation/airgap.md +67 -0
- package/dist/ai/docs/nocobase/quickstart/installation/cli.md +205 -0
- package/dist/ai/docs/nocobase/quickstart/installation/docker-compose.md +123 -0
- package/dist/ai/docs/nocobase/quickstart/installation/env.md +101 -0
- package/dist/ai/docs/nocobase/quickstart/installation/migration.md +50 -0
- package/dist/ai/docs/nocobase/quickstart/operations/backup-restore.md +94 -0
- package/dist/ai/docs/nocobase/quickstart/operations/manage-app.md +166 -0
- package/dist/ai/docs/nocobase/quickstart/operations/multi-environment.md +171 -0
- package/dist/ai/docs/nocobase/quickstart/plugins/third-party.md +86 -0
- package/dist/ai/docs/nocobase/quickstart/production/index.md +163 -0
- package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +158 -0
- package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +100 -0
- package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +166 -0
- package/dist/ai/docs/nocobase/quickstart/release-management.md +1 -0
- package/dist/ai/docs/nocobase/solution/all-in-one/installation.md +181 -0
- package/dist/ai/docs/nocobase/solution/crm/changelog.md +0 -3
- package/dist/ai/docs/nocobase/solution/crm/installation.md +6 -76
- package/dist/ai/docs/nocobase/solution/crm/v1.md +6 -35
- package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +0 -2
- package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +6 -69
- package/dist/ai/docs/nocobase/workflow/advanced/options.md +45 -1
- package/dist/client/{406.15c09d98faa2ccf1.js → 406.9a530334eae8cede.js} +1 -1
- package/dist/client/{428.e9f38da3b0d8b498.js → 428.431a00d29107058e.js} +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +18 -18
- package/dist/locale/de-DE.json +1 -0
- package/dist/locale/en-US.json +2 -1
- package/dist/locale/es-ES.json +1 -0
- package/dist/locale/fr-FR.json +1 -0
- package/dist/locale/hu-HU.json +1 -0
- package/dist/locale/id-ID.json +1 -0
- package/dist/locale/it-IT.json +1 -0
- package/dist/locale/ja-JP.json +1 -0
- package/dist/locale/ko-KR.json +1 -0
- package/dist/locale/nl-NL.json +1 -0
- package/dist/locale/pt-BR.json +1 -0
- package/dist/locale/ru-RU.json +1 -0
- package/dist/locale/tr-TR.json +1 -0
- package/dist/locale/uk-UA.json +1 -0
- package/dist/locale/vi-VN.json +1 -0
- package/dist/locale/zh-CN.json +2 -1
- package/dist/locale/zh-TW.json +1 -0
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/llm-providers/anthropic.js +17 -23
- package/dist/server/llm-providers/dashscope.js +3 -3
- package/dist/server/llm-providers/deepseek.js +2 -2
- package/dist/server/llm-providers/google-genai.js +17 -22
- package/dist/server/llm-providers/kimi/provider.js +4 -4
- package/dist/server/llm-providers/mimo.js +2 -2
- package/dist/server/llm-providers/ollama.js +14 -21
- package/dist/server/llm-providers/openai/completions.js +2 -2
- package/dist/server/llm-providers/openai/embedding.js +1 -1
- package/dist/server/llm-providers/openai/responses.js +2 -2
- package/dist/server/llm-providers/provider.d.ts +3 -1
- package/dist/server/llm-providers/provider.js +55 -22
- package/dist/server/llm-providers/xai.js +2 -2
- package/dist/server/resource/ai.js +11 -9
- package/dist/server/workflow/nodes/employee/index.js +2 -4
- package/dist/server/workflow/nodes/employee/types.d.ts +2 -2
- package/package.json +2 -2
- package/dist/ai/docs/nocobase/api/cli/app/down.md +0 -41
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description:
|
|
4
|
-
keywords:
|
|
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
|
|
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
|
|
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`)
|
|
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
|
|
15
|
+
This article applies to the following scenarios:
|
|
16
16
|
|
|
17
|
-
- You are installing or upgrading NocoBase
|
|
18
|
-
- You already have a NocoBase
|
|
19
|
-
- You need to prepare a connectable
|
|
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
|
|
21
|
+
## Differences between the old and new approaches
|
|
22
22
|
|
|
23
|
-
The
|
|
23
|
+
The old approach splits documentation by installation source, and each source requires separate download, configuration, installation, startup, and upgrade commands.
|
|
24
24
|
|
|
25
|
-
**
|
|
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
|
-
**
|
|
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
|
|
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
|
|
40
|
-
|
|
|
41
|
-
| Installation entry point
|
|
42
|
-
| Application runtime management
|
|
43
|
-
| Upgrade
|
|
44
|
-
| Development mode
|
|
45
|
-
| Database status
|
|
46
|
-
| View environment status and details | Manually
|
|
47
|
-
|
|
|
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
|
|
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
|
|
71
|
+
The wizard will guide you to choose:
|
|
72
72
|
|
|
73
|
-
-
|
|
74
|
-
- Installation source: Docker, npm,
|
|
73
|
+
- Create a new application or connect to an existing application
|
|
74
|
+
- Installation source: Docker, npm, Git
|
|
75
75
|
- NocoBase version
|
|
76
|
-
-
|
|
77
|
-
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
134
|
+
## Upgrade using the new approach
|
|
135
135
|
|
|
136
|
-
In the
|
|
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
|
|
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
|
|
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
|
-
|
|
|
157
|
-
|
|
|
158
|
-
| Start application
|
|
159
|
-
| Stop application
|
|
160
|
-
| Restart application
|
|
161
|
-
| View logs
|
|
162
|
-
| View env and API authentication status
|
|
163
|
-
| View env details
|
|
164
|
-
| View built-in database status
|
|
165
|
-
| Upgrade application
|
|
166
|
-
| Stop and
|
|
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
|
-
|
|
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
|
-
|
|
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`
|
|
175
|
+
`nb source` is used to manage local source projects and is mainly suitable for npm and Git source envs.
|
|
181
176
|
|
|
182
|
-
|
|
|
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
|
|
187
|
-
| Download or refresh source/
|
|
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
|
|
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
|
|
188
|
+
## NB_CLI_ROOT and directory structure
|
|
194
189
|
|
|
195
|
-
The CLI stores global configuration and local application files
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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
|
-
|
|
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
|
|
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
|
|
232
|
+
When viewing and locating applications, prefer `nb env list` and `nb env info`:
|
|
238
233
|
|
|
239
234
|
```bash
|
|
240
|
-
#
|
|
235
|
+
# View configured envs and API authentication status
|
|
241
236
|
nb env list
|
|
242
237
|
|
|
243
|
-
# View detailed information for
|
|
238
|
+
# View detailed information for an env
|
|
244
239
|
nb env info app1
|
|
245
240
|
```
|
|
246
241
|
|
|
247
|
-
`nb env list` is intended
|
|
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
|
|
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
|
|
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
|
|
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
|
-
###
|
|
258
|
+
### Method 1: connect to an existing application
|
|
264
259
|
|
|
265
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
275
|
+
If you need to refresh authentication:
|
|
281
276
|
|
|
282
277
|
```bash
|
|
283
278
|
nb env auth app1
|
|
284
279
|
```
|
|
285
280
|
|
|
286
|
-
###
|
|
281
|
+
### Method 2: create a new CLI env and then migrate files
|
|
287
282
|
|
|
288
|
-
|
|
283
|
+
Suitable for scenarios where you want to use `nb app` and `nb source` to manage local applications afterward.
|
|
289
284
|
|
|
290
|
-
Before
|
|
285
|
+
Before migration, complete the following first:
|
|
291
286
|
|
|
292
|
-
1. Stop the
|
|
293
|
-
2. Back up the
|
|
294
|
-
3. Back up the
|
|
295
|
-
4. Record the key environment variables of the
|
|
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
|
-
####
|
|
292
|
+
#### Migrate from an old Docker installation
|
|
298
293
|
|
|
299
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
####
|
|
328
|
+
#### Migrate from an old create-nocobase-app or Git source installation
|
|
334
329
|
|
|
335
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
356
|
-
- Copy
|
|
357
|
-
- Sync
|
|
358
|
-
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
385
|
-
|
|
386
|
-
|
|
|
387
|
-
|
|
|
388
|
-
| `docker compose up -d app`
|
|
389
|
-
| `docker compose stop app`
|
|
390
|
-
| `docker compose logs -f app`
|
|
391
|
-
| `docker compose pull app && docker compose up -d app` | `nb app upgrade -e app1`
|
|
392
|
-
| `yarn create nocobase-app my-nocobase-app ...`
|
|
393
|
-
| `npx create-nocobase-app@beta my-nocobase-app ...`
|
|
394
|
-
| `git clone ... -b next --depth=1 my-nocobase`
|
|
395
|
-
| `git clone ... -b develop --depth=1 my-nocobase`
|
|
396
|
-
| `yarn dev`
|
|
397
|
-
| `yarn nocobase upgrade`
|
|
398
|
-
| `yarn nocobase upgrade --skip-code-update`
|
|
399
|
-
| Manually
|
|
400
|
-
| Manually
|
|
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
|
|
405
|
-
- [NocoBase CLI
|
|
406
|
-
- [
|
|
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 `/
|
|
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 `/
|
|
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 `/
|
|
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)
|