contextgit 0.0.3 → 0.0.5

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.
@@ -7,6 +7,8 @@ export default class ClaimCmd extends Command {
7
7
  static flags: {
8
8
  ttl: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<number, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
9
9
  status: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
+ 'for-agent-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
11
+ 'thread-id': import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
10
12
  };
11
13
  run(): Promise<void>;
12
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAe,MAAM,aAAa,CAAA;AAIlD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,MAAM,CAAC,WAAW,SAA2E;IAE7F,MAAM,CAAC,IAAI;;MAKV;IAED,MAAM,CAAC,KAAK;;;MAUX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA6B3B"}
1
+ {"version":3,"file":"claim.d.ts","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAe,MAAM,aAAa,CAAA;AAIlD,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;IAC3C,MAAM,CAAC,WAAW,SAA2E;IAE7F,MAAM,CAAC,IAAI;;MAKV;IAED,MAAM,CAAC,KAAK;;;;;MAkBX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgC3B"}
@@ -20,30 +20,40 @@ export default class ClaimCmd extends Command {
20
20
  default: 'proposed',
21
21
  options: ['proposed', 'active'],
22
22
  }),
23
+ 'for-agent-id': Flags.string({
24
+ description: 'Claim on behalf of this agent ID (pre-claiming by orchestrator)',
25
+ required: false,
26
+ }),
27
+ 'thread-id': Flags.string({
28
+ description: 'Direct thread ID link for this claim',
29
+ required: false,
30
+ }),
23
31
  };
24
32
  async run() {
25
33
  const { args, flags } = await this.parse(ClaimCmd);
26
34
  const config = loadConfig();
27
35
  const store = new LocalStore(config.projectId);
28
- // Resolve current branch
29
- const branch = await store.getBranchByGitName(config.projectId, 'main');
30
36
  const branches = await store.listBranches(config.projectId);
31
37
  const activeBranch = branches.find((b) => b.status === 'active') ?? branches[0];
32
38
  if (!activeBranch) {
33
39
  this.error('No branch found. Run contextgit init first.');
34
40
  }
41
+ const agentId = flags['for-agent-id'] ?? `cli-${process.env.USER ?? 'unknown'}`;
35
42
  const claim = await store.claimTask(config.projectId, activeBranch.id, {
36
43
  task: args.task,
37
- agentId: `cli-${process.env.USER ?? 'unknown'}`,
44
+ agentId,
38
45
  role: config.agentRole ?? 'solo',
39
46
  status: flags.status,
40
47
  ttl: flags.ttl * 3_600_000,
48
+ threadId: flags['thread-id'],
41
49
  });
42
50
  this.log(`Claimed.`);
43
- this.log(`ID: ${claim.id}`);
44
- this.log(`Task: ${claim.task}`);
45
- this.log(`Status: ${claim.status}`);
46
- this.log(`TTL: ${flags.ttl}h`);
51
+ this.log(`ID: ${claim.id}`);
52
+ this.log(`Task: ${claim.task}`);
53
+ this.log(`Agent: ${claim.agentId}`);
54
+ this.log(`Thread ID: ${claim.threadId ?? '(none)'}`);
55
+ this.log(`Status: ${claim.status}`);
56
+ this.log(`TTL: ${flags.ttl}h`);
47
57
  store.close();
48
58
  }
49
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"claim.js","sourceRoot":"","sources":["../../src/commands/claim.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE,OAAO,EAAE,OAAO,EAAE,IAAI,E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,CAAC;QAED,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,SAAS,EAAE,CAAA;QAE/E,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,EAAE;YACrE,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO;YACP,IAAI,EAAE,MAAM,CAAC,SAAS,IAAI,MAAM;YAChC,MAAM,EAAE,KAAK,CAAC,MAA+B;YAC7C,GAAG,EAAE,KAAK,CAAC,GAAG,GAAG,SAAS;YAC1B,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC;SAC7B,CAAC,CAAA;QAEF,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QACpB,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;QAClC,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,IAAI,EAAE,CAAC,CAAA;QACpC,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,OAAO,EAAE,CAAC,CAAA;QACvC,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAA;QACpD,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,MAAM,EAAE,CAAC,CAAA;QACtC,IAAI,CAAC,GAAG,CAAC,cAAc,KAAK,CAAC,GAAG,GAAG,CAAC,CAAA;QAEpC,KAAK,CAAC,KAAK,EAAE,CAAA;IACf,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import { Command } from '@oclif/core';
2
2
  export default class CommitCmd extends Command {
3
3
  static description: string;
4
+ static args: {
5
+ message: import("@oclif/core/lib/interfaces/parser.js").Arg<string | undefined, Record<string, unknown>>;
6
+ };
4
7
  static flags: {
5
- message: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
+ message: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
9
  content: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
7
10
  thread: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
8
11
  close: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
@@ -1 +1 @@
1
- {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/commands/commit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAY5C,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SAA4B;IAE9C,MAAM,CAAC,KAAK;;;;;;;MAgCX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA2B3B"}
1
+ {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/commands/commit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAQ,OAAO,EAAS,MAAM,aAAa,CAAA;AAYlD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;IAC5C,MAAM,CAAC,WAAW,SAA4B;IAG9C,MAAM,CAAC,IAAI;;MAKV;IAED,MAAM,CAAC,KAAK;;;;;;;MAgCX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkC3B"}
@@ -1,5 +1,5 @@
1
1
  // commit — record a context commit via engine.commit().
2
- import { Command, Flags } from '@oclif/core';
2
+ import { Args, Command, Flags } from '@oclif/core';
3
3
  import { simpleGit } from 'simple-git';
4
4
  import { bootstrap } from '../bootstrap.js';
5
5
  async function captureGitSha(cwd) {
@@ -12,11 +12,18 @@ async function captureGitSha(cwd) {
12
12
  }
13
13
  export default class CommitCmd extends Command {
14
14
  static description = 'Record a context commit';
15
+ // Positional arg — mirrors git commit behaviour: contextgit commit "message"
16
+ static args = {
17
+ message: Args.string({
18
+ description: 'Short commit message (what was accomplished)',
19
+ required: false,
20
+ }),
21
+ };
15
22
  static flags = {
16
23
  message: Flags.string({
17
24
  char: 'm',
18
- description: 'Short commit message (what was accomplished)',
19
- required: true,
25
+ description: 'Short commit message alternative to positional arg',
26
+ required: false,
20
27
  }),
21
28
  content: Flags.string({
22
29
  char: 'c',
@@ -46,7 +53,12 @@ export default class CommitCmd extends Command {
46
53
  }),
47
54
  };
48
55
  async run() {
49
- const { flags } = await this.parse(CommitCmd);
56
+ const { args, flags } = await this.parse(CommitCmd);
57
+ // Positional arg takes precedence; -m flag is the fallback for scripts/hooks
58
+ const message = args.message ?? flags.message;
59
+ if (!message) {
60
+ this.error('A commit message is required. Usage: contextgit commit "your message" or contextgit commit -m "your message"');
61
+ }
50
62
  const ctx = await bootstrap();
51
63
  const threads = {};
52
64
  if (flags.thread?.length)
@@ -56,8 +68,8 @@ export default class CommitCmd extends Command {
56
68
  }
57
69
  const gitCommitSha = await captureGitSha(process.cwd());
58
70
  const commit = await ctx.engine.commit({
59
- message: flags.message,
60
- content: flags.content ?? flags.message,
71
+ message,
72
+ content: flags.content ?? message,
61
73
  gitCommitSha,
62
74
  ciRunId: flags['ci-run-id'],
63
75
  pipelineName: flags.pipeline,
@@ -1 +1 @@
1
- {"version":3,"file":"commit.js","sourceRoot":"","sources":["../../src/commands/commit.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAExD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,KAAK,UAAU,aAAa,CAAC,GAAW;IACtC,IAAI,CAAC;QACH,OAAO,CA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AAC,QAAQ;YAC5B,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC,CAAA;QAEF,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;QAC5B,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;QACjC,IAAI,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,OAAO,EAAE,CAAC,CAAA;IACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAgB5C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,MAAM,CAAC,WAAW,SAA0C;IAE5D,MAAM,CAAC,KAAK;;;MAUX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CA4F3B"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAS,MAAM,aAAa,CAAA;AAyD5C,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,MAAM,CAAC,WAAW,SAA0C;IAE5D,MAAM,CAAC,KAAK;;;MAWX;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAwJ3B"}
@@ -1,16 +1,56 @@
1
1
  // init — create .contextgit/config.json + project + branch in LocalStore.
2
2
  import { Command, Flags } from '@oclif/core';
3
3
  import { writeFileSync, mkdirSync, existsSync, readFileSync } from 'fs';
4
+ import { createInterface } from 'readline';
4
5
  import { join, basename } from 'path';
5
6
  import { nanoid } from 'nanoid';
6
7
  import { simpleGit } from 'simple-git';
7
8
  import { LocalStore } from '@contextgit/store';
8
9
  import { installGitHooks } from '../git-hooks.js';
10
+ import { detectClients, injectMcpServer } from '../lib/client-config.js';
11
+ const MCP_SYSTEM_PROMPT = `You have access to ContextGit memory tools.
12
+
13
+ At the start of every session, call context_get with scope=global immediately — before reading any files, before asking any questions, before doing any work. Do not skip this step.
14
+
15
+ After completing significant work (a feature, a decision, a resolved problem), call context_commit with a message describing what was done, what was decided, and any open questions. Include the current git branch and commit hash at the top of the message.
16
+
17
+ If you are about to explore a risky or experimental approach, call context_branch first to create an isolated context workspace.`;
9
18
  const SYSTEM_PROMPT_FRAGMENT = `\
10
- You have access to ContextGit memory tools. At the start of every session, call
11
- context_get with scope=global to load project state. After completing significant
12
- work, call context_commit with a message describing what was done and any open
13
- threads. Use context_branch before exploring risky changes.
19
+ You have access to ContextGit memory tools.
20
+
21
+ ## Session Start (do this every time)
22
+ Call context_get with scope=global immediately.
23
+ Do not ask questions first. Read the snapshot, then start working.
24
+ Start the highest priority item from the snapshot.
25
+
26
+ ## What counts as one task (commit after each)
27
+ Match the grain of your plan:
28
+ - Numbered steps in a plan → each numbered step = one commit
29
+ - User stories → each accepted story = one commit
30
+ - No plan → each logical unit of change (one file, one feature, one fix) = one commit
31
+
32
+ Do NOT batch unrelated changes into one commit.
33
+ When in doubt, commit more often rather than less.
34
+
35
+ ## After EVERY completed task
36
+ Immediately, without being asked:
37
+ \`\`\`
38
+ context_commit "what was built | key decisions | next task"
39
+ \`\`\`
40
+ Do not proceed to the next task until the current one is committed.
41
+
42
+ ## When scope changes mid-session
43
+ 1. Write a context_commit with replan: prefix BEFORE building new scope:
44
+ context_commit "replan: <what changed and why>"
45
+ 2. Then build the new scope
46
+ 3. Write a normal context_commit when done
47
+
48
+ ## Session End (do this every time)
49
+ Call context_commit with:
50
+ - what was built
51
+ - key decisions and why
52
+ - open threads
53
+ - the first concrete task for the next session
14
54
  `;
15
55
  export default class Init extends Command {
16
56
  static description = 'Initialize ContextGit in this project';
@@ -23,14 +63,17 @@ export default class Init extends Command {
23
63
  hooks: Flags.boolean({
24
64
  description: 'Install git hooks to auto-capture context on every git commit',
25
65
  default: false,
66
+ allowNo: true, // --no-hooks to explicitly skip and suppress prompt
26
67
  }),
27
68
  };
28
69
  async run() {
29
- const { flags } = await this.parse(Init);
70
+ const { flags, argv } = await this.parse(Init);
30
71
  const cwd = process.cwd();
31
72
  const configDir = join(cwd, '.contextgit');
32
73
  const configPath = join(configDir, 'config.json');
33
74
  const promptPath = join(configDir, 'system-prompt.md');
75
+ // True if the user explicitly passed --hooks or --no-hooks
76
+ const hooksExplicit = argv.some(a => String(a).startsWith('--hooks') || String(a) === '--no-hooks');
34
77
  // ── Self-heal: config exists but DB may be empty ───────────────────────────
35
78
  if (existsSync(configPath)) {
36
79
  let existing;
@@ -44,6 +87,11 @@ export default class Init extends Command {
44
87
  const gitBranch = await detectGitBranch(cwd);
45
88
  const branch = await store.getBranchByGitName(existing.projectId, gitBranch);
46
89
  if (branch) {
90
+ // BUG-2 fix: --hooks on already-initialized project always installs
91
+ if (flags.hooks) {
92
+ installGitHooks(cwd);
93
+ this.log('Git hooks installed (.git/hooks/post-commit, post-checkout, post-merge)');
94
+ }
47
95
  this.log('ContextGit already initialized. Config found at .contextgit/config.json');
48
96
  return;
49
97
  }
@@ -58,7 +106,6 @@ export default class Init extends Command {
58
106
  writeSystemPrompt(promptPath);
59
107
  this.log(`Recreated project "${existing.project}" (${existing.projectId}) for branch: ${gitBranch}`);
60
108
  this.log(`System prompt: .contextgit/system-prompt.md`);
61
- this.log(SYSTEM_PROMPT_FRAGMENT);
62
109
  if (flags.hooks) {
63
110
  installGitHooks(cwd);
64
111
  this.log('Git hooks installed (.git/hooks/post-commit, post-checkout, post-merge)');
@@ -68,7 +115,6 @@ export default class Init extends Command {
68
115
  // ── Fresh init ─────────────────────────────────────────────────────────────
69
116
  const projectName = flags.name ?? basename(cwd);
70
117
  const projectId = nanoid();
71
- // Open store (creates DB + runs migrations).
72
118
  const store = new LocalStore(projectId);
73
119
  await store.createProject({ id: projectId, name: projectName });
74
120
  const gitBranch = await detectGitBranch(cwd);
@@ -77,7 +123,6 @@ export default class Init extends Command {
77
123
  name: `Context: ${gitBranch}`,
78
124
  gitBranch,
79
125
  });
80
- // Write config
81
126
  mkdirSync(configDir, { recursive: true });
82
127
  const config = {
83
128
  project: projectName,
@@ -97,17 +142,73 @@ export default class Init extends Command {
97
142
  this.log(`Config: .contextgit/config.json`);
98
143
  this.log(`DB: ~/.contextgit/projects/${projectId}.db`);
99
144
  this.log(``);
100
- if (flags.hooks) {
145
+ // BUG-3 fix: prompt for hooks unless user was explicit about it
146
+ let installHooks = flags.hooks;
147
+ if (!hooksExplicit) {
148
+ installHooks = await promptYesNo('Install git hooks to auto-capture context on every git commit? (Y/n) ');
149
+ }
150
+ if (installHooks) {
101
151
  installGitHooks(cwd);
102
152
  this.log(`Git hooks installed (.git/hooks/post-commit, post-checkout, post-merge)`);
103
153
  }
104
154
  else {
105
- this.log(`Tip: run "contextgit init --hooks" to auto-capture context on every git commit`);
155
+ this.log(`Skipped hooks. Run "contextgit init --hooks" anytime to install them.`);
106
156
  }
107
157
  this.log(``);
108
- this.log(`Add the following to your MCP system prompt (.contextgit/system-prompt.md):`);
158
+ this.log(`System prompt written to .contextgit/system-prompt.md`);
109
159
  this.log(``);
110
- this.log(SYSTEM_PROMPT_FRAGMENT);
160
+ // ── Auto-configure MCP clients ─────────────────────────────────────────────
161
+ try {
162
+ const clients = detectClients();
163
+ if (clients.length === 0) {
164
+ this.log(`⚠️ No MCP clients detected.`);
165
+ this.log(``);
166
+ this.log(`Add the following to your MCP client config manually:`);
167
+ this.log(``);
168
+ this.log(` "contextgit": {`);
169
+ this.log(` "command": "npx",`);
170
+ this.log(` "args": ["contextgit", "mcp"],`);
171
+ this.log(` "systemPrompt": "${MCP_SYSTEM_PROMPT.replace(/\n/g, '\\n')}"`);
172
+ this.log(` }`);
173
+ this.log(``);
174
+ this.log(`Searched:`);
175
+ this.log(` ~/.claude.json`);
176
+ this.log(` ~/.cursor/mcp.json`);
177
+ this.log(` ~/Library/Application Support/Claude/claude_desktop_config.json`);
178
+ }
179
+ else {
180
+ let anyInjected = false;
181
+ for (const client of clients) {
182
+ const result = injectMcpServer(client.path, client.type, MCP_SYSTEM_PROMPT);
183
+ const label = clientLabel(client.type).padEnd(14);
184
+ const shortPath = client.path.replace(process.env['HOME'] ?? '', '~');
185
+ if (result.status === 'injected') {
186
+ this.log(`✅ Configured ${label} (${shortPath})`);
187
+ anyInjected = true;
188
+ }
189
+ else if (result.status === 'already-present') {
190
+ this.log(`⏭ ${label} already configured (skipped)`);
191
+ }
192
+ else if (result.status === 'error') {
193
+ this.log(`❌ ${label} config error: ${result.reason}`);
194
+ this.log(` Path: ${shortPath}`);
195
+ this.log(` Fix manually or re-run after repairing the file.`);
196
+ }
197
+ else {
198
+ this.log(`⏭ ${label} not found (skipped)`);
199
+ }
200
+ }
201
+ if (anyInjected) {
202
+ this.log(``);
203
+ this.log(`ContextGit is ready. Open Claude Code in this project and start a session.`);
204
+ this.log(`The agent will call context_get automatically on every session start.`);
205
+ }
206
+ }
207
+ }
208
+ catch (err) {
209
+ this.log(`⚠️ Could not auto-configure MCP clients: ${String(err)}`);
210
+ this.log(`Add the MCP server entry manually — see .contextgit/system-prompt.md`);
211
+ }
111
212
  }
112
213
  }
113
214
  // ─── Helpers ──────────────────────────────────────────────────────────────────
@@ -123,4 +224,28 @@ async function detectGitBranch(cwd) {
123
224
  function writeSystemPrompt(promptPath) {
124
225
  writeFileSync(promptPath, SYSTEM_PROMPT_FRAGMENT);
125
226
  }
227
+ function clientLabel(type) {
228
+ if (type === 'claude-code')
229
+ return 'Claude Code';
230
+ if (type === 'cursor')
231
+ return 'Cursor';
232
+ if (type === 'claude-desktop')
233
+ return 'Claude Desktop';
234
+ return type;
235
+ }
236
+ /** Prompt the user with a yes/no question. Defaults to yes on empty input. */
237
+ function promptYesNo(question) {
238
+ return new Promise(resolve => {
239
+ // Non-interactive environment (CI, piped stdin) — default to yes
240
+ if (!process.stdin.isTTY) {
241
+ resolve(true);
242
+ return;
243
+ }
244
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
245
+ rl.question(question, answer => {
246
+ rl.close();
247
+ resolve(answer.trim().toLowerCase() !== 'n');
248
+ });
249
+ });
250
+ }
126
251
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAE1E,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAA;AACvE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM,sBAAsB,GAAG;;;;;CAK9B,CAAA;AAED,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IACvC,MAAM,CAAC,WAAW,GAAG,uCAAuC,CAAA;IAE5D,MAAM,CAAC,KAAK,GAAG;QACb,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,mDAAmD;YAChE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,WAAW,EAAE,+DAA+D;YAC5E,OAAO,EAAE,KAAK;SACf,CAAC;KACH,CAAA;IAED,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QACxC,MA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AA;YACV,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QAC9C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ export type ClientType = 'claude-code' | 'cursor' | 'claude-desktop';
2
+ export interface DetectedClient {
3
+ type: ClientType;
4
+ path: string;
5
+ }
6
+ export interface InjectionResult {
7
+ status: 'injected' | 'already-present' | 'skipped' | 'error';
8
+ reason?: string;
9
+ }
10
+ /** Return all MCP clients whose config file exists on disk. */
11
+ export declare function detectClients(home?: string): DetectedClient[];
12
+ /** Check whether a contextgit entry already exists under mcpServers. */
13
+ export declare function isAlreadyInjected(config: Record<string, unknown>): boolean;
14
+ /**
15
+ * Inject the contextgit MCP server entry into the given client config file.
16
+ * Uses an atomic write (temp file + rename) so the original is never corrupted.
17
+ */
18
+ export declare function injectMcpServer(configPath: string, _clientType: ClientType, systemPrompt: string): InjectionResult;
19
+ //# sourceMappingURL=client-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-config.d.ts","sourceRoot":"","sources":["../../src/lib/client-config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,QAAQ,GAAG,gBAAgB,CAAA;AAEpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAA;IAChB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,UAAU,GAAG,iBAAiB,GAAG,SAAS,GAAG,OAAO,CAAA;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAoBD,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,IAAI,GAAE,MAAkB,GAAG,cAAc,EAAE,CAKxE;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAI1E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,UAAU,EACvB,YAAY,EAAE,MAAM,GACnB,eAAe,CAyCjB"}
@@ -0,0 +1,74 @@
1
+ import { existsSync, readFileSync, writeFileSync, renameSync } from 'fs';
2
+ import { homedir } from 'os';
3
+ import { join } from 'path';
4
+ const MCP_ENTRY = {
5
+ command: 'npx',
6
+ args: ['contextgit', 'mcp'],
7
+ };
8
+ /** Resolve known config paths for each client type. */
9
+ function clientPaths(home) {
10
+ const appData = process.env['APPDATA'] ?? '';
11
+ return {
12
+ 'claude-code': join(home, '.claude.json'),
13
+ 'cursor': join(home, '.cursor', 'mcp.json'),
14
+ 'claude-desktop': process.platform === 'win32'
15
+ ? join(appData, 'Claude', 'claude_desktop_config.json')
16
+ : join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'),
17
+ };
18
+ }
19
+ /** Return all MCP clients whose config file exists on disk. */
20
+ export function detectClients(home = homedir()) {
21
+ const paths = clientPaths(home);
22
+ return Object.keys(paths)
23
+ .filter(type => existsSync(paths[type]))
24
+ .map(type => ({ type, path: paths[type] }));
25
+ }
26
+ /** Check whether a contextgit entry already exists under mcpServers. */
27
+ export function isAlreadyInjected(config) {
28
+ const servers = config['mcpServers'] ?? config['globalShortcuts']?.['mcpServers'];
29
+ if (!servers || typeof servers !== 'object')
30
+ return false;
31
+ return 'contextgit' in servers;
32
+ }
33
+ /**
34
+ * Inject the contextgit MCP server entry into the given client config file.
35
+ * Uses an atomic write (temp file + rename) so the original is never corrupted.
36
+ */
37
+ export function injectMcpServer(configPath, _clientType, systemPrompt) {
38
+ // Read existing content — create empty object if file doesn't exist
39
+ let raw = '{}';
40
+ if (existsSync(configPath)) {
41
+ raw = readFileSync(configPath, 'utf8');
42
+ }
43
+ let config;
44
+ try {
45
+ config = JSON.parse(raw);
46
+ }
47
+ catch {
48
+ return {
49
+ status: 'error',
50
+ reason: 'existing config is not valid JSON — skipped to avoid data loss',
51
+ };
52
+ }
53
+ if (isAlreadyInjected(config)) {
54
+ return { status: 'already-present' };
55
+ }
56
+ // Resolve the mcpServers object — handle Claude Desktop's globalShortcuts wrapper
57
+ let target;
58
+ if (config['globalShortcuts'] &&
59
+ typeof config['globalShortcuts'] === 'object' &&
60
+ 'mcpServers' in config['globalShortcuts']) {
61
+ target = config['globalShortcuts']['mcpServers'];
62
+ }
63
+ else {
64
+ if (!config['mcpServers'])
65
+ config['mcpServers'] = {};
66
+ target = config['mcpServers'];
67
+ }
68
+ target['contextgit'] = { ...MCP_ENTRY, systemPrompt };
69
+ const tmpPath = configPath + '.contextgit-tmp';
70
+ writeFileSync(tmpPath, JSON.stringify(config, null, 2) + '\n', 'utf8');
71
+ renameSync(tmpPath, configPath);
72
+ return { status: 'injected' };
73
+ }
74
+ //# sourceMappingURL=client-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-config.js","sourceRoot":"","sources":["../../src/lib/client-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAc3B,MAAM,SAAS,GAAG;IAChB,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,CAAC,YAAY,EAAE,KAAK,CAAC;CAC5B,CAAA;AAED,uDAAuD;AACvD,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IAC5C,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC;QACzC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC;QAC3C,gBAAgB,EACd,OAAO,CAAC,QAAQ,KAAK,OA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4B,CAAA;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO;YACL,MAAM,EAAE,OAAO;YACf,MAAM,EAAE,gEAAgE;SACzE,CAAA;IACH,CAAC;IAED,IAAI,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAA;IACtC,CAAC;IAED,kFAAkF;IAClF,IAAI,MAA+B,CAAA;IACnC,IACE,MAAM,CAAC,iBAAiB,CAAC;QACzB,OAAO,MAAM,CAAC,iBAAiB,CAAC,KAAK,QAAQ;QAC7C,YAAY,IAAK,MAAM,CAAC,iBAAiB,CAAY,EACrD,CAAC;QACD,MAAM,GAAI,MAAM,CAAC,iBAAiB,CAA6B,CAAC,YAAY,CAA4B,CAAA;IAC1G,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;YAAE,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAA;QACpD,MAAM,GAAG,MAAM,CAAC,YAAY,CAA4B,CAAA;IAC1D,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,YAAY,EAAE,CAAA;IAErD,MAAM,OAAO,GAAG,UAAU,GAAG,iBAAiB,CAAA;IAC9C,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,CAAA;IACtE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAE/B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAA;AAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client-config.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-config.test.d.ts","sourceRoot":"","sources":["../../src/lib/client-config.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,97 @@
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
+ import { mkdtempSync, rmSync, writeFileSync, readFileSync, existsSync } from 'fs';
3
+ import { tmpdir } from 'os';
4
+ import { join } from 'path';
5
+ import { detectClients, injectMcpServer, isAlreadyInjected } from './client-config.js';
6
+ const SYSTEM_PROMPT = 'test system prompt';
7
+ let tmpDir;
8
+ beforeEach(() => {
9
+ tmpDir = mkdtempSync(join(tmpdir(), 'contextgit-test-'));
10
+ });
11
+ afterEach(() => {
12
+ rmSync(tmpDir, { recursive: true, force: true });
13
+ });
14
+ // 1. detectClients returns empty array when no config files exist
15
+ it('detectClients returns empty array when no config files exist', () => {
16
+ const result = detectClients(tmpDir);
17
+ expect(result).toEqual([]);
18
+ });
19
+ // 2. detectClients returns Claude Code entry when ~/.claude.json exists
20
+ it('detectClients returns claude-code when .claude.json exists', () => {
21
+ writeFileSync(join(tmpDir, '.claude.json'), '{}');
22
+ const result = detectClients(tmpDir);
23
+ expect(result).toHaveLength(1);
24
+ expect(result[0].type).toBe('claude-code');
25
+ expect(result[0].path).toBe(join(tmpDir, '.claude.json'));
26
+ });
27
+ // 3. injectMcpServer writes correct JSON structure to a new empty config file
28
+ it('injectMcpServer writes correct JSON to a new empty config file', () => {
29
+ const configPath = join(tmpDir, '.claude.json');
30
+ // file does not exist yet
31
+ const result = injectMcpServer(configPath, 'claude-code', SYSTEM_PROMPT);
32
+ expect(result.status).toBe('injected');
33
+ const written = JSON.parse(readFileSync(configPath, 'utf8'));
34
+ const servers = written['mcpServers'];
35
+ expect(servers).toBeDefined();
36
+ const entry = servers['contextgit'];
37
+ expect(entry['command']).toBe('npx');
38
+ expect(entry['args']).toEqual(['contextgit', 'mcp']);
39
+ expect(entry['systemPrompt']).toBe(SYSTEM_PROMPT);
40
+ });
41
+ // 4. injectMcpServer merges into existing config without touching other keys
42
+ it('injectMcpServer merges without touching other keys', () => {
43
+ const configPath = join(tmpDir, '.claude.json');
44
+ writeFileSync(configPath, JSON.stringify({
45
+ someOtherKey: 'keep-me',
46
+ mcpServers: { 'other-server': { command: 'npx', args: ['other'] } },
47
+ }));
48
+ const result = injectMcpServer(configPath, 'claude-code', SYSTEM_PROMPT);
49
+ expect(result.status).toBe('injected');
50
+ const written = JSON.parse(readFileSync(configPath, 'utf8'));
51
+ expect(written['someOtherKey']).toBe('keep-me');
52
+ const servers = written['mcpServers'];
53
+ expect(servers['other-server']).toBeDefined();
54
+ expect(servers['contextgit']).toBeDefined();
55
+ });
56
+ // 5. injectMcpServer returns already-present if contextgit key exists
57
+ it('injectMcpServer returns already-present if contextgit exists', () => {
58
+ const configPath = join(tmpDir, '.claude.json');
59
+ writeFileSync(configPath, JSON.stringify({
60
+ mcpServers: { contextgit: { command: 'npx', args: ['contextgit', 'mcp'] } },
61
+ }));
62
+ const result = injectMcpServer(configPath, 'claude-code', SYSTEM_PROMPT);
63
+ expect(result.status).toBe('already-present');
64
+ });
65
+ // 6. injectMcpServer returns error and does not write if existing file is invalid JSON
66
+ it('injectMcpServer returns error and does not write if file is invalid JSON', () => {
67
+ const configPath = join(tmpDir, '.claude.json');
68
+ writeFileSync(configPath, 'NOT JSON {{{');
69
+ const originalContent = readFileSync(configPath, 'utf8');
70
+ const result = injectMcpServer(configPath, 'claude-code', SYSTEM_PROMPT);
71
+ expect(result.status).toBe('error');
72
+ expect(result.reason).toContain('not valid JSON');
73
+ // File must not have been overwritten
74
+ expect(readFileSync(configPath, 'utf8')).toBe(originalContent);
75
+ });
76
+ // 7. injectMcpServer uses atomic write (temp file + rename)
77
+ it('injectMcpServer cleans up temp file after write', () => {
78
+ const configPath = join(tmpDir, '.claude.json');
79
+ injectMcpServer(configPath, 'claude-code', SYSTEM_PROMPT);
80
+ // Temp file should not exist after successful rename
81
+ expect(existsSync(configPath + '.contextgit-tmp')).toBe(false);
82
+ // Final file should exist
83
+ expect(existsSync(configPath)).toBe(true);
84
+ });
85
+ // 8. isAlreadyInjected returns true when contextgit is present under mcpServers
86
+ describe('isAlreadyInjected', () => {
87
+ it('returns true when contextgit is under mcpServers', () => {
88
+ expect(isAlreadyInjected({ mcpServers: { contextgit: {} } })).toBe(true);
89
+ });
90
+ it('returns false when contextgit is absent', () => {
91
+ expect(isAlreadyInjected({ mcpServers: { other: {} } })).toBe(false);
92
+ });
93
+ it('returns false when mcpServers is missing', () => {
94
+ expect(isAlreadyInjected({})).toBe(false);
95
+ });
96
+ });
97
+ //# sourceMappingURL=client-config.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-config.test.js","sourceRoot":"","sources":["../../src/lib/client-config.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAa,UAAU,EAAE,MAAM,IAAI,CAAA;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtF,MAAM,aAAa,GAAG,oBAAoB,CAAA;AAE1C,IAAI,MAAc,CAAA;AAElB,UAAU,CAAC,GAAG,EAAE;IACd,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAA;AAC1D,CAAC,CAAC,CAAA;AAEF,SAAS,CAAC,GAAG,EAAE;IACb,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA;AAEF,kEAAkE;AAClE,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;IACtE,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;IACpC,MAAM,CAAC,MAAM,CAAC,CAAC,OA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BAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC9D,0BAA0B;IAC1B,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3C,CAAC,CAAC,CAAA;AAEF,gFAAgF;AAChF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC1E,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACtE,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contextgit",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "contextgit": "./bin/run.js"
@@ -10,15 +10,18 @@
10
10
  "dirname": "contextgit",
11
11
  "commands": "./dist/commands"
12
12
  },
13
- "files": ["dist", "bin"],
13
+ "files": [
14
+ "dist",
15
+ "bin"
16
+ ],
14
17
  "scripts": {
15
18
  "build": "tsc",
16
19
  "typecheck": "tsc --noEmit"
17
20
  },
18
21
  "dependencies": {
19
- "@contextgit/core": "0.0.3",
20
- "@contextgit/store": "0.0.3",
21
- "@contextgit/api": "0.0.3",
22
+ "@contextgit/core": "workspace:*",
23
+ "@contextgit/store": "workspace:*",
24
+ "@contextgit/api": "workspace:*",
22
25
  "@oclif/core": "^3.27.0",
23
26
  "nanoid": "^5.0.0",
24
27
  "simple-git": "^3.27.0"
@@ -27,4 +30,4 @@
27
30
  "@types/node": "^20.0.0",
28
31
  "typescript": "^5.4.0"
29
32
  }
30
- }
33
+ }