troxy-cli 1.3.3 → 1.3.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/package.json +1 -1
- package/src/init.js +18 -2
package/package.json
CHANGED
package/src/init.js
CHANGED
|
@@ -89,8 +89,15 @@ export async function runInit({ key } = {}) {
|
|
|
89
89
|
return fs.existsSync(p);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
// Detect OpenClaw via CLI
|
|
93
|
+
let hasOpenClaw = false;
|
|
94
|
+
try {
|
|
95
|
+
execSync('openclaw --version', { stdio: 'ignore' });
|
|
96
|
+
hasOpenClaw = true;
|
|
97
|
+
} catch {}
|
|
98
|
+
|
|
99
|
+
if (detected.length === 0 && !hasOpenClaw) {
|
|
100
|
+
console.log('\n No MCP clients detected (Claude Desktop, Cursor, Windsurf, OpenClaw).');
|
|
94
101
|
console.log(' Troxy MCP server config:\n');
|
|
95
102
|
console.log(JSON.stringify(mcpEntry(key), null, 4));
|
|
96
103
|
console.log('\n Add the above to your MCP client\'s config under "mcpServers".\n');
|
|
@@ -105,6 +112,15 @@ export async function runInit({ key } = {}) {
|
|
|
105
112
|
console.log(` • ${client.name} ✗ (${err.message})`);
|
|
106
113
|
}
|
|
107
114
|
}
|
|
115
|
+
if (hasOpenClaw) {
|
|
116
|
+
try {
|
|
117
|
+
const entry = JSON.stringify({ command: 'npx', args: ['troxy-cli', 'mcp'], env: { TROXY_API_KEY: key } });
|
|
118
|
+
execSync(`openclaw mcp set troxy '${entry}'`, { stdio: 'ignore' });
|
|
119
|
+
console.log(` • OpenClaw ✓`);
|
|
120
|
+
} catch (err) {
|
|
121
|
+
console.log(` • OpenClaw ✗ (${err.message})`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
108
124
|
console.log('\n Restart your MCP client to activate Troxy.');
|
|
109
125
|
}
|
|
110
126
|
|