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

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 (82) hide show
  1. package/dist/ai/docs/nocobase/api/cli/app/restart.md +1 -3
  2. package/dist/ai/docs/nocobase/api/cli/app/start.md +1 -7
  3. package/dist/ai/docs/nocobase/api/cli/config/delete.md +7 -5
  4. package/dist/ai/docs/nocobase/api/cli/config/get.md +7 -5
  5. package/dist/ai/docs/nocobase/api/cli/config/index.md +38 -18
  6. package/dist/ai/docs/nocobase/api/cli/config/set.md +9 -7
  7. package/dist/ai/docs/nocobase/api/cli/env/index.md +19 -20
  8. package/dist/ai/docs/nocobase/api/cli/env/update.md +72 -72
  9. package/dist/ai/docs/nocobase/api/cli/index.md +0 -1
  10. package/dist/ai/docs/nocobase/api/cli/init.md +30 -0
  11. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/current.md +33 -0
  12. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/generate.md +54 -0
  13. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/index.md +60 -0
  14. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/info.md +42 -0
  15. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/reload.md +32 -0
  16. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/restart.md +32 -0
  17. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/start.md +32 -0
  18. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/status.md +36 -0
  19. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/stop.md +32 -0
  20. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/use.md +38 -0
  21. package/dist/ai/docs/nocobase/api/cli/proxy/index.md +124 -0
  22. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/current.md +33 -0
  23. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/generate.md +62 -0
  24. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/index.md +60 -0
  25. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/info.md +43 -0
  26. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/reload.md +32 -0
  27. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/restart.md +32 -0
  28. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/start.md +32 -0
  29. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/status.md +36 -0
  30. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/stop.md +32 -0
  31. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/use.md +38 -0
  32. package/dist/ai/docs/nocobase/data-sources/data-source-external-nocobase/index.md +157 -0
  33. package/dist/ai/docs/nocobase/data-sources/data-source-manager/index.md +5 -0
  34. package/dist/ai/docs/nocobase/ops-management/version-control/index.md +79 -0
  35. package/dist/ai/docs/nocobase/plugins/@nocobase/plugin-version-control/index.md +14 -0
  36. package/dist/ai/docs/nocobase/quickstart/production/index.md +75 -69
  37. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +211 -80
  38. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +72 -53
  39. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +186 -89
  40. package/dist/client/{290.0888139e33c9b7cb.js → 290.0f7f441d8a94f03c.js} +1 -1
  41. package/dist/client/{428.431a00d29107058e.js → 428.fdd0cc3cfd1632ef.js} +1 -1
  42. package/dist/client/ai-employees/chatbox/hooks/useChat.d.ts +14 -14
  43. package/dist/client/ai-employees/chatbox/stores/chat-box.d.ts +1 -105
  44. package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +1 -37
  45. package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +1 -109
  46. package/dist/client/index.js +3 -3
  47. package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +17 -0
  48. package/dist/client-v2/ai-employees/chatbox/stores/chat-box.d.ts +113 -0
  49. package/dist/client-v2/ai-employees/chatbox/stores/chat-conversations.d.ts +45 -0
  50. package/dist/client-v2/ai-employees/chatbox/stores/chat-messages.d.ts +118 -0
  51. package/dist/client-v2/ai-employees/chatbox/stores/create-selectors.d.ts +18 -0
  52. package/dist/client-v2/ai-employees/chatbox/stores/global-store.d.ts +9 -0
  53. package/dist/client-v2/ai-employees/types.d.ts +151 -0
  54. package/dist/client-v2/index.d.ts +8 -1
  55. package/dist/client-v2/index.js +1 -1
  56. package/dist/client-v2/repositories/AIConfigRepository.d.ts +81 -0
  57. package/dist/client-v2/repositories/hooks/useAIConfigRepository.d.ts +10 -0
  58. package/dist/collections/ai-context-datasource.js +1 -0
  59. package/dist/externalVersion.js +16 -16
  60. package/dist/node_modules/@langchain/xai/package.json +1 -1
  61. package/dist/node_modules/fs-extra/package.json +1 -1
  62. package/dist/node_modules/jsonrepair/package.json +1 -1
  63. package/dist/node_modules/just-bash/package.json +1 -1
  64. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  65. package/dist/node_modules/openai/package.json +1 -1
  66. package/dist/node_modules/zod/package.json +1 -1
  67. package/dist/server/collections/ai-conversations.js +1 -0
  68. package/dist/server/collections/ai-employees.js +1 -0
  69. package/dist/server/collections/ai-files.js +1 -0
  70. package/dist/server/collections/ai-messages.js +1 -0
  71. package/dist/server/collections/ai-settings.js +1 -0
  72. package/dist/server/collections/ai-tool-messages.js +1 -0
  73. package/dist/server/collections/lc-checkpoint-blobs.js +1 -0
  74. package/dist/server/collections/lc-checkpoint-writes.js +1 -0
  75. package/dist/server/collections/lc-checkpoints.js +1 -0
  76. package/dist/server/collections/llm-services.js +1 -0
  77. package/dist/server/collections/users-ai-employees.js +1 -0
  78. package/package.json +2 -2
  79. package/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +0 -402
  80. package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +0 -108
  81. package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +0 -54
  82. package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +0 -104
@@ -20,7 +20,6 @@ nb app restart [flags]
20
20
  | --- | --- | --- |
21
21
  | `--env`, `-e` | string | CLI env name to restart; uses the current env if omitted |
22
22
  | `--yes`, `-y` | boolean | When an explicitly passed `--env` targets a different env than the current env, skip the interactive confirmation prompt |
23
- | `--daemon`, `-d` / `--no-daemon` | boolean | Whether to run in daemon mode after stopping; enabled by default |
24
23
  | `--verbose` | boolean | Show underlying stop and start command output |
25
24
 
26
25
  ## Examples
@@ -28,14 +27,13 @@ nb app restart [flags]
28
27
  ```bash
29
28
  nb app restart
30
29
  nb app restart --env local
31
- nb app restart --env local --no-daemon
32
30
  nb app restart --env local --verbose
33
31
  nb app restart --env local-docker
34
32
  ```
35
33
 
36
34
  If you explicitly pass `--env` and it differs from the current env, the CLI asks for confirmation first. In non-interactive terminals or AI agent sessions, add `--yes` yourself or run `nb env use <name>` first and try again.
37
35
 
38
- By default, when applicable, the CLI first runs `nb license plugins sync --skip-if-no-license` to synchronize the commercial plugins allowed by the current license. Then local envs automatically complete any required install or upgrade preparation before starting again, and Docker envs complete that step before recreating the container. Whenever the CLI needs to wait for readiness, it checks `__health_check`: it prints one waiting line first, then one progress line every 10 seconds until the app becomes available or times out. If you pass `--no-daemon` for a local env, the app runs in the foreground, so the CLI does not keep waiting for the readiness check after startup.
36
+ By default, when applicable, the CLI first runs `nb license plugins sync --skip-if-no-license` to synchronize the commercial plugins allowed by the current license. Then local envs automatically complete any required install or upgrade preparation before starting again, and Docker envs complete that step before recreating the container. Whenever the CLI needs to wait for readiness, it checks `__health_check`: it prints one waiting line first, then one progress line every 10 seconds until the app becomes available or times out.
39
37
 
40
38
  ## Related Commands
41
39
 
@@ -20,7 +20,6 @@ nb app start [flags]
20
20
  | --- | --- | --- |
21
21
  | `--env`, `-e` | string | CLI env name to start; uses the current env if omitted |
22
22
  | `--yes`, `-y` | boolean | When an explicitly passed `--env` targets a different env than the current env, skip the interactive confirmation prompt |
23
- | `--daemon`, `-d` / `--no-daemon` | boolean | Whether to run in daemon mode; enabled by default |
24
23
  | `--verbose` | boolean | Show underlying local or Docker command output |
25
24
 
26
25
  ## Examples
@@ -28,18 +27,13 @@ nb app start [flags]
28
27
  ```bash
29
28
  nb app start
30
29
  nb app start --env local
31
- nb app start --env local --daemon
32
- nb app start --env local --no-daemon
33
30
  nb app start --env local --verbose
34
31
  nb app start --env local-docker
35
32
  ```
36
33
 
37
34
  If you explicitly pass `--env` and it differs from the current env, the CLI asks for confirmation first. In non-interactive terminals or AI agent sessions, add `--yes` yourself or run `nb env use <name>` first and try again.
38
35
 
39
- By default, when applicable, the CLI first runs `nb license plugins sync --skip-if-no-license` to synchronize the commercial plugins allowed by the current license. Then local envs automatically complete any required install or upgrade preparation before starting in daemon mode, and Docker envs recreate the app container from saved env config. Whenever the CLI needs to wait for readiness, it checks `__health_check`: it prints one waiting line first, then one progress line every 10 seconds until the app becomes available or times out.
40
-
41
- If you pass `--no-daemon` for a local env, the app runs in the foreground. In that case, the CLI does not keep waiting for the readiness check after startup.
42
-
36
+ By default, when applicable, the CLI first runs `nb license plugins sync --skip-if-no-license` to synchronize the commercial plugins allowed by the current license. Then local envs automatically complete any required install or upgrade preparation before starting, and Docker envs recreate the app container from saved env config. Whenever the CLI needs to wait for readiness, it checks `__health_check`: it prints one waiting line first, then one progress line every 10 seconds until the app becomes available or times out.
43
37
  ## Related Commands
44
38
 
45
39
  - [`nb app stop`](./stop.md)
@@ -1,7 +1,7 @@
1
1
  ---
2
- title: 'nb config delete'
3
- description: 'nb config delete command reference: delete an explicitly set CLI configuration item.'
4
- keywords: 'nb config delete,NocoBase CLI,delete configuration'
2
+ title: "nb config delete"
3
+ description: "nb config delete command reference: delete an explicitly set CLI configuration item."
4
+ keywords: "nb config delete,NocoBase CLI,delete configuration"
5
5
  ---
6
6
 
7
7
  # nb config delete
@@ -16,8 +16,8 @@ nb config delete <key>
16
16
 
17
17
  ## Parameters
18
18
 
19
- | Parameter | Type | Description |
20
- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | Parameter | Type | Description |
20
+ | --- | --- | --- |
21
21
  | `<key>` | string | Configuration item name. See [`nb config`](./index.md) for supported values |
22
22
 
23
23
  ## Examples
@@ -29,6 +29,8 @@ nb config delete docker.network
29
29
  nb config delete docker.container-prefix
30
30
  nb config delete proxy.nb-cli-root
31
31
  nb config delete proxy.upstream-host
32
+ nb config delete proxy.nginx-driver
33
+ nb config delete proxy.caddy-driver
32
34
  nb config delete bin.nginx
33
35
  nb config delete bin.git
34
36
  ```
@@ -1,7 +1,7 @@
1
1
  ---
2
- title: 'nb config get'
3
- description: 'nb config get command reference: read the effective value of a CLI configuration item.'
4
- keywords: 'nb config get,NocoBase CLI,read configuration'
2
+ title: "nb config get"
3
+ description: "nb config get command reference: read the effective value of a CLI configuration item."
4
+ keywords: "nb config get,NocoBase CLI,read configuration"
5
5
  ---
6
6
 
7
7
  # nb config get
@@ -16,8 +16,8 @@ nb config get <key>
16
16
 
17
17
  ## Parameters
18
18
 
19
- | Parameter | Type | Description |
20
- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | Parameter | Type | Description |
20
+ | --- | --- | --- |
21
21
  | `<key>` | string | Configuration item name. See [`nb config`](./index.md) for supported values |
22
22
 
23
23
  ## Examples
@@ -30,6 +30,8 @@ nb config get docker.network
30
30
  nb config get docker.container-prefix
31
31
  nb config get proxy.nb-cli-root
32
32
  nb config get proxy.upstream-host
33
+ nb config get proxy.nginx-driver
34
+ nb config get proxy.caddy-driver
33
35
  nb config get bin.nginx
34
36
  nb config get bin.git
35
37
  ```
@@ -1,34 +1,44 @@
1
1
  ---
2
- title: 'nb config'
3
- description: 'nb config command reference: manage the default configuration items of the NocoBase CLI.'
4
- keywords: 'nb config,NocoBase CLI,configuration,default configuration'
2
+ title: "nb config"
3
+ description: "nb config command reference: manage default configuration items for the NocoBase CLI."
4
+ keywords: "nb config,NocoBase CLI,configuration,default configuration"
5
5
  ---
6
6
 
7
7
  # nb config
8
8
 
9
- Manage the default CLI configuration. The current configuration items mainly fall into these groups:
9
+ Manage default CLI configuration values. The currently supported keys are mainly grouped like this:
10
10
 
11
11
  - CLI itself: `locale`, `update.policy`, `license.pkg-url`
12
12
  - Docker runtime: `docker.network`, `docker.container-prefix`
13
13
  - External executables: `bin.docker`, `bin.caddy`, `bin.git`, `bin.nginx`, `bin.yarn`
14
- - Proxy generation: `proxy.nb-cli-root`, `proxy.upstream-host`
14
+ - Proxy generation: `proxy.nb-cli-root`, `proxy.upstream-host`, `proxy.nginx-driver`, `proxy.caddy-driver`
15
15
 
16
- ## Common configuration items
16
+ Most projects only need a few of these keys. In practice, the most common ones are:
17
17
 
18
- | Configuration item | Default value | Description |
18
+ - `update.policy`
19
+ - `docker.network`
20
+ - `docker.container-prefix`
21
+ - `bin.nginx` or `bin.caddy`
22
+ - `proxy.nginx-driver` or `proxy.caddy-driver`
23
+
24
+ ## Common configuration keys
25
+
26
+ | Key | Default | Description |
19
27
  | --- | --- | --- |
20
- | `locale` | Resolved according to the CLI's current rules | Override the language used by the CLI |
21
- | `update.policy` | `prompt` | Update policy at startup: `prompt`, `auto`, or `off` |
22
- | `license.pkg-url` | `https://pkg.nocobase.com/` | Override the commercial extension package download URL |
23
- | `docker.network` | `nocobase` | Default network for Docker applications managed by the CLI |
24
- | `docker.container-prefix` | `nb` | Default prefix for Docker containers managed by the CLI |
28
+ | `locale` | resolved by the current CLI rules | Override the language used by the CLI |
29
+ | `update.policy` | `prompt` | Startup update policy: `prompt`, `auto`, or `off` |
30
+ | `license.pkg-url` | `https://pkg.nocobase.com/` | Override the download URL for commercial extension packages |
31
+ | `docker.network` | `nocobase` | Default network for CLI-managed Docker apps |
32
+ | `docker.container-prefix` | `nb` | Default prefix for CLI-managed Docker containers |
25
33
  | `bin.docker` | `docker` | Override the Docker executable path |
26
34
  | `bin.caddy` | `caddy` | Override the Caddy executable path |
27
35
  | `bin.git` | `git` | Override the Git executable path |
28
36
  | `bin.nginx` | `nginx` | Override the Nginx executable path |
29
37
  | `bin.yarn` | `yarn` | Override the Yarn executable path |
30
- | `proxy.nb-cli-root` | CLI root, usually the current user's home directory | Map the `.nocobase` path to the root path visible to the proxy process |
31
- | `proxy.upstream-host` | `127.0.0.1` | Host used when the proxy forwards traffic back to the NocoBase app |
38
+ | `proxy.nb-cli-root` | CLI root, usually the current user's home directory | Override the root path visible to the generated proxy config when the proxy process and CLI do not see the same filesystem root |
39
+ | `proxy.upstream-host` | `127.0.0.1` | Override the host used when the proxy forwards traffic back to the NocoBase app |
40
+ | `proxy.nginx-driver` | `local` | Default runtime driver used by `nb proxy nginx` |
41
+ | `proxy.caddy-driver` | `local` | Default runtime driver used by `nb proxy caddy` |
32
42
 
33
43
  ## Usage
34
44
 
@@ -40,10 +50,10 @@ nb config <command>
40
50
 
41
51
  | Command | Description |
42
52
  | --- | --- |
43
- | [`nb config get`](./get.md) | Read the effective value of a configuration item |
44
- | [`nb config set`](./set.md) | Set a configuration item |
45
- | [`nb config delete`](./delete.md) | Delete an explicitly configured item |
46
- | [`nb config list`](./list.md) | List the configuration items that are currently explicitly set |
53
+ | [`nb config get`](./get.md) | Read the effective value of a configuration key |
54
+ | [`nb config set`](./set.md) | Set a configuration key |
55
+ | [`nb config delete`](./delete.md) | Delete an explicitly set configuration key |
56
+ | [`nb config list`](./list.md) | List the configuration keys that are currently set explicitly |
47
57
 
48
58
  ## Examples
49
59
 
@@ -54,6 +64,8 @@ nb config set update.policy auto
54
64
  nb config get proxy.nb-cli-root
55
65
  nb config set proxy.nb-cli-root /workspace
56
66
  nb config set proxy.upstream-host host.docker.internal
67
+ nb config set proxy.nginx-driver docker
68
+ nb config set proxy.caddy-driver local
57
69
  nb config get docker.network
58
70
  nb config set docker.network nocobase
59
71
  nb config set bin.nginx /usr/sbin/nginx
@@ -61,7 +73,15 @@ nb config set bin.git /usr/bin/git
61
73
  nb config delete docker.container-prefix
62
74
  ```
63
75
 
76
+ ## Notes
77
+
78
+ - `bin.nginx` and `bin.caddy` only affect the `local` driver for `nb proxy nginx` and `nb proxy caddy`
79
+ - `proxy.nginx-driver` and `proxy.caddy-driver` store the default driver used by each provider
80
+ - `proxy.nb-cli-root` and `proxy.upstream-host` are advanced proxy overrides. Most CLI-managed `local` or `docker` envs can use the defaults directly
81
+ - If you only want to switch the active proxy driver, using `nb proxy nginx use` or `nb proxy caddy use` is usually clearer than setting the config key manually
82
+
64
83
  ## Related commands
65
84
 
66
85
  - [`nb init`](../init.md)
86
+ - [`nb proxy`](../proxy/index.md)
67
87
  - [`nb license`](../license/index.md)
@@ -1,12 +1,12 @@
1
1
  ---
2
- title: 'nb config set'
3
- description: 'nb config set command reference: set a CLI configuration item.'
4
- keywords: 'nb config set,NocoBase CLI,set configuration'
2
+ title: "nb config set"
3
+ description: "nb config set command reference: set a CLI configuration item."
4
+ keywords: "nb config set,NocoBase CLI,set configuration"
5
5
  ---
6
6
 
7
7
  # nb config set
8
8
 
9
- Set a CLI configuration item. See [`nb config`](./index.md) for the supported configuration keys.
9
+ Set a CLI configuration item. See [`nb config`](./index.md) for supported configuration keys.
10
10
 
11
11
  ## Usage
12
12
 
@@ -16,10 +16,10 @@ nb config set <key> <value>
16
16
 
17
17
  ## Parameters
18
18
 
19
- | Parameter | Type | Description |
20
- | --------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | Parameter | Type | Description |
20
+ | --- | --- | --- |
21
21
  | `<key>` | string | Configuration item name. See [`nb config`](./index.md) for supported values |
22
- | `<value>` | string | Configuration value, cannot be empty |
22
+ | `<value>` | string | Configuration value, cannot be empty |
23
23
 
24
24
  ## Examples
25
25
 
@@ -35,6 +35,8 @@ nb config set bin.git /usr/bin/git
35
35
  nb config set bin.nginx /usr/sbin/nginx
36
36
  nb config set proxy.nb-cli-root /workspace
37
37
  nb config set proxy.upstream-host host.docker.internal
38
+ nb config set proxy.nginx-driver docker
39
+ nb config set proxy.caddy-driver local
38
40
  nb config set bin.yarn yarn
39
41
  ```
40
42
 
@@ -1,16 +1,16 @@
1
1
  ---
2
- title: 'nb env'
3
- description: 'nb env command reference: manage NocoBase CLI envs, including adding, viewing the current env, checking status, switching, updating, generating proxy configs, authenticating, and removing.'
4
- keywords: 'nb env,NocoBase CLI,environment management,env,current env,proxy,authentication,OpenAPI'
2
+ title: "nb env"
3
+ description: "nb env command reference: manage NocoBase CLI envs, including adding, viewing the current env, checking status, switching, updating, authenticating, and removing."
4
+ keywords: "nb env,NocoBase CLI,environment management,env,current env,authentication,OpenAPI"
5
5
  ---
6
6
 
7
7
  # nb env
8
8
 
9
- Manage saved NocoBase CLI envs. An env stores connection and local runtime information such as the API address, authentication info, local app path, and database configuration.
9
+ Manage saved NocoBase CLI envs. An env stores connection details and local runtime information, such as the API address, authentication info, local app path, and database configuration.
10
10
 
11
11
  Starting from this version, the CLI separates two concepts:
12
12
 
13
- - `current env`: the env currently used by the current shell or agent runtime, isolated by `NB_SESSION_ID` when possible
13
+ - `current env`: the env currently used by the active shell or agent runtime, isolated by `NB_SESSION_ID` when possible
14
14
  - `last env`: the last env used globally, used as a fallback when session mode is not enabled
15
15
 
16
16
  ## Usage
@@ -21,18 +21,17 @@ nb env <command>
21
21
 
22
22
  ## Subcommands
23
23
 
24
- | Command | Description |
25
- | -------------------------------- | ---------------------------------------------------------------------------------- |
26
- | [`nb env add`](./add.md) | Save a NocoBase API endpoint and switch to this env |
27
- | [`nb env current`](./current.md) | View the currently effective env |
28
- | [`nb env update`](./update.md) | Update a saved env configuration and automatically handle follow-up sync as needed |
29
- | [`nb env list`](./list.md) | List configured envs |
30
- | [`nb env status`](./status.md) | View the status of the current env, a specified env, or all envs |
31
- | [`nb env info`](./info.md) | View detailed information for a single env |
32
- | [`nb env proxy`](./proxy/index.md) | Show proxy provider subcommands and generate Nginx or Caddy configs for one managed env |
33
- | [`nb env remove`](./remove.md) | Remove the env configuration after stopping the managed runtime |
34
- | [`nb env auth`](./auth.md) | Perform OAuth login for a saved env |
35
- | [`nb env use`](./use.md) | Switch the current env |
24
+ | Command | Description |
25
+ | --- | --- |
26
+ | [`nb env add`](./add.md) | Save a NocoBase API endpoint and switch to this env |
27
+ | [`nb env current`](./current.md) | View the env that is currently in effect |
28
+ | [`nb env update`](./update.md) | Update a saved env configuration and automatically handle follow-up sync as needed |
29
+ | [`nb env list`](./list.md) | List configured envs |
30
+ | [`nb env status`](./status.md) | View the status of the current env, a specified env, or all envs |
31
+ | [`nb env info`](./info.md) | View detailed information for a single env |
32
+ | [`nb env remove`](./remove.md) | Remove the env configuration after stopping the managed runtime |
33
+ | [`nb env auth`](./auth.md) | Perform OAuth login for a saved env |
34
+ | [`nb env use`](./use.md) | Switch the current env |
36
35
 
37
36
  ## Examples
38
37
 
@@ -42,7 +41,6 @@ nb env current
42
41
  nb env list
43
42
  nb env status
44
43
  nb env info app1
45
- nb env proxy nginx --env app1
46
44
  nb env update app1
47
45
  nb env use app1
48
46
  nb env auth app1
@@ -50,9 +48,9 @@ nb env auth app1
50
48
 
51
49
  ## session mode
52
50
 
53
- Session mode is recommended by default. This allows the `current env` in different terminals, different shells, or different agent runtimes to stay isolated from each other without affecting one another in parallel.
51
+ Session mode is recommended by default. It lets the `current env` in different terminals, shells, or agent runtimes stay isolated from one another instead of interfering in parallel.
54
52
 
55
- If session mode is not enabled, `nb env use` updates the global `last env`, and other sessions without session isolation will also be affected.
53
+ If session mode is not enabled, `nb env use` updates the global `last env`, and other sessions without session isolation are affected as well.
56
54
 
57
55
  See [`nb session setup`](../session/setup.md) for how to enable it.
58
56
 
@@ -61,4 +59,5 @@ See [`nb session setup`](../session/setup.md) for how to enable it.
61
59
  - [`nb init`](../init.md)
62
60
  - [`nb api`](../api/index.md)
63
61
  - [`nb app`](../app/index.md)
62
+ - [`nb proxy`](../proxy/index.md)
64
63
  - [`nb session`](../session/index.md)
@@ -1,14 +1,14 @@
1
1
  ---
2
- title: 'nb env update'
3
- description: 'nb env update command reference: update the saved API, authentication, source code, application, and database configuration.'
4
- keywords: 'nb env update,NocoBase CLI,env configuration,authentication,database,source code'
2
+ title: "nb env update"
3
+ description: "nb env update command reference: update the saved API, authentication, source code, application, and database configuration."
4
+ keywords: "nb env update,NocoBase CLI,env configuration,authentication,database,source code"
5
5
  ---
6
6
 
7
7
  # nb env update
8
8
 
9
- `nb env update` is used to update the configuration of a saved env. You can use it to adjust the API address, authentication method, source code origin, local app path, port, database parameters, and more. After the update is complete, the CLI will automatically handle the necessary follow-up steps based on the changes.
9
+ `nb env update` updates the configuration of a saved env. You can use it to adjust the API address, authentication method, source origin, local app path, public path, port, database parameters, and more. After the update finishes, the CLI automatically handles any required follow-up steps according to the changes.
10
10
 
11
- If you do not provide any configuration parameters, the CLI will also perform a re-sync based on the current env state.
11
+ If you do not pass any configuration parameters, the CLI still performs a re-sync based on the current env state.
12
12
 
13
13
  ## Usage
14
14
 
@@ -18,112 +18,112 @@ nb env update [name] [flags]
18
18
 
19
19
  ## Common options
20
20
 
21
- | Option | Type | Description |
22
- | ----------- | ------- | -------------------------------------------------------------------------------------- |
23
- | `[name]` | string | The name of the configured environment to update; if omitted, the current env is used. |
24
- | `--verbose` | boolean | Show detailed progress. |
21
+ | Option | Type | Description |
22
+ | --- | --- | --- |
23
+ | `[name]` | string | The configured env name to update; if omitted, the current env is used |
24
+ | `--verbose` | boolean | Show detailed progress |
25
25
 
26
26
  ## API and authentication options
27
27
 
28
- | Option | Type | Description |
29
- | --------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
- | `--api-base-url`, `-u` | string | NocoBase API address, including the `/api` prefix. |
31
- | `--auth-type` | string | Authentication method: `basic`, `token`, `oauth`. |
32
- | `--access-token`, `--token`, `-t` | string | API key or access token used for `token` authentication. After saving, the authentication method will be switched to `token`. |
33
- | `--username` | string | Username saved for `basic` authentication. Can only be used when the current env uses `basic` authentication, or when `--auth-type basic` is passed at the same time. |
34
-
35
- ## Source code and download options
36
-
37
- | Option | Type | Description |
38
- | ---------------------------------------------- | ------- | --------------------------------------------------------------------- |
39
- | `--source` | string | Saved application source: `docker`, `git`, `local`, `npm`. |
40
- | `--download-version`, `--version` | string | Saved version parameter: Docker tag, npm package version, or Git ref. |
41
- | `--docker-registry` | string | Docker image registry name, without the tag. |
42
- | `--docker-platform` | string | Docker image platform: `auto`, `linux/amd64`, `linux/arm64`. |
43
- | `--git-url` | string | Git repository URL. |
44
- | `--npm-registry` | string | Registry used for npm/Git downloads and dependency installation. |
45
- | `--dev-dependencies` / `--no-dev-dependencies` | boolean | Whether to install devDependencies when installing from npm/Git. |
46
- | `--build` / `--no-build` | boolean | Whether to build automatically after downloading from npm/Git. |
47
- | `--build-dts` / `--no-build-dts` | boolean | Whether to generate TypeScript declaration files during build. |
28
+ | Option | Type | Description |
29
+ | --- | --- | --- |
30
+ | `--api-base-url`, `-u` | string | NocoBase API URL, including the `/api` prefix |
31
+ | `--auth-type` | string | Authentication method: `basic`, `token`, or `oauth` |
32
+ | `--access-token`, `--token`, `-t` | string | API key or access token used with `token` authentication. Saving it also switches the auth type to `token` |
33
+ | `--username` | string | Username saved for `basic` authentication. Use it only when the current env already uses `basic`, or together with `--auth-type basic` |
34
+
35
+ ## Source and download options
36
+
37
+ | Option | Type | Description |
38
+ | --- | --- | --- |
39
+ | `--source` | string | Saved app source: `docker`, `git`, `local`, or `npm` |
40
+ | `--download-version`, `--version` | string | Saved version selector: Docker tag, npm package version, or Git ref |
41
+ | `--docker-registry` | string | Docker image registry name, without the tag |
42
+ | `--docker-platform` | string | Docker image platform: `auto`, `linux/amd64`, or `linux/arm64` |
43
+ | `--git-url` | string | Git repository URL |
44
+ | `--npm-registry` | string | Registry used for npm or Git downloads and dependency installation |
45
+ | `--dev-dependencies` / `--no-dev-dependencies` | boolean | Whether to install `devDependencies` for npm or Git sources |
46
+ | `--build` / `--no-build` | boolean | Whether to build automatically after an npm or Git download |
47
+ | `--build-dts` / `--no-build-dts` | boolean | Whether to generate TypeScript declaration files during the build |
48
48
 
49
49
  ## Application options
50
50
 
51
- | Option | Type | Description |
52
- | ------------ | ------ | ---------------------------------------------------------------------------------------------------- |
53
- | `--app-path` | string | Application directory. This is now the recommended option for managing local directories by default. |
54
- | `--app-public-path` | string | Public application path (`APP_PUBLIC_PATH`), such as `/` or `/nocobase/`. |
55
- | `--app-port` | string | Application HTTP port. |
56
- | `--cdn-base-url` | string | Client asset CDN base URL (`CDN_BASE_URL`). |
57
- | `--app-key` | string | Application secret key (`APP_KEY`). |
58
- | `--timezone` | string | Application time zone (`TZ`). |
51
+ | Option | Type | Description |
52
+ | --- | --- | --- |
53
+ | `--app-path` | string | Application directory. This is now the preferred way to manage the local app path |
54
+ | `--app-public-path` | string | Public application path (`APP_PUBLIC_PATH`), such as `/` or `/nocobase/` |
55
+ | `--app-port` | string | Application HTTP port |
56
+ | `--cdn-base-url` | string | CDN base URL for client-side static assets (`CDN_BASE_URL`) |
57
+ | `--app-key` | string | Application key (`APP_KEY`) |
58
+ | `--timezone` | string | Application timezone (`TZ`) |
59
59
 
60
60
  ## Database options
61
61
 
62
- | Option | Type | Description |
63
- | ------------------------------------------ | ------- | ---------------------------------------------------------- |
64
- | `--builtin-db` / `--no-builtin-db` | boolean | Whether to use the built-in database managed by the CLI. |
65
- | `--db-dialect` | string | Database type: `postgres`, `mysql`, `mariadb`, `kingbase`. |
66
- | `--builtin-db-image` | string | Built-in database container image. |
67
- | `--db-host` | string | Database host address. |
68
- | `--db-port` | string | Database port. |
69
- | `--db-database` | string | Database name. |
70
- | `--db-user` | string | Database username. |
71
- | `--db-password` | string | Database password. |
72
- | `--db-schema` | string | Database schema. Usually only used by PostgreSQL. |
73
- | `--db-table-prefix` | string | Table prefix. |
74
- | `--db-underscored` / `--no-db-underscored` | boolean | Whether table names and field names use underscore style. |
75
-
76
- ## Configuration cleanup options
77
-
78
- | Option | Type | Description |
79
- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
80
- | `--unset` | string[] | Clear one or more saved fields by the canonical flag name. Repeated usage is supported, and comma-separated values are also supported, for example `--unset git-url,username`. |
62
+ | Option | Type | Description |
63
+ | --- | --- | --- |
64
+ | `--builtin-db` / `--no-builtin-db` | boolean | Whether to use the built-in database managed by the CLI |
65
+ | `--db-dialect` | string | Database type: `postgres`, `mysql`, `mariadb`, or `kingbase` |
66
+ | `--builtin-db-image` | string | Container image used for the built-in database |
67
+ | `--db-host` | string | Database host |
68
+ | `--db-port` | string | Database port |
69
+ | `--db-database` | string | Database name |
70
+ | `--db-user` | string | Database username |
71
+ | `--db-password` | string | Database password |
72
+ | `--db-schema` | string | Database schema. This is usually used only by PostgreSQL |
73
+ | `--db-table-prefix` | string | Table prefix |
74
+ | `--db-underscored` / `--no-db-underscored` | boolean | Whether table names and field names use underscore naming |
75
+
76
+ ## Configuration cleanup
77
+
78
+ | Option | Type | Description |
79
+ | --- | --- | --- |
80
+ | `--unset` | string[] | Clear one or more saved fields by flag name. You can repeat the option or pass a comma-separated list, such as `--unset git-url,username` |
81
81
 
82
82
  ## Notes
83
83
 
84
84
  :::tip
85
85
 
86
- If you only want the CLI to re-sync according to the latest state of the current env, just run `nb env update` or `nb env update <name>`. No extra parameters are needed.
86
+ If you only want the CLI to re-sync based on the latest state of the current env, simply run `nb env update` or `nb env update <name>` without extra options.
87
87
 
88
88
  :::
89
89
 
90
- - After the update is complete, the CLI will automatically handle any required follow-up synchronization based on the changes made this time
91
- - Other options only update the saved env configuration; they do not automatically restart the application or automatically replace local source code or Docker images
92
- - After modifying settings such as `app-path`, `app-port`, `timezone`, or `db-*`, the CLI will usually prompt you to run `nb app restart --env <name>` afterward; if the change involves the built-in database managed by the CLI, it will prompt you to use `nb app restart --env <name> --with-db`
93
- - After modifying settings such as `app-port`, `app-public-path`, or `cdn-base-url` that affect reverse-proxy rendering, rerun `nb env proxy nginx` or `nb env proxy caddy` if you already use a generated proxy config
90
+ - After the update is complete, the CLI automatically handles any required follow-up synchronization based on the changes made this time
91
+ - Other options only update the saved env configuration; they do not automatically restart the application or replace local source code or Docker images
92
+ - After modifying settings such as `app-path`, `app-port`, `timezone`, or `db-*`, the CLI usually prompts you to run `nb app restart --env <name>`; if the change involves the built-in database managed by the CLI, it will prompt you to use `nb app restart --env <name> --with-db`
93
+ - After modifying settings such as `app-port`, `app-public-path`, or `cdn-base-url` that affect reverse-proxy output, rerun `nb proxy nginx generate` or `nb proxy caddy generate` if you already use a generated proxy config
94
94
  - When updating source settings such as `source`, `download-version`, `docker-registry`, `git-url`, or `npm-registry`, only the saved values are changed. Existing local source code, dependencies, and images are not automatically replaced
95
95
  - `--access-token` cannot be used together with `--auth-type basic` or `--auth-type oauth`
96
- - The same field cannot be used with both `--unset` and an explicit value at the same time. For example, you cannot write both `--unset git-url` and `--git-url ...`
97
- - If you switch the authentication method to `basic` or `oauth`, or clear the token, you will usually need to run `nb env auth <name>` afterward
96
+ - The same field cannot be used with both `--unset` and an explicit value at the same time. For example, do not use `--unset git-url` together with `--git-url ...`
97
+ - If you switch the authentication method to `basic` or `oauth`, or clear the token, you usually need to run `nb env auth <name>` afterward
98
98
 
99
99
  ## Examples
100
100
 
101
101
  ```bash
102
- # Re-sync the current env according to the latest state
102
+ # Re-sync the current env based on its latest saved state
103
103
  nb env update
104
104
 
105
- # Re-sync the specified env according to the latest state
105
+ # Re-sync a specific env
106
106
  nb env update prod
107
107
 
108
- # Update the API address
108
+ # Update the API URL
109
109
  nb env update prod --api-base-url http://localhost:13000/api
110
110
 
111
- # Update the token and switch the authentication method to token
111
+ # Update the token and switch auth type to token
112
112
  nb env update prod --access-token <token>
113
113
 
114
- # Switch to basic authentication, save only the username, and run nb env auth later
114
+ # Switch to basic auth, save the username, and run nb env auth later
115
115
  nb env update prod --auth-type basic --username admin
116
116
 
117
- # Adjust the source origin and version, only updating the saved configuration
117
+ # Update the saved source and version without replacing local code yet
118
118
  nb env update local --source git --git-url git@github.com:nocobase/nocobase.git --download-version next
119
119
 
120
- # Adjust the application port and time zone, then restart the application later
120
+ # Adjust the app port and timezone, then restart later
121
121
  nb env update local --app-port 13080 --timezone Asia/Shanghai
122
122
 
123
- # Adjust the public application path. After that, you usually also need to regenerate the proxy config
123
+ # Adjust the public path and regenerate the proxy afterward if needed
124
124
  nb env update local --app-public-path /nocobase/
125
125
 
126
- # Save a CDN base URL for versioned client assets
126
+ # Save the CDN base URL for client assets
127
127
  nb env update local --cdn-base-url https://cdn.example.com/nocobase/
128
128
 
129
129
  # Clear saved fields
@@ -191,7 +191,6 @@ This file is generated or refreshed by [`nb env update`](./env/update.md) and is
191
191
  ## Related links
192
192
 
193
193
  - [Quick Start](../../ai/quick-start.mdx)
194
- - [Install, Upgrade, and Migration](../../ai/install-upgrade-migration.mdx)
195
194
  - [Global Environment Variables](../app/env.md)
196
195
  - [AI Builder](../../ai-builder/index.md)
197
196
  - [Plugin Development](../../plugin-development/index.md)
@@ -38,6 +38,27 @@ nb init --env app1 --resume
38
38
 
39
39
  `--resume` only applies to initialization flows where the env configuration has already been saved, and `--env` must be passed explicitly.
40
40
 
41
+ ## Preparing an env without installing the app yet
42
+
43
+ `--prepare-only` is intended for flows where the env should be prepared first, then the license is activated, and only after that the app is installed and started.
44
+
45
+ If you want to save the env config, prepare the source files or image, and get the database ready first, but delay the actual app installation and first startup, you can use:
46
+
47
+ ```bash
48
+ nb init --env app1 --prepare-only
49
+ nb init --env app1 --prepare-only --ui
50
+ nb init --env app1 --prepare-only --yes
51
+ ```
52
+
53
+ This mode is available for local installation flows, including the `--ui` wizard. It is not available for remote connection flows. It saves the env as a prepared env, so you can continue later with a flow such as:
54
+
55
+ ```bash
56
+ nb license activate --env app1
57
+ nb app start --env app1
58
+ ```
59
+
60
+ `nb app start` will then complete the first installation and switch the env from the prepared state to the normal installed state.
61
+
41
62
  ## Installation directory layout
42
63
 
43
64
  You can view the full path with `nb env info app1 --field app.appPath`.
@@ -104,6 +125,7 @@ The “Default” below means the value or behavior that `nb init` usually uses
104
125
  | `--ui-port` | integer | `0` | Port for the `--ui` local service; `0` means automatic assignment |
105
126
  | `--locale` | string | Follows `NB_LOCALE`, CLI config, or system locale; final fallback is `en-US` | Language for CLI prompts and the local setup UI: `en-US` or `zh-CN` |
106
127
  | `--resume` | boolean | `false` | Continue the last unfinished initialization and reuse the saved workspace env config |
128
+ | `--prepare-only` | boolean | `false` | Save and prepare a local installation env, including `--ui` flows, without installing or starting the app yet |
107
129
 
108
130
  ### Connecting to an existing app
109
131
 
@@ -180,6 +202,14 @@ nb init --ui
180
202
  nb init --ui --ui-port 3000
181
203
  ```
182
204
 
205
+ ### Prepare first, then activate the license and start later
206
+
207
+ ```bash
208
+ nb init --env app1 --prepare-only
209
+ nb license activate --env app1
210
+ nb app start --env app1
211
+ ```
212
+
183
213
  ### Install a new local app in non-interactive mode
184
214
 
185
215
  If you do not specify `--source`, Docker is usually used as the install source.