@mmmbuto/gemini-cli-termux 0.24.5-termux β†’ 0.24.6-termux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # πŸ€– Gemini CLI – Termux Edition
2
2
 
3
3
  Android/Termux optimized fork of Google Gemini CLI. Installs cleanly on Termux
4
- by skipping native modules and adding clipboard detection for Termux.
4
+ with a native ARM64 PTY prebuild and clipboard detection for Termux.
5
5
 
6
6
  [![npm](https://img.shields.io/npm/v/@mmmbuto/gemini-cli-termux?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mmmbuto/gemini-cli-termux)
7
7
  [![downloads](https://img.shields.io/npm/dt/@mmmbuto/gemini-cli-termux?style=flat-square)](https://www.npmjs.com/package/@mmmbuto/gemini-cli-termux)
@@ -29,7 +29,7 @@ pkg update && pkg upgrade -y
29
29
  pkg install nodejs-lts -y
30
30
  npm install -g @mmmbuto/gemini-cli-termux
31
31
 
32
- gemini --version # expected: 0.24.5-termux (npm latest)
32
+ gemini --version # expected: 0.24.6-termux (npm latest)
33
33
  ```
34
34
 
35
35
  Build from source:
@@ -37,7 +37,7 @@ Build from source:
37
37
  ```bash
38
38
  git clone https://github.com/DioNanos/gemini-cli-termux.git
39
39
  cd gemini-cli-termux
40
- npm install --ignore-optional --ignore-scripts
40
+ npm install
41
41
  npm run build && npm run bundle
42
42
  node bundle/gemini.js --version
43
43
  ```
@@ -46,16 +46,16 @@ node bundle/gemini.js --version
46
46
 
47
47
  - **Smart Clipboard:** Auto-detects Android environment to enable seamless
48
48
  clipboard operations (fixes `TERMUX__PREFIX`).
49
- - **Streamlined Install:** Native PTY/keychain deps are **omitted** on Termux
50
- (fallback to `child_process` + file-based tokens), avoiding native builds.
49
+ - **Streamlined Install:** Uses `@mmmbuto/node-pty-android-arm64` prebuild (no
50
+ node-gyp) and file-based tokens instead of keychain.
51
51
  - **Clean UX:** Suppresses desktop-centric warnings (like home directory checks)
52
52
  to optimize the experience for mobile terminal usage.
53
53
  - **ARM64 Native:** Bundled specifically for Android architecture.
54
54
 
55
55
  ## Environment Specifics
56
56
 
57
- - **Shell Integration:** Uses robust `child_process` fallback instead of
58
- `node-pty` for maximum stability on Android.
57
+ - **Shell Integration:** Uses `@mmmbuto/node-pty-android-arm64` on Termux for
58
+ interactive PTY support (falls back to `child_process` if unavailable).
59
59
  - **Credentials:** Keys are stored in standard config files for portability (no
60
60
  dependency on system keychains).
61
61
  - **Parser:** Simplified Bash parsing to reduce heavy binary dependencies.
@@ -65,8 +65,8 @@ node bundle/gemini.js --version
65
65
  ### πŸ“š Complete Documentation
66
66
 
67
67
  - **Test Results**
68
- - [GEMINI_TEST_REPORT_v0.24.5.md](./GEMINI_TEST_REPORT_v0.24.5.md) β€” PARTIAL
69
- (interactive steps pending; build OK)
68
+ - [GEMINI_TEST_REPORT_v0.24.6.md](./GEMINI_TEST_REPORT_v0.24.6.md) β€” PARTIAL
69
+ (latest report; 0.24.6-termux)
70
70
  - **[Test Suite](./GEMINI_TEST_SUITE.md)** - Test methodology and checklist
71
71
  - **[Context Memory](./docs/cli/context-memory.md)** - Memory modes, JIT + JSON,
72
72
  and setup guide
@@ -76,7 +76,6 @@ node bundle/gemini.js --version
76
76
 
77
77
  | Issue | Quick Fix | Documentation |
78
78
  | --------------------- | ----------------------------- | --------------------------------------------------- |
79
- | node-pty warning | `export NODE_NO_WARNINGS=1` | [Details](./docs/patches/node-pty-warning.md) |
80
79
  | CLI syntax (`--json`) | Use `-o json` instead | [Details](./docs/patches/cli-syntax-differences.md) |
81
80
  | Hooks commands | Use interactive mode `/hooks` | [Details](./docs/patches/hooks-interactive-only.md) |
82
81
 
@@ -88,10 +87,6 @@ gemini -o json "your prompt" # βœ… JSON output
88
87
  gemini --output-format json "prompt" # βœ… Also works
89
88
  gemini --json "prompt" # ❌ Wrong syntax
90
89
 
91
- # Quiet mode (suppress warnings)
92
- export NODE_NO_WARNINGS=1
93
- gemini "your prompt"
94
-
95
90
  # Hooks management (interactive only)
96
91
  gemini # Start interactive mode
97
92
  /hooks # Manage hooks
@@ -105,19 +100,19 @@ See [docs/patches/README.md](./docs/patches/README.md) for complete solutions.
105
100
  npm install -g @mmmbuto/gemini-cli-termux@latest
106
101
  ```
107
102
 
108
- ### Changelog (0.24.5-termux)
103
+ ### Changelog (0.24.6-termux)
109
104
 
110
- - **Build fix**: MCP SDK typings shim for strict TypeScript builds on Termux.
111
- - **Auto-update**: Update command uses `@mmmbuto/gemini-cli-termux`.
112
- - **Docs/tests**: new test report for v0.24.5-termux.
105
+ - **PTY on Termux**: Uses `@mmmbuto/node-pty-android-arm64` prebuild.
106
+ - **Deps cleanup**: Removed `@lydell/node-pty-*` and generic `node-pty`.
107
+ - **Docs**: Updated Termux notes for PTY support.
113
108
 
114
109
  ## Tests
115
110
 
116
111
  - Suite: [`GEMINI_TEST_SUITE.md`](./GEMINI_TEST_SUITE.md)
117
112
  - Latest report:
118
- - [`GEMINI_TEST_REPORT_v0.24.5.md`](./GEMINI_TEST_REPORT_v0.24.5.md) β€” PARTIAL
119
- (interactive steps pending). Notes include non‑interactive tool confirmation
120
- limits.
113
+ - [`GEMINI_TEST_REPORT_v0.24.6.md`](./GEMINI_TEST_REPORT_v0.24.6.md) β€” PARTIAL
114
+ (latest report; 0.24.6-termux latest). Notes include non‑interactive tool
115
+ confirmation limits.
121
116
 
122
117
  ## Termux-API Integration
123
118
 
@@ -0,0 +1,239 @@
1
+ # πŸ€– Gemini CLI – Termux Edition
2
+
3
+ Android/Termux optimized fork of Google Gemini CLI. Installs cleanly on Termux
4
+ by skipping native modules and adding clipboard detection for Termux.
5
+
6
+ [![npm](https://img.shields.io/npm/v/@mmmbuto/gemini-cli-termux?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mmmbuto/gemini-cli-termux)
7
+ [![downloads](https://img.shields.io/npm/dt/@mmmbuto/gemini-cli-termux?style=flat-square)](https://www.npmjs.com/package/@mmmbuto/gemini-cli-termux)
8
+ [![ko-fi](https://img.shields.io/badge/β˜•_Support-Ko--fi-FF5E5B?style=flat-square&logo=ko-fi)](https://ko-fi.com/dionanos)
9
+
10
+ ---
11
+
12
+ ## What This Is
13
+
14
+ **Optimized Termux edition** of `google-gemini/gemini-cli`.
15
+
16
+ This project focuses on maintaining a first-class experience for Gemini on
17
+ Android/Termux. It provides critical adaptations for the mobile environment
18
+ while tracking upstream development closely.
19
+
20
+ - **Termux-First:** Pre-configured for Android filesystem and clipboard.
21
+ - **Lightweight:** Native dependencies managed for ARM64 without complex
22
+ compilation.
23
+ - **Up-to-Date:** Synchronized with the latest Google Gemini CLI features.
24
+
25
+ ## Installation (Termux)
26
+
27
+ ```bash
28
+ pkg update && pkg upgrade -y
29
+ pkg install nodejs-lts -y
30
+ npm install -g @mmmbuto/gemini-cli-termux
31
+
32
+ gemini --version # expected: 0.22.2-termux (npm latest); 0.22.7-termux available on testing channel
33
+ ```
34
+
35
+ Build from source:
36
+
37
+ ```bash
38
+ git clone https://github.com/DioNanos/gemini-cli-termux.git
39
+ cd gemini-cli-termux
40
+ npm install --ignore-optional --ignore-scripts
41
+ npm run build && npm run bundle
42
+ node bundle/gemini.js --version
43
+ ```
44
+
45
+ ## Termux Optimizations
46
+
47
+ - **Smart Clipboard:** Auto-detects Android environment to enable seamless
48
+ clipboard operations (fixes `TERMUX__PREFIX`).
49
+ - **Streamlined Install:** Native PTY/keychain deps are **omitted** on Termux
50
+ (fallback to `child_process` + file-based tokens), avoiding native builds.
51
+ - **Clean UX:** Suppresses desktop-centric warnings (like home directory checks)
52
+ to optimize the experience for mobile terminal usage.
53
+ - **ARM64 Native:** Bundled specifically for Android architecture.
54
+
55
+ ## Environment Specifics
56
+
57
+ - **Shell Integration:** Uses robust `child_process` fallback instead of
58
+ `node-pty` for maximum stability on Android.
59
+ - **Credentials:** Keys are stored in standard config files for portability (no
60
+ dependency on system keychains).
61
+ - **Parser:** Simplified Bash parsing to reduce heavy binary dependencies.
62
+
63
+ ## Documentation & Fixes
64
+
65
+ ### πŸ“š Complete Documentation
66
+
67
+ - **Test Results**
68
+ - [GEMINI_TEST_REPORT_v0.22.7.md](./GEMINI_TEST_REPORT_v0.22.7.md) β€” testing
69
+ channel
70
+ - [GEMINI_TEST_REPORT_v0.22.2.md](./GEMINI_TEST_REPORT_v0.22.2.md) β€” stable
71
+ baseline
72
+ - **[Test Suite](./GEMINI_TEST_SUITE.md)** - Test methodology and checklist
73
+ - **[Patches & Fixes](./docs/patches/)** - Known issues and workarounds
74
+
75
+ ### πŸ”§ Common Issues & Solutions
76
+
77
+ | Issue | Quick Fix | Documentation |
78
+ | --------------------- | ----------------------------- | --------------------------------------------------- |
79
+ | node-pty warning | `export NODE_NO_WARNINGS=1` | [Details](./docs/patches/node-pty-warning.md) |
80
+ | CLI syntax (`--json`) | Use `-o json` instead | [Details](./docs/patches/cli-syntax-differences.md) |
81
+ | Hooks commands | Use interactive mode `/hooks` | [Details](./docs/patches/hooks-interactive-only.md) |
82
+
83
+ ### πŸ“ Quick Reference
84
+
85
+ ```bash
86
+ # Correct usage examples
87
+ gemini -o json "your prompt" # βœ… JSON output
88
+ gemini --output-format json "prompt" # βœ… Also works
89
+ gemini --json "prompt" # ❌ Wrong syntax
90
+
91
+ # Quiet mode (suppress warnings)
92
+ export NODE_NO_WARNINGS=1
93
+ gemini "your prompt"
94
+
95
+ # Hooks management (interactive only)
96
+ gemini # Start interactive mode
97
+ /hooks # Manage hooks
98
+ ```
99
+
100
+ See [docs/patches/README.md](./docs/patches/README.md) for complete solutions.
101
+
102
+ ## Updating
103
+
104
+ ```bash
105
+ npm install -g @mmmbuto/gemini-cli-termux@latest
106
+ ```
107
+
108
+ ### Versions
109
+
110
+ - **latest / stable**: 0.22.2-termux (default npm dist-tag)
111
+ - **testing**: 0.22.7-termux (adds Gemini 3 Flash preview; install explicitly)
112
+ - **previous**: 0.21.4-termux
113
+
114
+ ## Tests
115
+
116
+ - Suite: [`GEMINI_TEST_SUITE.md`](./GEMINI_TEST_SUITE.md)
117
+ - Latest reports:
118
+ - [`GEMINI_TEST_REPORT_v0.22.7.md`](./GEMINI_TEST_REPORT_v0.22.7.md) β€” testing
119
+ channel, PASS (static verification) on Termux: version/env, CLI basics,
120
+ non-interactive JSON, Termux-API, context memory, Gemini 3 Flash, agent TOML
121
+ loader, patches integrity. Agent shell security filter blocks complex
122
+ `run_shell_command` calls in this environment (known restriction); CLI
123
+ itself verified via `--version`.
124
+ - [`GEMINI_TEST_REPORT_v0.22.2.md`](./GEMINI_TEST_REPORT_v0.22.2.md) β€” stable
125
+ baseline, PASS with expected optional-native warnings.
126
+
127
+ ## Termux-API Integration
128
+
129
+ This fork supports optional integration with Termux-API commands for Android
130
+ device access. Enable Gemini to interact with your device hardware and Android
131
+ features.
132
+
133
+ ## Context memory + TTS note:
134
+
135
+ - The Termux fork ships JSON context memory at
136
+ `~/.gemini/context_memory/{base.json,user.json,user.journal.jsonl}`. In
137
+ `/settings β†’ Context Memory` you can toggle autoload, choose the primary
138
+ source, and (if needed) enable writes to `base.json` via
139
+ `Allow Base Memory Writes`.
140
+ - TTS notifications are controlled by
141
+ `/settings β†’ Notifications β†’ Enable TTS Notifications`. When disabled,
142
+ `termux-tts-speak` is blocked even if an agent asks for it. These behaviors
143
+ are merge-safe and confined to Termux patches.
144
+
145
+ ### Quick Setup
146
+
147
+ ```bash
148
+ # Install Termux-API package
149
+ pkg install termux-api jq
150
+
151
+ # Copy tool discovery scripts
152
+ mkdir -p ~/.config/gemini/termux-tools
153
+ cp scripts/termux-tools/*.sh ~/.config/gemini/termux-tools/
154
+
155
+ # Configure in settings
156
+ cat > ~/.config/gemini/settings.json << 'EOF'
157
+ {
158
+ "tool_discovery_command": "bash ~/.config/gemini/termux-tools/discovery.sh",
159
+ "tool_call_command": "bash ~/.config/gemini/termux-tools/call.sh"
160
+ }
161
+ EOF
162
+
163
+ # Test
164
+ gemini "What's my battery status?"
165
+ ```
166
+
167
+ ### Supported Commands
168
+
169
+ Battery, Clipboard, Toast, Notifications, TTS, Vibrate, Torch, WiFi info,
170
+ Location, Camera, Dialog, Share, and more.
171
+
172
+ See [docs/termux-api/](./docs/termux-api/) for complete documentation.
173
+
174
+ ---
175
+
176
+ ## v0.22.7-termux (testing) Highlights
177
+
178
+ - **Gemini 3 Flash preview** enabled (`gemini-3-flash-preview`) with help/docs
179
+ visibility.
180
+
181
+ - **Context Memory (default ON)**: strict, merge-safe JSON memory at
182
+ `~/.gemini/context_memory/{base.json,user.json,user.journal.jsonl}` with
183
+ per-source autoload, primary selector, and GEMINI.md bootstrap on first run.
184
+ - **Deterministic compaction**: journal append-only with incremental offsets,
185
+ closed JSON schemas, key-based upsert, TTL/ephemeral guardrails,
186
+ sensitivity=high excluded from autoload.
187
+ - **Base write toggle**: enable/disable writes to `base.json` from
188
+ `/save_memory target=base` (off by default, merge-safe).
189
+ - **TTS toggle**: new `/settings` switch to allow/block `termux-tts-speak`;
190
+ shell tool blocks TTS when disabled.
191
+ - **Termux-first shell**: non-interactive commands (`echo`, `pwd`, `ls`) work
192
+ without native PTY deps; optional natives removed for faster installs.
193
+ - **Termux-API tools**: discovery/call scripts under `scripts/termux-tools/`
194
+ expose Termux APIs as tools (battery, tts, camera, etc.).
195
+
196
+ See `docs/cli/context-memory.md` for the detailed memory layout and settings.
197
+
198
+ ## v0.22.2-termux Improvements
199
+
200
+ This release includes significant improvements to the Termux experience:
201
+
202
+ ### Installation
203
+
204
+ - **Clear postinstall message** - No more confusion about native module warnings
205
+ - **`make termux-install`** - One-command build from source
206
+ - **`termux-setup.sh`** - Helper script for first-time setup
207
+
208
+ ### Developer Experience
209
+
210
+ - **Termux detection utility** - `isTermux()` and `detectTermuxEnvironment()`
211
+ - **Punycode warning suppression** - Cleaner output on Android
212
+ - **Merge-safe patches** - Easy to maintain after upstream sync
213
+ - **`check-termux-patches.sh`** - Verify patches after merge
214
+
215
+ ### Documentation
216
+
217
+ - Complete Termux-API integration plan
218
+ - 60+ commands documented with parameters
219
+ - Merge strategy guide for maintainers
220
+
221
+ ---
222
+
223
+ ## Changelog (Termux)
224
+
225
+ - **0.22.1-termux**: Termux-API integration, improved installation UX, Termux
226
+ detection utility, merge automation scripts.
227
+ - **0.22.0-termux**: Sync with upstream (0.21.0-nightly); added hide banner
228
+ patch; restored ARM64 dependency.
229
+ - **0.21.4-termux**: (Previous)
230
+
231
+ ## Upstream Tracking
232
+
233
+ - Upstream: https://github.com/google-gemini/gemini-cli
234
+ - Divergent files: `esbuild.config.js`, `docs/TERMUX.md`, `package.json`,
235
+ `README.md`, `test-gemini/*`
236
+
237
+ ## License
238
+
239
+ Apache 2.0 (same as upstream). See LICENSE.
@@ -15,36 +15,35 @@ Android.
15
15
  npm install -g @mmmbuto/gemini-cli-termux
16
16
 
17
17
  gemini --version
18
- # expected: 0.22.0-termux (latest)
18
+ # expected: 0.24.6-termux (latest)
19
19
  ```
20
20
 
21
21
  Features of the npm build
22
22
 
23
23
  - ARM64/Android bundle included
24
24
  - Termux clipboard patch (`PREFIX` -> `TERMUX__PREFIX`)
25
- - Native modules left optional; no NDK required
25
+ - PTY prebuild via `@mmmbuto/node-pty-android-arm64` (no NDK required)
26
26
 
27
27
  ## Build from source (Termux fork)
28
28
 
29
29
  ```bash
30
30
  git clone https://github.com/DioNanos/gemini-cli-termux.git
31
31
  cd gemini-cli-termux
32
- npm install --ignore-optional --ignore-scripts
32
+ npm install
33
33
  npm run build && npm run bundle
34
34
  node bundle/gemini.js --version
35
35
  ```
36
36
 
37
37
  ## Known issues
38
38
 
39
- 1. Native modules (keytar, node-pty, tree-sitter-bash) fail on Termux β†’ ignored
40
- with the install flags above.
41
- 2. Clipboardy TERMUX\_\_PREFIX is patched in the bundle.
42
- 3. Node punycode warning is harmless; optional:
39
+ 1. If the PTY prebuild fails to load, the CLI falls back to `child_process`
40
+ (non-interactive).
41
+ 2. Node punycode warning is harmless; optional:
43
42
  `node --no-deprecation bundle/gemini.js`.
44
43
 
45
44
  ## Limitations
46
45
 
47
- - No full PTY support β†’ some interactive shell features limited
46
+ - PTY support depends on the `@mmmbuto/node-pty-android-arm64` prebuild
48
47
  - No secure keychain β†’ credentials stored in plain config files
49
48
  - Bash parsing simplified (no tree-sitter)
50
49
 
@@ -52,7 +51,7 @@ node bundle/gemini.js --version
52
51
 
53
52
  - npm: `npm install -g @mmmbuto/gemini-cli-termux@latest`
54
53
  - source:
55
- `git pull && npm install --ignore-optional --ignore-scripts && npm run build && npm run bundle`
54
+ `git pull && npm install && npm run build && npm run bundle`
56
55
 
57
56
  ## Termux-API Support (Optional)
58
57
 
@@ -222,7 +222,7 @@ grep -r "isTermux" packages/cli/src/config/config.ts
222
222
  grep "termux-detect" packages/core/src/index.ts
223
223
 
224
224
  # Build test
225
- npm install --ignore-optional --ignore-scripts
225
+ npm install
226
226
  npm run build
227
227
  npm run bundle
228
228
  node bundle/gemini.js --version # deve essere 0.24.0-termux
@@ -289,7 +289,7 @@ Aggiornare versione e sandboxImageUri.
289
289
  | ------------------------- | ----------- | -------------------------------------- |
290
290
  | Context memory regression | Bassa | Test completo memory system |
291
291
  | Shell tool breakage | Bassa | Verificare isTermux() logic |
292
- | Build failure | Molto bassa | --ignore-optional --ignore-scripts |
292
+ | Build failure | Molto bassa | prepare-termux: npm install (no flags) |
293
293
  | npm publish issues | Bassa | Verificare files array in package.json |
294
294
 
295
295
  ---
@@ -8,32 +8,34 @@ it updated whenever a new patch is added or removed.
8
8
 
9
9
  1. **Clipboard (TERMUX\_\_PREFIX)** – On Termux set `TERMUX__PREFIX` from
10
10
  `$PREFIX` so clipboardy detects Termux correctly.
11
- 2. **Optional native modules** – Leave `node-pty`, `keytar`, `tree-sitter-bash`
12
- in `optionalDependencies`; build failures are tolerated.
13
- 3. **Core exports** – `packages/core/src/index.ts` re-exports stdio utilities,
11
+ 2. **Android PTY prebuild** – Use `@mmmbuto/node-pty-android-arm64` for
12
+ Termux; remove `@lydell/node-pty-*` and generic `node-pty`.
13
+ 3. **Prepare script** – `prepare` is a no-op on Termux to avoid unnecessary
14
+ bundle/husky work during installs.
15
+ 4. **Core exports** – `packages/core/src/index.ts` re-exports stdio utilities,
14
16
  hook/telemetry APIs, Termux detectors, and context-memory helpers so CLI
15
17
  bundling succeeds on Termux.
16
- 4. **Bundle** – Prebuilt `bundle/gemini.js` shipped in npm package
18
+ 5. **Bundle** – Prebuilt `bundle/gemini.js` shipped in npm package
17
19
  (ARM64/Android) with policy files under `bundle/policies/`.
18
- 5. **is-in-ci override** – Prevents ink from detecting Termux as CI.
19
- 6. **Punycode warning** – Suppresses deprecation warning on Android.
20
- 7. **Termux detection** – `packages/core/src/utils/termux-detect.ts` utility.
21
- 8. **Postinstall message** – Clear success message on Termux install.
22
- 9. **Context memory + Memory Mode** – JSON memories (base/user/journal) plus
20
+ 6. **is-in-ci override** – Prevents ink from detecting Termux as CI.
21
+ 7. **Punycode warning** – Suppresses deprecation warning on Android.
22
+ 8. **Termux detection** – `packages/core/src/utils/termux-detect.ts` utility.
23
+ 9. **Postinstall message** – Clear success message on Termux install.
24
+ 10. **Context memory + Memory Mode** – JSON memories (base/user/journal) plus
23
25
  presets: `default`, `jit`, `jit+json`. Auto-load toggles, primary selector,
24
26
  and MCP import tool (disabled by default; base writes still gated).
25
- 10. **Mobile-first settings** – Compact `/settings` rendering by default on
27
+ 11. **Mobile-first settings** – Compact `/settings` rendering by default on
26
28
  Termux; TTS toggle exposed (opt-in).
27
- 11. **Shell parser fix** – Base64 polyfill in bundle banner to support
29
+ 12. **Shell parser fix** – Base64 polyfill in bundle banner to support
28
30
  web-tree-sitter on Node 22/24 (fixes `run_shell_command`).
29
- 12. **MCP SDK typings shim** – Local `.d.ts` shims for
31
+ 13. **MCP SDK typings shim** – Local `.d.ts` shims for
30
32
  `@modelcontextprotocol/sdk` to satisfy strict builds.
31
33
  [Details](./mcp-sdk-typings-shim.md)
32
34
 
33
35
  ## Expected Warnings
34
36
 
35
- - Missing native modules may log warnings on Termux; functionality remains
36
- (non-PTY shell, plain token storage).
37
+ - No node-pty warnings expected on Termux. If PTY fails to load, the CLI
38
+ falls back to `child_process`.
37
39
 
38
40
  ## Scope
39
41
 
@@ -117,10 +117,10 @@ if [ ! -f "package.json" ]; then
117
117
  exit 1
118
118
  fi
119
119
 
120
- # Install dependencies (suppress optional warnings)
120
+ # Install dependencies
121
121
  echo ""
122
122
  echo "Installing dependencies..."
123
- npm install --ignore-optional --ignore-scripts 2>&1 | grep -v "npm warn" || true
123
+ npm install
124
124
 
125
125
  # Build
126
126
  echo ""
@@ -148,7 +148,7 @@ Add target:
148
148
  # Termux-specific install and build
149
149
  termux-install:
150
150
  @echo "=== Installing for Termux ==="
151
- npm install --ignore-optional --ignore-scripts
151
+ npm install
152
152
  npm run build
153
153
  npm run bundle
154
154
  @echo ""
@@ -465,7 +465,7 @@ PHASE 5 (Docs) - High Priority
465
465
 
466
466
  ```bash
467
467
  # 1. Build test
468
- npm install --ignore-optional --ignore-scripts
468
+ npm install
469
469
  npm run build
470
470
  npm run bundle
471
471
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Project**: gemini-cli-termux
4
4
  **Author**: DioNanos
5
- **Last updated**: 2025-12-28
5
+ **Last updated**: 2026-01-08
6
6
  **Scope**: Version-agnostic strategy for maintaining all Termux patches
7
7
 
8
8
  ---
@@ -86,6 +86,8 @@ Likely conflict files:
86
86
  - `packages/core/src/services/contextManager.ts` - Keep JIT + JSON wiring
87
87
  - `packages/core/src/utils/contextMemory.ts` - Keep JSON memory logic
88
88
  - `packages/core/src/tools/shell.ts` - Keep TTS guard
89
+ - `packages/core/package.json` - Keep `@mmmbuto/node-pty-android-arm64` and remove `@lydell/node-pty-*`/`node-pty`
90
+ - `scripts/prepare-termux.cjs` - Keep Termux prepare no-op
89
91
 
90
92
  ### Step 4: Verify patches intact
91
93
 
@@ -100,6 +102,8 @@ ls -la scripts/termux-tools/
100
102
  # Check that modifications are present
101
103
  grep "TERMUX PATCH" esbuild.config.js
102
104
  grep "postinstall" package.json
105
+ grep "@mmmbuto/node-pty-android-arm64" packages/core/package.json
106
+ ls -la scripts/prepare-termux.cjs
103
107
  grep "termux-detect" packages/core/src/index.ts
104
108
  grep "memory.mode" packages/cli/src/config/settingsSchema.ts
105
109
  ```
@@ -107,7 +111,7 @@ grep "memory.mode" packages/cli/src/config/settingsSchema.ts
107
111
  ### Step 5: Build test
108
112
 
109
113
  ```bash
110
- npm install --ignore-optional --ignore-scripts
114
+ npm install
111
115
  npm run build
112
116
  npm run bundle
113
117
  node bundle/gemini.js --version
@@ -1,7 +1,7 @@
1
1
  # Patch Analysis & Improvement Proposals
2
2
 
3
- **Project**: gemini-cli-termux **Version**: 0.22.0-termux **Author**: DioNanos
4
- **Date**: 2025-12-17
3
+ **Project**: gemini-cli-termux **Version**: 0.24.6-termux **Author**: DioNanos
4
+ **Date**: 2026-01-08
5
5
 
6
6
  ---
7
7
 
@@ -71,40 +71,38 @@ export default isInCi;
71
71
 
72
72
  ```json
73
73
  {
74
- "optionalDependencies": {
75
- "@lydell/node-pty": "1.1.0",
76
- "@lydell/node-pty-darwin-arm64": "1.1.0",
77
- "@lydell/node-pty-darwin-x64": "1.1.0",
78
- "@lydell/node-pty-linux-x64": "1.1.0",
79
- "@lydell/node-pty-win32-arm64": "1.1.0",
80
- "@lydell/node-pty-win32-x64": "1.1.0",
81
- "node-pty": "^1.0.0"
74
+ "optionalDependencies": {
75
+ "@mmmbuto/node-pty-android-arm64": "1.1.0"
82
76
  }
83
77
  }
84
78
  ```
85
79
 
86
80
  **Purpose**: Allows installation without compiling native modules.
87
81
 
88
- **Status**: βœ… Functional, but with warnings
82
+ **Status**: βœ… Functional, clean install on Termux
89
83
 
90
84
  **Proposed Improvements**: See
91
85
  [Installation Improvements](#installation-improvements)
92
86
 
93
87
  ---
94
88
 
95
- ### 4. esbuild External Modules
89
+ ### 4. Prepare Script (Termux)
90
+
91
+ **File**: `scripts/prepare-termux.cjs`
92
+
93
+ **Purpose**: Skips `husky` + `bundle` work on Termux installs.
94
+
95
+ **Status**: βœ… Functional
96
+
97
+ ---
98
+
99
+ ### 5. esbuild External Modules
96
100
 
97
101
  **File**: `esbuild.config.js`
98
102
 
99
103
  ```javascript
100
104
  const external = [
101
- '@lydell/node-pty',
102
- 'node-pty',
103
- '@lydell/node-pty-darwin-arm64',
104
- '@lydell/node-pty-darwin-x64',
105
- '@lydell/node-pty-linux-x64',
106
- '@lydell/node-pty-win32-arm64',
107
- '@lydell/node-pty-win32-x64',
105
+ '@mmmbuto/node-pty-android-arm64',
108
106
  ];
109
107
  ```
110
108
 
@@ -118,14 +116,18 @@ const external = [
118
116
 
119
117
  ### Issue 1: Warning during npm install
120
118
 
121
- **Symptom**:
119
+ **Symptom (before Termux-only fork)**:
122
120
 
123
121
  ```
124
122
  npm warn optional SKIPPING OPTIONAL DEPENDENCY: @lydell/node-pty@1.1.0
125
123
  npm warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @lydell/node-pty-linux-x64
126
124
  ```
127
125
 
128
- **Proposed Solution**:
126
+ **Current Status**:
127
+
128
+ With `@mmmbuto/node-pty-android-arm64`, installs on Termux should be clean and avoid node-gyp.
129
+
130
+ **Legacy Proposed Solution**:
129
131
 
130
132
  #### A. Custom postinstall script
131
133
 
@@ -173,23 +175,19 @@ if (os.platform() === 'android' || process.env.TERMUX_VERSION) {
173
175
  }
174
176
  ```
175
177
 
176
- #### B. Documentation .npmrc
178
+ #### B. Documentation .npmrc (legacy)
177
179
 
178
- Create `.npmrc` with:
179
-
180
- ```ini
181
- # Suppress optional dependency warnings
182
- loglevel=error
183
- optional=false
184
- ```
185
-
186
- **Note**: Not recommended globally, but useful for advanced users.
180
+ Previously used to suppress optional dependency warnings. **Do not use
181
+ `optional=false` now**, because it disables the Termux PTY prebuild.
187
182
 
188
183
  ---
189
184
 
190
- ### Issue 2: Build from source requires manual flags
185
+ ### Issue 2: Build from source should not require manual flags
186
+
187
+ **Symptom (before `prepare-termux`)**: `npm install` ran desktop-only prepare
188
+ steps, so users relied on `--ignore-scripts`.
191
189
 
192
- **Symptom**: Users must remember `--ignore-optional --ignore-scripts`.
190
+ **Current Status**: `prepare` is now Termux-aware, so plain `npm install` works.
193
191
 
194
192
  **Proposed Solution**:
195
193
 
@@ -202,12 +200,12 @@ optional=false
202
200
 
203
201
  # Standard install (desktop)
204
202
  install:
205
- nnpm install
203
+ npm install
206
204
 
207
205
  # Termux-specific install
208
206
  termux-install:
209
207
  @echo "Installing for Termux..."
210
- npm install --ignore-optional --ignore-scripts
208
+ npm install
211
209
  npm run build
212
210
  npm run bundle
213
211
  @echo ""
@@ -241,7 +239,7 @@ fi
241
239
 
242
240
  # Install dependencies
243
241
  echo "Installing dependencies..."
244
- npm install --ignore-optional --ignore-scripts 2>&1 | grep -v "npm warn"
242
+ npm install
245
243
 
246
244
  # Build
247
245
  echo "Building..."
package/bundle/gemini.js CHANGED
@@ -106968,7 +106968,7 @@ import { fileURLToPath as fileURLToPath4 } from "node:url";
106968
106968
  import path12 from "node:path";
106969
106969
  async function getVersion() {
106970
106970
  const pkgJson = await getPackageJson(__dirname3);
106971
- return "0.24.5-termux";
106971
+ return "0.24.6-termux";
106972
106972
  }
106973
106973
  var __filename, __dirname3;
106974
106974
  var init_version2 = __esm({
@@ -161895,8 +161895,8 @@ var GIT_COMMIT_INFO, CLI_VERSION;
161895
161895
  var init_git_commit = __esm({
161896
161896
  "packages/core/dist/src/generated/git-commit.js"() {
161897
161897
  "use strict";
161898
- GIT_COMMIT_INFO = "50a8951a";
161899
- CLI_VERSION = "0.24.5-termux";
161898
+ GIT_COMMIT_INFO = "6db122206";
161899
+ CLI_VERSION = "0.24.6-termux";
161900
161900
  }
161901
161901
  });
161902
161902
 
@@ -327567,21 +327567,16 @@ var init_getPty = __esm({
327567
327567
  "packages/core/dist/src/utils/getPty.js"() {
327568
327568
  "use strict";
327569
327569
  getPty = async () => {
327570
- if (process.env["PREFIX"]?.includes("com.termux")) {
327570
+ const isAndroid2 = process.platform === "android" || process.env["PREFIX"]?.includes("com.termux");
327571
+ if (!isAndroid2) {
327571
327572
  return null;
327572
327573
  }
327573
327574
  try {
327574
- const lydell = "@lydell/node-pty";
327575
- const module2 = await import(lydell);
327576
- return { module: module2, name: "lydell-node-pty" };
327575
+ const mmmbuto = "@mmmbuto/node-pty-android-arm64";
327576
+ const module2 = await import(mmmbuto);
327577
+ return { module: module2, name: "mmmbuto-node-pty" };
327577
327578
  } catch (_e) {
327578
- try {
327579
- const nodePty = "node-pty";
327580
- const module2 = await import(nodePty);
327581
- return { module: module2, name: "node-pty" };
327582
- } catch (_e2) {
327583
- return null;
327584
- }
327579
+ return null;
327585
327580
  }
327586
327581
  };
327587
327582
  }
@@ -342115,7 +342110,7 @@ var init_shellExecutionService = __esm({
342115
342110
  error: error40,
342116
342111
  aborted: abortSignal.aborted,
342117
342112
  pid: ptyProcess.pid,
342118
- executionMethod: ptyInfo?.name ?? "node-pty"
342113
+ executionMethod: ptyInfo?.name ?? "mmmbuto-node-pty"
342119
342114
  });
342120
342115
  };
342121
342116
  if (abortSignal.aborted) {
@@ -445956,7 +445951,7 @@ var WarningMessage = ({ text }) => {
445956
445951
  };
445957
445952
 
445958
445953
  // packages/cli/src/generated/git-commit.ts
445959
- var GIT_COMMIT_INFO2 = "6db12220";
445954
+ var GIT_COMMIT_INFO2 = "6db122206";
445960
445955
 
445961
445956
  // packages/cli/src/ui/components/AboutBox.tsx
445962
445957
  var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmbuto/gemini-cli-termux",
3
- "version": "0.24.5-termux",
3
+ "version": "0.24.6-termux",
4
4
  "engines": {
5
5
  "node": ">=20.0.0"
6
6
  },
@@ -14,7 +14,7 @@
14
14
  "url": "https://github.com/DioNanos/gemini-cli-termux.git"
15
15
  },
16
16
  "config": {
17
- "sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.24.5-termux"
17
+ "sandboxImageUri": "us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.24.6-termux"
18
18
  },
19
19
  "scripts": {
20
20
  "start": "crossenv NODE_ENV=development node scripts/start.js",
@@ -53,7 +53,7 @@
53
53
  "format": "prettier --experimental-cli --write .",
54
54
  "typecheck": "npm run typecheck --workspaces --if-present",
55
55
  "preflight": "npm run clean && npm ci && npm run format && npm run build && npm run lint:ci && npm run typecheck && npm run test:ci",
56
- "prepare": "husky && npm run bundle",
56
+ "prepare": "node scripts/prepare-termux.cjs",
57
57
  "prepare:package": "node scripts/prepare-package.js",
58
58
  "release:version": "node scripts/version.js",
59
59
  "telemetry": "node scripts/telemetry.js",
@@ -26,10 +26,10 @@ if (isTermux) {
26
26
  'β•‘ β•‘',
27
27
  );
28
28
  console.log(
29
- 'β•‘ Note: Native module warnings above are EXPECTED. β•‘',
29
+ 'β•‘ PTY: @mmmbuto/node-pty-android-arm64 (no node-gyp). β•‘',
30
30
  );
31
31
  console.log(
32
- 'β•‘ The CLI works with reduced PTY functionality. β•‘',
32
+ 'β•‘ The CLI supports interactive PTY on Termux. β•‘',
33
33
  );
34
34
  console.log(
35
35
  'β•‘ β•‘',