@eventmodelers/node-kit 0.0.2 → 0.0.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.
Files changed (3) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/src/cli.js +57 -7
package/README.md CHANGED
@@ -5,7 +5,7 @@ Real-time Claude agent + skill kit for the [Eventmodelers](https://eventmodelers
5
5
  ## Quick start
6
6
 
7
7
  ```bash
8
- npx @eventmodelers/agent-kit install
8
+ npx @eventmodelers/node-kit install
9
9
  ```
10
10
 
11
11
  The installer will prompt for:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventmodelers/node-kit",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "Real-time Claude agent that reacts to slice:changed events on an Eventmodelers board",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -15,6 +15,17 @@ import {
15
15
  appendFileSync,
16
16
  } from 'fs';
17
17
  import { execSync } from 'child_process';
18
+ import { createInterface } from 'readline';
19
+
20
+ async function prompt(question) {
21
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
22
+ return new Promise((resolve) => {
23
+ rl.question(question, (answer) => {
24
+ rl.close();
25
+ resolve(answer.trim());
26
+ });
27
+ });
28
+ }
18
29
 
19
30
  const __filename = fileURLToPath(import.meta.url);
20
31
  const __dirname = dirname(__filename);
@@ -29,7 +40,7 @@ program
29
40
  program
30
41
  .command('install')
31
42
  .description('Install ralph-li into the current directory')
32
- .action(() => {
43
+ .action(async () => {
33
44
  console.log('šŸš€ ralph-li\n');
34
45
 
35
46
  const targetDir = process.cwd();
@@ -107,16 +118,55 @@ program
107
118
  writeFileSync(gitignorePath, `${gitignoreEntry}\n`);
108
119
  }
109
120
 
110
- // Create empty config file if it doesn't exist
121
+ // Create or populate config file
111
122
  const configDir = join(targetDir, '.eventmodelers');
112
123
  const configPath = join(configDir, 'config.json');
113
124
  mkdirSync(configDir, { recursive: true });
114
- if (!existsSync(configPath)) {
115
- writeFileSync(configPath, '{}');
125
+
126
+ let config = {};
127
+ if (existsSync(configPath)) {
128
+ try {
129
+ config = JSON.parse(readFileSync(configPath, 'utf-8'));
130
+ } catch {
131
+ config = {};
132
+ }
133
+ }
134
+
135
+ const hasConfig = config.organizationId && config.boardId && config.token;
136
+ if (!hasConfig) {
137
+ console.log('\nšŸ”‘ Enter your Eventmodelers credentials:\n');
138
+ config.organizationId = config.organizationId || await prompt(' Organization ID: ');
139
+ config.boardId = config.boardId || await prompt(' Board ID: ');
140
+ config.token = config.token || await prompt(' Token: ');
141
+ writeFileSync(configPath, JSON.stringify(config, null, 2));
142
+ console.log('\n āœ“ Credentials saved to .eventmodelers/config.json');
143
+ } else {
144
+ console.log('\n āœ“ Config already present — skipping credential prompt');
116
145
  }
117
- console.log('\nšŸ”‘ Next: add your credentials to .eventmodelers/config.json');
118
- console.log(' Copy the config from https://app.eventmodelers.de/account and paste it into that file.');
119
- console.log(' Also add the boardId of the board you want to watch.');
146
+
147
+ // Configure MCP server in .claude/settings.json
148
+ const claudeDir = join(targetDir, '.claude');
149
+ const settingsPath = join(claudeDir, 'settings.json');
150
+ mkdirSync(claudeDir, { recursive: true });
151
+
152
+ let settings = {};
153
+ if (existsSync(settingsPath)) {
154
+ try {
155
+ settings = JSON.parse(readFileSync(settingsPath, 'utf-8'));
156
+ } catch {
157
+ settings = {};
158
+ }
159
+ }
160
+
161
+ const baseUrl = config.baseUrl || 'https://api.eventmodelers.de';
162
+ settings.mcpServers = settings.mcpServers || {};
163
+ settings.mcpServers.eventmodelers = {
164
+ type: 'http',
165
+ url: `${baseUrl}/mcp`,
166
+ };
167
+
168
+ writeFileSync(settingsPath, JSON.stringify(settings, null, 2));
169
+ console.log(' āœ“ MCP server configured in .claude/settings.json');
120
170
 
121
171
  console.log('\nāœ… Done!\n');
122
172
  console.log('Next steps — run both in separate terminals:\n');