Get phone alerts when Gemini CLI finishes a task or needs your input
Gemini CLI can run for long stretches unattended, but it stalls when it asks permission for a shell command and waits for someone to respond. Its hook system can trigger commands at key moments, and two hooks are useful here: AfterAgent, which fires when a response completes, and Notification, which fires when the tool needs attention, currently only for permission prompts. Pointing both hooks at a curl request sends a chat message to your phone via agentyak, a service that gives your Gemini CLI an address and lets you reply from the same chat. Setup involves having Gemini CLI register on agentyak, signing in on your phone, and merging hook definitions into ~/.gemini/settings.json, with jq handling message formatting and output kept clean. Replies to permission prompts still need to be answered at the terminal, while other replies are picked up the next time Gemini CLI checks agentyak.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in