@mmmbuto/gemini-cli-termux 0.22.7-termux → 0.24.1-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.
Files changed (103) hide show
  1. package/README.md +18 -78
  2. package/bundle/docs/TERMUX.md +97 -0
  3. package/bundle/docs/architecture.md +80 -0
  4. package/bundle/docs/assets/connected_devtools.png +0 -0
  5. package/bundle/docs/assets/gemini-screenshot.png +0 -0
  6. package/bundle/docs/assets/release_patch.png +0 -0
  7. package/bundle/docs/assets/theme-ansi-light.png +0 -0
  8. package/bundle/docs/assets/theme-ansi.png +0 -0
  9. package/bundle/docs/assets/theme-atom-one.png +0 -0
  10. package/bundle/docs/assets/theme-ayu-light.png +0 -0
  11. package/bundle/docs/assets/theme-ayu.png +0 -0
  12. package/bundle/docs/assets/theme-custom.png +0 -0
  13. package/bundle/docs/assets/theme-default-light.png +0 -0
  14. package/bundle/docs/assets/theme-default.png +0 -0
  15. package/bundle/docs/assets/theme-dracula.png +0 -0
  16. package/bundle/docs/assets/theme-github-light.png +0 -0
  17. package/bundle/docs/assets/theme-github.png +0 -0
  18. package/bundle/docs/assets/theme-google-light.png +0 -0
  19. package/bundle/docs/assets/theme-xcode-light.png +0 -0
  20. package/bundle/docs/changelogs/index.md +592 -0
  21. package/bundle/docs/changelogs/latest.md +225 -0
  22. package/bundle/docs/changelogs/preview.md +129 -0
  23. package/bundle/docs/changelogs/releases.md +896 -0
  24. package/bundle/docs/cli/authentication.md +3 -0
  25. package/bundle/docs/cli/checkpointing.md +94 -0
  26. package/bundle/docs/cli/commands.md +354 -0
  27. package/bundle/docs/cli/configuration.md +792 -0
  28. package/bundle/docs/cli/context-memory.md +69 -0
  29. package/bundle/docs/cli/custom-commands.md +315 -0
  30. package/bundle/docs/cli/enterprise.md +565 -0
  31. package/bundle/docs/cli/gemini-ignore.md +71 -0
  32. package/bundle/docs/cli/gemini-md.md +108 -0
  33. package/bundle/docs/cli/generation-settings.md +210 -0
  34. package/bundle/docs/cli/headless.md +388 -0
  35. package/bundle/docs/cli/index.md +63 -0
  36. package/bundle/docs/cli/keyboard-shortcuts.md +143 -0
  37. package/bundle/docs/cli/model-routing.md +37 -0
  38. package/bundle/docs/cli/model.md +62 -0
  39. package/bundle/docs/cli/sandbox.md +171 -0
  40. package/bundle/docs/cli/session-management.md +158 -0
  41. package/bundle/docs/cli/settings.md +114 -0
  42. package/bundle/docs/cli/system-prompt.md +93 -0
  43. package/bundle/docs/cli/telemetry.md +791 -0
  44. package/bundle/docs/cli/themes.md +237 -0
  45. package/bundle/docs/cli/token-caching.md +20 -0
  46. package/bundle/docs/cli/trusted-folders.md +95 -0
  47. package/bundle/docs/cli/tutorials.md +83 -0
  48. package/bundle/docs/cli/uninstall.md +47 -0
  49. package/bundle/docs/core/index.md +101 -0
  50. package/bundle/docs/core/memport.md +244 -0
  51. package/bundle/docs/core/policy-engine.md +267 -0
  52. package/bundle/docs/core/tools-api.md +131 -0
  53. package/bundle/docs/examples/proxy-script.md +83 -0
  54. package/bundle/docs/extensions/extension-releasing.md +183 -0
  55. package/bundle/docs/extensions/getting-started-extensions.md +245 -0
  56. package/bundle/docs/extensions/index.md +293 -0
  57. package/bundle/docs/faq.md +154 -0
  58. package/bundle/docs/get-started/authentication.md +321 -0
  59. package/bundle/docs/get-started/configuration-v1.md +888 -0
  60. package/bundle/docs/get-started/configuration.md +1511 -0
  61. package/bundle/docs/get-started/deployment.md +143 -0
  62. package/bundle/docs/get-started/examples.md +219 -0
  63. package/bundle/docs/get-started/gemini-3.md +116 -0
  64. package/bundle/docs/get-started/index.md +71 -0
  65. package/bundle/docs/get-started/installation.md +141 -0
  66. package/bundle/docs/hooks/best-practices.md +806 -0
  67. package/bundle/docs/hooks/index.md +665 -0
  68. package/bundle/docs/hooks/reference.md +168 -0
  69. package/bundle/docs/hooks/writing-hooks.md +1026 -0
  70. package/bundle/docs/ide-integration/ide-companion-spec.md +267 -0
  71. package/bundle/docs/ide-integration/index.md +202 -0
  72. package/bundle/docs/index.md +147 -0
  73. package/bundle/docs/integration-tests.md +211 -0
  74. package/bundle/docs/issue-and-pr-automation.md +134 -0
  75. package/bundle/docs/local-development.md +128 -0
  76. package/bundle/docs/mermaid/context.mmd +103 -0
  77. package/bundle/docs/mermaid/render-path.mmd +64 -0
  78. package/bundle/docs/npm.md +62 -0
  79. package/bundle/docs/patches/CONTEXT_MEMORY_COMPARISON.md +306 -0
  80. package/bundle/docs/patches/MERGE_TO_0.24_ANALYSIS.md +321 -0
  81. package/bundle/docs/patches/README.md +62 -0
  82. package/bundle/docs/quota-and-pricing.md +158 -0
  83. package/bundle/docs/release-confidence.md +164 -0
  84. package/bundle/docs/releases.md +540 -0
  85. package/bundle/docs/sidebar.json +297 -0
  86. package/bundle/docs/termux-api/COMMANDS.md +592 -0
  87. package/bundle/docs/termux-api/DISCOVERY_SETUP.md +670 -0
  88. package/bundle/docs/termux-api/EXECUTION_PLAN.md +532 -0
  89. package/bundle/docs/termux-api/MERGE_STRATEGY.md +325 -0
  90. package/bundle/docs/termux-api/PATCHES.md +483 -0
  91. package/bundle/docs/termux-api/README.md +416 -0
  92. package/bundle/docs/tools/file-system.md +217 -0
  93. package/bundle/docs/tools/index.md +95 -0
  94. package/bundle/docs/tools/mcp-server.md +1044 -0
  95. package/bundle/docs/tools/memory.md +54 -0
  96. package/bundle/docs/tools/shell.md +260 -0
  97. package/bundle/docs/tools/todos.md +57 -0
  98. package/bundle/docs/tools/web-fetch.md +59 -0
  99. package/bundle/docs/tools/web-search.md +42 -0
  100. package/bundle/docs/tos-privacy.md +96 -0
  101. package/bundle/docs/troubleshooting.md +158 -0
  102. package/bundle/gemini.js +8901 -6534
  103. package/package.json +10 -8
package/README.md CHANGED
@@ -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.22.2-termux (npm latest); 0.22.7-termux available on testing channel
32
+ gemini --version # expected: 0.24.1-termux (npm latest)
33
33
  ```
34
34
 
35
35
  Build from source:
@@ -65,11 +65,11 @@ node bundle/gemini.js --version
65
65
  ### 📚 Complete Documentation
66
66
 
67
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
68
+ - [GEMINI_TEST_REPORT_v0.24.0.md](./GEMINI_TEST_REPORT_v0.24.0.md) — PASS
69
+ (partial execution; interactive steps pending)
72
70
  - **[Test Suite](./GEMINI_TEST_SUITE.md)** - Test methodology and checklist
71
+ - **[Context Memory](./docs/cli/context-memory.md)** - Memory modes, JIT + JSON,
72
+ and setup guide
73
73
  - **[Patches & Fixes](./docs/patches/)** - Known issues and workarounds
74
74
 
75
75
  ### 🔧 Common Issues & Solutions
@@ -105,24 +105,22 @@ See [docs/patches/README.md](./docs/patches/README.md) for complete solutions.
105
105
  npm install -g @mmmbuto/gemini-cli-termux@latest
106
106
  ```
107
107
 
108
- ### Versions
108
+ ### Changelog (0.24.1-termux)
109
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
110
+ - **Memory Mode presets** in `/settings → Memory` (default / jit / jit+json).
111
+ - **JIT + JSON** combined memory support (ContextManager now loads JSON memory).
112
+ - **Memory settings reorganized** into a dedicated section; MCP import
113
+ categories hidden from UI.
114
+ - **Docs & tests refreshed** for 0.24.0-termux.
115
+ - **README cleanup**: legacy 0.22.x release sections removed.
113
116
 
114
117
  ## Tests
115
118
 
116
119
  - 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.
120
+ - Latest report:
121
+ - [`GEMINI_TEST_REPORT_v0.24.0.md`](./GEMINI_TEST_REPORT_v0.24.0.md) — PASS
122
+ (partial execution; interactive steps pending). Notes include
123
+ noninteractive tool confirmation limits.
126
124
 
127
125
  ## Termux-API Integration
128
126
 
@@ -134,9 +132,8 @@ features.
134
132
 
135
133
  - The Termux fork ships JSON context memory at
136
134
  `~/.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`.
135
+ `/settings → Memory` you can select **Memory Mode** (default / jit / jit+json)
136
+ and adjust Context Memory options (autoload, primary ordering, base writes).
140
137
  - TTS notifications are controlled by
141
138
  `/settings → Notifications → Enable TTS Notifications`. When disabled,
142
139
  `termux-tts-speak` is blocked even if an agent asks for it. These behaviors
@@ -171,63 +168,6 @@ Location, Camera, Dialog, Share, and more.
171
168
 
172
169
  See [docs/termux-api/](./docs/termux-api/) for complete documentation.
173
170
 
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
171
  ## Upstream Tracking
232
172
 
233
173
  - Upstream: https://github.com/google-gemini/gemini-cli
@@ -0,0 +1,97 @@
1
+ # Gemini CLI – Termux Guide
2
+
3
+ How to install and run the Termux edition `@mmmbuto/gemini-cli-termux` on
4
+ Android.
5
+
6
+ ## Prerequisites
7
+
8
+ - Termux installed
9
+ - Node.js 20+ (`pkg install nodejs-lts -y`)
10
+ - Git (only if building from source)
11
+
12
+ ## Install via npm (recommended)
13
+
14
+ ```bash
15
+ npm install -g @mmmbuto/gemini-cli-termux
16
+
17
+ gemini --version
18
+ # expected: 0.22.0-termux (latest)
19
+ ```
20
+
21
+ Features of the npm build
22
+
23
+ - ARM64/Android bundle included
24
+ - Termux clipboard patch (`PREFIX` -> `TERMUX__PREFIX`)
25
+ - Native modules left optional; no NDK required
26
+
27
+ ## Build from source (Termux fork)
28
+
29
+ ```bash
30
+ git clone https://github.com/DioNanos/gemini-cli-termux.git
31
+ cd gemini-cli-termux
32
+ npm install --ignore-optional --ignore-scripts
33
+ npm run build && npm run bundle
34
+ node bundle/gemini.js --version
35
+ ```
36
+
37
+ ## Known issues
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:
43
+ `node --no-deprecation bundle/gemini.js`.
44
+
45
+ ## Limitations
46
+
47
+ - No full PTY support → some interactive shell features limited
48
+ - No secure keychain → credentials stored in plain config files
49
+ - Bash parsing simplified (no tree-sitter)
50
+
51
+ ## Update
52
+
53
+ - npm: `npm install -g @mmmbuto/gemini-cli-termux@latest`
54
+ - source:
55
+ `git pull && npm install --ignore-optional --ignore-scripts && npm run build && npm run bundle`
56
+
57
+ ## Termux-API Support (Optional)
58
+
59
+ Enable access to Android hardware and APIs:
60
+
61
+ 1. Install Termux-API package:
62
+
63
+ ```bash
64
+ pkg install termux-api jq
65
+ ```
66
+
67
+ 2. Install Termux:API app from F-Droid
68
+
69
+ 3. Setup tool discovery:
70
+
71
+ ```bash
72
+ # Copy scripts to config
73
+ mkdir -p ~/.config/gemini/termux-tools
74
+ cp scripts/termux-tools/*.sh ~/.config/gemini/termux-tools/
75
+ chmod +x ~/.config/gemini/termux-tools/*.sh
76
+
77
+ # Configure in settings.json
78
+ cat > ~/.config/gemini/settings.json << 'EOF'
79
+ {
80
+ "tool_discovery_command": "bash ~/.config/gemini/termux-tools/discovery.sh",
81
+ "tool_call_command": "bash ~/.config/gemini/termux-tools/call.sh"
82
+ }
83
+ EOF
84
+ ```
85
+
86
+ 4. Test:
87
+ ```bash
88
+ gemini "What's my battery status?"
89
+ ```
90
+
91
+ See [docs/termux-api/](./docs/termux-api/) for complete documentation.
92
+
93
+ ## Report Termux issues
94
+
95
+ Use the fork issues: https://github.com/DioNanos/gemini-cli-termux/issues
96
+
97
+ Sunset: will deprecate when upstream adds native Termux support.
@@ -0,0 +1,80 @@
1
+ # Gemini CLI Architecture Overview
2
+
3
+ This document provides a high-level overview of the Gemini CLI's architecture.
4
+
5
+ ## Core components
6
+
7
+ The Gemini CLI is primarily composed of two main packages, along with a suite of
8
+ tools that can be used by the system in the course of handling command-line
9
+ input:
10
+
11
+ 1. **CLI package (`packages/cli`):**
12
+ - **Purpose:** This contains the user-facing portion of the Gemini CLI, such
13
+ as handling the initial user input, presenting the final output, and
14
+ managing the overall user experience.
15
+ - **Key functions contained in the package:**
16
+ - [Input processing](/docs/cli/commands.md)
17
+ - History management
18
+ - Display rendering
19
+ - [Theme and UI customization](/docs/cli/themes.md)
20
+ - [CLI configuration settings](/docs/get-started/configuration.md)
21
+
22
+ 2. **Core package (`packages/core`):**
23
+ - **Purpose:** This acts as the backend for the Gemini CLI. It receives
24
+ requests sent from `packages/cli`, orchestrates interactions with the
25
+ Gemini API, and manages the execution of available tools.
26
+ - **Key functions contained in the package:**
27
+ - API client for communicating with the Google Gemini API
28
+ - Prompt construction and management
29
+ - Tool registration and execution logic
30
+ - State management for conversations or sessions
31
+ - Server-side configuration
32
+
33
+ 3. **Tools (`packages/core/src/tools/`):**
34
+ - **Purpose:** These are individual modules that extend the capabilities of
35
+ the Gemini model, allowing it to interact with the local environment
36
+ (e.g., file system, shell commands, web fetching).
37
+ - **Interaction:** `packages/core` invokes these tools based on requests
38
+ from the Gemini model.
39
+
40
+ ## Interaction flow
41
+
42
+ A typical interaction with the Gemini CLI follows this flow:
43
+
44
+ 1. **User input:** The user types a prompt or command into the terminal, which
45
+ is managed by `packages/cli`.
46
+ 2. **Request to core:** `packages/cli` sends the user's input to
47
+ `packages/core`.
48
+ 3. **Request processed:** The core package:
49
+ - Constructs an appropriate prompt for the Gemini API, possibly including
50
+ conversation history and available tool definitions.
51
+ - Sends the prompt to the Gemini API.
52
+ 4. **Gemini API response:** The Gemini API processes the prompt and returns a
53
+ response. This response might be a direct answer or a request to use one of
54
+ the available tools.
55
+ 5. **Tool execution (if applicable):**
56
+ - When the Gemini API requests a tool, the core package prepares to execute
57
+ it.
58
+ - If the requested tool can modify the file system or execute shell
59
+ commands, the user is first given details of the tool and its arguments,
60
+ and the user must approve the execution.
61
+ - Read-only operations, such as reading files, might not require explicit
62
+ user confirmation to proceed.
63
+ - Once confirmed, or if confirmation is not required, the core package
64
+ executes the relevant action within the relevant tool, and the result is
65
+ sent back to the Gemini API by the core package.
66
+ - The Gemini API processes the tool result and generates a final response.
67
+ 6. **Response to CLI:** The core package sends the final response back to the
68
+ CLI package.
69
+ 7. **Display to user:** The CLI package formats and displays the response to
70
+ the user in the terminal.
71
+
72
+ ## Key design principles
73
+
74
+ - **Modularity:** Separating the CLI (frontend) from the Core (backend) allows
75
+ for independent development and potential future extensions (e.g., different
76
+ frontends for the same backend).
77
+ - **Extensibility:** The tool system is designed to be extensible, allowing new
78
+ capabilities to be added.
79
+ - **User experience:** The CLI focuses on providing a rich and interactive
80
+ terminal experience.
Binary file