builderos-cli 2.0.5 → 2.0.7
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/index.js +10 -6
- package/mcp-server.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -33,19 +33,22 @@ const VERSION = packageJson.version;
|
|
|
33
33
|
|
|
34
34
|
// Parse command line arguments
|
|
35
35
|
const args = process.argv.slice(2);
|
|
36
|
-
|
|
37
|
-
// Check for MCP server command first
|
|
38
36
|
const command = args[0];
|
|
37
|
+
|
|
38
|
+
// Check for MCP server command first (exit early before parsing options)
|
|
39
39
|
if (command === 'mcp') {
|
|
40
40
|
// Start MCP server (this will run indefinitely)
|
|
41
41
|
await startMCPServer().catch((error) => {
|
|
42
42
|
console.error('Fatal error:', error);
|
|
43
43
|
process.exit(1);
|
|
44
44
|
});
|
|
45
|
-
// MCP server is now running
|
|
45
|
+
// MCP server is now running and handling requests
|
|
46
|
+
// The server keeps the process alive, so we should not reach here
|
|
47
|
+
// But if we do, just exit cleanly
|
|
48
|
+
process.exit(0);
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
// Default options
|
|
51
|
+
// Default options (needed for other commands)
|
|
49
52
|
const options = {
|
|
50
53
|
apiUrl: process.env.BUILDEROS_API_URL || 'http://builder-os.test',
|
|
51
54
|
force: false,
|
|
@@ -115,6 +118,9 @@ Examples:
|
|
|
115
118
|
process.exit(0);
|
|
116
119
|
}
|
|
117
120
|
|
|
121
|
+
// Execute main for init/update commands
|
|
122
|
+
main();
|
|
123
|
+
|
|
118
124
|
// Utility: Check if file exists
|
|
119
125
|
async function fileExists(path) {
|
|
120
126
|
try {
|
|
@@ -418,5 +424,3 @@ async function main() {
|
|
|
418
424
|
process.exit(1);
|
|
419
425
|
}
|
|
420
426
|
}
|
|
421
|
-
|
|
422
|
-
main();
|
package/mcp-server.js
CHANGED