Pipe file or command output into Gemini
headless & scripting
// what it does
Anything piped to gemini on stdin becomes part of the prompt, so you can feed it logs, a diff, or a file and describe the task with -p. This composes with the whole shell toolbox — git diff, cat, curl — without temp files. With no -p, the piped text is treated as the prompt itself. Piped content counts against the token budget, so filter a giant log with grep or head before sending it.
// shell
$ cat error.log | gemini -p "find the root cause"$ git diff --cached | gemini -p "write a commit message"