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 CHANGED
@@ -168,11 +168,11 @@ nikou-cli hook init
168
168
  安装后也可以用 `ai-hook` 入口完成 Hook 初始化与启动:
169
169
 
170
170
  ```bash
171
- NIKOU_HOOK_MASTER_HOST=203.0.113.10 ai-hook init
171
+ ai-hook init
172
172
  ai-hook
173
173
  ```
174
174
 
175
- 其中 `ai-hook` 默认等价于 `nikou-cli hook worker codex`;如需 Claude:
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
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ normalizeCliArgs
4
+ } from "./chunk-F3EPGM5N.js";
5
+
6
+ // src/ai-hook.ts
7
+ process.argv = [
8
+ process.argv[0],
9
+ "ai-hook",
10
+ ...normalizeCliArgs("ai-hook", process.argv.slice(2))
11
+ ];
12
+ await import("./index.js");
@@ -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
+ };