nikou-cli 0.1.1 → 0.1.4
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/README.md +2 -2
- package/dist/ai-hook.d.ts +1 -0
- package/dist/ai-hook.js +12 -0
- package/dist/chunk-F3EPGM5N.js +25 -0
- package/dist/index.js +415 -447
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -168,11 +168,11 @@ nikou-cli hook init
|
|
|
168
168
|
安装后也可以用 `ai-hook` 入口完成 Hook 初始化与启动:
|
|
169
169
|
|
|
170
170
|
```bash
|
|
171
|
-
|
|
171
|
+
ai-hook init
|
|
172
172
|
ai-hook
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
初始化时会提示主节点地址:如果旧配置里已有主节点,直接回车沿用;没有默认值时输入 IP 或域名即可。`ai-hook` 默认等价于 `nikou-cli hook worker codex`;如需 Claude:
|
|
176
176
|
|
|
177
177
|
```bash
|
|
178
178
|
ai-hook claude --model opus
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
package/dist/ai-hook.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/cli-entry.ts
|
|
2
|
+
import path from "path";
|
|
3
|
+
var AI_HOOK_COMMAND_NAMES = /* @__PURE__ */ new Set(["ai-hook", "ai-hook.cmd", "ai-hook.exe"]);
|
|
4
|
+
var HOOK_SUBCOMMANDS = /* @__PURE__ */ new Set(["master", "init", "worker", "log", "help"]);
|
|
5
|
+
function normalizeCliArgs(commandPath, args) {
|
|
6
|
+
const commandName = path.basename(commandPath || "");
|
|
7
|
+
if (!AI_HOOK_COMMAND_NAMES.has(commandName)) {
|
|
8
|
+
return args;
|
|
9
|
+
}
|
|
10
|
+
const [firstArg = "", ...restArgs] = args;
|
|
11
|
+
if (firstArg === "hook") {
|
|
12
|
+
return args;
|
|
13
|
+
}
|
|
14
|
+
if (HOOK_SUBCOMMANDS.has(firstArg)) {
|
|
15
|
+
return ["hook", ...args];
|
|
16
|
+
}
|
|
17
|
+
if (!firstArg || firstArg.startsWith("-")) {
|
|
18
|
+
return ["hook", "worker", "codex", ...args];
|
|
19
|
+
}
|
|
20
|
+
return ["hook", "worker", firstArg, ...restArgs];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
normalizeCliArgs
|
|
25
|
+
};
|