@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.
Files changed (117) hide show
  1. package/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +127 -132
  2. package/dist/ai/docs/nocobase/ai-dev/capabilities.md +1 -1
  3. package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
  4. package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +1 -1
  5. package/dist/ai/docs/nocobase/api/cli/app/autostart/disable.md +44 -0
  6. package/dist/ai/docs/nocobase/api/cli/app/autostart/enable.md +44 -0
  7. package/dist/ai/docs/nocobase/api/cli/app/autostart/index.md +63 -0
  8. package/dist/ai/docs/nocobase/api/cli/app/autostart/list.md +41 -0
  9. package/dist/ai/docs/nocobase/api/cli/app/autostart/run.md +50 -0
  10. package/dist/ai/docs/nocobase/api/cli/app/index.md +18 -15
  11. package/dist/ai/docs/nocobase/api/cli/app/restart.md +3 -11
  12. package/dist/ai/docs/nocobase/api/cli/app/start.md +3 -11
  13. package/dist/ai/docs/nocobase/api/cli/app/stop.md +22 -12
  14. package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +6 -6
  15. package/dist/ai/docs/nocobase/api/cli/backup/create.md +49 -0
  16. package/dist/ai/docs/nocobase/api/cli/backup/index.md +46 -0
  17. package/dist/ai/docs/nocobase/api/cli/backup/restore.md +46 -0
  18. package/dist/ai/docs/nocobase/api/cli/config/delete.md +11 -9
  19. package/dist/ai/docs/nocobase/api/cli/config/get.md +11 -8
  20. package/dist/ai/docs/nocobase/api/cli/config/index.md +28 -24
  21. package/dist/ai/docs/nocobase/api/cli/config/set.md +14 -12
  22. package/dist/ai/docs/nocobase/api/cli/db/stop.md +10 -11
  23. package/dist/ai/docs/nocobase/api/cli/env/index.md +25 -23
  24. package/dist/ai/docs/nocobase/api/cli/env/info.md +12 -10
  25. package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +108 -0
  26. package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +54 -0
  27. package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +104 -0
  28. package/dist/ai/docs/nocobase/api/cli/env/remove.md +18 -14
  29. package/dist/ai/docs/nocobase/api/cli/env/update.md +115 -14
  30. package/dist/ai/docs/nocobase/api/cli/index.md +66 -52
  31. package/dist/ai/docs/nocobase/api/cli/init.md +244 -62
  32. package/dist/ai/docs/nocobase/api/cli/license/activate.md +13 -12
  33. package/dist/ai/docs/nocobase/api/cli/license/index.md +2 -2
  34. package/dist/ai/docs/nocobase/api/cli/plugin/import.md +74 -0
  35. package/dist/ai/docs/nocobase/api/cli/plugin/index.md +4 -2
  36. package/dist/ai/docs/nocobase/get-started/deployment/how-to-deploy-nocobase-faster.mdx +384 -0
  37. package/dist/ai/docs/nocobase/get-started/install-upgrade-plugins.mdx +16 -10
  38. package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +1 -1
  39. package/dist/ai/docs/nocobase/index.md +3 -3
  40. package/dist/ai/docs/nocobase/multi-app/multi-app/app-block-and-switcher.md +68 -0
  41. package/dist/ai/docs/nocobase/multi-app/multi-app/app-sso.md +71 -0
  42. package/dist/ai/docs/nocobase/multi-app/multi-app/index.md +9 -1
  43. package/dist/ai/docs/nocobase/multi-app/multi-app/sub-app-api.md +112 -0
  44. package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +3 -3
  45. package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +1 -1
  46. package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +2 -2
  47. package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +1 -1
  48. package/dist/ai/docs/nocobase/plugin-development/client/router.md +11 -11
  49. package/dist/ai/docs/nocobase/quickstart/index.md +27 -0
  50. package/dist/ai/docs/nocobase/quickstart/installation/airgap.md +67 -0
  51. package/dist/ai/docs/nocobase/quickstart/installation/cli.md +205 -0
  52. package/dist/ai/docs/nocobase/quickstart/installation/docker-compose.md +123 -0
  53. package/dist/ai/docs/nocobase/quickstart/installation/env.md +101 -0
  54. package/dist/ai/docs/nocobase/quickstart/installation/migration.md +50 -0
  55. package/dist/ai/docs/nocobase/quickstart/operations/backup-restore.md +94 -0
  56. package/dist/ai/docs/nocobase/quickstart/operations/manage-app.md +166 -0
  57. package/dist/ai/docs/nocobase/quickstart/operations/multi-environment.md +171 -0
  58. package/dist/ai/docs/nocobase/quickstart/plugins/third-party.md +86 -0
  59. package/dist/ai/docs/nocobase/quickstart/production/index.md +163 -0
  60. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +158 -0
  61. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +100 -0
  62. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +166 -0
  63. package/dist/ai/docs/nocobase/quickstart/release-management.md +1 -0
  64. package/dist/ai/docs/nocobase/solution/all-in-one/installation.md +181 -0
  65. package/dist/ai/docs/nocobase/solution/crm/changelog.md +0 -3
  66. package/dist/ai/docs/nocobase/solution/crm/installation.md +6 -76
  67. package/dist/ai/docs/nocobase/solution/crm/v1.md +6 -35
  68. package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +0 -2
  69. package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +6 -69
  70. package/dist/ai/docs/nocobase/workflow/advanced/options.md +45 -1
  71. package/dist/client/{406.15c09d98faa2ccf1.js → 406.9a530334eae8cede.js} +1 -1
  72. package/dist/client/{428.e9f38da3b0d8b498.js → 428.431a00d29107058e.js} +1 -1
  73. package/dist/client/index.js +2 -2
  74. package/dist/client-v2/index.js +1 -1
  75. package/dist/externalVersion.js +18 -18
  76. package/dist/locale/de-DE.json +1 -0
  77. package/dist/locale/en-US.json +2 -1
  78. package/dist/locale/es-ES.json +1 -0
  79. package/dist/locale/fr-FR.json +1 -0
  80. package/dist/locale/hu-HU.json +1 -0
  81. package/dist/locale/id-ID.json +1 -0
  82. package/dist/locale/it-IT.json +1 -0
  83. package/dist/locale/ja-JP.json +1 -0
  84. package/dist/locale/ko-KR.json +1 -0
  85. package/dist/locale/nl-NL.json +1 -0
  86. package/dist/locale/pt-BR.json +1 -0
  87. package/dist/locale/ru-RU.json +1 -0
  88. package/dist/locale/tr-TR.json +1 -0
  89. package/dist/locale/uk-UA.json +1 -0
  90. package/dist/locale/vi-VN.json +1 -0
  91. package/dist/locale/zh-CN.json +2 -1
  92. package/dist/locale/zh-TW.json +1 -0
  93. package/dist/node_modules/@langchain/xai/package.json +1 -1
  94. package/dist/node_modules/fs-extra/package.json +1 -1
  95. package/dist/node_modules/jsonrepair/package.json +1 -1
  96. package/dist/node_modules/just-bash/package.json +1 -1
  97. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  98. package/dist/node_modules/openai/package.json +1 -1
  99. package/dist/node_modules/zod/package.json +1 -1
  100. package/dist/server/llm-providers/anthropic.js +17 -23
  101. package/dist/server/llm-providers/dashscope.js +3 -3
  102. package/dist/server/llm-providers/deepseek.js +2 -2
  103. package/dist/server/llm-providers/google-genai.js +17 -22
  104. package/dist/server/llm-providers/kimi/provider.js +4 -4
  105. package/dist/server/llm-providers/mimo.js +2 -2
  106. package/dist/server/llm-providers/ollama.js +14 -21
  107. package/dist/server/llm-providers/openai/completions.js +2 -2
  108. package/dist/server/llm-providers/openai/embedding.js +1 -1
  109. package/dist/server/llm-providers/openai/responses.js +2 -2
  110. package/dist/server/llm-providers/provider.d.ts +3 -1
  111. package/dist/server/llm-providers/provider.js +55 -22
  112. package/dist/server/llm-providers/xai.js +2 -2
  113. package/dist/server/resource/ai.js +11 -9
  114. package/dist/server/workflow/nodes/employee/index.js +2 -4
  115. package/dist/server/workflow/nodes/employee/types.d.ts +2 -2
  116. package/package.json +2 -2
  117. package/dist/ai/docs/nocobase/api/cli/app/down.md +0 -41
@@ -1,16 +1,18 @@
1
1
  ---
2
- title: "nb env remove"
3
- description: "nb env remove command reference: remove a selected NocoBase CLI env config."
4
- keywords: "nb env remove,NocoBase CLI,delete environment,remove config"
2
+ title: 'nb env remove'
3
+ description: 'nb env remove command reference: stop managed runtimes before removing env configuration, or fully clean up locally managed resources when needed.'
4
+ keywords: 'nb env remove,NocoBase CLI,delete environment,remove configuration,purge'
5
5
  ---
6
6
 
7
7
  # nb env remove
8
8
 
9
- Remove a configured env. This command only removes the saved CLI env config and does not clean local app directories, containers, or storage data; use [`nb app down`](../app/down.md) when you need to clean local runtime resources.
9
+ Remove a configured env. For local/docker envs, this command first stops the CLI-managed application runtime and built-in database runtime on the current machine, then removes the saved CLI env configuration. For http/ssh envs, this command only removes the saved CLI env configuration.
10
10
 
11
- If the removed env is also the current env, the CLI automatically selects a new current env from the remaining envs. If no envs remain, the current env is cleared.
11
+ If the removed env is the current env, the CLI automatically selects a new current env from the remaining envs; if no envs are available, the current env is cleared.
12
12
 
13
- By default, the command asks for confirmation. To skip confirmation, pass `--yes`. In non-interactive mode, `--yes` is required before the env can be removed.
13
+ By default, the command requires confirmation. In non-interactive mode, you must explicitly pass `--force` to execute it.
14
+
15
+ To clean up CLI-managed resources on the current machine as thoroughly as possible, pass `--purge`. For local/docker envs, `--purge` also cleans up managed runtime resources, storage data, and downloaded local app files when applicable; for http/ssh envs, `--purge` does not affect external services and only removes the saved CLI env configuration.
14
16
 
15
17
  ## Usage
16
18
 
@@ -20,21 +22,23 @@ nb env remove <name> [flags]
20
22
 
21
23
  ## Parameters
22
24
 
23
- | Parameter | Type | Description |
24
- | --- | --- | --- |
25
- | `<name>` | string | Configured environment name to remove |
26
- | `--yes`, `-y` | boolean | Skip confirmation and remove the saved CLI env config |
27
- | `--verbose` | boolean | Show detailed progress |
25
+ | Parameter | Type | Description |
26
+ | --------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
27
+ | `<name>` | string | Name of the configured environment to remove |
28
+ | `--force`, `-f` | boolean | Skip confirmation for the current remove mode; required in non-interactive mode |
29
+ | `--purge` | boolean | Additionally clean up CLI-managed resources, storage data, and downloaded local app files on the current machine when applicable; for remote API envs, only the saved env configuration is removed |
30
+ | `--verbose` | boolean | Show detailed progress |
28
31
 
29
32
  ## Examples
30
33
 
31
34
  ```bash
32
35
  nb env remove staging
33
- nb env remove staging --yes
36
+ nb env remove staging --force
37
+ nb env remove staging --purge --force
34
38
  ```
35
39
 
36
- ## Related Commands
40
+ ## Related commands
37
41
 
38
- - [`nb app down`](../app/down.md)
42
+ - [`nb app stop`](../app/stop.md)
39
43
  - [`nb env current`](./current.md)
40
44
  - [`nb env list`](./list.md)
@@ -1,12 +1,14 @@
1
1
  ---
2
- title: "nb env update"
3
- description: "nb env update command reference: refresh OpenAPI Schema and runtime command cache for a selected env."
4
- keywords: "nb env update,NocoBase CLI,OpenAPI,runtime commands,swagger"
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
- Refresh OpenAPI Schema from the NocoBase app and update local runtime command cache. Cache is stored in `.nocobase/versions/<hash>/commands.json`.
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.
10
+
11
+ If you do not provide any configuration parameters, the CLI will also perform a re-sync based on the current env state.
10
12
 
11
13
  ## Usage
12
14
 
@@ -14,27 +16,126 @@ Refresh OpenAPI Schema from the NocoBase app and update local runtime command ca
14
16
  nb env update [name] [flags]
15
17
  ```
16
18
 
17
- ## Parameters
19
+ ## Common options
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. |
25
+
26
+ ## API and authentication options
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. |
48
+
49
+ ## Application options
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`). |
59
+
60
+ ## Database options
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`. |
81
+
82
+ ## Notes
18
83
 
19
- | Parameter | Type | Description |
20
- | --- | --- | --- |
21
- | `[name]` | string | Configured environment name to refresh; uses the current env if omitted |
22
- | `--verbose` | boolean | Show detailed progress |
23
- | `--api-base-url` | string | Override the NocoBase API URL and persist it to the target env |
24
- | `--role` | string | Role override sent as the `X-Role` request header |
25
- | `--token`, `-t` | string | API key override persisted to the target env |
84
+ :::tip
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.
87
+
88
+ :::
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
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
+ - `--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
26
98
 
27
99
  ## Examples
28
100
 
29
101
  ```bash
102
+ # Re-sync the current env according to the latest state
30
103
  nb env update
104
+
105
+ # Re-sync the specified env according to the latest state
31
106
  nb env update prod
107
+
108
+ # Update the API address
32
109
  nb env update prod --api-base-url http://localhost:13000/api
33
- nb env update prod --token <token>
110
+
111
+ # Update the token and switch the authentication method to token
112
+ nb env update prod --access-token <token>
113
+
114
+ # Switch to basic authentication, save only the username, and run nb env auth later
115
+ nb env update prod --auth-type basic --username admin
116
+
117
+ # Adjust the source origin and version, only updating the saved configuration
118
+ nb env update local --source git --git-url git@github.com:nocobase/nocobase.git --download-version next
119
+
120
+ # Adjust the application port and time zone, then restart the application later
121
+ nb env update local --app-port 13080 --timezone Asia/Shanghai
122
+
123
+ # Adjust the public application path. After that, you usually also need to regenerate the proxy config
124
+ nb env update local --app-public-path /nocobase/
125
+
126
+ # Save a CDN base URL for versioned client assets
127
+ nb env update local --cdn-base-url https://cdn.example.com/nocobase/
128
+
129
+ # Clear saved fields
130
+ nb env update local --unset git-url --unset username
131
+ nb env update local --unset git-url,username
34
132
  ```
35
133
 
36
- ## Related Commands
134
+ ## Related commands
37
135
 
38
136
  - [`nb api`](../api/index.md)
137
+ - [`nb env auth`](./auth.md)
39
138
  - [`nb env info`](./info.md)
40
139
  - [`nb env add`](./add.md)
140
+ - [`nb app restart`](../app/restart.md)
141
+ - [`nb source download`](../source/download.md)
@@ -1,21 +1,21 @@
1
1
  ---
2
- title: "NocoBase CLI"
3
- description: "NocoBase CLI (nb command) reference: initialization, configuration, environment management, app runtime, source, database, plugins, commercial licensing, API, CLI self updates, and Skills management."
4
- keywords: "NocoBase CLI,nb,command line,command reference,configuration,environment management,plugin management,commercial licensing,API"
2
+ title: 'NocoBase CLI'
3
+ description: 'NocoBase CLI (`nb` command) reference: initialization, backup and restore, configuration, environment management, app runtime, source code, database, plugins, commercial license, API, CLI self-update, and Skills management.'
4
+ keywords: 'NocoBase CLI,nb,command line,command reference,backup,restore,environment management,plugin management,commercial license,API'
5
5
  ---
6
6
 
7
7
  # NocoBase CLI
8
8
 
9
9
  ## Description
10
10
 
11
- NocoBase CLI (`nb`) is the command-line entry point for initializing, connecting to, and managing NocoBase apps in a local workspace.
11
+ NocoBase CLI (`nb`) is the command-line entry point for NocoBase, used to initialize, connect to, and manage NocoBase applications in a local workspace.
12
12
 
13
- It supports two common setup paths:
13
+ It supports two common initialization paths:
14
14
 
15
- - Connect an existing NocoBase app and save it as a CLI env
16
- - Install a new NocoBase app from Docker, npm, or Git, then save it as a CLI env
15
+ - Connect to an existing NocoBase application and save it as a CLI env
16
+ - Install a new NocoBase application via Docker, npm, or Git, then save it as a CLI env
17
17
 
18
- When creating a new local app, [`nb init`](./init.md) can also install or update NocoBase AI coding skills. Use `--skip-skills` when you want to skip that step.
18
+ When creating a new local application, [`nb init`](./init.md) can also install or update NocoBase AI coding skills. To skip this step, use `--skip-skills`.
19
19
 
20
20
  ## Usage
21
21
 
@@ -23,48 +23,50 @@ When creating a new local app, [`nb init`](./init.md) can also install or update
23
23
  nb [command]
24
24
  ```
25
25
 
26
- The root command mainly displays help and dispatches execution to command groups or standalone commands.
26
+ The root command itself is mainly used to display help and dispatch invocations to command groups or standalone commands.
27
27
 
28
- ## Topics
28
+ ## Command groups (Topics)
29
29
 
30
- `nb --help` shows the following topics:
30
+ The following command groups are shown in `nb --help`:
31
31
 
32
- | Topic | Description |
33
- | --- | --- |
34
- | [`nb api`](./api/index.md) | Work with NocoBase API. |
35
- | [`nb app`](./app/index.md) | Manage NocoBase app runtimes: start, stop, restart, logs, and upgrades. |
36
- | [`nb config`](./config/index.md) | Manage CLI configuration defaults. |
37
- | [`nb db`](./db/index.md) | Manage the built-in database for the selected env. |
38
- | [`nb env`](./env/index.md) | Manage NocoBase project environments, current env, status, details, and command runtimes. |
39
- | [`nb license`](./license/index.md) | Manage commercial licensing and licensed plugins. |
40
- | [`nb plugin`](./plugin/index.md) | Manage plugins in the selected NocoBase env. |
41
- | [`nb scaffold`](./scaffold/index.md) | Generate NocoBase plugin development scaffolds. |
42
- | [`nb self`](./self/index.md) | Inspect or update the NocoBase CLI itself. |
43
- | [`nb session`](./session/index.md) | Configure `NB_SESSION_ID` so current env is isolated per shell or agent runtime. |
44
- | [`nb skills`](./skills/index.md) | Inspect or synchronize NocoBase AI coding skills for the current workspace. |
45
- | [`nb source`](./source/index.md) | Work with the local NocoBase source project: download, develop, build, and test. |
32
+ | Command group | Description |
33
+ | ------------------------------------ | --------------------------------------------------------------------------------------------- |
34
+ | [`nb api`](./api/index.md) | Call NocoBase APIs through the CLI. |
35
+ | [`nb app`](./app/index.md) | Manage the application runtime: start, stop, restart, logs, and upgrade. |
36
+ | [`nb backup`](./backup/index.md) | Create backups and download them locally, or restore a local backup file to the target env. |
37
+ | [`nb config`](./config/index.md) | Manage CLI default configuration. |
38
+ | [`nb db`](./db/index.md) | Manage the built-in database of the selected env. |
39
+ | [`nb env`](./env/index.md) | Manage NocoBase project environments, the current env, status, details, and runtime commands. |
40
+ | [`nb license`](./license/index.md) | Manage commercial licenses and licensed plugins. |
41
+ | [`nb plugin`](./plugin/index.md) | Manage plugins in the selected NocoBase env. |
42
+ | [`nb scaffold`](./scaffold/index.md) | Generate scaffolding for NocoBase plugin development. |
43
+ | [`nb self`](./self/index.md) | Check or update NocoBase CLI itself. |
44
+ | [`nb session`](./session/index.md) | Configure `NB_SESSION_ID` so the current env is isolated by shell or agent runtime. |
45
+ | [`nb skills`](./skills/index.md) | Check or sync NocoBase AI coding skills in the current workspace. |
46
+ | [`nb source`](./source/index.md) | Manage local source projects: download, develop, build, and test. |
46
47
 
47
48
  ## Commands
48
49
 
49
- Standalone commands exposed directly by the root command:
50
+ Standalone commands currently exposed directly by the root command:
50
51
 
51
- | Command | Description |
52
- | --- | --- |
53
- | [`nb init`](./init.md) | Set up NocoBase so coding agents can connect and work with it. |
52
+ | Command | Description |
53
+ | ---------------------- | ---------------------------------------------------------- |
54
+ | [`nb init`](./init.md) | Initialize NocoBase so coding agents can connect and work. |
54
55
 
55
- ## Display help text
56
+ ## Viewing help
56
57
 
57
- Show help for the root command:
58
+ View help for the root command:
58
59
 
59
60
  ```bash
60
61
  nb --help
61
62
  ```
62
63
 
63
- Show help for a command or command group:
64
+ View help for a command or command group:
64
65
 
65
66
  ```bash
66
67
  nb init --help
67
68
  nb app --help
69
+ nb backup --help
68
70
  nb config --help
69
71
  nb api resource --help
70
72
  nb license --help
@@ -72,25 +74,25 @@ nb license --help
72
74
 
73
75
  ## Examples
74
76
 
75
- Interactive setup:
77
+ Interactive initialization:
76
78
 
77
79
  ```bash
78
80
  nb init
79
81
  ```
80
82
 
81
- Browser-based setup:
83
+ Initialize using a browser form:
82
84
 
83
85
  ```bash
84
86
  nb init --ui
85
87
  ```
86
88
 
87
- Create a Docker-based app non-interactively:
89
+ Create a Docker application non-interactively:
88
90
 
89
91
  ```bash
90
92
  nb init --env app1 --yes --source docker --version alpha
91
93
  ```
92
94
 
93
- Connect an existing app:
95
+ Connect to an existing application:
94
96
 
95
97
  ```bash
96
98
  nb env add app1 --api-base-url http://localhost:13000/api
@@ -98,7 +100,7 @@ nb env current
98
100
  nb env status
99
101
  ```
100
102
 
101
- Start the app and refresh runtime commands:
103
+ Resync env status after starting the application:
102
104
 
103
105
  ```bash
104
106
  nb app start -e app1
@@ -111,7 +113,7 @@ Call an API:
111
113
  nb api resource list --resource users -e app1
112
114
  ```
113
115
 
114
- View CLI default config:
116
+ View CLI default configuration:
115
117
 
116
118
  ```bash
117
119
  nb config list
@@ -125,59 +127,71 @@ nb license status -e app1
125
127
  nb license plugins list -e app1
126
128
  ```
127
129
 
130
+ Create and download a backup:
131
+
132
+ ```bash
133
+ nb backup create -e app1 --output ./backups
134
+ ```
135
+
136
+ Restore a local backup:
137
+
138
+ ```bash
139
+ nb backup restore -e app1 --file ./backups/backup_20260520_190408_8397.nbdata --yes --force
140
+ ```
141
+
128
142
  ## Environment variables
129
143
 
130
144
  The following environment variables affect CLI behavior:
131
145
 
132
- | Variable | Description |
133
- | --- | --- |
134
- | `NB_CLI_ROOT` | Root directory where the CLI stores `.nocobase` config and local app files. Defaults to the current user's home directory. |
135
- | `NB_LOCALE` | Language for CLI prompts and the local setup UI. Supported values are `en-US` and `zh-CN`. |
136
- | `NB_SESSION_ID` | Session ID for the current shell or agent runtime. When set, `nb env use` and `nb env current` are isolated per session. |
146
+ | Variable | Description |
147
+ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
148
+ | `NB_CLI_ROOT` | Root directory where the CLI stores `.nocobase` configuration and local application files. Defaults to the current user's home directory. |
149
+ | `NB_LOCALE` | CLI prompt language and local initialization UI language. Supports `en-US` and `zh-CN`. |
150
+ | `NB_SESSION_ID` | Session ID for the current shell or agent runtime. When set, `nb env use` and `nb env current` are isolated by session. |
137
151
 
138
152
  Example:
139
153
 
140
154
  ```bash
141
155
  export NB_CLI_ROOT=/your/workspace
142
- export NB_LOCALE=en-US
156
+ export NB_LOCALE=zh-CN
143
157
  ```
144
158
 
145
159
  ## Configuration files
146
160
 
147
- Default config file:
161
+ Default configuration file:
148
162
 
149
163
  ```text
150
164
  ~/.nocobase/config.json
151
165
  ```
152
166
 
153
- After setting `NB_CLI_ROOT=/your/workspace`, the config file path becomes:
167
+ After setting `NB_CLI_ROOT=/your/workspace`, the configuration file path becomes:
154
168
 
155
169
  ```text
156
170
  /your/workspace/.nocobase/config.json
157
171
  ```
158
172
 
159
- The CLI also keeps compatibility with legacy project config under the current working directory.
173
+ The CLI is also compatible with reading legacy project configuration in the current working directory.
160
174
 
161
- Current env session cache is stored in:
175
+ The session-level cache for the current env is stored in:
162
176
 
163
177
  ```text
164
178
  .nocobase/sessions/<NB_SESSION_ID>.json
165
179
  ```
166
180
 
167
- The globally last-used env is stored in the `lastEnv` field in `config.json`. When `NB_SESSION_ID` is not set, the CLI falls back to that global value.
181
+ The globally last-used env is stored in the `lastEnv` field of `config.json`. When `NB_SESSION_ID` is not set, the CLI falls back to this global value.
168
182
 
169
- Runtime command cache is stored in:
183
+ The runtime command cache is stored in:
170
184
 
171
185
  ```text
172
186
  .nocobase/versions/<hash>/commands.json
173
187
  ```
174
188
 
175
- This file is generated or refreshed by [`nb env update`](./env/update.md) and caches runtime commands synchronized from the target app.
189
+ This file is generated or refreshed by [`nb env update`](./env/update.md) and is used to cache runtime commands synchronized from the target application.
176
190
 
177
191
  ## Related links
178
192
 
179
193
  - [Quick Start](../../ai/quick-start.mdx)
180
194
  - [Install, Upgrade, and Migration](../../ai/install-upgrade-migration.mdx)
181
- - [Environment Variables](../app/env.md)
195
+ - [Global Environment Variables](../app/env.md)
182
196
  - [AI Builder](../../ai-builder/index.md)
183
197
  - [Plugin Development](../../plugin-development/index.md)