diff options
| author | Castor Gemini <[email protected]> | 2025-08-22 11:32:49 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-22 11:32:49 -0500 |
| commit | 985f472c4a2b293d2842c49c689d3453c71c3612 (patch) | |
| tree | dc2107999aeb3f523970158879f8a9135624e22f | |
| parent | b1ef979f75bb68a15e9bb15d6a44b27c0c5d9922 (diff) | |
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.
| -rw-r--r-- | packages/cli/src/ui/hooks/shellCommandProcessor.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.ts index 23f2bb29..3478aecd 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.ts @@ -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, |
