thingd-cli 0.6.0 → 0.7.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAY7C,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAyCnE"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAY7C,wBAAsB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDnE"}
package/dist/install.js CHANGED
@@ -9,12 +9,23 @@ export async function runInstall(context) {
9
9
  const dbPath = defaultThingdDbPath();
10
10
  const driver = detectDriver();
11
11
  ensureThingdDir();
12
- const config = generateMcpConfig(nodePath, cliPath, dbPath, driver);
12
+ const globalBin = findGlobalBinPath();
13
+ const config = globalBin
14
+ ? {
15
+ command: globalBin,
16
+ args: ["mcp", "--path", dbPath, "--driver", driver],
17
+ }
18
+ : generateMcpConfig(nodePath, cliPath, dbPath, driver);
13
19
  context.stderr.write(`\n${pc.bold("thingd install")}\n\n`);
14
20
  context.stderr.write(` ${pc.green("✓")} Database path: ${pc.cyan(dbPath)}\n`);
15
21
  context.stderr.write(` ${pc.green("✓")} Driver: ${pc.cyan(driver)}\n`);
16
- context.stderr.write(` ${pc.green("✓")} Node: ${pc.cyan(nodePath)}\n`);
17
- context.stderr.write(` ${pc.green("✓")} CLI: ${pc.cyan(cliPath)}\n\n`);
22
+ if (globalBin) {
23
+ context.stderr.write(` ${pc.green("✓")} Command: ${pc.cyan(globalBin)}\n\n`);
24
+ }
25
+ else {
26
+ context.stderr.write(` ${pc.green("✓")} Node: ${pc.cyan(nodePath)}\n`);
27
+ context.stderr.write(` ${pc.green("✓")} CLI: ${pc.cyan(cliPath)}\n\n`);
28
+ }
18
29
  const claudeResult = updateClaudeDesktopConfig(config);
19
30
  if (claudeResult.updated) {
20
31
  context.stderr.write(` ${pc.bold("Claude Desktop:")}\n`);
@@ -34,6 +45,22 @@ export async function runInstall(context) {
34
45
  context.stdout.write(`${JSON.stringify(fullConfig, null, 2)}\n`);
35
46
  context.stderr.write(`\n Restart Claude Desktop to activate. Cursor activates immediately after pasting.\n\n`);
36
47
  }
48
+ function findGlobalBinPath() {
49
+ try {
50
+ const cliPath = resolveCliPath();
51
+ // In standard npm/nvm/pnpm global installations:
52
+ // CLI is at <prefix>/lib/node_modules/thingd-cli/dist/index.js
53
+ // Binary is at <prefix>/bin/thingd
54
+ const candidate = resolve(cliPath, "../../../../../bin/thingd");
55
+ if (existsSync(candidate)) {
56
+ return candidate;
57
+ }
58
+ }
59
+ catch {
60
+ // Ignore
61
+ }
62
+ return null;
63
+ }
37
64
  function resolveCliPath() {
38
65
  const scriptPath = process.argv[1];
39
66
  if (!scriptPath) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thingd-cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Admin and operator CLI for thingd.",
5
5
  "type": "module",
6
6
  "author": "Sayan Mohsin",
@@ -33,7 +33,7 @@
33
33
  "cli-table3": "^0.6.5",
34
34
  "picocolors": "^1.1.1",
35
35
  "zod": "^4.4.3",
36
- "thingd": "0.6.0"
36
+ "thingd": "0.7.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=20"