@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.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/cli.js +57 -7
package/README.md
CHANGED
package/package.json
CHANGED
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
|
|
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
|
-
|
|
115
|
-
|
|
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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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');
|