@nocobase/plugin-ai 2.1.0-beta.45 → 2.1.0-beta.47

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 (74) hide show
  1. package/dist/ai/docs/nocobase/api/cli/config/delete.md +7 -5
  2. package/dist/ai/docs/nocobase/api/cli/config/get.md +7 -5
  3. package/dist/ai/docs/nocobase/api/cli/config/index.md +38 -18
  4. package/dist/ai/docs/nocobase/api/cli/config/set.md +9 -7
  5. package/dist/ai/docs/nocobase/api/cli/env/index.md +19 -20
  6. package/dist/ai/docs/nocobase/api/cli/env/update.md +72 -72
  7. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/current.md +33 -0
  8. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/generate.md +54 -0
  9. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/index.md +60 -0
  10. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/info.md +42 -0
  11. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/reload.md +32 -0
  12. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/restart.md +32 -0
  13. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/start.md +32 -0
  14. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/status.md +36 -0
  15. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/stop.md +32 -0
  16. package/dist/ai/docs/nocobase/api/cli/proxy/caddy/use.md +38 -0
  17. package/dist/ai/docs/nocobase/api/cli/proxy/index.md +124 -0
  18. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/current.md +33 -0
  19. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/generate.md +62 -0
  20. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/index.md +60 -0
  21. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/info.md +43 -0
  22. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/reload.md +32 -0
  23. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/restart.md +32 -0
  24. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/start.md +32 -0
  25. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/status.md +36 -0
  26. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/stop.md +32 -0
  27. package/dist/ai/docs/nocobase/api/cli/proxy/nginx/use.md +38 -0
  28. package/dist/ai/docs/nocobase/ops-management/version-control/index.md +73 -0
  29. package/dist/ai/docs/nocobase/quickstart/production/index.md +75 -69
  30. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +211 -80
  31. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +72 -53
  32. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +186 -89
  33. package/dist/client/{290.0888139e33c9b7cb.js → 290.0f7f441d8a94f03c.js} +1 -1
  34. package/dist/client/{428.431a00d29107058e.js → 428.fdd0cc3cfd1632ef.js} +1 -1
  35. package/dist/client/ai-employees/chatbox/hooks/useChat.d.ts +14 -14
  36. package/dist/client/ai-employees/chatbox/stores/chat-box.d.ts +1 -105
  37. package/dist/client/ai-employees/chatbox/stores/chat-conversations.d.ts +1 -37
  38. package/dist/client/ai-employees/chatbox/stores/chat-messages.d.ts +1 -109
  39. package/dist/client/index.js +3 -3
  40. package/dist/client-v2/ai-employees/chatbox/hooks/useChatBoxActions.d.ts +17 -0
  41. package/dist/client-v2/ai-employees/chatbox/stores/chat-box.d.ts +113 -0
  42. package/dist/client-v2/ai-employees/chatbox/stores/chat-conversations.d.ts +45 -0
  43. package/dist/client-v2/ai-employees/chatbox/stores/chat-messages.d.ts +118 -0
  44. package/dist/client-v2/ai-employees/chatbox/stores/create-selectors.d.ts +18 -0
  45. package/dist/client-v2/ai-employees/chatbox/stores/global-store.d.ts +9 -0
  46. package/dist/client-v2/ai-employees/types.d.ts +151 -0
  47. package/dist/client-v2/index.d.ts +8 -1
  48. package/dist/client-v2/index.js +1 -1
  49. package/dist/client-v2/repositories/AIConfigRepository.d.ts +81 -0
  50. package/dist/client-v2/repositories/hooks/useAIConfigRepository.d.ts +10 -0
  51. package/dist/collections/ai-context-datasource.js +1 -0
  52. package/dist/externalVersion.js +16 -16
  53. package/dist/node_modules/@langchain/xai/package.json +1 -1
  54. package/dist/node_modules/fs-extra/package.json +1 -1
  55. package/dist/node_modules/jsonrepair/package.json +1 -1
  56. package/dist/node_modules/just-bash/package.json +1 -1
  57. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  58. package/dist/node_modules/openai/package.json +1 -1
  59. package/dist/node_modules/zod/package.json +1 -1
  60. package/dist/server/collections/ai-conversations.js +1 -0
  61. package/dist/server/collections/ai-employees.js +1 -0
  62. package/dist/server/collections/ai-files.js +1 -0
  63. package/dist/server/collections/ai-messages.js +1 -0
  64. package/dist/server/collections/ai-settings.js +1 -0
  65. package/dist/server/collections/ai-tool-messages.js +1 -0
  66. package/dist/server/collections/lc-checkpoint-blobs.js +1 -0
  67. package/dist/server/collections/lc-checkpoint-writes.js +1 -0
  68. package/dist/server/collections/lc-checkpoints.js +1 -0
  69. package/dist/server/collections/llm-services.js +1 -0
  70. package/dist/server/collections/users-ai-employees.js +1 -0
  71. package/package.json +2 -2
  72. package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +0 -108
  73. package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +0 -54
  74. package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +0 -104
@@ -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
@@ -0,0 +1,33 @@
1
+ ---
2
+ title: "nb proxy caddy current"
3
+ description: "nb proxy caddy current command reference: print the current Caddy provider driver."
4
+ keywords: "nb proxy caddy current,NocoBase CLI,caddy,driver"
5
+ ---
6
+
7
+ # nb proxy caddy current
8
+
9
+ Print the current Caddy provider driver.
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ nb proxy caddy current
15
+ ```
16
+
17
+ ## Output
18
+
19
+ The command prints one value directly:
20
+
21
+ - `local`
22
+ - `docker`
23
+
24
+ ## Examples
25
+
26
+ ```bash
27
+ nb proxy caddy current
28
+ ```
29
+
30
+ ## Related commands
31
+
32
+ - [`nb proxy caddy use`](./use.md)
33
+ - [`nb proxy caddy info`](./info.md)
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: "nb proxy caddy generate"
3
+ description: "nb proxy caddy generate command reference: generate or refresh the Caddy config for one CLI-managed env."
4
+ keywords: "nb proxy caddy generate,NocoBase CLI,caddy,reverse proxy,proxy configuration"
5
+ ---
6
+
7
+ # nb proxy caddy generate
8
+
9
+ Generate or refresh the Caddy entry config for one CLI-managed env.
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ nb proxy caddy generate --env <name> [--host <domain>] [--port <port>]
15
+ ```
16
+
17
+ ## Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ | --- | --- | --- |
21
+ | `--env`, `-e` | string | CLI-managed env name to generate the config for |
22
+ | `--host` | string | Host written into the site address, such as `app1.example.com` |
23
+ | `--port` | string | Listen port written into the site address, such as `8080` |
24
+
25
+ ## Generated files
26
+
27
+ Using env `test2` as an example, the command typically maintains these files and directories:
28
+
29
+ - `NB_CLI_ROOT/.nocobase/proxy/caddy/nocobase.caddy`
30
+ - `NB_CLI_ROOT/.nocobase/proxy/caddy/test2/app.caddy`
31
+ - `NB_CLI_ROOT/.nocobase/proxy/caddy/test2/public/index-v1.html`
32
+ - `NB_CLI_ROOT/.nocobase/proxy/caddy/test2/public/index-v2.html`
33
+
34
+ In the current design, `app.caddy` is already the complete site config for one env and is no longer split into a separate `generated.caddy` file.
35
+
36
+ ## Examples
37
+
38
+ ```bash
39
+ nb proxy caddy generate --env demo --host demo.local.nocobase.com
40
+ nb proxy caddy generate --env demo --host demo.local.nocobase.com --port 8080
41
+ ```
42
+
43
+ ## Notes
44
+
45
+ - `generate` only writes or refreshes config and does not automatically start Caddy
46
+ - Regenerating config overwrites `app.caddy` as a whole
47
+ - If you change settings such as `app-port` or `app-public-path` with `nb env update`, you will usually need to rerun this command
48
+ - Only CLI-managed `local` or `docker` envs can use this command
49
+
50
+ ## Related commands
51
+
52
+ - [`nb proxy caddy start`](./start.md)
53
+ - [`nb proxy caddy reload`](./reload.md)
54
+ - [`nb env update`](../../env/update.md)
@@ -0,0 +1,60 @@
1
+ ---
2
+ title: "nb proxy caddy"
3
+ description: "nb proxy caddy command-group reference: manage the Caddy provider driver, config generation, and runtime control."
4
+ keywords: "nb proxy caddy,NocoBase CLI,caddy,reverse proxy,proxy configuration"
5
+ ---
6
+
7
+ # nb proxy caddy
8
+
9
+ `nb proxy caddy` is the command-group entry for the Caddy provider.
10
+
11
+ If you already have a domain, want to get HTTPS running quickly, and do not want to maintain too many TLS details yourself, this is usually the place to start. It handles two things:
12
+
13
+ - choosing how Caddy runs, which means `local` or `docker`
14
+ - generating, starting, reloading, and inspecting the Caddy entrypoint for CLI-managed envs
15
+
16
+ ## Usage
17
+
18
+ ```bash
19
+ nb proxy caddy <command>
20
+ ```
21
+
22
+ ## Subcommands
23
+
24
+ | Command | Description |
25
+ | --- | --- |
26
+ | [`nb proxy caddy use`](./use.md) | Switch the Caddy driver |
27
+ | [`nb proxy caddy current`](./current.md) | Print the current driver |
28
+ | [`nb proxy caddy generate`](./generate.md) | Generate or refresh the Caddy config for one env |
29
+ | [`nb proxy caddy start`](./start.md) | Start the Caddy proxy |
30
+ | [`nb proxy caddy restart`](./restart.md) | Restart the Caddy proxy |
31
+ | [`nb proxy caddy reload`](./reload.md) | Reload the Caddy config |
32
+ | [`nb proxy caddy stop`](./stop.md) | Stop the Caddy proxy |
33
+ | [`nb proxy caddy status`](./status.md) | Show Caddy runtime status |
34
+ | [`nb proxy caddy info`](./info.md) | Show driver, config paths, and runtime info |
35
+
36
+ ## Notes
37
+
38
+ - The current driver is stored in `proxy.caddy-driver`
39
+ - The default driver is `local`
40
+ - The local driver uses the executable pointed to by `bin.caddy`, whose default value is `caddy`
41
+ - The Docker driver uses `caddy:latest`
42
+ - The default Docker container name is `<docker.container-prefix>-caddy-proxy`
43
+ - The Docker driver mounts host `NB_CLI_ROOT` into the container at `/apps`
44
+
45
+ ## Typical workflow
46
+
47
+ ```bash
48
+ nb proxy caddy use local
49
+ nb proxy caddy generate --env app1 --host app1.example.com
50
+ nb proxy caddy start
51
+ nb proxy caddy status
52
+ nb proxy caddy info
53
+ ```
54
+
55
+ ## Related commands
56
+
57
+ - [`nb proxy`](../index.md)
58
+ - [`nb proxy nginx`](../nginx/index.md)
59
+ - [`nb env update`](../../env/update.md)
60
+ - [`nb config`](../../config/index.md)