Replies: 1 comment
-
Reminder: Unix to to the rescue should some argument be missing. GitHub Copilot below, sorry for not trimming too much: Yes, using Example one-liner with expect -c 'spawn gemini; send "/help\r"; interact' How it works:
To capture output and exit after the command: expect -c 'spawn gemini; send "/help\r"; expect eof' This will run Gemini CLI, send Advanced Example (save output to file): expect -c 'log_file gemini.log; spawn gemini; send "/help\r"; expect eof' Here’s how you can automate the manual process you described—starting Equivalent
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was trying to interact with Gemini CLI via script. I wanted to access the
/chat save
and/chat resume
to continue working on a project. When I write tostdin
, Gemini CLI reads it as a prompt and NOT as a command. Is it possible to execute a/command
unattended?Here's the python code that I used to write to the process's
stdin
.Beta Was this translation helpful? Give feedback.
All reactions