Android/Termux optimized fork of **Google Gemini CLI** (`google-gemini/gemini-cli`).
npm install @mmmbuto/gemini-cli-termuxAndroid/Termux optimized fork of Google Gemini CLI
(google-gemini/gemini-cli).
- ✅ Tracks upstream regularly
- ✅ Minimal, Termux-focused patches
- ✅ Tested release: v0.28.0-termux (tag: v0.28.0-termux)




---

This repository packages a Termux-first build of Gemini CLI:
- Upstream project: https://github.com/google-gemini/gemini-cli
- Upstream docs: https://geminicli.com/docs/
- This fork: https://github.com/DioNanos/gemini-cli-termux
If you are on macOS / Linux / Windows, you should install the upstream
package:
``bash`
npm install -g @google/gemini-cli
---
Gemini CLI is designed for desktop platforms. On Termux/Android, a few
dependencies and environment assumptions can break or degrade UX.
This fork keeps the upstream experience intact while adding the **smallest
possible patch-set** to make it reliable on Android:
- Native ARM64 PTY support (no node-gyp build on device)
- Termux-friendly clipboard detection
- Mobile filesystem + environment guardrails
- Context Memory integration (persistent memory in
~/.gemini/context_memory/)termux-tts-speak
- TTS (Text-to-Speech) support via
---
`bash`
pkg update && pkg upgrade -y
pkg install -y nodejs-lts
Optional but recommended for a better mobile experience:
`bash`
pkg install -y termux-api
`bash
npm install -g @mmmbuto/gemini-cli-termux@latest
gemini --version
`
`bash`
npm install -g @mmmbuto/gemini-cli-termux@latest
Upstream publishes latest, preview, and nightly builds. This fork is meant
to track upstream stable while keeping Termux fixes.
---
Interactive mode:
`bash
cd /path/to/your/project
gemini
`
Useful slash commands inside the session:
`text`
/help
/auth
Headless / CI usage:
`bash`
gemini -p "Explain the project structure" \
-o json
---
Gemini CLI supports multiple authentication methods (Google login, Gemini API
key, Vertex AI). Termux users can use the same options as upstream.
Start gemini, then run:
`bash`
/auth
Follow the on-screen flow.
> Note (Android): Google login uses a browser flow that redirects to a
> localhost URL the CLI listens on during setup. Use the browser on the same
> device.
Gemini API key (Google AI Studio):
`bash`
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
Vertex AI (examples):
`bash
export GOOGLE_GENAI_USE_VERTEXAI=true
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
export GOOGLE_CLOUD_LOCATION="us-central1"
Persisting without leaking secrets: create a
.gemini/.env file
(project-level) or ~/.gemini/.env (user-level).Full docs:
- https://google-gemini.github.io/gemini-cli/docs/get-started/authentication.html
---
Termux optimizations
This fork applies a minimal set of Termux-specific fixes:
- Clipboard detection fixes for Android/Termux environments.
- ARM64 PTY prebuild for responsive interactive UI on Android.
- Termux-API tool discovery (when
termux-api is installed).
- Mobile-safe guards (avoids desktop-only assumptions for paths, keychains,
etc.).
- googleSearch tool fix - works without requiring additional NPM installs.See
docs/TERMUX.md for Termux-specific documentation.---
Known differences vs upstream (v0.28.0-termux)
From the latest test reports:
Linux x86_64 (VPS1):
-
gemini extensions settings works, may appear as config in some versions
- auth / logout are functional but may not appear in the top-level help
output
- A standalone PTY require-test may fail in some environments even when PTY
works in the app
- Context Memory: ✅ Functional - reads from ~/.gemini/context_memory/
- TTS (Text-to-Speech): ✅ Functional - reads from settings,
termux-tts-speak enabled by default
- googleSearch tool: ✅ Fixed - works without external dependenciesTermux ARM64 (Android):
- Context Memory: ⚠️ init
ENOENT on empty path; files exist
- Agent TOML: ❌ loader file not found (source older than test suite)
- PTY: ✅ loaded correctly
- Termux-API: ✅ detection & discovery OKFull reports:
- GEMINI_TEST_REPORT_v0.28.0-linux.md
- GEMINI_TEST_REPORT_v0.28.0-termux.md
---
Documentation
- Test Suite: GEMINI_TEST_SUITE.md
- Test Report (latest):
GEMINI_TEST_REPORT_v0.28.0-linux.md
GEMINI_TEST_REPORT_v0.28.0-termux.md
- Context Memory:
docs/cli/context-memory.md
- Termux-specific docs: docs/TERMUX.md---
Build from source (Termux)
`bash
git clone https://github.com/DioNanos/gemini-cli-termux.git
cd gemini-cli-termux
npm install
npm run build && npm run bundle
node bundle/gemini.js --version
``---
This is an independent community fork created to improve the Termux
experience.
Gemini CLI is an upstream project by Google, licensed under Apache-2.0.
---
If this project saved you time (or helped you run real work from your phone),
you can support it here:
- ☕ Ko-fi: https://ko-fi.com/dionanos