kodingo-cli 1.0.8 → 1.0.10

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.
@@ -75,16 +75,6 @@ async function runDoctor(results) {
75
75
  tempId = null; // already deleted — skip outer cleanup
76
76
  }, results);
77
77
  // ── Shared: environment checks ──────────────────────────────────────────────
78
- if (process.env.ANTHROPIC_API_KEY) {
79
- results.push({ name: "ANTHROPIC_API_KEY is set", ok: true });
80
- }
81
- else {
82
- results.push({
83
- name: "ANTHROPIC_API_KEY is not set",
84
- ok: "warn",
85
- message: "git inference will use fallback summaries",
86
- });
87
- }
88
78
  const repoRoot = findRepoRoot(process.cwd());
89
79
  const hookPath = path_1.default.join(repoRoot, ".git", "hooks", "post-commit");
90
80
  if (fs_1.default.existsSync(hookPath) &&
@@ -38,10 +38,26 @@ var __importStar = (this && this.__importStar) || (function () {
38
38
  return result;
39
39
  };
40
40
  })();
41
+ var __importDefault = (this && this.__importDefault) || function (mod) {
42
+ return (mod && mod.__esModule) ? mod : { "default": mod };
43
+ };
41
44
  Object.defineProperty(exports, "__esModule", { value: true });
42
45
  exports.registerInitCommand = registerInitCommand;
43
46
  const readline = __importStar(require("node:readline"));
44
47
  const persistence_config_1 = require("../utils/persistence-config");
48
+ const path_1 = __importDefault(require("path"));
49
+ const fs_1 = __importDefault(require("fs"));
50
+ function findRepoRoot(startPath) {
51
+ let current = startPath;
52
+ while (true) {
53
+ if (fs_1.default.existsSync(path_1.default.join(current, ".git")))
54
+ return current;
55
+ const parent = path_1.default.dirname(current);
56
+ if (parent === current)
57
+ return startPath;
58
+ current = parent;
59
+ }
60
+ }
45
61
  // ── Prompt helper ─────────────────────────────────────────────────────────────
46
62
  function prompt(rl, question) {
47
63
  return new Promise((resolve) => rl.question(question, (ans) => resolve(ans.trim())));
@@ -119,6 +135,9 @@ function registerInitCommand(program) {
119
135
  await verifyCloudConnection(apiUrl, token);
120
136
  const config = { mode: "cloud", apiUrl, token };
121
137
  (0, persistence_config_1.writeConfig)(config);
138
+ // Also save workspace-specific config scoped to this repo
139
+ const repoRoot = findRepoRoot(process.cwd());
140
+ (0, persistence_config_1.writeWorkspaceConfig)(repoRoot, { mode: "cloud", apiUrl, token });
122
141
  console.log(`\n✔ Cloud mode configured successfully.`);
123
142
  console.log(` API URL : ${apiUrl}`);
124
143
  console.log(` Config : ${persistence_config_1.CONFIG_PATH}`);
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CONFIG_PATH = void 0;
7
7
  exports.readConfig = readConfig;
8
8
  exports.writeConfig = writeConfig;
9
+ exports.writeWorkspaceConfig = writeWorkspaceConfig;
10
+ exports.readWorkspaceConfig = readWorkspaceConfig;
9
11
  exports.isCloudMode = isCloudMode;
10
12
  exports.getPersistence = getPersistence;
11
13
  /**
@@ -46,6 +48,16 @@ function writeConfig(config) {
46
48
  }
47
49
  node_fs_1.default.writeFileSync(exports.CONFIG_PATH, JSON.stringify(config, null, 2), "utf-8");
48
50
  }
51
+ function writeWorkspaceConfig(repoPath, wsConfig) {
52
+ const existing = readConfig();
53
+ const workspaces = existing.workspaces ?? {};
54
+ workspaces[repoPath] = wsConfig;
55
+ writeConfig({ ...existing, workspaces });
56
+ }
57
+ function readWorkspaceConfig(repoPath) {
58
+ const config = readConfig();
59
+ return config.workspaces?.[repoPath] ?? null;
60
+ }
49
61
  function isCloudMode() {
50
62
  return readConfig().mode === "cloud";
51
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -33,4 +33,4 @@
33
33
  "@types/uuid": "^10.0.0",
34
34
  "typescript": "^5.6.0"
35
35
  }
36
- }
36
+ }