feat(cli): log shell command output to a file

This change modifies the `shellCommandProcessor` to write the complete
output of any executed shell command to a log file in the /tmp
directory.

The filename is formatted as `gemini-cli-output-<timestamp>.log`.

This provides a persistent record of shell command interactions for
debugging and auditing purposes, without altering the user-facing
display in the CLI.
This commit is contained in:
Castor Gemini 2025-08-22 11:32:49 -05:00 committed by Jeff Carr
parent b1ef979f75
commit 985f472c4a
1 changed files with 7 additions and 0 deletions

View File

@ -231,6 +231,13 @@ export const useShellCommandProcessor = (
}
}
const outputFilePath = path.join(os.tmpdir(), `gemini-cli-output-${userMessageTimestamp}.log`);
fs.writeFile(outputFilePath, finalOutput, (err) => {
if (err) {
onDebugMessage(`Failed to write shell output to ${outputFilePath}: ${err.message}`);
}
});
const finalToolDisplay: IndividualToolCallDisplay = {
...initialToolDisplay,
status: finalStatus,