← Back to Writing
09 May 2026 5 min read

Can Your Gemini Message You When It's Done or Needs Something? Mine Can. Here's How I Set It Up on Android.

A practical setup guide for running Gemini CLI on Android with Termux, GitHub auth, and real notifications when tasks finish, fail, or need input.

Gemini CLI Android Termux Productivity

The problem nobody talks about:

You fire off a long Gemini task, refactor this, fix all tests, update dependencies, and then you’re just staring at a terminal. Waiting. On your phone. Like a hostage.

I fixed that. Now Gemini sends me a notification when it’s done, when it hits an error, or when it needs me back. I scroll Reddit, it works, it pings me. That’s the whole deal.

Here’s the exact setup.

What you’ll have after this

  • Gemini CLI running natively on Android (Termux)
  • GitHub fully authenticated, no credential prompts, no hanging pushes
  • A notify command Gemini uses to ping you like a real notification
  • A g shortcut so firing off tasks is one letter
  • A GEMINI.md that tells Gemini to always notify you and never get stuck on GitHub

Step 1 — Install Termux (NOT from Play Store)

The Play Store version is dead. Get it from GitHub:

Install both, then open Termux and run:

pkg update && pkg upgrade -y
pkg install -y nodejs-lts termux-api

Then install the Termux-optimized Gemini fork:

npm install -g @mmmbuto/gemini-cli-termux

Launch and log in:

gemini

Choose Login with Google.

Step 2 — Get a GitHub Personal Access Token

Gemini needs this to do GitHub work without hanging on credential prompts.

  1. GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Generate new token (classic)
  3. Name it termux-gemini, set your expiration
  4. Check: repo (full), workflow, read:org
  5. Copy it immediately — you won’t see it again

Treat this like a password. Never commit it anywhere.

Step 3 — Paste the Master Prompt

Replace YOUR_GITHUB_TOKEN_HERE with your token and YourName with your real name, then paste this into Gemini and let it run:

Execute every step below automatically without asking me anything. Just run the commands.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 1 — GITHUB SETUP
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1. pkg update && pkg install git gh -y

2. echo "YOUR_GITHUB_TOKEN_HERE" | gh auth login --with-token

3. gh auth setup-git

4. git config --global credential.helper store

5. git config --global user.name "YourName"
   git config --global user.email "$(gh api user --jq '.email' 2>/dev/null || echo 'you@users.noreply.github.com')"

6. gh auth status

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 2 — NOTIFICATION SYSTEM
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

7. mkdir -p ~/bin

8. Create ~/bin/notify with this exact content:
#!/data/data/com.termux/files/usr/bin/bash
termux-notification \
  --title "Gemini 🤖" \
  --content "$*" \
  --action "am start -n com.termux/.app.TermuxActivity" \
  --priority max \
  --sound \
  --vibrate 500,200,500

9. chmod +x ~/bin/notify

10. grep -q '\$HOME/bin' ~/.bashrc || echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc

11. source ~/.bashrc

12. notify "Notify system is online ✅"

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 3 — g SHORTCUT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

13. Add this to ~/.bashrc (skip if already exists):
    grep -q "^g()" ~/.bashrc || cat >> ~/.bashrc << 'EOF'
# One-letter Gemini launcher
g() {
  gemini "$*"
}
EOF
    source ~/.bashrc

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 4 — GEMINI.MD INSTRUCTIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

14. mkdir -p ~/.gemini

15. APPEND the following to ~/.gemini/GEMINI.md (do NOT overwrite):

## Git & GitHub Workflow

MANDATORY: These rules apply to every session.

Before any git operation: gh auth setup-git
Always clone with: gh repo clone <owner>/<repo>
Never use plain git clone https://... it hits a credential prompt.
Always work on a feature branch, never commit to main.
Use gh pr create --fill to open PRs non-interactively.

---

## User Presence & Notifications

The user is NOT watching the terminal. They have minimized Termux.

Use notify in these situations:
- A long task completed
- You need input before continuing
- An error occurred that needs attention
- You're about to do something destructive

notify "Done! Build finished ✅"
notify "Waiting for your input — check Termux"
notify "Error ❌ — cannot proceed without you"

Do NOT spam. Only notify at meaningful checkpoints.
Tapping the notification opens Termux.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PART 5 — FINAL CHECK
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

16. notify "All set! Gemini + GitHub + Notifications ready 🚀"

The g shortcut explained

Instead of typing gemini "do this thing" every time, you now just type:

g "fix all TypeScript errors and run tests"

It’s a tiny bash function in your .bashrc:

g() {
  gemini "$*"
}

One letter. Everything you type after it gets passed straight to Gemini.

How the notification system works

The notify command wraps termux-notification with settings tuned to actually interrupt you:

SettingWhat it does
--priority maxHeads-up popup over whatever app you’re in
--soundRings even with screen off
--vibrate 500,200,500Physical buzz pattern
--action "am start ..."Tap = back in Termux instantly
No --id flagEvery call is a fresh notification, guaranteed to ring

And because the rules are baked into GEMINI.md, Gemini reads them on every session automatically.

Troubleshooting

  • Notification doesn’t pop up? Android Settings → Apps → Termux → Notifications → Allow
  • notify: command not found? Run source ~/.bashrc or restart Termux
  • gh auth status shows unauthenticated? Token expired or wrong scopes; generate a new one and rerun Part 1
  • git push hangs? Run gh auth setup-git manually, then retry

Setup once. It runs while you do other things. Pings you when it matters.