@mmmbuto/gemini-cli-termux 0.24.4-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.3-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.3.md](./GEMINI_TEST_REPORT_v0.24.3.md) β€” PASS
69
- (partial execution; interactive steps pending)
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.3-termux)
103
+ ### Changelog (0.24.6-termux)
109
104
 
110
- - **Upstream merge**: v0.25.0-nightly integrated with Termux patches preserved.
111
- - **Build fixes**: MessageBus import compatibility + `@types/js-yaml` added.
112
- - **Docs/tests**: new test report for v0.24.3-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.3.md`](./GEMINI_TEST_REPORT_v0.24.3.md) β€” PASS
119
- (partial execution; interactive steps pending). Notes include
120
- non‑interactive tool confirmation 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,29 +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`).
31
+ 13. **MCP SDK typings shim** – Local `.d.ts` shims for
32
+ `@modelcontextprotocol/sdk` to satisfy strict builds.
33
+ [Details](./mcp-sdk-typings-shim.md)
29
34
 
30
35
  ## Expected Warnings
31
36
 
32
- - Missing native modules may log warnings on Termux; functionality remains
33
- (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`.
34
39
 
35
40
  ## Scope
36
41
 
@@ -0,0 +1,27 @@
1
+ # MCP SDK Type Shims (Termux Build)
2
+
3
+ **Purpose**: Work around missing TypeScript declarations in
4
+ `@modelcontextprotocol/sdk` for the Termux build, so `tsc --build` succeeds
5
+ under strict settings.
6
+
7
+ ## Problem
8
+
9
+ The MCP SDK package currently ships JS modules without `.d.ts` declarations in
10
+ our environment, which causes TypeScript errors (TS7016/TS2339/TS2722) during
11
+ CLI/core builds.
12
+
13
+ ## Patch Summary
14
+
15
+ We add minimal local `.d.ts` shims that cover only the APIs this fork uses.
16
+ These shims are **type-only** and **do not change runtime behavior**.
17
+
18
+ ## Files
19
+
20
+ - `packages/core/src/types/mcp-sdk-shims.d.ts`
21
+ - `packages/cli/src/types/mcp-sdk-shims.d.ts`
22
+
23
+ ## Notes
24
+
25
+ - Keep the shim surface aligned with actual usage in core/cli.
26
+ - Remove this patch once upstream ships proper TypeScript declarations for the
27
+ SDK (or once our build can consume them directly).
@@ -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