Skip to content

Commit c0fc8d0

Browse files
author
farfarfun
committed
refactor(install): drop nlt-service-* wrappers; add nlt-celery
- Remove duplicate nlt-service-{airflow,celery,paperclip,code-server,new-api} - Emit nlt-celery -> celery/setup.sh (parity with nlt-airflow) - Update nlt-services hint, smoke test, README, and superpowers docs Made-with: Cursor
1 parent 212edd5 commit c0fc8d0

7 files changed

Lines changed: 35 additions & 42 deletions

File tree

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Python 包元数据见根目录 [`pyproject.toml`](pyproject.toml)(MIT)。
2121

2222
## 推荐:一键安装到 ~/.local/nltdeploy
2323

24-
将仓库内脚本同步到 `~/.local/nltdeploy/libexec/nltdeploy/`,并在 `~/.local/nltdeploy/bin/` 生成以 `nlt-` / `nlt-service-` 开头的命令(实现与规格见 [`docs/superpowers/specs/2026-04-11-nltdeploy-local-install-design.md`](docs/superpowers/specs/2026-04-11-nltdeploy-local-install-design.md))。
24+
将仓库内脚本同步到 `~/.local/nltdeploy/libexec/nltdeploy/`,并在 `~/.local/nltdeploy/bin/` 生成以 **`nlt-`** 开头的命令(实现与规格见 [`docs/superpowers/specs/2026-04-11-nltdeploy-local-install-design.md`](docs/superpowers/specs/2026-04-11-nltdeploy-local-install-design.md))。
2525

2626
**克隆仓库后本地安装 / 更新:**
2727

@@ -85,23 +85,19 @@ bash tests/install_smoke.sh
8585
| `nlt-pip-sources` | `scripts/tools/pip-sources/setup.sh`(无参时 gum 选 install/update/reinstall/uninstall) |
8686
| `nlt-python-env` | `scripts/tools/python-env/setup.sh`(无参时 gum 选子命令;见脚本头) |
8787
| `nlt-airflow-install` | `scripts/services/airflow/setup.sh` install |
88-
| `nlt-airflow`(可接任意子命令;无参为 gum 菜单) | `scripts/services/airflow/setup.sh` …(含 `update`|
89-
| `nlt-service-airflow` | 同上 `setup.sh`,透传子命令(如 `start` / `stop` / `restart` / `status` / `update`|
88+
| `nlt-airflow` | 同上 `setup.sh` 全量子命令(如 `start` / `stop` / `status` / `update`);无参为 gum 菜单 |
9089
| `nlt-celery-install` | `scripts/services/celery/setup.sh` install |
91-
| `nlt-celery-update` | `setup.sh` update |
92-
| `nlt-service-celery` | 同上 `setup.sh`,透传(如 `start-worker` / `start-beat` / `start-flower` / `stop` / `restart` / `status`|
90+
| `nlt-celery-update` | 同上 `setup.sh` update |
91+
| `nlt-celery` | 同上 `setup.sh` 全量子命令(如 `start-worker` / `stop` / `status`;无参为菜单 |
9392
| `nlt-utils`(可接子参数,如 `gum``all`| `scripts/tools/utils/setup.sh`|
9493
| `nlt-github-net` | `scripts/tools/github-net/setup.sh`(无参 gum;可 `install` / `update` / `reinstall` / `uninstall`|
9594
| `nlt-services` | `scripts/services/nlt-services.sh`(无参 gum;`status``install` 先选安装或卸载;非交互:`install add <模块>` / `install remove <模块>``status --no-http`|
9695
| `nlt-paperclip-install` | `scripts/services/paperclip/setup.sh` install(git clone + pnpm install) |
97-
| `nlt-paperclip` | 同上,透传子命令;无参为 gum 菜单 |
98-
| `nlt-service-paperclip` | 同上 `setup.sh`,透传(如 `start` / `stop` / `status` / `update`|
96+
| `nlt-paperclip` | 同上 `setup.sh` 全量子命令;无参为 gum 菜单 |
9997
| `nlt-code-server-install` | `scripts/services/code-server/setup.sh` install(下载解压官方包) |
100-
| `nlt-code-server` | 同上,透传子命令;无参为 gum 菜单 |
101-
| `nlt-service-code-server` | 同上 `setup.sh`,透传(如 `start` / `stop` / `status` / `update`|
98+
| `nlt-code-server` | 同上 `setup.sh` 全量子命令;无参为 gum 菜单 |
10299
| `nlt-new-api-install` | `scripts/services/new-api/setup.sh` install(下载 Release 二进制) |
103-
| `nlt-new-api` | 同上,透传子命令;无参为 gum 菜单 |
104-
| `nlt-service-new-api` | 同上 `setup.sh`,透传(如 `start` / `stop` / `status` / `update`|
100+
| `nlt-new-api` | 同上 `setup.sh` 全量子命令;无参为 gum 菜单 |
105101

106102
## 目录结构
107103

docs/superpowers/plans/2026-04-11-nltdeploy-local-install.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
44
5-
**Goal:** 提供仓库根目录一键 `install.sh`,将 `scripts/` 中的实现同步到 `~/.local/nltdeploy/libexec/nltdeploy/`,并在 `bin/` 生成符合规格的 `nlt-*` / `nlt-service-*` 薄包装;文档与 `NLTDEPLOY_RAW_BASE` 兼容变量同步更新。
5+
**Goal:** 提供仓库根目录一键 `install.sh`,将 `scripts/` 中的实现同步到 `~/.local/nltdeploy/libexec/nltdeploy/`,并在 `bin/` 生成符合规格的 **`nlt-*`** 薄包装;文档与 `NLTDEPLOY_RAW_BASE` 兼容变量同步更新。
66

77
**Architecture:****`scripts/` 为单一源码真相**(不在首版重复维护第二套脚本正文)。安装时按固定映射表 **复制**`libexec`(避免符号链接在打包/部分文件系统上的问题)。`bin` 下全部为两行级薄包装:`NLTDEPLOY_ROOT` + `exec` 到 libexec 目标并附加固定子命令参数。Airflow/Celery 继续沿用现有 `setup.sh` 的子命令接口。
88

@@ -143,10 +143,10 @@ _emit_wrapper nlt-github-net github-net/setup.sh
143143

144144
_emit_wrapper nlt-airflow-install airflow/setup.sh install
145145
_emit_wrapper nlt-airflow airflow/setup.sh
146-
_emit_wrapper nlt-service-airflow airflow/setup.sh
147146

148147
_emit_wrapper nlt-celery-install celery/setup.sh install
149-
_emit_wrapper nlt-service-celery celery/setup.sh
148+
_emit_wrapper nlt-celery-update celery/setup.sh update
149+
_emit_wrapper nlt-celery celery/setup.sh
150150
```
151151

152152
- [ ] **Step 3: 安装结束提示 PATH(不默认写 profile)**
@@ -169,7 +169,7 @@ Expected: 退出码 0。
169169

170170
```bash
171171
git add install.sh
172-
git commit -m "feat: generate nlt-* and nlt-service-* bin wrappers in install.sh"
172+
git commit -m "feat: generate nlt-* bin wrappers in install.sh"
173173
```
174174

175175
---
@@ -237,8 +237,8 @@ export NLTDEPLOY_ROOT="${TMP}/nd"
237237
bash "${ROOT}/install.sh"
238238
for f in \
239239
nlt-pip-sources nlt-python-env nlt-utils nlt-github-net \
240-
nlt-airflow-install nlt-airflow nlt-service-airflow \
241-
nlt-celery-install nlt-service-celery
240+
nlt-airflow-install nlt-airflow \
241+
nlt-celery-install nlt-celery-update nlt-celery
242242
do
243243
[[ -x "${NLTDEPLOY_ROOT}/bin/${f}" ]] || { echo "missing: bin/${f}" >&2; exit 1; }
244244
bash -n "${NLTDEPLOY_ROOT}/bin/${f}" || exit 1
@@ -280,7 +280,7 @@ git commit -m "test: add install smoke test for bin wrappers and libexec"
280280

281281
表格列:`新命令(bin)` | `原 scripts 路径与用法` | 备注。
282282

283-
须包含本计划中 `_emit_wrapper` 列出的全部 `nlt-*` / `nlt-service-*` 名称。
283+
须包含本计划中 `_emit_wrapper` 列出的全部 `nlt-*` 名称。
284284

285285
- [ ] **Step 3: 在「环境变量」相关小节补充 `NLTDEPLOY_RAW_BASE`**
286286

@@ -301,7 +301,7 @@ git commit -m "docs: document local install, nlt-* mapping, and NLTDEPLOY_RAW_BA
301301
|----------|----------|
302302
| 一键安装 + `bin``nlt-*` | Task 1–2 |
303303
| `libexec` 实现分离 | Task 1 |
304-
| `nlt-service-<域>` 单入口透传子命令 | Task 2(Airflow/Celery 等) |
304+
| `nlt-<域>` 单入口透传子命令 | Task 2(Airflow/Celery 等) |
305305
| `nlt-airflow-install` 非 service | Task 2 |
306306
| `NLTDEPLOY_ROOT` 可覆盖 | Task 1–2 薄包装 |
307307
| `NONINTERACTIVE` 保留 | 无需改脚本(沿用现有) |

docs/superpowers/specs/2026-04-11-nltdeploy-local-install-design.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
- **一键安装**:单入口脚本(可 `curl | bash`,也可 clone 后本地执行)完成目录创建、文件同步、`bin` 下命令就绪,并提示配置 `PATH`
1414
- **统一安装根**:运行时工具箱根目录为 **`~/.local/nltdeploy`**(可通过环境变量覆盖,见第 6 节)。
15-
- **PATH 仅暴露 `nlt-*`**:用户可执行文件全部以 `nlt-` 开头;其中 **服务启停类****`nlt-service-`** 开头
15+
- **PATH 仅暴露 `nlt-*`**:用户可执行文件全部以 `nlt-` 开头(含工具、安装类与服务生命周期,**不再**单独使用 `nlt-service-*` 前缀)
1616
- **实现与入口分离**:真实逻辑放在 **`libexec/nltdeploy/`**`bin` 仅为薄包装,便于升级与测试。
1717

1818
成功标准:安装后在不进入仓库目录的情况下,仅依赖 `PATH` 即可调用文档中列出的命令;现有 `scripts/` 行为可通过迁移表逐项对齐或显式废弃。
@@ -25,8 +25,9 @@
2525
|------|------|------|
2626
| 主形态 | **A:Bash 小命令为主** | 与当前仓库以 shell 为主力一致;Python 包不作为终端主入口(可后续作为可选依赖,本规格不强制)。 |
2727
| 命令前缀 | **`nlt-`** | 所有 `bin` 内可执行文件名均以此开头。 |
28-
| 服务类前缀 | **`nlt-service-`** | 长期运行服务的 start/stop/restart/status 等归属此族。 |
29-
| Airflow「首次安装」 | **`nlt-airflow-install`(非 service)** | 与「装环境」一致归为工具/安装类;装好后日常运维用 **`nlt-service-airflow`** 接子命令(如 `start` / `status`),与 `nlt-airflow` 等价透传。 |
28+
| 服务生命周期 | **`nlt-<域>`** |**`nlt-airflow`****`nlt-celery`****`nlt-paperclip`** 等总控入口透传 `start` / `stop` / `status` / `update` 等子命令;****再生成 `nlt-service-<域>` 重复包装。 |
29+
| Airflow「首次安装」 | **`nlt-airflow-install`** | 首次/干净环境安装;日常运维用 **`nlt-airflow`** 接子命令。 |
30+
| Celery | **`nlt-celery-install`** / **`nlt-celery-update`** / **`nlt-celery`** | 安装、依赖升级与全量子命令(含 worker/beat/flower)分口,与 Airflow 的 install + 总控对称。 |
3031
| 数据与运行时目录 | **默认保持现有 `~/opt/...` 约定** | 与 README 及现有脚本一致,降低迁移成本;若设置 `AIRFLOW_HOME` / `CELERY_HOME` 等,仍以用户环境为准。后续可在实现阶段增加可选「统一到 `~/.local/nltdeploy/var`」的迁移助手,**不作为本规格 v1 默认行为**|
3132

3233
---
@@ -41,7 +42,7 @@
4142
└── etc/nltdeploy/ # 用户级配置覆盖(可选)
4243
```
4344

44-
- **`bin/`**:仅包含名称以 `nlt-` 开头的文件(含 `nlt-service-*`
45+
- **`bin/`**:仅包含名称以 `nlt-` 开头的文件。
4546
- **`libexec/nltdeploy/`**:可按域分子目录(例如 `pip/``python-env/``airflow/``celery/`),具体结构由实现计划定义;规格要求 **不将 `libexec` 加入 PATH**
4647

4748
---
@@ -68,11 +69,11 @@
6869

6970
### 4.3 服务(进程生命周期)
7071

71-
- 模式:**`nlt-service-<服务名>`** 为单一薄包装`exec` 到对应域脚本并 **透传 `"$@"`**;动作为 **第一个参数**(及后续参数)。
72+
- 模式:**`nlt-<服务名>`** 为薄包装`exec` 到对应域 `setup.sh` **透传 `"$@"`**;动作为 **第一个参数**(及后续参数)。
7273
- 动作建议统一为:`start` | `stop` | `restart` | `status` | `update`(Celery 另有 `start-worker` / `start-beat` / `start-flower` 等,与域脚本一致)。
7374
- 示例:
74-
- `nlt-service-airflow start` / `stop` / `restart` / `status` / `update`
75-
- `nlt-service-celery start-worker` / `start-beat` / `stop` / `status` / …
75+
- `nlt-airflow start` / `stop` / `restart` / `status` / `update`
76+
- `nlt-celery start-worker` / `start-beat` / `stop` / `status` / …
7677

7778
---
7879

@@ -111,7 +112,7 @@
111112
## 8. 测试与验收(规格层)
112113

113114
- 安装脚本在 **macOS 与 Linux**(含无 TTY 的 `NONINTERACTIVE`)下可完成安装。
114-
- 抽样验收:`nlt-pip-sources``nlt-python-env``nlt-airflow-install``nlt-service-airflow status`(在未安装服务时可有明确退出码与提示)等按迁移表可调用。
115+
- 抽样验收:`nlt-pip-sources``nlt-python-env``nlt-airflow-install``nlt-airflow status`(在未安装服务时可有明确退出码与提示)等按迁移表可调用。
115116

116117
---
117118

@@ -125,5 +126,5 @@
125126
## 规格自检记录
126127

127128
- **占位符**:无 TBD;数据目录默认策略已写死为保留 `~/opt` 与既有 env。
128-
- **一致性**服务类仅 `nlt-service-*`;Airflow 安装单独 `nlt-airflow-install`,与上文表格一致。
129+
- **一致性**服务生命周期统一经 `nlt-<域>`;Airflow / Celery 的首次安装仍用 `nlt-airflow-install``nlt-celery-install`,与上文表格一致。
129130
- **范围**:本文件仅定义布局与命名;不展开具体 systemd/launchd 或进程管理实现细节(归入实现计划)。

docs/superpowers/specs/2026-04-11-nltdeploy-tool-service-conventions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@
5959
### 3.2 与 `bin` 命名的关系(不破坏现有安装)
6060

6161
- **推荐**:每个域一个 **总控入口**(如 `nlt-airflow``airflow/setup.sh "$@"`),所有子命令通过参数触发直执行或 gum 菜单。
62-
- **服务族命名**每个长期运行域对应 **一个** **`nlt-service-<域>`**透传子命令(如 `nlt-service-airflow start`),**不再**为每个动词单独生成 `nlt-service-<域>-<动词>` 文件
63-
- **新增服务/工具**优先 **总控** `nlt-<域>`**`nlt-service-<域>`**(二者可指向同一 libexec 脚本);安装类入口仍可用 `nlt-<域>-install`
62+
- **服务域**长期运行域只用 **`nlt-<域>`** 透传子命令(如 `nlt-airflow start`),****再提供并行的 `nlt-service-<域>` 包装
63+
- **新增服务/工具**总控 `nlt-<域>`;需要单独语义时仍可用 `nlt-<域>-install` / `nlt-<域>-update`(如 Celery)等,**不为**每个动词单独生成 `nlt-<域>-<动词>` 文件
6464

6565
---
6666

@@ -102,7 +102,7 @@
102102
- [ ] 无参数走 gum 交互;带首参子命令时直执行,不经过主菜单。
103103
- [ ] 需要 gum 前调用 `_nlt_ensure_gum`,且 gum 已安装时 O(1) 跳过。
104104
- [ ] `NONINTERACTIVE=1` 行为在脚本头注释中说明。
105-
- [ ] `install.sh` 与 README 中的 `nlt-*` / `nlt-service-*` 对照表已更新(若新增包装)。
105+
- [ ] `install.sh` 与 README 中的 `nlt-*` 对照表已更新(若新增包装)。
106106

107107
---
108108

install.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,23 +328,19 @@ do_install_or_update() {
328328

329329
_emit_wrapper nlt-airflow-install airflow/setup.sh install
330330
_emit_wrapper nlt-airflow airflow/setup.sh
331-
_emit_wrapper nlt-service-airflow airflow/setup.sh
332331

333332
_emit_wrapper nlt-celery-install celery/setup.sh install
334333
_emit_wrapper nlt-celery-update celery/setup.sh update
335-
_emit_wrapper nlt-service-celery celery/setup.sh
334+
_emit_wrapper nlt-celery celery/setup.sh
336335

337336
_emit_wrapper nlt-paperclip-install paperclip/setup.sh install
338337
_emit_wrapper nlt-paperclip paperclip/setup.sh
339-
_emit_wrapper nlt-service-paperclip paperclip/setup.sh
340338

341339
_emit_wrapper nlt-code-server-install code-server/setup.sh install
342340
_emit_wrapper nlt-code-server code-server/setup.sh
343-
_emit_wrapper nlt-service-code-server code-server/setup.sh
344341

345342
_emit_wrapper nlt-new-api-install new-api/setup.sh install
346343
_emit_wrapper nlt-new-api new-api/setup.sh
347-
_emit_wrapper nlt-service-new-api new-api/setup.sh
348344

349345
if [[ "${NLTDEPLOY_SKIP_PROFILE_HINT:-}" != "1" ]]; then
350346
echo ""

scripts/services/nlt-services.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ cmd_status() {
166166
echo " Flower URL: http://${FLOWER_ADDRESS}:${FLOWER_PORT}/"
167167
echo " 探测: $(http_probe "http://${FLOWER_ADDRESS}:${FLOWER_PORT}/")"
168168
fi
169-
echo " 详情: nlt-service-celery status"
169+
echo " 详情: nlt-celery status"
170170

171171
section "Paperclip"
172172
echo " 名称: Paperclip"

tests/install_smoke.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ bash "${ROOT}/install.sh" install
1010
bash "${ROOT}/install.sh" update
1111
for f in \
1212
nlt-pip-sources nlt-python-env nlt-utils nlt-github-net nlt-services \
13-
nlt-airflow-install nlt-airflow nlt-service-airflow \
14-
nlt-celery-install nlt-celery-update nlt-service-celery \
15-
nlt-paperclip-install nlt-paperclip nlt-service-paperclip \
16-
nlt-code-server-install nlt-code-server nlt-service-code-server \
17-
nlt-new-api-install nlt-new-api nlt-service-new-api
13+
nlt-airflow-install nlt-airflow \
14+
nlt-celery-install nlt-celery-update nlt-celery \
15+
nlt-paperclip-install nlt-paperclip \
16+
nlt-code-server-install nlt-code-server \
17+
nlt-new-api-install nlt-new-api
1818
do
1919
[[ -x "${NLTDEPLOY_ROOT}/bin/${f}" ]] || { echo "missing: bin/${f}" >&2; exit 1; }
2020
bash -n "${NLTDEPLOY_ROOT}/bin/${f}" || exit 1

0 commit comments

Comments
 (0)