@nocobase/plugin-ai 2.1.0-beta.44 → 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 (104) hide show
  1. package/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +127 -132
  2. package/dist/ai/docs/nocobase/ai-dev/capabilities.md +1 -1
  3. package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
  4. package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +1 -1
  5. package/dist/ai/docs/nocobase/api/cli/app/autostart/disable.md +44 -0
  6. package/dist/ai/docs/nocobase/api/cli/app/autostart/enable.md +44 -0
  7. package/dist/ai/docs/nocobase/api/cli/app/autostart/index.md +63 -0
  8. package/dist/ai/docs/nocobase/api/cli/app/autostart/list.md +41 -0
  9. package/dist/ai/docs/nocobase/api/cli/app/autostart/run.md +50 -0
  10. package/dist/ai/docs/nocobase/api/cli/app/index.md +18 -15
  11. package/dist/ai/docs/nocobase/api/cli/app/restart.md +3 -11
  12. package/dist/ai/docs/nocobase/api/cli/app/start.md +3 -11
  13. package/dist/ai/docs/nocobase/api/cli/app/stop.md +22 -12
  14. package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +6 -6
  15. package/dist/ai/docs/nocobase/api/cli/backup/create.md +49 -0
  16. package/dist/ai/docs/nocobase/api/cli/backup/index.md +46 -0
  17. package/dist/ai/docs/nocobase/api/cli/backup/restore.md +46 -0
  18. package/dist/ai/docs/nocobase/api/cli/config/delete.md +11 -9
  19. package/dist/ai/docs/nocobase/api/cli/config/get.md +11 -8
  20. package/dist/ai/docs/nocobase/api/cli/config/index.md +28 -24
  21. package/dist/ai/docs/nocobase/api/cli/config/set.md +14 -12
  22. package/dist/ai/docs/nocobase/api/cli/db/stop.md +10 -11
  23. package/dist/ai/docs/nocobase/api/cli/env/index.md +25 -23
  24. package/dist/ai/docs/nocobase/api/cli/env/info.md +12 -10
  25. package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +108 -0
  26. package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +54 -0
  27. package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +104 -0
  28. package/dist/ai/docs/nocobase/api/cli/env/remove.md +18 -14
  29. package/dist/ai/docs/nocobase/api/cli/env/update.md +115 -14
  30. package/dist/ai/docs/nocobase/api/cli/index.md +66 -52
  31. package/dist/ai/docs/nocobase/api/cli/init.md +244 -62
  32. package/dist/ai/docs/nocobase/api/cli/license/activate.md +13 -12
  33. package/dist/ai/docs/nocobase/api/cli/license/index.md +2 -2
  34. package/dist/ai/docs/nocobase/api/cli/plugin/import.md +74 -0
  35. package/dist/ai/docs/nocobase/api/cli/plugin/index.md +4 -2
  36. package/dist/ai/docs/nocobase/get-started/deployment/how-to-deploy-nocobase-faster.mdx +384 -0
  37. package/dist/ai/docs/nocobase/get-started/install-upgrade-plugins.mdx +16 -10
  38. package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +1 -1
  39. package/dist/ai/docs/nocobase/index.md +3 -3
  40. package/dist/ai/docs/nocobase/multi-app/multi-app/app-block-and-switcher.md +68 -0
  41. package/dist/ai/docs/nocobase/multi-app/multi-app/app-sso.md +71 -0
  42. package/dist/ai/docs/nocobase/multi-app/multi-app/index.md +9 -1
  43. package/dist/ai/docs/nocobase/multi-app/multi-app/sub-app-api.md +112 -0
  44. package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +3 -3
  45. package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +1 -1
  46. package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +2 -2
  47. package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +1 -1
  48. package/dist/ai/docs/nocobase/plugin-development/client/router.md +11 -11
  49. package/dist/ai/docs/nocobase/quickstart/index.md +27 -0
  50. package/dist/ai/docs/nocobase/quickstart/installation/airgap.md +67 -0
  51. package/dist/ai/docs/nocobase/quickstart/installation/cli.md +205 -0
  52. package/dist/ai/docs/nocobase/quickstart/installation/docker-compose.md +123 -0
  53. package/dist/ai/docs/nocobase/quickstart/installation/env.md +101 -0
  54. package/dist/ai/docs/nocobase/quickstart/installation/migration.md +50 -0
  55. package/dist/ai/docs/nocobase/quickstart/operations/backup-restore.md +94 -0
  56. package/dist/ai/docs/nocobase/quickstart/operations/manage-app.md +166 -0
  57. package/dist/ai/docs/nocobase/quickstart/operations/multi-environment.md +171 -0
  58. package/dist/ai/docs/nocobase/quickstart/plugins/third-party.md +86 -0
  59. package/dist/ai/docs/nocobase/quickstart/production/index.md +163 -0
  60. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +158 -0
  61. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +100 -0
  62. package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +166 -0
  63. package/dist/ai/docs/nocobase/quickstart/release-management.md +1 -0
  64. package/dist/ai/docs/nocobase/solution/all-in-one/installation.md +181 -0
  65. package/dist/ai/docs/nocobase/solution/crm/changelog.md +0 -3
  66. package/dist/ai/docs/nocobase/solution/crm/installation.md +6 -76
  67. package/dist/ai/docs/nocobase/solution/crm/v1.md +6 -35
  68. package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +0 -2
  69. package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +6 -69
  70. package/dist/ai/docs/nocobase/workflow/advanced/options.md +45 -1
  71. package/dist/client/{406.15c09d98faa2ccf1.js → 406.9a530334eae8cede.js} +1 -1
  72. package/dist/client/{428.e9f38da3b0d8b498.js → 428.431a00d29107058e.js} +1 -1
  73. package/dist/client/index.js +2 -2
  74. package/dist/client-v2/index.js +1 -1
  75. package/dist/externalVersion.js +16 -16
  76. package/dist/locale/de-DE.json +1 -0
  77. package/dist/locale/en-US.json +2 -1
  78. package/dist/locale/es-ES.json +1 -0
  79. package/dist/locale/fr-FR.json +1 -0
  80. package/dist/locale/hu-HU.json +1 -0
  81. package/dist/locale/id-ID.json +1 -0
  82. package/dist/locale/it-IT.json +1 -0
  83. package/dist/locale/ja-JP.json +1 -0
  84. package/dist/locale/ko-KR.json +1 -0
  85. package/dist/locale/nl-NL.json +1 -0
  86. package/dist/locale/pt-BR.json +1 -0
  87. package/dist/locale/ru-RU.json +1 -0
  88. package/dist/locale/tr-TR.json +1 -0
  89. package/dist/locale/uk-UA.json +1 -0
  90. package/dist/locale/vi-VN.json +1 -0
  91. package/dist/locale/zh-CN.json +2 -1
  92. package/dist/locale/zh-TW.json +1 -0
  93. package/dist/node_modules/@langchain/xai/package.json +1 -1
  94. package/dist/node_modules/fs-extra/package.json +1 -1
  95. package/dist/node_modules/jsonrepair/package.json +1 -1
  96. package/dist/node_modules/just-bash/package.json +1 -1
  97. package/dist/node_modules/nodejs-snowflake/package.json +1 -1
  98. package/dist/node_modules/openai/package.json +1 -1
  99. package/dist/node_modules/zod/package.json +1 -1
  100. package/dist/server/resource/ai.js +11 -9
  101. package/dist/server/workflow/nodes/employee/index.js +2 -4
  102. package/dist/server/workflow/nodes/employee/types.d.ts +2 -2
  103. package/package.json +2 -2
  104. package/dist/ai/docs/nocobase/api/cli/app/down.md +0 -41
@@ -1,12 +1,16 @@
1
1
  ---
2
- title: "nb init"
3
- description: "nb init command reference: initialize NocoBase, connect an existing app or install a new app, and save it as a CLI env."
4
- keywords: "nb init,NocoBase CLI,initialization,env,Docker,npm,Git"
2
+ title: 'nb init'
3
+ description: 'nb init command reference: install a new app, take over an existing local app, or connect to a remote app and save it as a CLI env.'
4
+ keywords: 'nb init,NocoBase CLI,initialize,env,Docker,npm,Git,remote connection'
5
5
  ---
6
6
 
7
7
  # nb init
8
8
 
9
- Initialize the current workspace so coding agents can connect to and use NocoBase. `nb init` can connect an existing app or install a new app from Docker, npm, or Git.
9
+ Initialize the current workspace so the coding agent can connect to and use NocoBase.
10
+
11
+ `nb init` can install a new local NocoBase app, or save the connection information of an existing app.
12
+
13
+ In addition, `nb init` also synchronizes NocoBase AI coding skills by default. You only need to add `--skip-skills` if you already manage skills yourself, or if you are running in CI or an offline environment.
10
14
 
11
15
  ## Usage
12
16
 
@@ -14,85 +18,263 @@ Initialize the current workspace so coding agents can connect to and use NocoBas
14
18
  nb init [flags]
15
19
  ```
16
20
 
17
- ## Notes
21
+ ## Interactive modes
18
22
 
19
- `nb init` supports three prompt modes:
23
+ `nb init` supports three interactive modes:
20
24
 
21
- - Default mode: fill in setup details step by step in the terminal.
22
- - `--ui`: open a local browser form for the setup wizard.
23
- - `--yes`: skip prompts and use flags plus defaults. This mode requires `--env <envName>` and creates a new local app.
25
+ - `nb init`: complete the setup step by step in the terminal
26
+ - `nb init --ui`: open a local browser form and complete setup with a visual wizard
27
+ - `nb init --yes --env app1`: skip prompts and use flags directly; parameters not explicitly passed will use default values
24
28
 
25
- By default, `nb init` installs or updates NocoBase AI coding skills during initialization or resume. Use `--skip-skills` to skip this step when skills are managed separately, or when running in CI or offline environments.
29
+ `--yes` mode is suitable for scripts, CI/CD, or other non-interactive scenarios. In this mode, `--env <envName>` is required. Generally, it installs a new local app by default; if you do not specify `--source`, it uses `docker` as the default install source.
26
30
 
27
- If initialization is interrupted after env configuration has been saved, resume it with:
31
+ ## Resuming interrupted initialization
32
+
33
+ Installation flows save the env configuration first, then perform download, database, and app installation. If the process fails midway, you can continue with:
28
34
 
29
35
  ```bash
30
36
  nb init --env app1 --resume
31
37
  ```
32
38
 
39
+ `--resume` only applies to initialization flows where the env configuration has already been saved, and `--env` must be passed explicitly.
40
+
41
+ ## Installation directory layout
42
+
43
+ You can view the full path with `nb env info app1 --field app.appPath`.
44
+
45
+ By default, the CLI organizes local files under `app-path` using the following convention:
46
+
47
+ ```text
48
+ <app-path>/
49
+ ├── source/ # Default directory for app source code or downloaded content
50
+ ├── storage/ # Runtime data directory
51
+ └── .env # Optional app environment variable file
52
+ ```
53
+
54
+ Typically:
55
+
56
+ - `source/` mainly corresponds to the local app directory for npm / Git envs. For Docker envs, the CLI also keeps this default path derivation, but most of the time you do not need to care about it manually
57
+ - `storage/` is used for runtime data, such as built-in database data, plugins, logs, and more
58
+ - `.env` is an optional app environment variable file. You only need to add it in `<app-path>/.env` when you want to customize environment variables; if this file exists, Docker, npm, and Git install sources will all read it by default
59
+
60
+ This represents the CLI's default directory convention. Depending on the install source, plugins, and runtime stage, the actual generated directory contents may not be exactly the same.
61
+
62
+ ## Notes
63
+
64
+ :::warning Notes
65
+
66
+ - `--ui` cannot be used together with `--yes`
67
+ - `--ui` also cannot be used together with `--resume`
68
+ - `--ui-host` and `--ui-port` can only be used together with `--ui`
69
+ - `--skip-auth` cannot be used together with `--access-token` or `--token`
70
+
71
+ :::
72
+
73
+ ## Quickly locate by Steps
74
+
75
+ The Steps shown are not exactly the same for different setup paths. For example, when connecting to an existing app, you usually only use `Getting started` and `Remote connection`.
76
+
77
+ If you are following the local UI wizard step by step, you can first use the table below to quickly locate the relevant section:
78
+
79
+ | Step | Main related parameters |
80
+ | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
81
+ | `Getting started` | `--env`、`--yes`、`--ui`、`--locale`、`--verbose`、`--skip-skills`、`--resume` |
82
+ | `App environment` | `--lang`、`--app-path`、`--app-port`、`--force` |
83
+ | `App source and version` | `--source`、`--version`、`--skip-download`、`--git-url`、`--docker-registry`、`--docker-platform`、`--npm-registry`、`--replace`、`--dev-dependencies`、`--output-dir`、`--docker-save`、`--build`、`--build-dts` |
84
+ | `Configure the database` | `--builtin-db`、`--db-dialect`、`--builtin-db-image`、`--db-host`、`--db-port`、`--db-database`、`--db-user`、`--db-password`、`--db-schema`、`--db-table-prefix`、`--db-underscored` |
85
+ | `Create an admin account` | `--root-username`、`--root-email`、`--root-password`、`--root-nickname` |
86
+ | `Remote connection` | `--api-base-url`、`--auth-type`、`--access-token`、`--username`、`--password`、`--skip-auth` |
87
+
33
88
  ## Parameters
34
89
 
35
- | Parameter | Type | Description |
36
- | --- | --- | --- |
37
- | `--yes`, `-y` | boolean | Skip prompts and use flags plus defaults |
38
- | `--env`, `-e` | string | Env name for this setup; required with `--yes` and `--resume` |
39
- | `--ui` | boolean | Open the browser-based setup wizard; cannot be used with `--yes` |
40
- | `--verbose` | boolean | Show verbose command output |
41
- | `--skip-skills` | boolean | Skip installing or updating NocoBase AI coding skills during init |
42
- | `--ui-host` | string | Local service bind address for `--ui`, default `127.0.0.1` |
43
- | `--ui-port` | integer | Local service port for `--ui`; `0` means auto-assign |
44
- | `--locale` | string | CLI prompt and UI language: `en-US` or `zh-CN` |
45
- | `--api-base-url`, `-u` | string | NocoBase API URL, including the `/api` prefix |
46
- | `--auth-type`, `-a` | string | Authentication type: `token` or `oauth` |
47
- | `--access-token`, `-t` | string | API key or access token used with `token` authentication |
48
- | `--resume` | boolean | Reuse saved workspace env config and continue initialization |
49
- | `--lang`, `-l` | string | Language for the installed NocoBase app |
50
- | `--force`, `-f` | boolean | Reconfigure an existing env and replace conflicting runtime resources when needed |
51
- | `--app-root-path` | string | Local npm/Git app source directory, default `./<envName>/source/` |
52
- | `--app-port` | string | Local app port, default `13000`; `--yes` mode auto-selects an available port |
53
- | `--storage-path` | string | Directory for uploaded files and managed database data, default `./<envName>/storage/` |
54
- | `--root-username` | string | Initial admin username |
55
- | `--root-email` | string | Initial admin email |
56
- | `--root-password` | string | Initial admin password |
57
- | `--root-nickname` | string | Initial admin nickname |
58
- | `--builtin-db`, `--no-builtin-db` | boolean | Whether to create a CLI-managed built-in database |
59
- | `--db-dialect` | string | Database dialect: `postgres`, `mysql`, `mariadb`, or `kingbase` |
60
- | `--builtin-db-image` | string | Built-in database container image |
61
- | `--db-host` | string | Database host |
62
- | `--db-port` | string | Database port |
63
- | `--db-database` | string | Database name |
64
- | `--db-user` | string | Database user |
65
- | `--db-password` | string | Database password |
66
- | `--skip-download` | boolean | Skip downloading app files or pulling the Docker image before installation, and reuse existing local resources |
67
- | `--source`, `-s` | string | How to obtain NocoBase: `docker`, `npm`, or `git` |
68
- | `--version`, `-v` | string | Version parameter: npm version, Docker image tag, or Git ref |
69
- | `--replace`, `-r` | boolean | Replace the target directory if it already exists |
70
- | `--dev-dependencies`, `-D` | boolean | Whether npm/Git installs devDependencies |
71
- | `--output-dir`, `-o` | string | Download target directory, or directory for the Docker tarball |
72
- | `--git-url` | string | Git repository URL |
73
- | `--docker-registry` | string | Docker image repository name without tag |
74
- | `--docker-platform` | string | Docker image platform: `auto`, `linux/amd64`, or `linux/arm64` |
75
- | `--docker-save`, `--no-docker-save` | boolean | Whether to save the pulled Docker image as a tarball |
76
- | `--npm-registry` | string | Registry used for npm/Git downloads and dependency installation |
77
- | `--build`, `--no-build` | boolean | Whether to build after npm/Git dependency installation |
78
- | `--build-dts` | boolean | Whether to generate TypeScript declaration files during npm/Git build |
90
+ There are many parameters, so it is clearer to break them down by usage scenario.
91
+
92
+ The “Default” below means the value or behavior that `nb init` usually uses when you omit that parameter.
93
+
94
+ ### Basics and interaction
95
+
96
+ | Parameter | Type | Default | Description |
97
+ | --------------- | ------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
98
+ | `--yes`, `-y` | boolean | `false` | Skip prompts and use flags and default values |
99
+ | `--env`, `-e` | string | None | The env name to save for this initialization; required in `--yes` and `--resume` modes |
100
+ | `--ui` | boolean | `false` | Open the local browser wizard; cannot be used with `--yes` or `--resume` |
101
+ | `--verbose` | boolean | `false` | Show detailed command output |
102
+ | `--skip-skills` | boolean | `false` | Skip syncing NocoBase AI coding skills |
103
+ | `--ui-host` | string | `127.0.0.1` | Bind address for the `--ui` local service |
104
+ | `--ui-port` | integer | `0` | Port for the `--ui` local service; `0` means automatic assignment |
105
+ | `--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
+ | `--resume` | boolean | `false` | Continue the last unfinished initialization and reuse the saved workspace env config |
107
+
108
+ ### Connecting to an existing app
109
+
110
+ | Parameter | Type | Default | Description |
111
+ | ---------------------- | ------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
112
+ | `--api-base-url`, `-u` | string | None | API base URL; must include the `/api` prefix |
113
+ | `--auth-type`, `-a` | string | `oauth` | Authentication method: `basic`, `token`, or `oauth`. In most cases, the default `oauth` is fine; in some CI/CD scenarios, `basic` can also be used |
114
+ | `--access-token`, `-t` | string | None | API key or access token used for `token` authentication |
115
+ | `--username` | string | None | Username used for `basic` authentication |
116
+ | `--password` | string | None | Password used for `basic` authentication |
117
+ | `--skip-auth` | boolean | `false` | Save the env and auth method first, then complete login later with `nb env auth` |
118
+
119
+ ### Basic parameters for local installation
120
+
121
+ | Parameter | Type | Default | Description |
122
+ | ----------------- | ------- | ----------------------------------- | --------------------------------------------------------------------------------- |
123
+ | `--lang`, `-l` | string | `en-US` | UI language of the newly installed app |
124
+ | `--force`, `-f` | boolean | `false` | Reconfigure an existing env and replace conflicting runtime resources when needed |
125
+ | `--app-path` | string | `./<envName>/` | Local npm/Git app directory |
126
+ | `--app-port` | string | `13000` | Local app HTTP port; in `--yes` mode, an available port is selected automatically |
127
+ | `--root-username` | string | `nocobase` (`--yes` mode) | Initial admin username |
128
+ | `--root-email` | string | `admin@nocobase.com` (`--yes` mode) | Initial admin email |
129
+ | `--root-password` | string | `admin123` (`--yes` mode) | Initial admin password |
130
+ | `--root-nickname` | string | `Super Admin` (`--yes` mode) | Initial admin display name |
131
+
132
+ ### Database parameters
133
+
134
+ | Parameter | Type | Default | Description |
135
+ | ------------------------------------------ | ------- | --------------------------------------------------------------------- | ----------------------------------------------------------------- |
136
+ | `--builtin-db` / `--no-builtin-db` | boolean | `true` | Whether to create and connect a CLI-managed built-in database |
137
+ | `--db-dialect` | string | `postgres` | Database type: `postgres`, `mysql`, `mariadb`, `kingbase` |
138
+ | `--builtin-db-image` | string | Follows `--db-dialect` and locale | Built-in database container image |
139
+ | `--db-host` | string | `postgres` for built-in databases; `127.0.0.1` for external databases | Database host address |
140
+ | `--db-port` | string | `postgres=5432`、`mysql=3306`、`mariadb=3306`、`kingbase=54321` | Database port |
141
+ | `--db-database` | string | `nocobase`; `kingbase` for KingbaseES | Database name |
142
+ | `--db-user` | string | `nocobase` | Database username |
143
+ | `--db-password` | string | `nocobase` | Database password |
144
+ | `--db-schema` | string | None | Database schema; only used by PostgreSQL |
145
+ | `--db-table-prefix` | string | None | Database table prefix |
146
+ | `--db-underscored` / `--no-db-underscored` | boolean | `false` | Whether database table names and field names use underscore style |
147
+
148
+ ### Download and source code parameters
149
+
150
+ | Parameter | Type | Default | Description |
151
+ | ---------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
152
+ | `--skip-download` | boolean | `false` | Skip download and reuse an existing local app directory or Docker image |
153
+ | `--source`, `-s` | string | `docker` | How to obtain NocoBase: `docker`, `npm`, or `git` |
154
+ | `--version`, `-v` | string | `beta` | Version parameter: npm package version, Docker image tag, or Git ref |
155
+ | `--replace`, `-r` | boolean | `false` | Replace when the target directory already exists |
156
+ | `--dev-dependencies`, `-D` / `--no-dev-dependencies` | boolean | `false` | Whether to install devDependencies for npm/Git installs |
157
+ | `--output-dir`, `-o` | string | Derived from `--app-path` for npm/Git; `./nocobase-<version>` for Docker + `--docker-save` | Download target directory, or the tarball save directory when `--docker-save` is enabled |
158
+ | `--git-url` | string | `https://github.com/nocobase/nocobase.git` | Git repository URL |
159
+ | `--docker-registry` | string | `nocobase/nocobase`; under `zh-CN` locale, `registry.cn-shanghai.aliyuncs.com/nocobase/nocobase` | Docker image repository name, without tag |
160
+ | `--docker-platform` | string | `auto` | Docker image platform: `auto`, `linux/amd64`, `linux/arm64` |
161
+ | `--docker-save` / `--no-docker-save` | boolean | `false` | Whether to additionally save the Docker image as a tarball after pulling |
162
+ | `--npm-registry` | string | Empty | Registry used for npm/Git download and dependency installation |
163
+ | `--build` / `--no-build` | boolean | `true` | Whether to build after installing npm/Git dependencies |
164
+ | `--build-dts` | boolean | `false` | Whether to generate TypeScript declaration files during npm/Git builds |
79
165
 
80
166
  ## Examples
81
167
 
168
+ The most common usage patterns are as follows.
169
+
170
+ ### Complete the setup step by step in the terminal
171
+
82
172
  ```bash
83
173
  nb init
174
+ ```
175
+
176
+ ### Open the local browser wizard
177
+
178
+ ```bash
84
179
  nb init --ui
180
+ nb init --ui --ui-port 3000
181
+ ```
182
+
183
+ ### Install a new local app in non-interactive mode
184
+
185
+ If you do not specify `--source`, Docker is usually used as the install source.
186
+
187
+ ```bash
85
188
  nb init --env app1 --yes
86
- nb init --env app1 --yes --skip-skills
87
- nb init --env app1 --resume
88
- nb init --env app1 --resume --skip-skills
189
+ nb init --env app1 --yes --source docker --version latest
190
+ nb init --env app1 --yes --source docker --version beta
89
191
  nb init --env app1 --yes --source docker --version alpha
90
- nb init --env app1 --yes --source npm --version alpha --app-port 13080
91
- nb init --env app1 --yes --source git --version fix/cli-v2
92
- nb init --ui --ui-port 3000
192
+ nb init --env app1 --yes --source docker --version main \
193
+ --docker-registry registry.cn-beijing.aliyuncs.com/nocobase/nocobase
194
+ nb init --env app1 --yes --source npm --version latest
195
+ nb init --env app1 --yes --source npm --version beta
196
+ nb init --env app1 --yes --source npm --version alpha
197
+ nb init --env app1 --yes --source npm --version beta --app-port 13080
198
+ nb init --env app1 --yes --source git --version latest
199
+ nb init --env app1 --yes --source git --version beta
200
+ nb init --env app1 --yes --source git --version alpha
201
+ nb init --env app1 --yes --source git --version feat/plugin-workflow-timeout
202
+ nb init --env app1 --yes --source git --version latest \
203
+ --git-url https://gitee.com/nocobase/nocobase.git
204
+ ```
205
+
206
+ ### Quick install and use basic authentication
207
+
208
+ If you want to quickly install a local app in non-interactive mode and directly save `basic` authentication after installation, you can also write it like this. This way, you do not need to open a browser to complete OAuth.
209
+
210
+ If you keep the default admin account used in `--yes` mode, the shortest form is:
211
+
212
+ When omitted, the default admin account is `nocobase`, and the default password is `admin123`:
213
+
214
+ ```bash
215
+ nb init --env app1 --yes --auth-type basic
216
+ ```
217
+
218
+ If you also want to customize the admin account, you can write it like this:
219
+
220
+ ```bash
221
+ nb init --env app1 --yes \
222
+ --auth-type basic \
223
+ --root-username admin \
224
+ --root-password secret123
225
+ ```
226
+
227
+ ### Connect to an existing app
228
+
229
+ Using OAuth by default is fine. If opening a browser is inconvenient in some CI/CD scenarios, you can also directly save `basic` authentication; if you already have an API token, you can also directly save `token` authentication.
230
+
231
+ ```bash
232
+ nb init --env staging --yes \
233
+ --api-base-url https://demo.example.com/api
234
+
235
+ nb init --env staging --yes \
236
+ --api-base-url https://demo.example.com/api \
237
+ --auth-type basic \
238
+ --username <username> \
239
+ --password <password>
240
+
241
+ nb init --env staging --yes \
242
+ --api-base-url https://demo.example.com/api \
243
+ --auth-type token \
244
+ --access-token <token>
245
+
246
+ nb init --env staging --yes \
247
+ --api-base-url https://demo.example.com/api \
248
+ --auth-type oauth \
249
+ --skip-auth
250
+ ```
251
+
252
+ ### Customize database naming
253
+
254
+ If you need to specify a PostgreSQL schema, table prefix, or underscore naming, you can pass parameters like this:
255
+
256
+ ```bash
257
+ nb init --env app1 --yes \
258
+ --db-dialect postgres \
259
+ --db-schema public \
260
+ --db-table-prefix nb_ \
261
+ --db-underscored
262
+ ```
263
+
264
+ ### Continue the last interrupted initialization
265
+
266
+ ```bash
267
+ nb init --env app1 --resume
268
+ ```
269
+
270
+ ### Show detailed logs when troubleshooting
271
+
272
+ ```bash
273
+ nb init --env app1 --yes --source docker --version latest --verbose
93
274
  ```
94
275
 
95
- ## Related Commands
276
+ ## Related commands
96
277
 
97
278
  - [`nb env add`](./env/add.md)
279
+ - [`nb env auth`](./env/auth.md)
98
280
  - [`nb source download`](./source/download.md)
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: "nb license activate"
3
- description: "nb license activate command reference: activate NocoBase commercial licensing for a selected env."
3
+ description: "nb license activate command reference: activate an existing NocoBase commercial license key for a selected env."
4
4
  keywords: "nb license activate,NocoBase CLI,commercial licensing"
5
5
  ---
6
6
 
7
7
  # nb license activate
8
8
 
9
- Activate commercial licensing for a selected env. You can provide an existing license key directly, or request and activate a license online.
9
+ Activate an existing commercial license key for a selected env. You can pass it directly, read it from a file, or paste it in an interactive terminal.
10
10
 
11
11
  ## Usage
12
12
 
@@ -19,33 +19,34 @@ nb license activate [flags]
19
19
  | Parameter | Type | Description |
20
20
  | --- | --- | --- |
21
21
  | `--env`, `-e` | string | CLI env name; when omitted, the current env is used |
22
- | `--key` | string | Existing license key to activate |
23
- | `--key-file` | string | Read the license key from a file |
24
- | `--online` | boolean | Request a license online and activate it |
25
- | `--account` | string | License service account for online activation |
26
- | `--password` | string | License service password for online activation |
27
- | `--desc` | string | Application name submitted for online activation |
22
+ | `--key` | string | Pass an existing commercial license key directly |
23
+ | `--key-file` | string | Read an existing commercial license key from a file |
28
24
  | `--yes`, `-y` | boolean | When an explicitly passed `--env` targets a different env than the current env, skip the interactive confirmation prompt |
29
25
  | `--json` | boolean | Output JSON |
30
26
 
31
27
  ## Examples
32
28
 
33
29
  ```bash
30
+ nb license activate
34
31
  nb license activate --env app1 --key <licenseKey>
35
32
  nb license activate --env app1 --key-file ./license.txt
36
- nb license activate --env app1 --online
37
- nb license activate --env app1 --online --account aa --password bb --desc test24
38
- nb license activate --env app1 --online --account aa --password bb --desc test24 --yes
39
33
  nb license activate --env app1 --json --key-file ./license.txt
40
34
  ```
41
35
 
42
36
  ## Notes
43
37
 
44
- When online activation is used, the CLI requests a license key from the license service with the current env's instance ID and app URL.
38
+ When run interactively, the CLI first shows the current instance Hostname and Instance ID, then prompts you to paste the license key directly or enter a key file path. Use that information to confirm the license is being bound to the correct instance.
39
+
40
+ After activation succeeds, restart the app so the license and commercial plugin state actually takes effect. The CLI automatically synchronizes the commercial plugins allowed by the current license before restarting:
41
+
42
+ ```bash
43
+ nb app restart
44
+ ```
45
45
 
46
46
  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.
47
47
 
48
48
  ## Related Commands
49
49
 
50
+ - [`nb app restart`](../app/restart.md)
50
51
  - [`nb license id`](./id.md)
51
52
  - [`nb license status`](./status.md)
@@ -6,7 +6,7 @@ keywords: "nb license,NocoBase CLI,commercial licensing,license"
6
6
 
7
7
  # nb license
8
8
 
9
- Manage NocoBase commercial licensing, including license activation, instance IDs, license status, and licensed plugins.
9
+ Manage NocoBase commercial licensing, including activating an existing license key, instance IDs, license status, and licensed plugins.
10
10
 
11
11
  ## Usage
12
12
 
@@ -18,7 +18,7 @@ nb license <command>
18
18
 
19
19
  | Command | Description |
20
20
  | --- | --- |
21
- | [`nb license activate`](./activate.md) | Activate commercial licensing for the current env |
21
+ | [`nb license activate`](./activate.md) | Activate commercial licensing for the current env with an existing license key |
22
22
  | [`nb license id`](./id.md) | Show or generate the instance ID for the current env |
23
23
  | [`nb license status`](./status.md) | Show commercial license status for the current env |
24
24
  | [`nb license plugins`](./plugins/index.md) | Manage commercial plugins allowed by the current license |
@@ -0,0 +1,74 @@
1
+ ---
2
+ title: "nb plugin import"
3
+ description: "nb plugin import command reference: import a packaged plugin archive or npm package into the selected env storage/plugins directory, or into a custom storage path."
4
+ keywords: "nb plugin import,NocoBase CLI,import plugin,storage-path,npm-registry"
5
+ ---
6
+
7
+ # nb plugin import
8
+
9
+ Import a packaged plugin archive or npm package into `storage/plugins`. This command only puts the plugin into the target directory. It does not enable the plugin automatically.
10
+
11
+ ## Usage
12
+
13
+ ```bash
14
+ nb plugin import <archive> [flags]
15
+ ```
16
+
17
+ ## Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ | --- | --- | --- |
21
+ | `<archive>` | string | Plugin source. Required. Supports a local `.tgz` path, a remote `http(s)` archive URL, or an npm package name / tag |
22
+ | `--env`, `-e` | string | CLI env name. Usually uses the current env when omitted. If you explicitly pass `--storage-path`, you can omit `--env` |
23
+ | `--yes`, `-y` | boolean | When an explicitly passed `--env` targets a different env than the current env, skip the interactive confirmation prompt |
24
+ | `--storage-path` | string | Override the target storage root path. The actual import directory is `<storage-path>/plugins` |
25
+ | `--npm-registry` | string | When the source is an npm package name or tag, specify the npm registry to use |
26
+
27
+ ## Examples
28
+
29
+ ```bash
30
+ # Remote archive
31
+ nb plugin import https://github.com/nocobase/plugin-auth-cas/releases/download/v1.4.0/plugin-auth-cas-1.4.0.tgz
32
+
33
+ # Local archive
34
+ nb plugin import /your/path/plugin-auth-cas-1.4.0.tgz
35
+
36
+ # npm package or tag
37
+ nb plugin import @my-scope/plugin-auth-cas@beta
38
+
39
+ # Private npm registry
40
+ nb plugin import @my-scope/plugin-auth-cas@beta --npm-registry=https://registry.example.com
41
+
42
+ # Write directly into a local storage path without relying on the current env
43
+ nb plugin import ./plugin-auth-cas-1.4.0.tgz --storage-path ./storage
44
+ ```
45
+
46
+ ## Notes
47
+
48
+ If you already selected the target env, the default path is that env's `storage/plugins`.
49
+
50
+ If you only want to write the plugin into a local storage directory, pass `--storage-path`. In that case you can omit `--env`, and the CLI writes directly into `<storage-path>/plugins`.
51
+
52
+ After the import finishes, the usual next step is to restart the app and then decide whether you also need to enable the plugin. In most cases:
53
+
54
+ - For a first-time installation, run [`nb app restart`](../app/restart.md) first, then run [`nb plugin enable`](./enable.md)
55
+ - If you only re-imported a newer archive, restart the app first and then verify that the new version has loaded
56
+
57
+ If the source lives in a private npm registry, log in first and then import it:
58
+
59
+ ```bash
60
+ npm login --registry=https://registry.example.com
61
+ nb plugin import @my-scope/plugin-auth-cas@beta --npm-registry=https://registry.example.com
62
+ ```
63
+
64
+ :::warning Note
65
+
66
+ You do not need to extract anything into `storage/plugins` by hand. `nb plugin import` puts the plugin into the correct directory automatically.
67
+
68
+ :::
69
+
70
+ ## Related Commands
71
+
72
+ - [`nb app restart`](../app/restart.md)
73
+ - [`nb plugin enable`](./enable.md)
74
+ - [`Install and upgrade third-party plugins`](../../../quickstart/plugins/third-party.md)
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: "nb plugin"
3
- description: "nb plugin command reference: manage plugins for the selected NocoBase env."
4
- keywords: "nb plugin,NocoBase CLI,plugin management,enable,disable,list"
3
+ description: "nb plugin command reference: manage plugins for the selected NocoBase env and import packaged plugins into storage/plugins."
4
+ keywords: "nb plugin,NocoBase CLI,plugin management,enable,disable,list,import"
5
5
  ---
6
6
 
7
7
  # nb plugin
@@ -18,6 +18,7 @@ nb plugin <command>
18
18
 
19
19
  | Command | Description |
20
20
  | --- | --- |
21
+ | [`nb plugin import`](./import.md) | Import a packaged plugin archive or npm package |
21
22
  | [`nb plugin list`](./list.md) | List installed plugins |
22
23
  | [`nb plugin enable`](./enable.md) | Enable one or more plugins |
23
24
  | [`nb plugin disable`](./disable.md) | Disable one or more plugins |
@@ -25,6 +26,7 @@ nb plugin <command>
25
26
  ## Examples
26
27
 
27
28
  ```bash
29
+ nb plugin import ./plugin-auth-cas-1.4.0.tgz --storage-path ./storage
28
30
  nb plugin list -e local
29
31
  nb plugin enable @nocobase/plugin-sample
30
32
  nb plugin disable -e local @nocobase/plugin-sample