fix issue with multi-word processing

This commit is contained in:
Ismail Pelaseyed committed 2025-09-12 08:51:51 +02:00
1 parent a8e96bc78d
commit bc8a7e21d7
2 files changed
+8 -5

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@vibe-kit/grok-cli",
"version": "0.0.25",
"version": "0.0.26",
"description": "An open-source AI agent that brings the power of Grok directly into your terminal.",
"main": "dist/index.js",
"bin": {
+7 -4
View File
@@ -313,7 +313,7 @@ program
"A conversational AI CLI tool powered by Grok with text editor capabilities"
)
.version("1.0.1")
.argument("[message]", "Initial message to send to Grok")
.argument("[message...]", "Initial message to send to Grok")
.option("-d, --directory <dir>", "set working directory", process.cwd())
.option("-k, --api-key <key>", "Grok API key (or set GROK_API_KEY env var)")
.option(
@@ -383,9 +383,12 @@ program
ensureUserSettingsDirectory();
render(
React.createElement(ChatInterface, { agent, initialMessage: message })
);
// Support variadic positional arguments for multi-word initial message
const initialMessage = Array.isArray(message)
? message.join(" ")
: message;
render(React.createElement(ChatInterface, { agent, initialMessage }));
} catch (error: any) {
console.error("❌ Error initializing Grok CLI:", error.message);
process.exit(1);