From 3f82a60986c6ab7b6519034b46b56ae603d8ecbb Mon Sep 17 00:00:00 2001
From: Castor Regex <regex@wit.com>
Date: Sun, 24 Aug 2025 13:07:04 -0500
Subject: feat(startup): create new chat on startup

---
 packages/cli/src/gemini.tsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'packages/cli/src/gemini.tsx')

diff --git a/packages/cli/src/gemini.tsx b/packages/cli/src/gemini.tsx
index b285a5af..3195a52c 100644
--- a/packages/cli/src/gemini.tsx
+++ b/packages/cli/src/gemini.tsx
@@ -4,6 +4,7 @@
  * SPDX-License-Identifier: Apache-2.0
  */
 
+import { execFileSync } from 'child_process';
 import React from 'react';
 import { render } from 'ink';
 import { AppWrapper } from './ui/App.js';
@@ -159,6 +160,17 @@ export async function main() {
     argv,
   );
 
+  // Create a new chat on startup.
+  try {
+    const countOutput = execFileSync('/home/jcarr/go/bin/regex', ['--count-auto'], { encoding: 'utf8' });
+    const count = parseInt(countOutput.trim(), 10);
+    const topic = `Auto ${count + 1}`;
+    execFileSync('/home/jcarr/go/bin/regex', ['--new-chat', sessionId, topic]);
+  } catch (e) {
+    console.error(`Error creating new chat: ${e}`);
+  }
+
+
   const consolePatcher = new ConsolePatcher({
     stderr: true,
     debugMode: config.getDebugMode(),
-- 
cgit v1.2.3

