@mmmbuto/gemini-cli-termux
v0.28.2-termux
Published
Android/Termux optimized fork of **Google Gemini CLI** (`google-gemini/gemini-cli`).
Readme
🤖 Gemini CLI – Termux Edition
Android/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)
What is this?
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:
npm install -g @google/gemini-cliWhy a Termux fork?
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/) - TTS (Text-to-Speech) support via
termux-tts-speak
Installation (Termux)
Prerequisites
pkg update && pkg upgrade -y
pkg install -y nodejs-ltsOptional but recommended for a better mobile experience:
pkg install -y termux-apiInstall
npm install -g @mmmbuto/gemini-cli-termux@latest
gemini --versionUpdate
npm install -g @mmmbuto/gemini-cli-termux@latestUpstream release channels
Upstream publishes latest, preview, and nightly builds. This fork is meant
to track upstream stable while keeping Termux fixes.
Quick start
Interactive mode:
cd /path/to/your/project
geminiUseful slash commands inside the session:
/help
/authHeadless / CI usage:
gemini -p "Explain the project structure" \
-o jsonAuthentication
Gemini CLI supports multiple authentication methods (Google login, Gemini API key, Vertex AI). Termux users can use the same options as upstream.
Interactive (recommended)
Start gemini, then run:
/authFollow the on-screen flow.
Note (Android): Google login uses a browser flow that redirects to a
localhostURL the CLI listens on during setup. Use the browser on the same device.
Environment variables (headless / CI)
Gemini API key (Google AI Studio):
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"Vertex AI (examples):
export GOOGLE_GENAI_USE_VERTEXAI=true
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"
export GOOGLE_CLOUD_LOCATION="us-central1"
# Option A: API key
export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
# Option B: Service account
# export GOOGLE_APPLICATION_CREDENTIALS="/absolute/path/to/keyfile.json"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-apiis 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 settingsworks, may appear asconfigin some versionsauth/logoutare 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-speakenabled by default - googleSearch tool: ✅ Fixed - works without external dependencies
Termux ARM64 (Android):
- Context Memory: ⚠️ init
ENOENTon empty path; files exist - Agent TOML: ❌ loader file not found (source older than test suite)
- PTY: ✅ loaded correctly
- Termux-API: ✅ detection & discovery OK
Full reports:
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)
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 --versionDisclaimer
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.
Support
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
