@insforge/install 0.0.35 → 0.0.37

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 (2) hide show
  1. package/dist/index.js +53 -0
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -190,6 +190,59 @@ import {
190
190
  };
191
191
  writeConfig(config, argv.client);
192
192
  }
193
+
194
+ // Fetch instructions documentation once (only in dev mode)
195
+ if (argv.dev) {
196
+ let instructionsContent = null;
197
+ try {
198
+ const fetch = (await import('node-fetch')).default;
199
+ const fs = await import('fs');
200
+ const apiBaseUrl = envVars.API_BASE_URL || "http://localhost:7130";
201
+ const response = await fetch(`${apiBaseUrl}/api/docs/instructions`);
202
+
203
+ if (response.ok) {
204
+ const result = await response.json();
205
+ if (result && result.content) {
206
+ instructionsContent = result.content;
207
+ }
208
+ }
209
+ } catch (fetchError) {
210
+ logger.warn(`Could not download instructions: ${fetchError.message}`);
211
+ }
212
+
213
+ // Save instructions to appropriate files based on client
214
+ if (instructionsContent) {
215
+ const fs = await import('fs');
216
+ const frontmatter = `---
217
+ description: Instructions building apps with MCP
218
+ globs: *
219
+ alwaysApply: true
220
+ ---
221
+
222
+ `;
223
+ const contentWithFrontmatter = frontmatter + instructionsContent;
224
+
225
+ // Save CLAUDE.md for claude-code client
226
+ if (argv.client === "claude-code") {
227
+ const claudeMdPath = path.join(process.cwd(), 'CLAUDE.md');
228
+ fs.writeFileSync(claudeMdPath, contentWithFrontmatter, 'utf-8');
229
+ logger.info(`Saved instructions to: ${claudeMdPath}`);
230
+ }
231
+
232
+ // Save cursor rules for cursor client
233
+ if (argv.client === "cursor") {
234
+ const cursorRulesDir = path.join(process.cwd(), '.cursor', 'rules');
235
+ const cursorRulesPath = path.join(cursorRulesDir, 'cursor-rules.mdc');
236
+
237
+ if (!fs.existsSync(cursorRulesDir)) {
238
+ fs.mkdirSync(cursorRulesDir, { recursive: true });
239
+ }
240
+ fs.writeFileSync(cursorRulesPath, contentWithFrontmatter, 'utf-8');
241
+ logger.info(`Saved cursor rules to: ${cursorRulesPath}`);
242
+ }
243
+ }
244
+ }
245
+
193
246
  logger.box(green(`Successfully installed Insforge MCP server in ${argv.client}.`));
194
247
  } catch (e) {
195
248
  logger.error(red(e.message));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@insforge/install",
3
- "version": "0.0.35",
3
+ "version": "0.0.37",
4
4
  "description": "CLI tool for installing Insforge MCP servers across different AI clients",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,9 +11,10 @@
11
11
  "start": "node dist/index.js"
12
12
  },
13
13
  "dependencies": {
14
- "yargs": "^17.7.2",
14
+ "consola": "^3.2.3",
15
+ "node-fetch": "^3.3.2",
15
16
  "picocolors": "^1.0.0",
16
- "consola": "^3.2.3"
17
+ "yargs": "^17.7.2"
17
18
  },
18
19
  "keywords": [
19
20
  "insforge",