@emqo/claudebridge 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/dist/cli.js +13 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -28,10 +28,15 @@ function removePid() { try {
28
28
  }
29
29
  catch { } }
30
30
  const args = process.argv.slice(2);
31
+ if (args.includes("--help") || args.includes("-h")) {
32
+ console.log("Usage: claudebridge <start|stop|status|reload|init> [--config path] [--daemon|-d]");
33
+ process.exit(0);
34
+ }
31
35
  const cmd = args.find(a => !a.startsWith("-")) || "start";
32
36
  const cfgIdx = args.indexOf("--config");
33
37
  const cfgPath = cfgIdx !== -1 ? args[cfgIdx + 1] : undefined;
34
38
  const daemon = args.includes("--daemon") || args.includes("-d");
39
+ const DEFAULT_CFG = join(DIR, "config.yaml");
35
40
  switch (cmd) {
36
41
  case "start": {
37
42
  const existing = readPid();
@@ -39,7 +44,8 @@ switch (cmd) {
39
44
  console.log(`Already running (PID ${existing})`);
40
45
  process.exit(0);
41
46
  }
42
- const childArgs = [ENTRY, ...(cfgPath ? ["--config", cfgPath] : [])];
47
+ const resolvedCfg = cfgPath || DEFAULT_CFG;
48
+ const childArgs = [ENTRY, "--config", resolvedCfg];
43
49
  if (daemon) {
44
50
  ensureDir();
45
51
  const { openSync } = await import("fs");
@@ -92,8 +98,10 @@ switch (cmd) {
92
98
  break;
93
99
  }
94
100
  case "init": {
95
- if (existsSync("config.yaml")) {
96
- console.log("config.yaml already exists");
101
+ ensureDir();
102
+ const target = cfgPath || DEFAULT_CFG;
103
+ if (existsSync(target)) {
104
+ console.log(`${target} already exists`);
97
105
  process.exit(0);
98
106
  }
99
107
  const example = join(__dirname, "..", "config.yaml.example");
@@ -101,8 +109,8 @@ switch (cmd) {
101
109
  console.error("config.yaml.example not found");
102
110
  process.exit(1);
103
111
  }
104
- copyFileSync(example, "config.yaml");
105
- console.log("Created config.yaml from template");
112
+ copyFileSync(example, target);
113
+ console.log(`Created ${target} from template`);
106
114
  break;
107
115
  }
108
116
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emqo/claudebridge",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Bridge Claude Code Agent SDK to chat platforms (Telegram, Discord, etc.)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {