npm package: @mmmbuto/gemini-advanced
Description: Experimental Custom Gemini CLI optimized for Termux/Android, integrating features from Qwen Code.
Latest version: 0.1.1
Deprecated: Deprecated: use @mmmbuto/gemini-cli-termux

# 🤖 Gemini Advanced CLI (Experimental Termux Build)

**Experimental Custom Build** for Android/Termux.
This is an optimized fork of the Google Gemini CLI, enhanced with advanced features inspired by Qwen Code, specifically designed and built for the Termux environment.

[![npm](https://img.shields.io/npm/v/@mmmbuto/gemini-advanced?style=flat-square&logo=npm)](https://www.npmjs.com/package/@mmmbuto/gemini-advanced)
[![downloads](https://img.shields.io/npm/dt/@mmmbuto/gemini-advanced?style=flat-square)](https://www.npmjs.com/package/@mmmbuto/gemini-advanced)
[![ko-fi](https://img.shields.io/badge/☕_Support-Ko--fi-FF5E5B?style=flat-square&logo=ko-fi)](https://ko-fi.com/dionanos)

---

## ⚠️ Important Note

This project is an **experimental custom version**. It is specifically designed and built for **Termux on Android**. While the package structure is multi-platform compatible, we only maintain and test builds for the Termux/Android environment. For other platforms, please use the original Google Gemini CLI.

## 🚀 Features

- **Termux-Optimized**: Enhanced compatibility specifically for Android/Termux environments (no native dependencies required).
- **Advanced Policy Engine**: Sophisticated policy management with "Always Allow" functionality.
- **Enhanced Settings Validation**: Robust configuration validation using Zod schema.
- **API Key Priority System**: Improved credential management prioritizing environment variables.
- **Dual Upstream Integration**: Merging the best features from Google Gemini CLI and Qwen Code.
- **Native Module Handling**: Graceful fallbacks for `node-pty`, `keytar`, and `tree-sitter` on Android.

## 📦 Installation (Termux Only)

### Prerequisites (Termux)
```bash
pkg update && pkg upgrade -y
pkg install nodejs-lts -y
```

### Global Installation
```bash
npm install -g @mmmbuto/gemini-advanced
```

## 🖥️ Usage

```bash
gemini-advanced --version  # expected: 0.1.1 (latest)
gemini-advanced -p "Explain this project"
```

### Non-Interactive Mode
```bash
gemini-advanced -o json "Explain this codebase"
```

### Interactive Mode
```bash
gemini-advanced
```

## 🏗️ Architecture Overview

This project integrates advanced features inspired by Qwen Code into the Google Gemini CLI base, with specific optimizations for Android/Termux:

- **Advanced Policy Engine**: Implements sophisticated policy management with "Always Allow" functionality and granular control for shell and MCP tools
- **Settings Validation**: Enhanced configuration validation using Zod schema for improved reliability
- **API Key Management**: Improved credential handling with priority for environment variables
- **Android/Termux Optimizations**: Specific patches and configurations for optimal performance on Android devices

## 🧩 Patches Applied

- Clipboardy: sets `TERMUX__PREFIX` from `PREFIX` on Android
- Native modules (`keytar`, `node-pty`, `tree-sitter-bash`) marked optional; install with `--ignore-optional --ignore-scripts`
- Advanced Policy Engine: Implements "Always Allow" policies with granular shell & MCP support
- Settings Validation: Enhanced validation using Zod for settings schema
- API Key Priority: Prioritizes `GEMINI_API_KEY` env var over stored credentials
- Qwen-inspired Features: Integration of advanced features inspired by Qwen Code project

## 📁 Directory Structure

```
gemini-advancedd/
├── packages/
│   ├── cli/           # Main CLI interface
│   ├── core/          # Core functionality and services
│   └── ...            # Additional modules
├── scripts/           # Build and utility scripts
├── docs/              # Documentation
├── esbuild.config.js  # Bundling configuration
├── package.json       # Project manifest
└── README.md          # This file
```

## 🤝 Contributing

We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.

## 🔐 Security

Please see [SECURITY.md](./SECURITY.md) for information on reporting security vulnerabilities.

For more details on the advanced features incorporated from Qwen Code, see [ADVANCED_FEATURES.md](./ADVANCED_FEATURES.md).

## 📋 License

This project is released under the MIT License. See the [LICENSE](./LICENSE) file for details.

Original Google Gemini CLI code is licensed under Apache 2.0 as per the original project.