@lifeaitools/clauth 0.4.0 → 0.4.1
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/cli/commands/install.js +26 -0
- package/cli/index.js +1 -1
- package/package.json +1 -1
package/cli/commands/install.js
CHANGED
|
@@ -248,6 +248,32 @@ export async function runInstall(opts = {}) {
|
|
|
248
248
|
s9.warn('Skill directory not found — skipping');
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
+
// ── Step 9.5: Install MCP server config ───
|
|
252
|
+
const s95 = ora('Configuring MCP server for Claude Code...').start();
|
|
253
|
+
try {
|
|
254
|
+
const mcpJsonPath = join(
|
|
255
|
+
process.platform === 'win32' ? process.env.USERPROFILE : process.env.HOME,
|
|
256
|
+
'.mcp.json'
|
|
257
|
+
);
|
|
258
|
+
const cliEntry = join(ROOT, 'cli', 'index.js').replace(/\\/g, '/');
|
|
259
|
+
let mcpConfig = {};
|
|
260
|
+
if (existsSync(mcpJsonPath)) {
|
|
261
|
+
try { mcpConfig = JSON.parse(readFileSync(mcpJsonPath, 'utf8')); } catch {}
|
|
262
|
+
}
|
|
263
|
+
if (!mcpConfig.mcpServers) mcpConfig.mcpServers = {};
|
|
264
|
+
mcpConfig.mcpServers.clauth = {
|
|
265
|
+
command: 'node',
|
|
266
|
+
args: [cliEntry, 'serve', '--action', 'mcp'],
|
|
267
|
+
};
|
|
268
|
+
const { writeFileSync } = await import('fs');
|
|
269
|
+
writeFileSync(mcpJsonPath, JSON.stringify(mcpConfig, null, 2) + '\n', 'utf8');
|
|
270
|
+
s95.succeed(`MCP server config → ${mcpJsonPath}`);
|
|
271
|
+
} catch (e) {
|
|
272
|
+
s95.warn(`MCP config skipped: ${e.message}`);
|
|
273
|
+
console.log(chalk.yellow(' Add manually to ~/.mcp.json:'));
|
|
274
|
+
console.log(chalk.gray(` { "mcpServers": { "clauth": { "command": "node", "args": ["${join(ROOT, 'cli', 'index.js').replace(/\\/g, '/')}", "serve", "--action", "mcp"] } } }`));
|
|
275
|
+
}
|
|
276
|
+
|
|
251
277
|
// ── Step 10: Done ─────────────────────────
|
|
252
278
|
console.log('');
|
|
253
279
|
console.log(chalk.cyan('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
package/cli/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import * as api from "./api.js";
|
|
|
12
12
|
import os from "os";
|
|
13
13
|
|
|
14
14
|
const config = new Conf(getConfOptions());
|
|
15
|
-
const VERSION = "0.4.
|
|
15
|
+
const VERSION = "0.4.1";
|
|
16
16
|
|
|
17
17
|
// ============================================================
|
|
18
18
|
// Password prompt helper
|