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:
parent
b1ef979f75
commit
985f472c4a
|
@ -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 = {
|
const finalToolDisplay: IndividualToolCallDisplay = {
|
||||||
...initialToolDisplay,
|
...initialToolDisplay,
|
||||||
status: finalStatus,
|
status: finalStatus,
|
||||||
|
|
Loading…
Reference in New Issue