@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.
- package/dist/ai/docs/nocobase/ai/install-upgrade-migration.mdx +127 -132
- package/dist/ai/docs/nocobase/ai-dev/capabilities.md +1 -1
- package/dist/ai/docs/nocobase/ai-dev/index.md +1 -1
- package/dist/ai/docs/nocobase/ai-dev/watermark-plugin.md +1 -1
- package/dist/ai/docs/nocobase/api/cli/app/autostart/disable.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/enable.md +44 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/index.md +63 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/list.md +41 -0
- package/dist/ai/docs/nocobase/api/cli/app/autostart/run.md +50 -0
- package/dist/ai/docs/nocobase/api/cli/app/index.md +18 -15
- package/dist/ai/docs/nocobase/api/cli/app/restart.md +3 -11
- package/dist/ai/docs/nocobase/api/cli/app/start.md +3 -11
- package/dist/ai/docs/nocobase/api/cli/app/stop.md +22 -12
- package/dist/ai/docs/nocobase/api/cli/app/upgrade.md +6 -6
- package/dist/ai/docs/nocobase/api/cli/backup/create.md +49 -0
- package/dist/ai/docs/nocobase/api/cli/backup/index.md +46 -0
- package/dist/ai/docs/nocobase/api/cli/backup/restore.md +46 -0
- package/dist/ai/docs/nocobase/api/cli/config/delete.md +11 -9
- package/dist/ai/docs/nocobase/api/cli/config/get.md +11 -8
- package/dist/ai/docs/nocobase/api/cli/config/index.md +28 -24
- package/dist/ai/docs/nocobase/api/cli/config/set.md +14 -12
- package/dist/ai/docs/nocobase/api/cli/db/stop.md +10 -11
- package/dist/ai/docs/nocobase/api/cli/env/index.md +25 -23
- package/dist/ai/docs/nocobase/api/cli/env/info.md +12 -10
- package/dist/ai/docs/nocobase/api/cli/env/proxy/caddy.md +108 -0
- package/dist/ai/docs/nocobase/api/cli/env/proxy/index.md +54 -0
- package/dist/ai/docs/nocobase/api/cli/env/proxy/nginx.md +104 -0
- package/dist/ai/docs/nocobase/api/cli/env/remove.md +18 -14
- package/dist/ai/docs/nocobase/api/cli/env/update.md +115 -14
- package/dist/ai/docs/nocobase/api/cli/index.md +66 -52
- package/dist/ai/docs/nocobase/api/cli/init.md +244 -62
- package/dist/ai/docs/nocobase/api/cli/license/activate.md +13 -12
- package/dist/ai/docs/nocobase/api/cli/license/index.md +2 -2
- package/dist/ai/docs/nocobase/api/cli/plugin/import.md +74 -0
- package/dist/ai/docs/nocobase/api/cli/plugin/index.md +4 -2
- package/dist/ai/docs/nocobase/get-started/deployment/how-to-deploy-nocobase-faster.mdx +384 -0
- package/dist/ai/docs/nocobase/get-started/install-upgrade-plugins.mdx +16 -10
- package/dist/ai/docs/nocobase/get-started/upgrading/docker.md +1 -1
- package/dist/ai/docs/nocobase/index.md +3 -3
- package/dist/ai/docs/nocobase/multi-app/multi-app/app-block-and-switcher.md +68 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/app-sso.md +71 -0
- package/dist/ai/docs/nocobase/multi-app/multi-app/index.md +9 -1
- package/dist/ai/docs/nocobase/multi-app/multi-app/sub-app-api.md +112 -0
- package/dist/ai/docs/nocobase/plugin-development/client/appendix/faq.md +3 -3
- package/dist/ai/docs/nocobase/plugin-development/client/component/index.md +1 -1
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/common-capabilities.md +2 -2
- package/dist/ai/docs/nocobase/plugin-development/client/ctx/index.md +1 -1
- package/dist/ai/docs/nocobase/plugin-development/client/router.md +11 -11
- package/dist/ai/docs/nocobase/quickstart/index.md +27 -0
- package/dist/ai/docs/nocobase/quickstart/installation/airgap.md +67 -0
- package/dist/ai/docs/nocobase/quickstart/installation/cli.md +205 -0
- package/dist/ai/docs/nocobase/quickstart/installation/docker-compose.md +123 -0
- package/dist/ai/docs/nocobase/quickstart/installation/env.md +101 -0
- package/dist/ai/docs/nocobase/quickstart/installation/migration.md +50 -0
- package/dist/ai/docs/nocobase/quickstart/operations/backup-restore.md +94 -0
- package/dist/ai/docs/nocobase/quickstart/operations/manage-app.md +166 -0
- package/dist/ai/docs/nocobase/quickstart/operations/multi-environment.md +171 -0
- package/dist/ai/docs/nocobase/quickstart/plugins/third-party.md +86 -0
- package/dist/ai/docs/nocobase/quickstart/production/index.md +163 -0
- package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/caddy.md +158 -0
- package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/index.md +100 -0
- package/dist/ai/docs/nocobase/quickstart/production/reverse-proxy/nginx.md +166 -0
- package/dist/ai/docs/nocobase/quickstart/release-management.md +1 -0
- package/dist/ai/docs/nocobase/solution/all-in-one/installation.md +181 -0
- package/dist/ai/docs/nocobase/solution/crm/changelog.md +0 -3
- package/dist/ai/docs/nocobase/solution/crm/installation.md +6 -76
- package/dist/ai/docs/nocobase/solution/crm/v1.md +6 -35
- package/dist/ai/docs/nocobase/solution/ticket-system/changelog.md +0 -2
- package/dist/ai/docs/nocobase/solution/ticket-system/installation.md +6 -69
- package/dist/ai/docs/nocobase/workflow/advanced/options.md +45 -1
- package/dist/client/{406.15c09d98faa2ccf1.js → 406.9a530334eae8cede.js} +1 -1
- package/dist/client/{428.e9f38da3b0d8b498.js → 428.431a00d29107058e.js} +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +16 -16
- package/dist/locale/de-DE.json +1 -0
- package/dist/locale/en-US.json +2 -1
- package/dist/locale/es-ES.json +1 -0
- package/dist/locale/fr-FR.json +1 -0
- package/dist/locale/hu-HU.json +1 -0
- package/dist/locale/id-ID.json +1 -0
- package/dist/locale/it-IT.json +1 -0
- package/dist/locale/ja-JP.json +1 -0
- package/dist/locale/ko-KR.json +1 -0
- package/dist/locale/nl-NL.json +1 -0
- package/dist/locale/pt-BR.json +1 -0
- package/dist/locale/ru-RU.json +1 -0
- package/dist/locale/tr-TR.json +1 -0
- package/dist/locale/uk-UA.json +1 -0
- package/dist/locale/vi-VN.json +1 -0
- package/dist/locale/zh-CN.json +2 -1
- package/dist/locale/zh-TW.json +1 -0
- package/dist/node_modules/@langchain/xai/package.json +1 -1
- package/dist/node_modules/fs-extra/package.json +1 -1
- package/dist/node_modules/jsonrepair/package.json +1 -1
- package/dist/node_modules/just-bash/package.json +1 -1
- package/dist/node_modules/nodejs-snowflake/package.json +1 -1
- package/dist/node_modules/openai/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/resource/ai.js +11 -9
- package/dist/server/workflow/nodes/employee/index.js +2 -4
- package/dist/server/workflow/nodes/employee/types.d.ts +2 -2
- package/package.json +2 -2
- package/dist/ai/docs/nocobase/api/cli/app/down.md +0 -41
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description:
|
|
4
|
-
keywords:
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
24
|
-
|
|
|
25
|
-
| `<name>`
|
|
26
|
-
| `--
|
|
27
|
-
| `--
|
|
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 --
|
|
36
|
+
nb env remove staging --force
|
|
37
|
+
nb env remove staging --purge --force
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
## Related
|
|
40
|
+
## Related commands
|
|
37
41
|
|
|
38
|
-
- [`nb app
|
|
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:
|
|
3
|
-
description:
|
|
4
|
-
keywords:
|
|
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
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
|
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:
|
|
3
|
-
description:
|
|
4
|
-
keywords:
|
|
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
|
|
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
|
|
13
|
+
It supports two common initialization paths:
|
|
14
14
|
|
|
15
|
-
- Connect an existing NocoBase
|
|
16
|
-
- Install a new NocoBase
|
|
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
|
|
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
|
|
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
|
|
30
|
+
The following command groups are shown in `nb --help`:
|
|
31
31
|
|
|
32
|
-
|
|
|
33
|
-
|
|
|
34
|
-
| [`nb api`](./api/index.md)
|
|
35
|
-
| [`nb app`](./app/index.md)
|
|
36
|
-
| [`nb
|
|
37
|
-
| [`nb
|
|
38
|
-
| [`nb
|
|
39
|
-
| [`nb
|
|
40
|
-
| [`nb
|
|
41
|
-
| [`nb
|
|
42
|
-
| [`nb
|
|
43
|
-
| [`nb
|
|
44
|
-
| [`nb
|
|
45
|
-
| [`nb
|
|
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
|
|
52
|
-
|
|
|
53
|
-
| [`nb init`](./init.md) |
|
|
52
|
+
| Command | Description |
|
|
53
|
+
| ---------------------- | ---------------------------------------------------------- |
|
|
54
|
+
| [`nb init`](./init.md) | Initialize NocoBase so coding agents can connect and work. |
|
|
54
55
|
|
|
55
|
-
##
|
|
56
|
+
## Viewing help
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
View help for the root command:
|
|
58
59
|
|
|
59
60
|
```bash
|
|
60
61
|
nb --help
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
|
|
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
|
|
77
|
+
Interactive initialization:
|
|
76
78
|
|
|
77
79
|
```bash
|
|
78
80
|
nb init
|
|
79
81
|
```
|
|
80
82
|
|
|
81
|
-
|
|
83
|
+
Initialize using a browser form:
|
|
82
84
|
|
|
83
85
|
```bash
|
|
84
86
|
nb init --ui
|
|
85
87
|
```
|
|
86
88
|
|
|
87
|
-
Create a Docker
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
133
|
-
|
|
|
134
|
-
| `NB_CLI_ROOT`
|
|
135
|
-
| `NB_LOCALE`
|
|
136
|
-
| `NB_SESSION_ID` | Session ID for the current shell or agent runtime. When set, `nb env use` and `nb env current` are isolated
|
|
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=
|
|
156
|
+
export NB_LOCALE=zh-CN
|
|
143
157
|
```
|
|
144
158
|
|
|
145
159
|
## Configuration files
|
|
146
160
|
|
|
147
|
-
Default
|
|
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
|
|
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
|
|
173
|
+
The CLI is also compatible with reading legacy project configuration in the current working directory.
|
|
160
174
|
|
|
161
|
-
|
|
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
|
|
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
|
-
|
|
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
|
|
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)
|