You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use `nb` CLI only to complete NocoBase bootstrapand lifecycle actions.
14
+
Use `nb` CLI only to complete NocoBase bootstrap, lifecycle, and maintenance actions.
15
15
16
16
# Scope
17
17
18
18
- Bootstrap or connect NocoBase environments through `nb init`.
19
19
- Manage saved CLI environments through `nb env`.
20
20
- Manage app runtime lifecycle through `nb app`.
21
+
- Check and update the `nb` CLI through `nb self`.
22
+
- Check and update installed NocoBase skills through `nb skills`.
21
23
- Inspect built-in database runtime only when it helps verify or diagnose the selected environment.
22
24
23
25
# Non-Goals
@@ -39,6 +41,9 @@ Use `nb` CLI only to complete NocoBase bootstrap and lifecycle actions.
39
41
- Never proactively fill install/setup forms on the user's behalf; only surface the URL, explain the next step, and let the user complete the form.
40
42
- If the CLI prints a continuation or recovery command, especially `nb init ... --resume ...`, execute that exact direct `nb` command unless it is destructive or conflicts with the user's latest instruction.
41
43
- Use `nb app <command>` for runtime lifecycle operations.
44
+
- Use `nb self <command>` only for CLI self-check/update.
45
+
- Use `nb skills <command>` only for installed skills check/update.
46
+
- Do not execute ambiguous status/check/update/upgrade intents until the target is clear: app/runtime/env, CLI, or skills.
42
47
- Do not add extra precheck gates before executing user-requested `nb` commands.
43
48
- Prefer executing user-requested runtime commands first; use `nb --help` when user asks for diagnostics/help output or command discovery is needed.
44
49
- Surface CLI outputs and hints directly to users.
@@ -53,12 +58,16 @@ Use `nb` CLI only to complete NocoBase bootstrap and lifecycle actions.
53
58
-`restart`
54
59
-`logs`
55
60
-`down`
61
+
-`self-check`
62
+
-`self-update`
63
+
-`skills-check`
64
+
-`skills-update`
56
65
57
66
# Input Contract
58
67
59
68
| Input | Required | Default | Notes |
60
69
|---|---|---|---|
61
-
|`task`| yes | inferred | one of `install/app-manage/upgrade/start/stop/restart/logs/down`|
70
+
|`task`| yes | inferred | one of `install/app-manage/upgrade/start/stop/restart/logs/down/self-check/self-update/skills-check/skills-update`|
62
71
|`app_env_action`| for `task=app-manage`|`list`| one of `add/use/current/list/remove`; `current` is derived from list output |
63
72
|`app_env_name`| conditional | none | required for `add/use/remove`|
64
73
|`app_base_url`| conditional | none | required for `add`; accepts URL with or without `/api` (auto-normalized) |
@@ -69,6 +78,7 @@ Use `nb` CLI only to complete NocoBase bootstrap and lifecycle actions.
69
78
# Execution Policy
70
79
71
80
- Execute the target `nb` command directly.
81
+
- Intent clarification is not a precheck gate. If the user's wording is ambiguous, ask one concise clarification question before running any command.
72
82
- Install routing:
73
83
- when the user provides an official NocoBase install or quick-start URL, read it first and follow that official flow, ignoring local install command tables on conflict
74
84
- otherwise use `nb init --ui` as the guided install entrypoint
@@ -91,6 +101,45 @@ Use `nb` CLI only to complete NocoBase bootstrap and lifecycle actions.
91
101
- For `env add`, normalize API base URL before execution:
92
102
- if URL already ends with `/api`, keep as-is
93
103
- otherwise append `/api`
104
+
- For CLI maintenance, execute the exact command requested by task:
105
+
-`self-check` -> `nb self check --json`
106
+
-`self-update` -> `nb self update --yes`
107
+
- For skills maintenance, execute the exact command requested by task:
108
+
-`skills-check` -> `nb skills check --json`
109
+
-`skills-update` -> `nb skills update --yes`
110
+
- Preserve JSON check output from `nb self check --json` and `nb skills check --json` when reporting results.
111
+
- After `self-update` or `skills-update`, run the matching check command as readback unless the CLI says the shell/session must be restarted first.
112
+
113
+
# Intent Disambiguation
114
+
115
+
When the user says generic status/check/update/upgrade wording without an explicit target, do not infer a command.
Use this for `nb` CLI health/version/update checks. No env is required.
293
+
294
+
## self-update
295
+
296
+
```bash
297
+
nb self update --yes
298
+
nb self check --json
299
+
```
300
+
301
+
Run the update command first. Run the check command afterward as readback unless the CLI says a new shell/session is required.
302
+
303
+
## skills-check
304
+
305
+
```bash
306
+
nb skills check --json
307
+
```
308
+
309
+
Use this for installed NocoBase skills health/version/update checks. No env is required.
310
+
311
+
## skills-update
312
+
313
+
```bash
314
+
nb skills update --yes
315
+
nb skills check --json
316
+
```
317
+
318
+
Run the update command first. Run the check command afterward as readback unless the CLI says a new shell/session is required.
319
+
235
320
# Safety
236
321
237
322
- Never run `upgrade` on ambiguous env.
238
323
- Ask explicit confirmation before `upgrade` when user intent is not explicit.
239
324
- Treat `nb app down` as destructive because it removes runtime containers and saved local app files. Always ask explicit confirmation before running it.
240
325
- Never pass `--all` or `--yes` to `nb app down` unless the user explicitly requests those flags.
326
+
- Treat `nb self update --yes` and `nb skills update --yes` as allowed update shortcuts only when the user clearly requests CLI or skills update.
327
+
- Do not substitute package-manager update commands (`npm`, `pnpm`, `yarn`) for `nb self update --yes` or `nb skills update --yes`.
241
328
242
329
Confirmation template:
243
330
@@ -247,18 +334,19 @@ Confirmation template:
247
334
248
335
Require explicit user confirmation before:
249
336
337
+
- ambiguous status/check/update/upgrade intents where the target could be app/runtime/env, CLI, or skills.
250
338
-`nb app upgrade` when the target env is ambiguous or the user did not clearly request an upgrade.
251
339
-`nb app down` in all cases.
252
340
-`nb env remove <name> -f`.
253
-
- Any command that includes `--all`, `--yes`, or force-style deletion flags.
341
+
- Any command that includes `--all`, `--yes`, or force-style deletion flags, except exact `nb self update --yes` / `nb skills update --yes` commands when the user clearly requested that update.
254
342
255
343
# Output Contract
256
344
257
345
Final response must include:
258
346
259
347
- selected task
260
348
- executed commands
261
-
- relevant CLI outputs (including error/hint lines when failed)
349
+
- relevant CLI outputs, including JSON check output and error/hint lines when failed
262
350
- normalized API base URL (for `env add`)
263
351
- next action
264
352
@@ -279,6 +367,10 @@ Final response must include:
279
367
- Any CLI-provided `nb init ... --resume ...` continuation was followed or surfaced with a blocker.
280
368
- Runtime lifecycle commands used `nb app ...`.
281
369
- Env operations used the final `nb env` syntax.
370
+
- Ambiguous status/check/update/upgrade wording was clarified before command execution.
371
+
- CLI maintenance used `nb self check --json` or `nb self update --yes`.
372
+
- Skills maintenance used `nb skills check --json` or `nb skills update --yes`.
373
+
- Maintenance update commands were followed by matching check commands when the CLI allowed it.
282
374
- Final readback used `nb env list` and, when relevant, `nb env info`.
Copy file name to clipboardExpand all lines: skills/nocobase-env-manage/agents/openai.yaml
+29-2Lines changed: 29 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
interface:
2
2
display_name: "NocoBase Env Manage"
3
-
short_description: "Bootstrapand manage NocoBase with nb CLI only"
3
+
short_description: "Bootstrap, lifecycle, CLI, and skills maintenance with nb CLI only"
4
4
default_prompt: >
5
5
Use $nocobase-env-manage with nb CLI only.
6
6
@@ -17,12 +17,17 @@ interface:
17
17
- If install prints a URL that cannot be opened in a sandbox, ask to elevate/open outside the sandbox first; if the user refuses, provide the URL directly.
18
18
- Never proactively fill or submit install/setup forms for the user.
19
19
- Runtime lifecycle commands are under `nb app`.
20
+
- CLI self maintenance commands are under `nb self`.
21
+
- Skills maintenance commands are under `nb skills`.
22
+
- Do not execute ambiguous status/check/update/upgrade intents until the target is clear: app/runtime/env, CLI, or skills.
20
23
- Do not add extra precheck gates before executing requested `nb` commands.
21
24
- Prefer executing requested runtime commands first; use `nb --help` when user asks diagnostics/help output or command discovery is needed.
22
25
- Relay CLI outputs and hints directly.
23
26
24
27
Execution policy:
25
28
- execute target command directly
29
+
- intent clarification is not a precheck gate: if the user says generic `检查状态`, `健康检查`, `诊断`, `检查更新`, `升级`, or `更新` without naming app/runtime/env, CLI, or skills, ask which target they mean before running any command
- for `nb init --ui`, treat it as a long-running interactive command; wait for completion instead of interrupting it mid-run or stopping at the setup URL
27
32
- when an install command fails with a CLI hint, follow the printed direct `nb` next-step command, especially `nb init ... --resume ...`
28
33
- if command fails, report key CLI error/hint lines as-is and provide next action
@@ -35,6 +40,14 @@ interface:
35
40
- for `env add`, normalize `--api-base-url` before execution:
36
41
- if URL already ends with `/api`, keep as-is
37
42
- otherwise append `/api`
43
+
- for CLI maintenance, execute exact commands:
44
+
- self-check: `nb self check --json`
45
+
- self-update: `nb self update --yes`, then `nb self check --json` unless CLI asks for a new shell/session first
46
+
- for skills maintenance, execute exact commands:
47
+
- skills-check: `nb skills check --json`
48
+
- skills-update: `nb skills update --yes`, then `nb skills check --json` unless CLI asks for a new shell/session first
49
+
- preserve JSON check output from `nb self check --json` and `nb skills check --json`
50
+
- do not substitute package-manager update commands for `nb self update --yes` or `nb skills update --yes`
38
51
39
52
Tasks:
40
53
- install: official URL flow when provided; otherwise `nb init --ui`; follow `--resume` hints; verify with `nb env list` and `nb env info`
-[8) Wrong env targeted for runtime command](#8-wrong-env-targeted-for-runtime-command)
13
+
-[9) CLI self check or update fails](#9-cli-self-check-or-update-fails)
14
+
-[10) Skills check or update fails](#10-skills-check-or-update-fails)
15
+
-[11) Generic check or update intent is ambiguous](#11-generic-check-or-update-intent-is-ambiguous)
13
16
14
17
## 1) `nb` command not found
15
18
@@ -121,3 +124,64 @@ nb app upgrade --env <correct_env>
121
124
nb app stop --env <correct_env>
122
125
nb app start --env <correct_env>
123
126
```
127
+
128
+
## 9) CLI self check or update fails
129
+
130
+
Symptom:
131
+
132
+
-`nb self check --json` reports an unhealthy CLI, version mismatch, or update availability
133
+
-`nb self update --yes` fails or asks for a shell/session restart
134
+
135
+
Fix:
136
+
137
+
```bash
138
+
nb self check --json
139
+
nb self update --yes
140
+
nb self check --json
141
+
```
142
+
143
+
If the update command says a new shell/session is required, stop after surfacing that message and ask the user to restart the shell or agent session before rechecking. Do not replace the command with `npm`, `pnpm`, or `yarn` update flows.
-`nb skills update --yes` fails or asks for a shell/session restart
151
+
152
+
Fix:
153
+
154
+
```bash
155
+
nb skills check --json
156
+
nb skills update --yes
157
+
nb skills check --json
158
+
```
159
+
160
+
If the update command prints repair instructions, surface them directly. Do not edit installed skill files manually unless the user explicitly asks for local skill development.
161
+
162
+
## 11) Generic check or update intent is ambiguous
163
+
164
+
Symptom:
165
+
166
+
- user says `检查状态`, `健康检查`, `诊断`, `检查更新`, `升级`, or `更新`
167
+
- user does not name app/runtime/env, CLI, or skills
0 commit comments