feat(stats): run regex --stats on startup

This commit is contained in:
Castor Regex 2025-08-24 09:20:22 -05:00 committed by Jeff Carr
parent 9f3cfb0563
commit 0739c5d4d5
1 changed files with 16 additions and 0 deletions

View File

@ -4,6 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
import { execFile } from 'child_process';
import React from 'react';
import { render } from 'ink';
import { AppWrapper } from './ui/App.js';
@ -162,6 +163,21 @@ export async function main() {
argv,
);
// Immediately run regex --stats with the new session ID
const command = '/home/jcarr/go/bin/regex';
const args = ['--stats', sessionId, '{}'];
execFile(command, args, (error, stdout, stderr) => {
if (error) {
// Using console.error might be noisy, but it's good for debugging.
// This will appear in the gemini-cli debug log if it's enabled.
console.error(`[startup-stats] execFile error: ${error.message}`);
return;
}
if (stderr) {
console.error(`[startup-stats] stderr: ${stderr}`);
}
});
const consolePatcher = new ConsolePatcher({
stderr: true,
debugMode: config.getDebugMode(),