@chenmk/superflow 0.5.1 → 0.5.3
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/INSTALL.en.md +2 -2
- package/INSTALL.md +4 -4
- package/README.md +2 -2
- package/README.zh-CN.md +3 -3
- package/installer/bin/superflow-installer.cjs +67 -0
- package/installer/package.json +16 -0
- package/package.json +4 -3
- package/scripts/preinstall.js +9 -9
package/INSTALL.en.md
CHANGED
|
@@ -8,12 +8,12 @@ aliases, scripts, rules, and handoff state for Claude Code and Codex.
|
|
|
8
8
|
## 1. Install
|
|
9
9
|
|
|
10
10
|
```bash
|
|
11
|
-
|
|
11
|
+
npx --yes --package=@chenmk/superflow@latest superflow-install
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
> **Node.js requirement:** Node.js 20 or later is required. If `node -v` is older,
|
|
15
15
|
> installation stops before command aliases are created. With nvm, run
|
|
16
|
-
> `nvm install
|
|
16
|
+
> `nvm install 20 && nvm use 20 && nvm alias default 20`, open a new terminal, and reinstall.
|
|
17
17
|
|
|
18
18
|
The repository `install.sh` and `install.ps1` scripts detect the Codex/Claude
|
|
19
19
|
Hosts actually installed and register their managed MCP entries together with
|
package/INSTALL.md
CHANGED
|
@@ -29,7 +29,7 @@ docs -> design -> implement -> verify -> archive
|
|
|
29
29
|
| Python | hook 中的 Python 脚本需要 | `python3 --version` |
|
|
30
30
|
|
|
31
31
|
> **Node 版本不足:** 安装会在创建命令前停止。若已安装 nvm,运行
|
|
32
|
-
> `nvm install
|
|
32
|
+
> `nvm install 20 && nvm use 20 && nvm alias default 20`,重新打开终端后再安装。
|
|
33
33
|
|
|
34
34
|
支持系统:
|
|
35
35
|
|
|
@@ -43,7 +43,7 @@ docs -> design -> implement -> verify -> archive
|
|
|
43
43
|
### 2.1 npm 全局安装(推荐给普通用户)
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
|
-
|
|
46
|
+
npx --yes --package=@chenmk/superflow@latest superflow-install
|
|
47
47
|
superflow --version
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ superflow --version
|
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
npm config set registry https://registry.npmmirror.com
|
|
54
|
-
|
|
54
|
+
npx --yes --package=@chenmk/superflow@latest superflow-install
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
### 2.2 从源码安装(贡献者或本地调试)
|
|
@@ -669,7 +669,7 @@ superflow pipeline --agent codex
|
|
|
669
669
|
|
|
670
670
|
| 场景 | 命令 |
|
|
671
671
|
|------|------|
|
|
672
|
-
| 安装 CLI | `
|
|
672
|
+
| 安装 CLI | `npx --yes --package=@chenmk/superflow@latest superflow-install` |
|
|
673
673
|
| 初始化并选择工具 | `superflow init` |
|
|
674
674
|
| 非交互初始化两侧 | `superflow init --yes` |
|
|
675
675
|
| 检查健康 | `superflow doctor` |
|
package/README.md
CHANGED
|
@@ -151,11 +151,11 @@ Each phase has a clear owner and an exit gate:
|
|
|
151
151
|
## Install
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
|
-
|
|
154
|
+
npx --yes --package=@chenmk/superflow@latest superflow-install
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
> **Node.js requirement:** Node.js 20 or later is required. On an older runtime,
|
|
158
|
-
> installation stops before command aliases are created and prints Node
|
|
158
|
+
> installation stops before command aliases are created and prints Node 20 upgrade instructions.
|
|
159
159
|
|
|
160
160
|
For a source checkout, `bash install.sh` detects installed Codex, Claude, and
|
|
161
161
|
Codex and Claude Hosts and installs CLI, Skills/Hooks, and their managed MCP registrations
|
package/README.zh-CN.md
CHANGED
|
@@ -100,19 +100,19 @@ docs -> design -> implement -> verify -> archive
|
|
|
100
100
|
## 安装
|
|
101
101
|
|
|
102
102
|
```bash
|
|
103
|
-
|
|
103
|
+
npx --yes --package=@chenmk/superflow@latest superflow-install
|
|
104
104
|
# 或本地源码:
|
|
105
105
|
# git clone https://github.com/.../superflow-cli && cd superflow-cli && bash install.sh
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
> **Node.js 要求:** 需要 Node.js 20+。版本不足时,安装会在创建命令前停止,并打印 Node
|
|
108
|
+
> **Node.js 要求:** 需要 Node.js 20+。版本不足时,安装会在创建命令前停止,并打印 Node 20 的升级和重装指引。
|
|
109
109
|
|
|
110
110
|
完整安装、初始化和日常使用教程见 [INSTALL.md](./INSTALL.md)。
|
|
111
111
|
|
|
112
112
|
从源码执行 `bash install.sh` 时,会检测本机已有的 Codex、Claude,并一次完成
|
|
113
113
|
CLI、Skills/Hooks 与对应托管 MCP 注册;安装后重启检测到的 Agent 即可。
|
|
114
114
|
|
|
115
|
-
> **💡 装完即全局生效,无需逐项目 init**:`
|
|
115
|
+
> **💡 装完即全局生效,无需逐项目 init**:`npx --yes --package=@chenmk/superflow@latest superflow-install`(或 `bash install.sh`)会自动把 superflow hooks 注册到 `~/.claude/settings.json`(全局),**本机上所有项目仓库**都获得 superflow 守门。钩子内部靠 `.sdd-enforced` 标记懒激活(没跑 `superflow clarify` 之前所有钩子静默放行,零干扰)。
|
|
116
116
|
>
|
|
117
117
|
> 只有需要项目级产物(OpenSpec change 目录 / `.sdd/` 任务文件 / 团队约定)时,才在项目根目录跑 `superflow init`。**绝大多数项目不需要这一步**——hooks 已经在全局生效了。
|
|
118
118
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const { spawnSync } = require('child_process');
|
|
5
|
+
const { existsSync } = require('fs');
|
|
6
|
+
const { join } = require('path');
|
|
7
|
+
|
|
8
|
+
const NODE_MIN = 20;
|
|
9
|
+
const MAIN = '@chenmk/superflow@latest';
|
|
10
|
+
const NVM_URL = 'https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.7/install.sh';
|
|
11
|
+
|
|
12
|
+
function run(command, args, options) {
|
|
13
|
+
const result = spawnSync(command, args, { stdio: 'inherit', ...options });
|
|
14
|
+
if (result.error) throw result.error;
|
|
15
|
+
if (result.status !== 0) throw new Error(`${command} failed with ${result.status}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function major(version) {
|
|
19
|
+
const match = String(version || '').match(/^v?(\d+)/);
|
|
20
|
+
return match ? Number(match[1]) : 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function main() {
|
|
24
|
+
console.log('[Superflow] Starting one-command installation...');
|
|
25
|
+
if (major(process.version) >= NODE_MIN) {
|
|
26
|
+
run(process.platform === 'win32' ? 'npm.cmd' : 'npm', ['install', '-g', MAIN,
|
|
27
|
+
'--registry', 'https://registry.npmjs.org']);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (process.platform === 'win32') {
|
|
31
|
+
run('winget', ['install', '--id', 'OpenJS.NodeJS', '--exact', '--source', 'winget',
|
|
32
|
+
'--accept-package-agreements', '--accept-source-agreements']);
|
|
33
|
+
const npm = join(process.env.ProgramFiles || 'C:\\Program Files', 'nodejs', 'npm.cmd');
|
|
34
|
+
if (!existsSync(npm)) throw new Error('Node installed; reopen terminal and rerun this command.');
|
|
35
|
+
run(npm, ['install', '-g', MAIN, '--registry', 'https://registry.npmjs.org']);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const home = process.env.HOME;
|
|
39
|
+
if (!home) throw new Error('HOME is required to install Node.js.');
|
|
40
|
+
const nvm = process.env.NVM_DIR || join(home, '.nvm');
|
|
41
|
+
const script = [
|
|
42
|
+
'set -e',
|
|
43
|
+
'export NVM_DIR="$SUPERFLOW_NVM_DIR"',
|
|
44
|
+
'if [ ! -s "$NVM_DIR/nvm.sh" ]; then',
|
|
45
|
+
` curl -fsSL "${NVM_URL}" | bash`,
|
|
46
|
+
'fi',
|
|
47
|
+
'. "$NVM_DIR/nvm.sh"',
|
|
48
|
+
`nvm install ${NODE_MIN}`,
|
|
49
|
+
`nvm use --delete-prefix ${NODE_MIN}`,
|
|
50
|
+
`nvm alias default ${NODE_MIN}`,
|
|
51
|
+
`npm install -g "${MAIN}" --registry https://registry.npmjs.org`,
|
|
52
|
+
'superflow --version',
|
|
53
|
+
].join('\n');
|
|
54
|
+
run('bash', ['-lc', script], { env: { ...process.env, SUPERFLOW_NVM_DIR: nvm } });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (require.main === module) {
|
|
58
|
+
try {
|
|
59
|
+
main();
|
|
60
|
+
console.log('[Superflow] Installation complete. Restart your terminal before using Superflow.');
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error(`[Superflow] Installation failed: ${error.message}`);
|
|
63
|
+
process.exitCode = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
}
|
|
67
|
+
module.exports = { major };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chenmk/superflow-installer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "One-command Node and Superflow installer",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "bin/superflow-installer.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"superflow-installer": "bin/superflow-installer.js"
|
|
9
|
+
},
|
|
10
|
+
"files": ["bin", "README.md"],
|
|
11
|
+
"engines": { "node": ">=14" },
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public",
|
|
14
|
+
"registry": "https://registry.npmjs.org"
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chenmk/superflow",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "SuperBridge Flow workflow CLI for Claude Code and Codex",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
},
|
|
24
24
|
"bin": {
|
|
25
25
|
"superflow": "dist/app/cli.js",
|
|
26
|
-
"superflow-mcp": "dist/mcp/server.js"
|
|
26
|
+
"superflow-mcp": "dist/mcp/server.js",
|
|
27
|
+
"superflow-install": "installer/bin/superflow-installer.cjs"
|
|
27
28
|
},
|
|
28
29
|
"files": [
|
|
29
30
|
"dist",
|
|
31
|
+
"installer",
|
|
30
32
|
"scripts",
|
|
31
33
|
"assets",
|
|
32
34
|
"README.md",
|
|
@@ -40,7 +42,6 @@
|
|
|
40
42
|
"prebuild": "npm run check:design-principles && npm run check:managed-design",
|
|
41
43
|
"build": "node scripts/clean-dist.js && tsc && node scripts/ensure-bin-modes.js",
|
|
42
44
|
"dev": "tsx watch src/cli/index.ts",
|
|
43
|
-
"preinstall": "node scripts/preinstall.js",
|
|
44
45
|
"postinstall": "node scripts/postinstall.js",
|
|
45
46
|
"prepack": "npm run build",
|
|
46
47
|
"prepublishOnly": "npm run release:check && npm test && npm run build",
|
package/scripts/preinstall.js
CHANGED
|
@@ -14,35 +14,35 @@ export function isSupportedNode(version) {
|
|
|
14
14
|
|
|
15
15
|
export function buildNodeVersionMessage(version, language) {
|
|
16
16
|
const commands = [
|
|
17
|
-
' nvm install
|
|
18
|
-
' nvm use
|
|
19
|
-
' nvm alias default
|
|
17
|
+
' nvm install 20',
|
|
18
|
+
' nvm use 20',
|
|
19
|
+
' nvm alias default 20',
|
|
20
20
|
].join('\n');
|
|
21
21
|
|
|
22
22
|
if (language === 'zh') {
|
|
23
23
|
return [
|
|
24
24
|
`[Superflow] 需要 Node.js ${MIN_NODE_MAJOR} 或更高版本,当前检测到 ${version}。`,
|
|
25
25
|
'',
|
|
26
|
-
'请先升级到 Node.js
|
|
26
|
+
'请先升级到 Node.js 20;请改用一键安装器;它会自动安装并设定 Node.js 20。',
|
|
27
27
|
'若已安装 nvm,请运行:',
|
|
28
28
|
commands,
|
|
29
29
|
'',
|
|
30
30
|
'完成后重新打开终端,再运行:',
|
|
31
|
-
'
|
|
32
|
-
'未安装 nvm 时,请用系统包管理器或 https://nodejs.org 安装 Node.js
|
|
31
|
+
' npx --yes --package=@chenmk/superflow@latest superflow-install',
|
|
32
|
+
'未安装 nvm 时,请用系统包管理器或 https://nodejs.org 安装 Node.js 20。',
|
|
33
33
|
].join('\n');
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
return [
|
|
37
37
|
`[Superflow] Node.js ${MIN_NODE_MAJOR} or later is required; detected ${version}.`,
|
|
38
38
|
'',
|
|
39
|
-
'Install Node.js
|
|
39
|
+
'Install Node.js 20 first. Use the one-command installer to install and set Node.js 20 automatically.',
|
|
40
40
|
'If nvm is already installed, run:',
|
|
41
41
|
commands,
|
|
42
42
|
'',
|
|
43
43
|
'Open a new terminal, then rerun:',
|
|
44
|
-
'
|
|
45
|
-
'Without nvm, use your system package manager or https://nodejs.org to install Node.js
|
|
44
|
+
' npx --yes --package=@chenmk/superflow@latest superflow-install',
|
|
45
|
+
'Without nvm, use your system package manager or https://nodejs.org to install Node.js 20.',
|
|
46
46
|
].join('\n');
|
|
47
47
|
}
|
|
48
48
|
|