Compare commits

...
18 Commits
Author SHA1 Message Date
evandro 2a5d482c52 docs(readme): padroniza README (hero, badges, quickstart, arquitetura)
Release / Semantic Release (push) Successful in 11m32s
Tests / Unit Tests (push) Successful in 11m51s
Tests / Type Check (push) Successful in 11m32s
2026-10-24 04:13:00 +00:00
evandro 9d1ce44ea3 docs: redesign do README (padrão TwitterBR-MOD) — dados atualizados
Release / Semantic Release (push) Successful in 10m24s
Tests / Unit Tests (push) Successful in 10m51s
Tests / Type Check (push) Successful in 10m25s
2026-10-13 21:45:12 -03:00
Gemini Nexus Bot 42466c274b docs: establish dual license (CC-BY-NC-SA + MIT) and correct attribution
Tests / Unit Tests (push) Canceled after 0s
Tests / Type Check (push) Canceled after 0s
Release / Semantic Release (push) Successful in 10m18s
- Add LICENSE-MIT for all new code written by evandrodevbr
- Rewrite License section: dual structure (original code CC-BY-NC-SA, new code MIT)
- Add migration notice: project is transitioning to fully open-source MIT
- Rewrite Credits section: accurately attribute what Draculabo created vs what evandrodevbr rewrote
- Remove outdated 'commercial use prohibited' disclaimer
- Applied across all 4 languages (EN, PT-BR, ES, ZH-CN)
2026-05-02 03:14:15 -03:00
Gemini Nexus Bot 0dbae81353 docs: refine READMEs and highlight Windows SmartScreen warning
- Move Windows SmartScreen workaround instructions to a highly visible warning block at the top of the files
- Add SmartScreen instructions to the Installation / Downloads sections
- Standardize headings, hierarchy, and formatting across all 4 languages (EN, PT-BR, ES, ZH-CN)
- Polish text for better flow and clarity in 'Why Gemini Nexus?' and Tech Stack sections
2026-05-02 02:46:14 -03:00
Gemini Nexus Bot a4727713d2 Merge branch 'main' of https://github.com/evandrodevbr/GeminiNexus 2026-05-02 02:28:43 -03:00
Gemini Nexus Bot b13f06c0a3 ci: upload release assets sequentially with retry
Prevents 'HTTP 404: Not Found' and '502 Bad Gateway' errors from GitHub API
when attempting to upload many assets simultaneously using the gh cli.
2026-05-02 02:28:38 -03:00
semantic-release-bot 7a6587cb8b chore(release): 0.15.3
## [0.15.3](https://github.com/evandrodevbr/GeminiNexus/compare/v0.15.2...v0.15.3) (2026-05-02)

### 👷 Build System

* allow fs-xattr and appdmg to build in pnpm v10 ([1c26a9e](https://github.com/evandrodevbr/GeminiNexus/commit/1c26a9e542f3fa5a05b370b8a332ffe5a727ea92))
2026-05-02 05:13:21 +00:00
Gemini Nexus Bot e1c9a9e34a Merge branch 'main' of https://github.com/evandrodevbr/GeminiNexus 2026-05-02 02:12:25 -03:00
Gemini Nexus Bot 1c26a9e542 build: allow fs-xattr and appdmg to build in pnpm v10 2026-05-02 02:09:53 -03:00
semantic-release-bot 5026be12d2 chore(release): 0.15.2
## [0.15.2](https://github.com/evandrodevbr/GeminiNexus/compare/v0.15.1...v0.15.2) (2026-05-02)

### 👷 Build System

* allow macos-alias and other native modules to build in pnpm v10 ([2e3a65b](https://github.com/evandrodevbr/GeminiNexus/commit/2e3a65b76b91012638c422f6223b79399775c635))
2026-05-02 04:57:50 +00:00
Gemini Nexus Bot c05daba98b Merge branch 'main' of https://github.com/evandrodevbr/GeminiNexus 2026-05-02 01:57:07 -03:00
Gemini Nexus Bot 2e3a65b76b build: allow macos-alias and other native modules to build in pnpm v10
- Fixes MakerDMG failure (Cannot find module '../build/Release/volume.node')
- Add macos-alias, better-sqlite3, keytar, and electron to trustedDependencies and pnpm.onlyBuiltDependencies
- Also updated pnpm-workspace.yaml allowBuilds directive
2026-05-02 01:48:15 -03:00
semantic-release-bot 62634b5511 chore(release): 0.15.1
## [0.15.1](https://github.com/evandrodevbr/GeminiNexus/compare/v0.15.0...v0.15.1) (2026-05-02)

### ✅ Tests

* add universal electron mock to fix headless CI test runs ([1d35801](https://github.com/evandrodevbr/GeminiNexus/commit/1d35801980e3e54cec1d3e52ed75850eb7eec350))
* fix test environments failing due to missing IS_DEV_ENVIRONMENT mock export ([269ad18](https://github.com/evandrodevbr/GeminiNexus/commit/269ad18ed6c09585e881d0d916558b1bcc7ad940))
* update proxy-advanced-handler tests to reflect optional service registration ([f4daaa8](https://github.com/evandrodevbr/GeminiNexus/commit/f4daaa8ca13bc75c7e5090905176c06b61ecfedc))

### 👷 Build System

* replace MakerSquirrel with MakerZIP for Windows ([27223f5](https://github.com/evandrodevbr/GeminiNexus/commit/27223f587d7facf25beef77aa6984cd248f2703d))
2026-05-02 04:46:37 +00:00
Gemini Nexus Bot 27223f587d build: replace MakerSquirrel with MakerZIP for Windows
- Remove @electron-forge/maker-squirrel dependency
- Squirrel.Windows fails on modern Windows GitHub Actions runners with Win32Exception during zip creation
- We already use MakerWix which produces a much better .msi installer for Windows users
- Add MakerZIP support for win32 to provide a portable alternative alongside the MSI
2026-05-02 01:42:46 -03:00
Gemini Nexus Bot 1d35801980 test: add universal electron mock to fix headless CI test runs
Vitest workers throw 'Electron failed to install correctly' when backend unit tests indirectly import electron via path/util modules. This mock provides stubs for ipc, app, and BrowserWindow interfaces so happy-dom environments don't crash expecting native binaries.
2026-05-02 01:27:57 -03:00
Gemini Nexus Bot 269ad18ed6 test: fix test environments failing due to missing IS_DEV_ENVIRONMENT mock export 2026-05-02 01:18:12 -03:00
Gemini Nexus Bot 9b9b977ae6 Merge branch 'main' of https://github.com/evandrodevbr/GeminiNexus 2026-05-02 01:09:55 -03:00
Gemini Nexus Bot f4daaa8ca1 test: update proxy-advanced-handler tests to reflect optional service registration
- Mock service-registry correctly exposing getServiceOptional
- Update tests to expect successful fallback resolutions when services are not yet registered
- Remove obsolete error test that is now correctly handled via ConfigManager fallback
2026-05-02 01:05:06 -03:00
23 changed files with 3713 additions and 9188 deletions

No files matched your search

+15 -1
View File
@@ -118,6 +118,8 @@ jobs:
Write-Host "Incompatible WiX Toolset detected: $installed"
choco upgrade wixtoolset --version=3.14.0 --allow-downgrade -y
}
# Ensure 7zip is available for Squirrel.Windows zip operations
choco install 7zip -y
- name: Install dependencies
run: pnpm install --frozen-lockfile
@@ -223,4 +225,16 @@ jobs:
fi
printf 'Uploading %s assets to %s\n' "${#files[@]}" "$RELEASE_TAG"
gh release upload "$RELEASE_TAG" "${files[@]}" --clobber
# Upload files sequentially with retries to prevent GitHub API rate limits and 404/502 errors
for file in "${files[@]}"; do
echo "Uploading $file..."
if ! gh release upload "$RELEASE_TAG" "$file" --clobber; then
echo "::warning::Failed to upload $file. Retrying in 5 seconds..."
sleep 5
if ! gh release upload "$RELEASE_TAG" "$file" --clobber; then
echo "::error::Failed to upload $file after retry."
exit 1
fi
fi
done
+24
View File
@@ -2,6 +2,30 @@
# Changelog
## [0.15.3](https://github.com/evandrodevbr/GeminiNexus/compare/v0.15.2...v0.15.3) (2026-05-02)
### 👷 Build System
* allow fs-xattr and appdmg to build in pnpm v10 ([1c26a9e](https://github.com/evandrodevbr/GeminiNexus/commit/1c26a9e542f3fa5a05b370b8a332ffe5a727ea92))
## [0.15.2](https://github.com/evandrodevbr/GeminiNexus/compare/v0.15.1...v0.15.2) (2026-05-02)
### 👷 Build System
* allow macos-alias and other native modules to build in pnpm v10 ([2e3a65b](https://github.com/evandrodevbr/GeminiNexus/commit/2e3a65b76b91012638c422f6223b79399775c635))
## [0.15.1](https://github.com/evandrodevbr/GeminiNexus/compare/v0.15.0...v0.15.1) (2026-05-02)
### ✅ Tests
* add universal electron mock to fix headless CI test runs ([1d35801](https://github.com/evandrodevbr/GeminiNexus/commit/1d35801980e3e54cec1d3e52ed75850eb7eec350))
* fix test environments failing due to missing IS_DEV_ENVIRONMENT mock export ([269ad18](https://github.com/evandrodevbr/GeminiNexus/commit/269ad18ed6c09585e881d0d916558b1bcc7ad940))
* update proxy-advanced-handler tests to reflect optional service registration ([f4daaa8](https://github.com/evandrodevbr/GeminiNexus/commit/f4daaa8ca13bc75c7e5090905176c06b61ecfedc))
### 👷 Build System
* replace MakerSquirrel with MakerZIP for Windows ([27223f5](https://github.com/evandrodevbr/GeminiNexus/commit/27223f587d7facf25beef77aa6984cd248f2703d))
## [0.15.0](https://github.com/evandrodevbr/GeminiNexus/compare/v0.14.0...v0.15.0) (2026-05-02)
### ✨ Features
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025-present evandrodevbr
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+139 -55
View File
@@ -23,27 +23,48 @@
<img src="https://img.shields.io/github/license/evandrodevbr/GeminiNexus?style=flat-square" alt="Licencia" />
</a>
<img src="https://img.shields.io/badge/plataforma-Windows%20%7C%20macOS%20%7C%20Linux-informational?style=flat-square" alt="Plataforma" />
<img src="https://img.shields.io/badge/electron-latest-47848F?style=flat-square&logo=electron&logoColor=white" alt="Electron" />
</p>
> [!IMPORTANT]
> **Usuarios de Windows:** Si ves una advertencia de SmartScreen **"Windows protegió su PC"** durante la instalación, haz clic en **"Más información"** y luego en **"Ejecutar de todas formas"**. Esta es una advertencia de seguridad esperada para aplicaciones nuevas no firmadas.
---
## 📖 Tabla de Contenidos
- [✨ ¿Por qué Gemini Nexus?](#-por-qué-gemini-nexus)
- [🎯 Características](#-características)
- [📸 Capturas de Pantalla](#-capturas-de-pantalla)
- [⚡ Instalación e Inicio Rápido](#-instalación-e-inicio-rápido)
- [🛠️ Stack Tecnológico](#️-stack-tecnológico)
- [💻 Desarrollo](#-desarrollo)
- [❓ Preguntas Frecuentes](#-preguntas-frecuentes)
- [🤝 Contribuir](#-contribuir)
- [📄 Licencia](#-licencia)
---
## ✨ ¿Por qué Gemini Nexus?
Al usar IDEs y herramientas de programación con IA, ¿te has encontrado con estos problemas?
- 😫 La cuota de una sola cuenta se agota rápido, requiriendo cambios manuales frecuentes
- 🔄 Gestionar múltiples cuentas de Google/Claude es tedioso
- 📊 No sabes cuántos tokens has consumido o cuánta cuota queda
- 🔌 Necesitas un proxy local confiable que hable los protocolos OpenAI/Anthropic
- 😫 **Límites de cuota:** La cuota de una sola cuenta se agota rápido, requiriendo cambios manuales frecuentes.
- 🔄 **Gestión de cuentas:** Gestionar múltiples cuentas de Google/Claude es tedioso.
- 📊 **Uso a ciegas:** No sabes cuántos tokens has consumido o cuánta cuota queda.
- 🔌 **Problemas de integración:** Necesitas un proxy local confiable que hable los protocolos OpenAI/Anthropic de forma nativa.
- 🔍 **Falta de transparencia:** No puedes ver qué se envía o recibe exactamente a través del proxy.
**Gemini Nexus** resuelve todo esto. Es una aplicación de escritorio profesional en Electron que actúa como gateway inteligente entre tus herramientas de desarrollo y Google Gemini / Claude AI:
**Gemini Nexus** resuelve todo esto. Es una aplicación de escritorio profesional en Electron que actúa como gateway inteligente entre tus herramientas de desarrollo y Google Gemini / Claude AI.
- ✅ **Pool de Cuentas Ilimitado** — Agrega cualquier cantidad de cuentas Google Gemini y Claude
- ✅ **Cambio Automático Inteligente** — Rota automáticamente a la siguiente cuenta disponible cuando la cuota es baja
- ✅ **Analytics de Uso en Tiempo Real** — Dashboard nivel SaaS con gráficos de área, indicadores de tendencia y distribución por modelo
- ✅ **Observabilidad Completa del Proxy** — Monitor de tráfico en vivo, replay de solicitudes e inspector de capacidades de modelos
- ✅ **Compatible con OpenAI y Anthropic** — Proxy drop-in para Cursor, Windsurf, OpenCode y cualquier herramienta compatible
- ✅ **Seguro por Defecto** — Cifrado AES-256-GCM con gestión nativa de credenciales del SO
### Propuesta de Valor
- ✅ **Pool de Cuentas Ilimitado** — Agrega cualquier cantidad de cuentas Google Gemini y Claude.
- ✅ **Cambio Automático Inteligente** — Rota automáticamente a la siguiente cuenta disponible cuando la cuota es baja o hay rate limit.
- ✅ **Analytics de Uso en Tiempo Real** — Dashboard nivel SaaS con gráficos de área, indicadores de tendencia y distribución por modelo.
- ✅ **Observabilidad Completa del Proxy** — Monitor de tráfico en vivo, replay de solicitudes e inspector de capacidades de modelos.
- ✅ **Compatible con OpenAI y Anthropic** — Proxy drop-in para Cursor, Windsurf, OpenCode y cualquier herramienta compatible con OpenAI.
- ✅ **Seguro por Defecto** — Cifrado AES-256-GCM con gestión nativa de credenciales del sistema operativo.
---
@@ -79,7 +100,7 @@ Al usar IDEs y herramientas de programación con IA, ¿te has encontrado con est
<ul>
<li>Endpoint compatible con OpenAI <code>/v1/chat/completions</code></li>
<li>Endpoint compatible con Anthropic <code>/v1/messages</code></li>
<li>Soporte completo de streaming SSE</li>
<li>Soporte completo de streaming SSE (probado con Cursor, Windsurf, OpenCode)</li>
<li>Mapeo de modelos (ej: <code>claude-sonnet-4-6</code> → <code>gemini-3-flash</code>)</li>
<li>Puerto, timeout y API key configurables</li>
<li>Control de visibilidad de modelos</li>
@@ -99,17 +120,17 @@ Al usar IDEs y herramientas de programación con IA, ¿te has encontrado con est
<td width="50%">
<h3>🔍 Observabilidad del Proxy (Avanzado)</h3>
<ul>
<li><strong>Monitor de Tráfico</strong> — Log en vivo de solicitudes/respuestas</li>
<li><strong>Monitor de Tráfico</strong> — Log en vivo de solicitudes/respuestas con latencia y modelo</li>
<li><strong>Replay de Solicitudes</strong> — Reproduce cualquier solicitud para debugging</li>
<li><strong>Capacidades de Modelos</strong> — Inspecciona visión, thinking, streaming, modo JSON</li>
<li><strong>Herramientas para Devs</strong> — Generación de código cURL y Python</li>
<li><strong>Capacidades de Modelos</strong> — Inspecciona soporte de visión, thinking, streaming, modo JSON</li>
<li><strong>Herramientas para Devs</strong> — Generación de código cURL y Python, copia con un clic</li>
</ul>
</td>
<td width="50%">
<h3>🔐 Seguridad y Cifrado</h3>
<ul>
<li>Cifrado AES-256-GCM para todos los datos sensibles</li>
<li>Integración con gestor de credenciales nativo del SO</li>
<li>Integración con gestor de credenciales nativo del SO (Keytar + SafeStorage)</li>
<li>Migración automática de datos legacy en texto plano</li>
<li>Almacenamiento cifrado de tokens y cuotas por cuenta</li>
</ul>
@@ -119,8 +140,9 @@ Al usar IDEs y herramientas de programación con IA, ¿te has encontrado con est
<td width="50%">
<h3>⚙️ Configuración y Personalización</h3>
<ul>
<li>Tema Oscuro / Claro / Sistema</li>
<li>Soporte de temas Oscuro / Claro / Sistema</li>
<li>Multi-idioma: English & Português (Brasil)</li>
<li>Override de proxy URL por cuenta</li>
<li>Toggles de visibilidad de modelos</li>
<li>Acceso al directorio de logs</li>
</ul>
@@ -130,8 +152,9 @@ Al usar IDEs y herramientas de programación con IA, ¿te has encontrado con est
<ul>
<li>App nativa Electron con integración en bandeja del sistema</li>
<li>Sidebar colapsable con estado persistente</li>
<li>Layouts responsivos</li>
<li>Barra de estado con indicadores en vivo</li>
<li>Layouts responsivos en todas las vistas</li>
<li>Barra de estado con indicadores en vivo de proxy y conexión</li>
<li>Error boundaries con fallbacks amigables al usuario</li>
</ul>
</td>
</tr>
@@ -165,31 +188,46 @@ Al usar IDEs y herramientas de programación con IA, ¿te has encontrado con est
---
## ⚡ Inicio Rápido
## ⚡ Instalación e Inicio Rápido
### Requisitos Previos
### 📦 Descarga
- **Node.js** v20 o superior
- **npm**
Puedes descargar los binarios precompilados más recientes para Windows, macOS y Linux desde nuestra [página de Releases](https://github.com/evandrodevbr/GeminiNexus/releases).
### Compilar desde el Código Fuente
*(Consulta la advertencia en la parte superior de esta página si usas Windows y te encuentras con el aviso de SmartScreen).*
```bash
git clone https://github.com/evandrodevbr/GeminiNexus.git
cd GeminiNexus
npm install
npm start
### 🔌 Uso con IDEs de IA
# Compilar para producción
npm run make
```
### Uso con IDEs de IA
Con la aplicación en ejecución y al menos una cuenta agregada, configura tu IDE preferido (Cursor, Windsurf, OpenCode, etc.):
```plaintext
API Base URL: http://localhost:10100/v1
API Key: (copiar de la página Proxy en la app)
Model: gemini-3-flash
Model: gemini-3-flash (o cualquier modelo mapeado)
```
### 🛠️ Compilar desde el Código Fuente
#### Requisitos Previos
- **Node.js** v20 o superior
- **npm** (este proyecto usa `package-lock.json`)
#### Pasos
```bash
# Clonar el repositorio
git clone https://github.com/evandrodevbr/GeminiNexus.git
cd GeminiNexus
# Instalar dependencias
npm install
# Iniciar en modo desarrollo
npm start
# Compilar para producción (ej: instalador de Windows)
npm run make
```
---
@@ -209,44 +247,90 @@ Model: gemini-3-flash
---
## 💻 Desarrollo
```bash
# Iniciar entorno de dev (Electron + Vite HMR)
npm start
# Ejecutar linting
npm run lint
# Verificación de tipos
npm run type-check
# Formatear código
npm run format:write
# Ejecutar pruebas
npm test
```
---
## ❓ Preguntas Frecuentes
<details>
<summary><b>P: ¿La app no inicia?</b></summary>
1. Asegúrate de que las dependencias están instaladas: `npm install`
2. Node.js versión >= 20
3. Intenta eliminar `node_modules` y reinstalar
<summary><b>P: ¿Aviso de Windows SmartScreen ("Windows protegió su PC") durante la instalación?</b></summary>
Sí, este es un aviso común para nuevas aplicaciones no firmadas. Haz clic en **"Más información"** y luego en **"Ejecutar de todas formas"**. Consulta la advertencia en la parte superior del README para más detalles.
</details>
<details>
<summary><b>P: ¿El IDE no conecta al proxy?</b></summary>
1. Asegúrate de que el proxy está corriendo (indicador verde en la barra de estado)
2. Confirma que el puerto coincide (por defecto `10100`)
3. Copia la API key de la página Proxy
4. Asegúrate de tener al menos una cuenta activa
<summary><b>P: ¿La app no inicia al compilar desde el código fuente?</b></summary>
1. Asegúrate de que todas las dependencias están instaladas: `npm install`.
2. Verifica que tu versión de Node.js sea >= 20.
3. Intenta eliminar `node_modules` y reinstalar.
4. En Windows, asegúrate de que el WiX Toolset esté disponible para el comando `npm run make`.
</details>
<details>
<summary><b>P: ¿El inicio de sesión de la cuenta falló?</b></summary>
1. Asegúrate de que tu conexión a la red funcione correctamente.
2. Intenta borrar los datos de la app y volver a iniciar sesión.
3. Comprueba si la cuenta está restringida por Google/Claude.
</details>
<details>
<summary><b>P: ¿El IDE no se puede conectar al proxy?</b></summary>
1. Asegúrate de que el proxy esté funcionando (indicador verde en la barra de estado).
2. Confirma que el puerto coincide con tu configuración del IDE (por defecto `10100`).
3. Copia la API key directamente desde la página Proxy y pégala en la configuración de tu IDE.
4. Asegúrate de tener al menos una cuenta activa en la página Cuentas.
</details>
---
## 🤝 Contribuir
¡Las contribuciones son bienvenidas! Por favor lee `CONTRIBUTING.md` para más detalles.
---
## 📄 Licencia
[CC BY-NC-SA 4.0](LICENSE)
Este proyecto utiliza una estructura de licencia dual:
---
- **Código original** de [AntigravityManager](https://github.com/Draculabo/AntigravityManager) por [Draculabo](https://github.com/Draculabo): Licenciado bajo [CC BY-NC-SA 4.0](LICENSE).
- **Todo el código nuevo, funcionalidades y arquitectura** por [evandrodevbr](https://github.com/evandrodevbr): Licenciado bajo la [Licencia MIT](LICENSE-MIT).
## ⚠️ Aviso Legal
> [!WARNING]
> **Solo con Fines Educativos**
>
> Este proyecto está destinado exclusivamente a fines educativos y de investigación. Se proporciona "tal cual" sin ninguna garantía. **El uso comercial está estrictamente prohibido.**
> 🔄 **Aviso de Migración:** Este proyecto está siendo migrado activamente a una licencia completamente open-source (MIT). A medida que el código original restante se reescribe progresivamente, todo el proyecto hará la transición a MIT. Estamos comprometidos a hacer Gemini Nexus 100% open-source.
---
## 🙏 Créditos
**Gemini Nexus** es una versión significativamente mejorada y expandida del proyecto original [AntigravityManager](https://github.com/Draculabo/AntigravityManager) creado por [Draculabo](https://github.com/Draculabo). Toda la arquitectura fundamental y diseño fueron realizados por el autor original.
Este proyecto fue originalmente un fork de [AntigravityManager](https://github.com/Draculabo/AntigravityManager) creado por [Draculabo](https://github.com/Draculabo). El concepto inicial del proxy y la estructura base de Electron se basaron en su trabajo.
Desde el fork, **la gran mayoría del código ha sido reescrito, rediseñado y expandido** por [evandrodevbr](https://github.com/evandrodevbr), incluyendo pero no limitado a:
- Rediseño completo de UI/UX (navegación, cuentas, analíticas de uso, gestión del proxy)
- Dashboard de Analíticas de Uso con seguimiento de costos, promedios de tokens e integración con OpenRouter
- Monitor de tráfico con inspección de tokens/costos por solicitud
- Aislamiento de entorno (dev/prod), pipeline CI/CD e infraestructura de pruebas
- Configuración rápida para IDEs (OpenCode, Cursor, VS Code, Claude Code)
- Configuración personalizada de precios de modelos
- Toda la documentación e internacionalización (EN, PT-BR, ES, ZH-CN)
+139 -297
View File
@@ -1,348 +1,190 @@
<p align="center">
<img src="docs/assets/logo.png" alt="Gemini Nexus" width="128" height="128" />
</p>
<div align="center">
<h1 align="center">Gemini Nexus</h1>
<img src="docs/assets/logo.png" width="110" alt="Gemini Nexus logo">
<p align="center">
<strong>🚀 Professional multi-account AI gateway for Google Gemini & Claude</strong>
</p>
<h1>Gemini Nexus</h1>
<p align="center">
English | <a href="README.pt-BR.md">Português</a> | <a href="README.zh-CN.md">中文</a> | <a href="README.es.md">Español</a>
</p>
<p><strong>Desktop gateway that pools Google accounts behind a local OpenAI/Anthropic-compatible API, with encrypted credentials and auto-switching.</strong></p>
<p align="center">
<a href="https://github.com/evandrodevbr/GeminiNexus/releases">
<img src="https://img.shields.io/github/v/release/evandrodevbr/GeminiNexus?style=flat-square" alt="Release" />
</a>
<a href="https://github.com/evandrodevbr/GeminiNexus/releases">
<img src="https://img.shields.io/github/downloads/evandrodevbr/GeminiNexus/total?style=flat-square&color=blue" alt="Downloads" />
</a>
<a href="https://github.com/evandrodevbr/GeminiNexus/blob/main/LICENSE">
<img src="https://img.shields.io/github/license/evandrodevbr/GeminiNexus?style=flat-square" alt="License" />
</a>
<img src="https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-informational?style=flat-square" alt="Platform" />
<img src="https://img.shields.io/badge/electron-latest-47848F?style=flat-square&logo=electron&logoColor=white" alt="Electron" />
</p>
<a href="#-quickstart">Quickstart</a> ·
<a href="#-architecture">Architecture</a> ·
<a href="#-security-model">Security</a> ·
<a href="https://git.evandro.dev.br/evandro/gemini-nexus/issues">Issues</a>
---
![Stack](https://img.shields.io/badge/Stack-Electron_41_%C2%B7_React_19-47848F?logo=electron&logoColor=white)
![Status](https://img.shields.io/badge/status-v0.15.3_active-brightgreen)
![License](https://img.shields.io/badge/license-CC_BY--NC--SA_4.0_%2B_MIT-lightgrey)
## 📖 Table of Contents
<sub>English · <a href="README.pt-BR.md">Português</a> · <a href="README.zh-CN.md">中文</a> · <a href="README.es.md">Español</a></sub>
- [Why Gemini Nexus?](#-why-gemini-nexus)
- [Features](#-features)
- [Screenshots](#-screenshots)
- [Quick Start](#-quick-start)
- [Tech Stack](#️-tech-stack)
- [Development](#-development)
- [FAQ](#-faq)
- [Contributing](#-contributing)
- [License](#-license)
</div>
---
<hr />
## ✨ Why Gemini Nexus?
## 📌 The problem
When using AI-powered IDEs and coding tools, have you ever run into these problems?
Working with AI-powered IDEs and coding tools on a single Google account means quota that runs out, manual account switching, no idea how many tokens you spent, and no view of what the proxy actually sends upstream. Gemini Nexus keeps all accounts in one pool, switches between them automatically and shows the traffic.
- 😫 Single account quota runs out quickly, requiring frequent manual switching
- 🔄 Managing multiple Google/Claude accounts is cumbersome
- 📊 Don't know how much quota or tokens you've consumed
- 🔌 Need a reliable local API proxy that speaks OpenAI/Anthropic protocols
- 🔍 Can't see what's actually being sent/received by the proxy
## ✨ What it does
**Gemini Nexus** solves all of these. It's a professional Electron desktop application that acts as an intelligent gateway between your development tools and Google Gemini / Claude AI:
- **Pools** Google accounts added through OAuth, with status (Active, Rate Limited, Expired), last-used time and an optional per-account proxy URL.
- **Switches** accounts automatically when quota drops below 5 % or an account is rate-limited; `CloudMonitorService` polls quota every 5 minutes.
- **Schedules** requests across the pool in `cache-first`, `balance` (default) or `performance-first` mode, with a per-account circuit breaker (default backoff 60 s → 5 min → 30 min → 2 h).
- **Serves** `POST /v1/chat/completions` (OpenAI), `POST /v1/messages` (Anthropic), `GET /v1/models` and `GET /v1/models/capabilities`, so Cursor, Windsurf, OpenCode, Claude Code and similar clients can connect.
- **Maps** requested model names to upstream models through the `custom_mapping` and `anthropic_mapping` settings; request timeout defaults to 120 s.
- **Tracks** token usage per account and model, charts prompt and completion tokens, and estimates cost with editable per-model pricing.
- **Inspects** traffic (latency, status, model), replays logged requests and generates cURL and Python snippets plus an IDE Quick Setup.
- **Protects** stored credentials with AES-256-GCM and an OS-keychain master key (see [Security model](#-security-model)).
- ✅ **Unlimited Account Pool** — Add any number of Google Gemini & Claude accounts
- ✅ **Smart Auto-Switching** — Automatically rotates to the next available account when quota is low or rate-limited
- ✅ **Real-time Usage Analytics** — SaaS-grade dashboard with area charts, trend indicators, and model distribution
- ✅ **Full Proxy Observability** — Live traffic monitor, request replay, and model capabilities inspector
- ✅ **OpenAI & Anthropic Compatible** — Drop-in replacement proxy for Cursor, Windsurf, OpenCode, and any OpenAI-compatible tool
- ✅ **Secure by Default** — AES-256-GCM encryption with OS-native credential management
## 🖼️ Demo
---
<details>
<summary>Screenshots</summary>
## 🎯 Features
<p align="center"><img src="docs/assets/main.png" alt="Main dashboard" width="80%"></p>
<p align="center"><img src="docs/assets/2usage.png" alt="Usage analytics" width="80%"></p>
<p align="center"><img src="docs/assets/3proxy.png" alt="Proxy monitor" width="80%"></p>
<p align="center"><img src="docs/assets/4routing.png" alt="Routing config" width="80%"></p>
<p align="center"><img src="docs/assets/5docs.png" alt="Documentation" width="80%"></p>
<p align="center"><img src="docs/assets/6connections.png" alt="Active connections" width="80%"></p>
<p align="center"><img src="docs/assets/7config.png" alt="Settings" width="80%"></p>
<table>
<tr>
<td width="50%">
<h3>☁️ Cloud Account Pool</h3>
<ul>
<li>Add unlimited Google Gemini / Claude accounts via OAuth</li>
<li>Display avatar, email, status, and last used time</li>
<li>Real-time status monitoring (Active, Rate Limited, Expired)</li>
<li>Per-account proxy URL configuration</li>
<li>Device identity profile management with history</li>
</ul>
</td>
<td width="50%">
<h3>📊 Usage Analytics Dashboard</h3>
<ul>
<li>Real-time token consumption with 15s auto-refresh</li>
<li>Area charts for daily/hourly prompt & completion tokens</li>
<li>Trend indicators (% change vs previous period)</li>
<li>Inline sparklines on stat cards</li>
<li>Model distribution ranking with horizontal bar charts</li>
<li>Prompt/Completion ratio visualization</li>
</ul>
</td>
</tr>
<tr>
<td width="50%">
<h3>🔌 Local API Proxy (Gateway)</h3>
<ul>
<li>OpenAI <code>/v1/chat/completions</code> compatible endpoint</li>
<li>Anthropic <code>/v1/messages</code> compatible endpoint</li>
<li>Full SSE streaming support (tested with Cursor, Windsurf, OpenCode)</li>
<li>Model mapping (e.g. <code>claude-sonnet-4-6</code> → <code>gemini-3-flash</code>)</li>
<li>Configurable port, timeout, and API key</li>
<li>Model visibility control (show/hide specific models)</li>
</ul>
</td>
<td width="50%">
<h3>🔄 Intelligent Auto-Switching</h3>
<ul>
<li>Unlimited pool mode with smart backup selection</li>
<li>Auto-switch when quota < 5% or rate-limited</li>
<li>Background monitoring every 5 minutes</li>
<li>Graceful fallback with status reason tracking</li>
</ul>
</td>
</tr>
<tr>
<td width="50%">
<h3>🔍 Proxy Observability (Advanced)</h3>
<ul>
<li><strong>Traffic Monitor</strong> — Live request/response log with latency, status, and model info</li>
<li><strong>Request Replay</strong> — Replay any recorded request for debugging</li>
<li><strong>Model Capabilities</strong> — Inspect vision, thinking, streaming, JSON mode support per model</li>
<li><strong>Developer Tools</strong> — cURL & Python code generation, one-click copy</li>
</ul>
</td>
<td width="50%">
<h3>🔐 Security & Encryption</h3>
<ul>
<li>AES-256-GCM encryption for all sensitive data</li>
<li>OS native credential manager integration (Keytar + SafeStorage)</li>
<li>Auto migration of legacy plaintext data</li>
<li>Encrypted token & quota storage per account</li>
</ul>
</td>
</tr>
<tr>
<td width="50%">
<h3>⚙️ Settings & Customization</h3>
<ul>
<li>Dark / Light / System theme support</li>
<li>Multi-language: English & Português (Brasil)</li>
<li>Per-account proxy URL override</li>
<li>Model visibility toggles</li>
<li>Log directory access</li>
</ul>
</td>
<td width="50%">
<h3>🖥️ Desktop Experience</h3>
<ul>
<li>Native Electron app with system tray integration</li>
<li>Collapsible sidebar with persistent state</li>
<li>Responsive layouts across all views</li>
<li>Status bar with live proxy and connection indicators</li>
<li>Error boundaries with user-friendly fallbacks</li>
</ul>
</td>
</tr>
</table>
</details>
---
## 🚀 Quickstart
## 📸 Screenshots
**Use a release.** Download the build for your platform from [Releases](https://git.evandro.dev.br/evandro/gemini-nexus/releases), open the app, add at least one account, enable the proxy (it is disabled by default) and point your IDE at it:
```text
API Base URL: http://localhost:8045/v1 (default, configurable on the Proxy page; development builds use 8046)
API Key: (copy it from the Proxy page in the app)
Model: gemini-3-flash (or any mapped model)
```
<p align="center">
<img src="docs/assets/main.png" alt="Main" width="80%" />
</p>
<p align="center">
<img src="docs/assets/2usage.png" alt="Usage" width="80%" />
</p>
<p align="center">
<img src="docs/assets/3proxy.png" alt="Proxy" width="80%" />
</p>
<p align="center">
<img src="docs/assets/4routing.png" alt="Routing" width="80%" />
</p>
<p align="center">
<img src="docs/assets/5docs.png" alt="Docs" width="80%" />
</p>
<p align="center">
<img src="docs/assets/6connections.png" alt="Connections" width="80%" />
</p>
<p align="center">
<img src="docs/assets/7config.png" alt="Config" width="80%" />
</p>
> [!WARNING]
> Builds are not code-signed. If Windows shows "Windows protected your PC", click **More info → Run anyway**.
---
**Build from source.**
## ⚡ Quick Start
### Prerequisites
- **Node.js** v20 or higher
- **npm** (this project uses `package-lock.json`)
### Build from Source
| Tool | Minimum version |
|---|---|
| Node.js | 20+ (recommended in `AGENTS.md`; `.nvmrc` pins 22.17.1) |
| pnpm | 10.11.0 (`packageManager`; lockfile is `pnpm-lock.yaml`) |
| Native toolchain | needed by `better-sqlite3` and `keytar`: Visual Studio 2022 Build Tools (C++) on Windows, Xcode Command Line Tools on macOS, `build-essential` + `python3` + `libsecret-1-dev` on Ubuntu (`base-devel` + `python` + `libsecret` on Arch) |
```bash
# Clone the repository
git clone https://github.com/evandrodevbr/GeminiNexus.git
cd GeminiNexus
# Install dependencies
npm install
# Start development
npm start
# Build for production (Windows installer)
npm run make
git clone https://git.evandro.dev.br/evandro/gemini-nexus.git
cd gemini-nexus
pnpm install # postinstall runs scripts/setup-dev.js --check-only to verify the toolchain
pnpm start # dev mode (Electron + Vite HMR)
pnpm run make # installers/packages for the current platform
pnpm run make:win # Windows: extracts WiX from wix314-binaries.zip, then runs make
```
### Using with AI IDEs
There is no `.env.example` and no variable is required. Optional variables read by the code or described in the docs:
Once the proxy is running, configure your IDE:
| Variable | Required | Description |
|---|---|---|
| `HTTP_PROXY` / `HTTPS_PROXY` / `NO_PROXY` | No | Route the app's outbound requests through a local proxy (see [TLS inspection](#-security-model)). |
| `NODE_EXTRA_CA_CERTS` | No | Extra CA certificate for Node-side TLS when inspecting traffic. |
| `SENTRY_DSN` | No | Sentry DSN used when error reporting is enabled. |
```plaintext
# In Cursor / Windsurf / OpenCode settings:
API Base URL: http://localhost:10100/v1
API Key: (copy from the Proxy page in the app)
Model: gemini-3-flash (or any mapped model)
## 🧱 Architecture
```mermaid
flowchart LR
C["Client: Cursor, Windsurf, OpenCode, Claude Code"] -->|"/v1/chat/completions, /v1/messages"| P["NestJS proxy, port 8045"]
P --> S["Account scheduler and circuit breaker"]
S -->|"Google OAuth account"| G["Google upstream APIs"]
M["CloudMonitor and AutoSwitch, quota every 5 min"] -->|"quota polling"| G
S -->|"reads accounts"| DB[("SQLite: better-sqlite3 and Drizzle")]
M --> DB
K["AES-256-GCM, master key in OS keychain"] -->|"encrypts tokens"| DB
```
---
1. A client sends OpenAI- or Anthropic-format requests to the NestJS proxy (Fastify, bound to `0.0.0.0`).
2. The proxy guard checks the API key when one is configured; with an empty key the proxy runs in open mode.
3. The token manager picks an account according to the scheduling mode and each account's circuit-breaker state, then calls Google's upstream APIs with that account's OAuth token.
4. `CloudMonitorService` polls quota every 5 minutes and `AutoSwitchService` switches the active account when quota is below 5 % or the account is rate-limited.
5. The React 19 renderer (TanStack Router and Query) talks to the main process over oRPC on IPC; accounts, usage and settings live in SQLite (better-sqlite3 + Drizzle). Design notes: [`docs/cloud_features.md`](docs/cloud_features.md).
## 🛠️ Tech Stack
## 🔒 Security model
| Category | Technologies |
|----------|-------------|
| **Core** | [Electron](https://www.electronjs.org/), [React 19](https://react.dev/), [TypeScript](https://www.typescriptlang.org/) |
| **Build** | [Vite](https://vitejs.dev/), [Electron Forge](https://www.electronforge.io/) |
| **Styling** | [Tailwind CSS v4](https://tailwindcss.com/), [Radix UI](https://www.radix-ui.com/), [Lucide Icons](https://lucide.dev/) |
| **State** | [TanStack Query](https://tanstack.com/query/latest), [TanStack Router](https://tanstack.com/router/latest) |
| **Backend** | [NestJS](https://nestjs.com/) (internal gateway), [ORPC](https://orpc.unnoq.com/) (type-safe RPC) |
| **Database** | [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3), [Drizzle ORM](https://orm.drizzle.team/) |
| **Charts** | [Nivo](https://nivo.rocks/) (Line, Bar, Pie) |
| **i18n** | [react-i18next](https://react.i18next.com/) |
| **Testing** | [Vitest](https://vitest.dev/), [Playwright](https://playwright.dev/) |
Gemini Nexus holds OAuth tokens for several accounts and forwards traffic upstream, so credential handling is the core of the design. Everything below is implemented in this repository; limits are stated where they exist.
---
- **Credential storage and isolation.** `token_json` and `quota_json` are encrypted with AES-256-GCM (unique IV per operation, authenticated) before they reach SQLite. The master key lives in the OS credential store through `keytar` (Windows Credential Manager, macOS Keychain, Linux Secret Service/libsecret), never in a plain file. Legacy plaintext rows are migrated at startup. Accounts are kept in their own database (`cloud_accounts.db`), independent from the IDE's local database.
- **Log masking.** Keys such as `token`, `refresh_token`, `api_key`, `authorization`, `cookie` and `client_secret` are replaced by `[REDACTED]` before logging ([`src/utils/sensitiveDataMasking.ts`](src/utils/sensitiveDataMasking.ts)); the traffic logger also redacts the `authorization`, `x-api-key` and `cookie` headers.
- **Request logging, not an audit trail.** Winston writes API, traffic and app logs to rotating files (API log: 30 days, 50 MB per file). These are operational logs, not a tamper-evident audit trail; the `*-audit.json` files are rotation bookkeeping from `winston-daily-rotate-file`.
- **Proxy access.** The proxy is off by default. Once enabled it listens on `0.0.0.0`, and requests are authenticated only when `api_key` is non-empty (empty means open mode). Set a key and keep it private.
- **TLS inspection (debugging only).** [`docs/proxyman-install.md`](docs/proxyman-install.md) and [`docs/proxyman-debugging.md`](docs/proxyman-debugging.md) explain how to read the app's HTTPS traffic with Proxyman: trust its root CA, set the proxy variables and `NODE_EXTRA_CA_CERTS`, then start the app. `NODE_TLS_REJECT_UNAUTHORIZED=0` (and the script's `-AllowInsecureTls` flag) is a temporary override; never leave it on. Do not commit proxy addresses, certificate paths, cookies or OAuth codes, and redact logs before sharing them. `scripts/start-antigravity-with-proxyman.ps1` targets the installed official Antigravity client, not this app.
- **Error reporting.** Sentry reports (they need `SENTRY_DSN`) are gated by the `error_reporting_enabled` setting, which `DEFAULT_APP_CONFIG` ships as `true`; turn it off in Settings to opt out. The Windows user-name segment is masked in reported exception messages.
## 💻 Development
Supported versions and how to report a vulnerability: [`SECURITY.md`](SECURITY.md).
```bash
# Start dev environment (Electron + Vite HMR)
npm start
## 🗂️ Structure
# Run linting
npm run lint
# Type check
npm run type-check
# Format code
npm run format:write
# Run tests
npm test
```
### Project Structure
```plaintext
```text
src/
├── actions/ # App actions and flow orchestration
├── components/ # React UI components
│ ├── proxy/ # Proxy page components (advanced tabs)
│ ├── usage/ # Usage analytics components (StatCard, ChartCard)
│ └── ui/ # Base UI primitives (Radix-based)
├── hooks/ # Custom React hooks
├── ipc/ # Electron IPC + database handlers
├── layouts/ # Layout components (MainLayout + sidebar)
├── localization/ # i18n translation resources
├── routes/ # TanStack Router pages (index, usage, proxy, settings)
├── server/ # NestJS backend (proxy gateway service)
├── services/ # Service layer
├── types/ # TypeScript type definitions + Zod schemas
└── utils/ # Utility functions
├── components/ # UI (proxy/, usage/, ui/ primitives)
├── ipc/ # oRPC routers (account, cloud, config, gateway, usage...)
├── server/ # NestJS proxy gateway (modules: proxy, usage)
├── services/ # AutoSwitchService, CloudMonitorService, GoogleAPIService
├── routes/ # index, usage, proxy, settings
├── utils/ # paths, logger, sensitiveDataMasking
└── tests/ # unit tests (Vitest) and E2E (Playwright)
cli/ # separate Python CLI for account switching and quota checks
docs/ # design notes and Proxyman guides
scripts/ # setup-dev, build-windows, generate-assets
```
---
## 🧪 Scripts
## ❓ FAQ
| Command | What it does |
|---|---|
| `pnpm start` | Run the app in dev mode (`electron-forge start`, with `DEBUG=electron-forge:*`). |
| `pnpm run dev` | Same as `start`. |
| `pnpm run package` | Package the app with Electron Forge, without building installers. |
| `pnpm run make` | Build installers/packages for the current platform. |
| `pnpm run make:win` | Windows build helper: extracts WiX from `wix314-binaries.zip`, adds it to `PATH`, runs `electron-forge make`. |
| `pnpm run publish` | Publish through Electron Forge. |
| `pnpm run setup` | Run `scripts/setup-dev.js`: detect the native toolchain and install or guide the setup. |
| `pnpm run postinstall` | `scripts/setup-dev.js --check-only`; runs automatically after `pnpm install`. |
| `pnpm run lint` | ESLint over the repo. |
| `pnpm run format` | Prettier check. |
| `pnpm run format:write` | Prettier write. |
| `pnpm test` | Vitest unit tests (`vitest run`). |
| `pnpm run test:watch` | Vitest in watch mode. |
| `pnpm run test:unit` | Vitest (default mode). |
| `pnpm run test:e2e` | Playwright E2E tests. |
| `pnpm run test:all` | Unit tests, then Playwright. |
| `pnpm run type-check` | `tsc --noEmit`. |
<details>
<summary><b>Q: The app won't start?</b></summary>
## 📚 Documentation
1. Make sure all dependencies are installed: `npm install`
2. Check if Node.js version is >= 20
3. Try deleting `node_modules` and reinstalling
4. On Windows, ensure the WiX Toolset is available for `npm run make`
- [`docs/cloud_features.md`](docs/cloud_features.md): account pool, quota monitoring and auto-switch design.
- [`docs/proxyman-install.md`](docs/proxyman-install.md) and [`docs/proxyman-debugging.md`](docs/proxyman-debugging.md): TLS inspection setup (Windows).
- [`docs/OpencodeAPI.md`](docs/OpencodeAPI.md): OpenCode custom-endpoint integration (in Portuguese).
- [`cli/README.md`](cli/README.md): the Python command-line tool.
- [`CONTRIBUTING.md`](CONTRIBUTING.md), [`SECURITY.md`](SECURITY.md), [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md), [`CHANGELOG.md`](CHANGELOG.md), [`LICENSE`](LICENSE), [`LICENSE-MIT`](LICENSE-MIT).
- Translations: [Português](README.pt-BR.md), [中文](README.zh-CN.md), [Español](README.es.md).
</details>
## 🛣️ Limitations and next steps
<details>
<summary><b>Q: Account login failed?</b></summary>
1. Ensure network connection is working
2. Try clearing app data and logging in again
3. Check if the account is restricted by Google/Claude
</details>
<details>
<summary><b>Q: IDE can't connect to the proxy?</b></summary>
1. Make sure the proxy is running (green indicator in the status bar)
2. Verify the port matches your IDE config (default: `10100`)
3. Copy the API key from the Proxy page and paste it in your IDE settings
4. Check that at least one account is active in the Accounts page
</details>
<details>
<summary><b>Q: Token counts show zero?</b></summary>
1. This was a known bug in earlier versions — update to the latest version
2. Token tracking now correctly handles streaming metadata and estimated counts
3. Usage data refreshes every 15 seconds on the Usage Analytics page
</details>
---
- Upstream access goes through Google's `v1internal` Cloud Code endpoints and OAuth scopes ([`src/services/GoogleAPIService.ts`](src/services/GoogleAPIService.ts)). These are internal, undocumented APIs and may change without notice. The project is unofficial and not affiliated with Google or Anthropic.
- Accounts are added through Google OAuth; Claude models are reached through model mapping, not through separate Claude accounts.
- End-to-end tests are not run in CI (Electron needs a graphical environment); run `pnpm run test:e2e` locally.
- The Windows MSI is only produced when the WiX Toolset is available on the build machine; otherwise the Windows artifact is the ZIP.
- The workflows in `.github/workflows/` are written for GitHub (they call the `gh` CLI and the GitHub release publisher), so this README shows no CI badge.
- Next step stated by the project: migrate the remaining original code to MIT (see [License](#-license)).
## 🤝 Contributing
Contributions are welcome! Please read `CONTRIBUTING.md` for details.
Read [`CONTRIBUTING.md`](CONTRIBUTING.md) and [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md). Releases are versioned by semantic-release from Conventional Commits. Before opening a PR, these must pass:
---
```bash
pnpm run lint && pnpm run format:write && pnpm run type-check && pnpm test
```
## 📄 License
[CC BY-NC-SA 4.0](LICENSE)
---
## ⚠️ Disclaimer
> [!WARNING]
> **For Educational Purposes Only**
>
> This project is intended solely for educational and research purposes. It is provided "as-is" without any warranty. **Commercial use is strictly prohibited.**
>
> By using this software, you agree that you will not use it for any commercial purposes, and you are solely responsible for ensuring your use complies with all applicable laws and regulations. The authors and contributors are not responsible for any misuse or damages arising from the use of this software.
---
## 🙏 Credits
**Gemini Nexus** is a significantly enhanced and expanded version of the original project [AntigravityManager](https://github.com/Draculabo/AntigravityManager) created by [Draculabo](https://github.com/Draculabo). All fundamental architecture and design were made by the original author.
Mixed licensing: code inherited from [AntigravityManager](https://github.com/Draculabo/AntigravityManager) (by Draculabo) is [CC BY-NC-SA 4.0](LICENSE) (non-commercial, share-alike); all new code is [MIT](LICENSE-MIT). The project is migrating to MIT as the remaining original code is rewritten, so check both files before any commercial use.
+88 -70
View File
@@ -26,19 +26,22 @@
<img src="https://img.shields.io/badge/electron-latest-47848F?style=flat-square&logo=electron&logoColor=white" alt="Electron" />
</p>
> [!IMPORTANT]
> **Usuários do Windows:** Se você vir um aviso do SmartScreen **"O Windows protegeu o seu computador"** durante a instalação, clique em **"Mais informações"** e depois em **"Executar mesmo assim"**. Isso é um aviso de segurança esperado para aplicativos novos e não assinados.
---
## 📖 Sumário
- [Por que o Gemini Nexus?](#-por-que-o-gemini-nexus)
- [Funcionalidades](#-funcionalidades)
- [Screenshots](#-screenshots)
- [Início Rápido](#-início-rápido)
- [Stack Tecnológica](#️-stack-tecnológica)
- [Desenvolvimento](#-desenvolvimento)
- [FAQ](#-faq)
- [Contribuindo](#-contribuindo)
- [Licença](#-licença)
- [✨ Por que o Gemini Nexus?](#-por-que-o-gemini-nexus)
- [🎯 Funcionalidades](#-funcionalidades)
- [📸 Screenshots](#-screenshots)
- [⚡ Instalação e Início Rápido](#-instalação-e-início-rápido)
- [🛠️ Stack Tecnológica](#️-stack-tecnológica)
- [💻 Desenvolvimento](#-desenvolvimento)
- [❓ FAQ](#-faq)
- [🤝 Contribuindo](#-contribuindo)
- [📄 Licença](#-licença)
---
@@ -46,20 +49,22 @@
Ao usar IDEs e ferramentas de programação com IA, você já enfrentou estes problemas?
- 😫 A cota da conta única acaba rápido, exigindo trocas manuais frequentes
- 🔄 Gerenciar múltiplas contas do Google/Claude é cansativo
- 📊 Não sabe quantos tokens já consumiu ou quanta cota resta
- 🔌 Precisa de um proxy local confiável que fale os protocolos OpenAI/Anthropic
- 🔍 Não consegue ver o que está sendo enviado/recebido pelo proxy
- 😫 **Limites de cota:** A cota da conta única acaba rápido, exigindo trocas manuais frequentes.
- 🔄 **Gestão de contas:** Gerenciar múltiplas contas do Google/Claude é cansativo.
- 📊 **Uso às cegas:** Você não sabe quantos tokens já consumiu ou quanta cota resta.
- 🔌 **Problemas de integração:** Precisa de um proxy local confiável que fale os protocolos OpenAI/Anthropic nativamente.
- 🔍 **Falta de transparência:** Não consegue ver o que está sendo enviado ou recebido pelo proxy nos bastidores.
**Gemini Nexus** resolve tudo isso. É um aplicativo desktop profissional em Electron que funciona como um gateway inteligente entre suas ferramentas de desenvolvimento e o Google Gemini / Claude AI:
O **Gemini Nexus** resolve tudo isso. É um aplicativo desktop profissional em Electron que funciona como um gateway inteligente entre suas ferramentas de desenvolvimento e o Google Gemini / Claude AI.
- ✅ **Pool de Contas Ilimitado** — Adicione quantas contas Google Gemini & Claude quiser
- ✅ **Troca Automática Inteligente** — Rotaciona automaticamente para a próxima conta disponível quando a cota está baixa ou com rate limit
- ✅ **Analytics de Uso em Tempo Real** — Dashboard nível SaaS com gráficos de área, indicadores de tendência e distribuição por modelo
- ✅ **Observabilidade Completa do Proxy** — Monitor de tráfego ao vivo, replay de requisições e inspetor de capacidades dos modelos
- ✅ **Compatível com OpenAI & Anthropic** — Proxy drop-in para Cursor, Windsurf, OpenCode e qualquer ferramenta compatível com OpenAI
- ✅ **Seguro por Padrão** — Criptografia AES-256-GCM com gerenciamento nativo de credenciais do SO
### Principais Vantagens
- ✅ **Pool de Contas Ilimitado** — Adicione quantas contas Google Gemini & Claude quiser.
- ✅ **Troca Automática Inteligente** — Rotaciona automaticamente para a próxima conta disponível quando a cota está baixa ou com rate limit.
- ✅ **Analytics de Uso em Tempo Real** — Dashboard nível SaaS com gráficos de área, indicadores de tendência e distribuição por modelo.
- ✅ **Observabilidade Completa do Proxy** — Monitor de tráfego ao vivo, replay de requisições e inspetor de capacidades dos modelos.
- ✅ **Compatível com OpenAI & Anthropic** — Proxy drop-in para Cursor, Windsurf, OpenCode e qualquer ferramenta compatível com OpenAI.
- ✅ **Seguro por Padrão** — Criptografia AES-256-GCM com gerenciamento nativo de credenciais do sistema operacional.
---
@@ -98,7 +103,7 @@ Ao usar IDEs e ferramentas de programação com IA, você já enfrentou estes pr
<li>Streaming SSE completo (testado com Cursor, Windsurf, OpenCode)</li>
<li>Mapeamento de modelos (ex: <code>claude-sonnet-4-6</code> → <code>gemini-3-flash</code>)</li>
<li>Porta, timeout e API key configuráveis</li>
<li>Controle de visibilidade de modelos (mostrar/ocultar modelos específicos)</li>
<li>Controle de visibilidade de modelos</li>
</ul>
</td>
<td width="50%">
@@ -115,9 +120,9 @@ Ao usar IDEs e ferramentas de programação com IA, você já enfrentou estes pr
<td width="50%">
<h3>🔍 Observabilidade do Proxy (Avançado)</h3>
<ul>
<li><strong>Monitor de Tráfego</strong> — Log ao vivo de requisições/respostas com latência, status e informações do modelo</li>
<li><strong>Monitor de Tráfego</strong> — Log ao vivo de requisições/respostas com latência e informações do modelo</li>
<li><strong>Replay de Requisições</strong> — Reproduza qualquer requisição registrada para debugging</li>
<li><strong>Capacidades dos Modelos</strong> — Inspecione suporte a visão, thinking, streaming e modo JSON por modelo</li>
<li><strong>Capacidades dos Modelos</strong> — Inspecione suporte a visão, thinking, streaming e modo JSON</li>
<li><strong>Ferramentas para Devs</strong> — Geração de código cURL & Python, cópia com um clique</li>
</ul>
</td>
@@ -125,7 +130,7 @@ Ao usar IDEs e ferramentas de programação com IA, você já enfrentou estes pr
<h3>🔐 Segurança e Criptografia</h3>
<ul>
<li>Criptografia AES-256-GCM para todos os dados sensíveis</li>
<li>Integração com gerenciador de credenciais nativo do SO (Keytar + SafeStorage)</li>
<li>Integração com gerenciador de credenciais nativo (Keytar + SafeStorage)</li>
<li>Migração automática de dados legados em texto plano</li>
<li>Armazenamento criptografado de tokens & cotas por conta</li>
</ul>
@@ -183,14 +188,32 @@ Ao usar IDEs e ferramentas de programação com IA, você já enfrentou estes pr
---
## ⚡ Início Rápido
## ⚡ Instalação e Início Rápido
### Pré-requisitos
### 📦 Download
Você pode baixar os binários pré-compilados mais recentes para Windows, macOS e Linux na nossa [página de Releases](https://github.com/evandrodevbr/GeminiNexus/releases).
*(Consulte o aviso no topo desta página se você estiver usando o Windows e encontrar o prompt do SmartScreen).*
### 🔌 Usando com IDEs de IA
Com o aplicativo rodando e pelo menos uma conta adicionada, configure sua IDE preferida (Cursor, Windsurf, OpenCode, etc.):
```plaintext
API Base URL: http://localhost:10100/v1
API Key: (copie da página Proxy no app)
Model: gemini-3-flash (ou qualquer modelo mapeado)
```
### 🛠️ Compilando pelo Código Fonte
#### Pré-requisitos
- **Node.js** v20 ou superior
- **npm** (este projeto usa `package-lock.json`)
### Compilando pelo Código Fonte
#### Passos
```bash
# Clone o repositório
@@ -203,21 +226,10 @@ npm install
# Inicie o modo de desenvolvimento
npm start
# Compile para produção (instalador Windows)
# Compile para produção (ex: instalador Windows)
npm run make
```
### Usando com IDEs de IA
Com o proxy em execução, configure sua IDE:
```plaintext
# Nas configurações do Cursor / Windsurf / OpenCode:
API Base URL: http://localhost:10100/v1
API Key: (copie da página Proxy no app)
Model: gemini-3-flash (ou qualquer modelo mapeado)
```
---
## 🛠️ Stack Tecnológica
@@ -280,41 +292,43 @@ src/
## ❓ FAQ
<details>
<summary><b>P: O app não inicia?</b></summary>
<summary><b>P: Aviso do Windows SmartScreen ("O Windows protegeu o seu computador") durante a instalação?</b></summary>
1. Certifique-se de que todas as dependências estão instaladas: `npm install`
2. Verifique se a versão do Node.js é >= 20
3. Tente deletar `node_modules` e reinstalar
4. No Windows, certifique-se de que o WiX Toolset está disponível para `npm run make`
Sim, este é um aviso comum para novos aplicativos não assinados. Clique em **"Mais informações"** e depois em **"Executar mesmo assim"**. Veja o aviso no topo do README para mais detalhes.
</details>
<details>
<summary><b>P: O app não inicia ao compilar pelo código fonte?</b></summary>
1. Certifique-se de que todas as dependências estão instaladas: `npm install`.
2. Verifique se a versão do Node.js é >= 20.
3. Tente deletar `node_modules` e reinstalar.
4. No Windows, certifique-se de que o WiX Toolset está disponível para o comando `npm run make`.
</details>
<details>
<summary><b>P: O login da conta falhou?</b></summary>
1. Verifique se a conexão com a internet está funcionando
2. Tente limpar os dados do app e fazer login novamente
3. Verifique se a conta está restrita pelo Google/Claude
1. Verifique se a conexão com a internet está funcionando.
2. Tente limpar os dados do app e fazer login novamente.
3. Verifique se a conta está restrita pelo Google/Claude.
</details>
<details>
<summary><b>P: A IDE não conecta no proxy?</b></summary>
1. Certifique-se de que o proxy está rodando (indicador verde na barra de status)
2. Verifique se a porta corresponde à configuração da sua IDE (padrão: `10100`)
3. Copie a API key da página Proxy e cole nas configurações da sua IDE
4. Verifique se pelo menos uma conta está ativa na página de Contas
<summary><b>P: A IDE não consegue conectar ao proxy?</b></summary>
1. Certifique-se de que o proxy está rodando (indicador verde na barra de status).
2. Verifique se a porta corresponde à configuração da sua IDE (padrão: `10100`).
3. Copie a API key da página Proxy e cole nas configurações da sua IDE.
4. Verifique se pelo menos uma conta está ativa na página de Contas.
</details>
<details>
<summary><b>P: A contagem de tokens mostra zero?</b></summary>
1. Este era um bug conhecido em versões anteriores — atualize para a versão mais recente
2. O rastreamento de tokens agora lida corretamente com metadados de streaming e contagens estimadas
3. Os dados de uso são atualizados a cada 15 segundos na página de Analytics de Uso
1. Este era um bug conhecido em versões anteriores — por favor, atualize para a versão mais recente.
2. O rastreamento de tokens agora lida corretamente com metadados de streaming e contagens estimadas.
3. Os dados de uso são atualizados a cada 15 segundos na página de Analytics de Uso.
</details>
---
@@ -327,21 +341,25 @@ Contribuições são bem-vindas! Leia o `CONTRIBUTING.md` para mais detalhes.
## 📄 Licença
[CC BY-NC-SA 4.0](LICENSE)
Este projeto utiliza uma estrutura de licença dual:
---
- **Código original** do [AntigravityManager](https://github.com/Draculabo/AntigravityManager) por [Draculabo](https://github.com/Draculabo): Licenciado sob [CC BY-NC-SA 4.0](LICENSE).
- **Todo o código novo, funcionalidades e arquitetura** por [evandrodevbr](https://github.com/evandrodevbr): Licenciado sob a [Licença MIT](LICENSE-MIT).
## ⚠️ Aviso Legal
> [!WARNING]
> **Apenas para Fins Educacionais**
>
> Este projeto destina-se exclusivamente a fins de pesquisa e educação. Ele é fornecido "como está" sem qualquer garantia. **O uso comercial é estritamente proibido.**
>
> Ao usar este software, você concorda que não o utilizará para quaisquer fins comerciais, e que é o único responsável por garantir que seu uso esteja em conformidade com todas as leis e regulamentações aplicáveis. Os autores e contribuidores não se responsabilizam por qualquer uso indevido ou danos decorrentes do uso deste software.
> 🔄 **Aviso de Migração:** Este projeto está sendo ativamente migrado para uma licença totalmente open-source (MIT). À medida que o código original restante é progressivamente reescrito, todo o projeto será transicionado para MIT. Estamos comprometidos em tornar o Gemini Nexus 100% open-source.
---
## 🙏 Créditos
**Gemini Nexus** é uma versão significativamente aprimorada e expandida do projeto original [AntigravityManager](https://github.com/Draculabo/AntigravityManager) criado por [Draculabo](https://github.com/Draculabo). Toda a arquitetura fundamental e design foram criados pelo autor original.
Este projeto foi originalmente um fork de [AntigravityManager](https://github.com/Draculabo/AntigravityManager) criado por [Draculabo](https://github.com/Draculabo). O conceito inicial de proxy e a estrutura base do Electron foram baseados em seu trabalho.
Desde o fork, **a grande maioria do código base foi reescrita, redesenhada e expandida** por [evandrodevbr](https://github.com/evandrodevbr), incluindo mas não se limitando a:
- Redesign completo de UI/UX (navegação, contas, analytics de uso, gerenciamento de proxy)
- Dashboard de Analytics de Uso com rastreamento de custos, médias de tokens e integração com OpenRouter
- Monitor de tráfego com inspeção de tokens/custos por requisição
- Isolamento de ambiente (dev/prod), pipeline CI/CD e infraestrutura de testes
- Configuração Rápida para IDEs (OpenCode, Cursor, VS Code, Claude Code)
- Configuração personalizada de preços de modelos
- Toda a documentação e internacionalização (EN, PT-BR, ES, ZH-CN)
+148 -54
View File
@@ -23,25 +23,48 @@
<img src="https://img.shields.io/github/license/evandrodevbr/GeminiNexus?style=flat-square" alt="许可证" />
</a>
<img src="https://img.shields.io/badge/平台-Windows%20%7C%20macOS%20%7C%20Linux-informational?style=flat-square" alt="平台" />
<img src="https://img.shields.io/badge/electron-latest-47848F?style=flat-square&logo=electron&logoColor=white" alt="Electron" />
</p>
> [!IMPORTANT]
> **Windows 用户:** 如果在安装过程中看到 **“Windows 已保护你的电脑”** (SmartScreen) 警告,请点击 **“更多信息”** (More info),然后点击 **“仍要运行”** (Run anyway)。这是未签名的新应用预期的安全提示,属于正常现象。
---
## 📖 目录
- [✨ 为什么选择 Gemini Nexus?](#-为什么选择-gemini-nexus)
- [🎯 功能特性](#-功能特性)
- [📸 截图](#-截图)
- [⚡ 安装与快速开始](#-安装与快速开始)
- [🛠️ 技术栈](#️-技术栈)
- [💻 开发](#-开发)
- [❓ 常见问题](#-常见问题)
- [🤝 参与贡献](#-参与贡献)
- [📄 许可证](#-许可证)
---
## ✨ 为什么选择 Gemini Nexus?
- 😫 单个账户配额很快用完,需要频繁手动切换
- 🔄 管理多个 Google/Claude 账户非常繁琐
- 📊 不知道已经消耗了多少 Token 或还剩多少配额
- 🔌 需要一个可靠的本地 API 代理,支持 OpenAI/Anthropic 协议
在使用 AI 驱动的 IDE 和编程工具时,你是否遇到过这些问题?
**Gemini Nexus** 解决所有这些问题。它是一个专业的 Electron 桌面应用,作为你的开发工具和 Google Gemini / Claude AI 之间的智能网关:
- 😫 **配额限制:** 单个账户配额很快用完,需要频繁手动切换。
- 🔄 **账户管理:** 管理多个 Google/Claude 账户非常繁琐。
- 📊 **盲目使用:** 不知道已经消耗了多少 Token 或还剩多少配额。
- 🔌 **集成问题:** 需要一个可靠的本地 API 代理,并且必须原生支持 OpenAI/Anthropic 协议。
- 🔍 **缺乏透明度:** 无法查看代理在后台实际发送或接收的数据。
- ✅ **无限账户池** — 添加任意数量的 Google Gemini 和 Claude 账户
- ✅ **智能自动切换** — 当配额不足或被限速时自动轮换到下一个可用账户
- ✅ **实时使用分析** — SaaS 级仪表板,配备面积图、趋势指标和模型分布
- ✅ **完整的代理可观测性** — 实时流量监控、请求重放和模型能力检查器
- ✅ **兼容 OpenAI 和 Anthropic** — 即插即用的代理,支持 Cursor、Windsurf、OpenCode
- ✅ **默认安全** — AES-256-GCM 加密,配合操作系统原生凭证管理
**Gemini Nexus** 解决所有这些问题。它是一个专业的 Electron 桌面应用,作为你的开发工具和 Google Gemini / Claude AI 之间的智能网关。
### 核心价值主张
- ✅ **无限账户池** — 添加任意数量的 Google Gemini 和 Claude 账户。
- ✅ **智能自动切换** — 当配额不足或被限速时自动轮换到下一个可用账户。
- ✅ **实时使用分析** — SaaS 级仪表板,配备面积图、趋势指标和模型分布。
- ✅ **完整的代理可观测性** — 实时流量监控、请求重放和模型能力检查器。
- ✅ **兼容 OpenAI 和 Anthropic** — 即插即用的代理,支持 Cursor、Windsurf、OpenCode 以及任何兼容 OpenAI 的工具。
- ✅ **默认安全** — AES-256-GCM 加密,配合操作系统原生凭证管理。
---
@@ -77,10 +100,10 @@
<ul>
<li>兼容 OpenAI <code>/v1/chat/completions</code></li>
<li>兼容 Anthropic <code>/v1/messages</code></li>
<li>完整的 SSE 流式传输支持</li>
<li>完整的 SSE 流式传输支持(已在 Cursor, Windsurf, OpenCode 测试)</li>
<li>模型映射(如 <code>claude-sonnet-4-6</code> → <code>gemini-3-flash</code>)</li>
<li>可配置端口、超时时间和 API 密钥</li>
<li>模型可见性控制</li>
<li>模型可见性控制(隐藏/显示特定模型)</li>
</ul>
</td>
<td width="50%">
@@ -97,17 +120,17 @@
<td width="50%">
<h3>🔍 代理可观测性(高级)</h3>
<ul>
<li><strong>流量监控</strong> — 实时请求/响应日志</li>
<li><strong>流量监控</strong> — 实时请求/响应日志,含延迟和模型信息</li>
<li><strong>请求重放</strong> — 重放任意请求进行调试</li>
<li><strong>模型能力</strong> — 检查视觉、思考、流式、JSON 模式</li>
<li><strong>开发者工具</strong> — cURL 和 Python 代码生成</li>
<li><strong>模型能力</strong> — 检查每个模型对视觉、思考、流式、JSON 模式的支持</li>
<li><strong>开发者工具</strong> — cURL 和 Python 代码生成,一键复制</li>
</ul>
</td>
<td width="50%">
<h3>🔐 安全与加密</h3>
<ul>
<li>所有敏感数据采用 AES-256-GCM 加密</li>
<li>集成操作系统原生凭证管理器</li>
<li>集成操作系统原生凭证管理器 (Keytar + SafeStorage)</li>
<li>自动迁移旧版明文数据</li>
<li>每个账户的 Token 和配额均加密存储</li>
</ul>
@@ -119,6 +142,7 @@
<ul>
<li>深色 / 浅色 / 跟随系统主题</li>
<li>多语言:English & Português (Brasil)</li>
<li>每个账户可独立覆盖代理 URL</li>
<li>模型可见性开关</li>
<li>日志目录访问</li>
</ul>
@@ -128,8 +152,9 @@
<ul>
<li>原生 Electron 应用,系统托盘集成</li>
<li>可折叠侧边栏,状态持久化</li>
<li>响应式布局</li>
<li>响应式布局适配所有视图</li>
<li>状态栏实时显示代理和连接指标</li>
<li>错误边界处理以及友好的用户提示</li>
</ul>
</td>
</tr>
@@ -163,31 +188,46 @@
---
## ⚡ 快速开始
## ⚡ 安装与快速开始
### 前置要求
### 📦 下载
- **Node.js** v20 或更高版本
- **npm**
您可以从我们的 [Releases 页面](https://github.com/evandrodevbr/GeminiNexus/releases) 下载适用于 Windows、macOS 和 Linux 的最新预编译版本。
### 从源码构建
*(如果您使用的是 Windows 并在安装时遇到了 SmartScreen 提示,请参阅页面顶部的警告)。*
```bash
git clone https://github.com/evandrodevbr/GeminiNexus.git
cd GeminiNexus
npm install
npm start
### 🔌 配合 AI IDE 使用
# 构建生产版本
npm run make
```
### 配合 AI IDE 使用
在代理运行并至少添加一个账户后,配置您首选的 IDE(Cursor、Windsurf、OpenCode 等):
```plaintext
API Base URL: http://localhost:10100/v1
API Key: (从应用的 Proxy 页面复制)
Model: gemini-3-flash
Model: gemini-3-flash (或您选择的任何映射模型)
```
### 🛠️ 从源码构建
#### 前置要求
- **Node.js** v20 或更高版本
- **npm** (本项目使用 `package-lock.json`)
#### 步骤
```bash
# 克隆仓库
git clone https://github.com/evandrodevbr/GeminiNexus.git
cd GeminiNexus
# 安装依赖
npm install
# 启动开发环境
npm start
# 构建生产版本(例如 Windows 安装程序)
npm run make
```
---
@@ -207,44 +247,98 @@ Model: gemini-3-flash
---
## 💻 开发
```bash
# 启动开发环境 (Electron + Vite HMR)
npm start
# 运行代码规范检查
npm run lint
# 类型检查
npm run type-check
# 格式化代码
npm run format:write
# 运行测试
npm test
```
---
## ❓ 常见问题
<details>
<summary><b>问:应用无法启动?</b></summary>
1. 确保依赖已安装:`npm install`
2. Node.js 版本 >= 20
3. 尝试删除 `node_modules` 并重新安装
<summary><b>问:安装时出现 Windows SmartScreen 警告("Windows 已保护你的电脑")?</b></summary>
是的,对于未签名的新应用,这是一个常见的警告。请点击 **"更多信息"** (More info),然后点击 **"仍要运行"** (Run anyway)。详情请参阅 README 顶部的提示。
</details>
<details>
<summary><b>问:IDE 无法连接代理?</b></summary>
1. 确保代理正在运行(状态栏绿色指示器)
2. 确认端口一致(默认 `10100`)
3. 从 Proxy 页面复制 API 密钥
4. 确保至少有一个账户处于活跃状态
<summary><b>问:从源码构建时应用无法启动?</b></summary>
1. 确保所有依赖均已安装:`npm install`
2. 检查 Node.js 版本是否 >= 20。
3. 尝试删除 `node_modules` 并重新安装。
4. 在 Windows 上,请确保已安装 WiX Toolset 以便执行 `npm run make` 命令。
</details>
<details>
<summary><b>问:账户登录失败?</b></summary>
1. 确保您的网络连接正常。
2. 尝试清除应用数据并重新登录。
3. 检查该账户是否已被 Google/Claude 限制。
</details>
<details>
<summary><b>问:IDE 无法连接到代理?</b></summary>
1. 确保代理正在运行(查看状态栏的绿色指示器)。
2. 确认端口与您 IDE 中的配置一致(默认为 `10100`)。
3. 直接从 Proxy 页面复制 API 密钥并粘贴到 IDE 设置中。
4. 确保在 Accounts 页面中至少有一个活跃的账户。
</details>
<details>
<summary><b>问:Token 计数显示为零?</b></summary>
1. 这是早期版本中的一个已知漏洞 — 请更新至最新版本。
2. 目前 Token 追踪功能已能正确处理流式元数据及预估计数。
3. 使用数据会在 Usage Analytics 页面每 15 秒自动刷新。
</details>
---
## 🤝 参与贡献
欢迎贡献代码!详情请参阅 `CONTRIBUTING.md`。
---
## 📄 许可证
[CC BY-NC-SA 4.0](LICENSE)
本项目采用双重许可结构:
---
- **原始代码**来自 [Draculabo](https://github.com/Draculabo) 的 [AntigravityManager](https://github.com/Draculabo/AntigravityManager):采用 [CC BY-NC-SA 4.0](LICENSE) 许可。
- **所有新代码、功能和架构**由 [evandrodevbr](https://github.com/evandrodevbr) 开发:采用 [MIT 许可证](LICENSE-MIT)。
## ⚠️ 免责声明
> [!WARNING]
> **仅供教育目的**
>
> 本项目仅供教育和研究目的使用。按"原样"提供,不提供任何担保。**严禁商业用途。**
> 🔄 **迁移通知:** 本项目正在积极迁移到完全开源许可证(MIT)。随着剩余原始代码的逐步重写,整个项目将过渡到 MIT。我们致力于将 Gemini Nexus 打造为 100% 开源项目。
---
## 🙏 致谢
**Gemini Nexus** 基于 [Draculabo](https://github.com/Draculabo) 创建的原始项目 [AntigravityManager](https://github.com/Draculabo/AntigravityManager) 大幅增强和扩展。所有基础架构和设计均由原作者完成。
本项目最初是从 [Draculabo](https://github.com/Draculabo) 创建的 [AntigravityManager](https://github.com/Draculabo/AntigravityManager) 分支而来的。最初的代理概念和早期的 Electron 框架基于他的工作。
自从分支以来,[evandrodevbr](https://github.com/evandrodevbr) **重写、重新设计并扩展了绝大部分代码库**,包括但不限于:
- 完整的 UI/UX 重新设计(导航、账户、使用分析、代理管理)
- 使用分析仪表板,包含成本跟踪、Token 平均值以及 OpenRouter 集成
- 流量监视器,提供按请求查看的 Token/成本检查
- 环境隔离(dev/prod)、CI/CD 流水线和测试基础设施
- IDE 快速设置(OpenCode、Cursor、VS Code、Claude Code)
- 自定义模型定价配置
- 所有文档和国际化(EN, PT-BR, ES, ZH-CN)
+1 -6
View File
@@ -10,7 +10,6 @@ import type {
import { MakerDeb } from '@electron-forge/maker-deb';
import { MakerDMG } from '@electron-forge/maker-dmg';
import { MakerRpm } from '@electron-forge/maker-rpm';
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
import { MakerWix } from '@electron-forge/maker-wix';
import { MakerZIP } from '@electron-forge/maker-zip';
import { AutoUnpackNativesPlugin } from '@electron-forge/plugin-auto-unpack-natives';
@@ -441,10 +440,6 @@ const config: ForgeConfig = {
},
},
makers: [
new MakerSquirrel({
setupIcon: 'images/icon.ico',
iconUrl: 'https://raw.githubusercontent.com/evandrodevbr/GeminiNexus/main/images/icon.ico',
}),
...(process.platform === 'win32' && process.arch === 'x64' && isWixAvailable()
? [
new MakerWix({
@@ -463,7 +458,7 @@ const config: ForgeConfig = {
},
['darwin'],
),
new MakerZIP({}, ['darwin']),
new MakerZIP({}, ['darwin', 'win32']),
appImageMaker,
new MakerRpm({}),
new MakerDeb({}),
+25 -3
View File
@@ -1,7 +1,7 @@
{
"name": "gemini-nexus",
"productName": "Gemini Nexus",
"version": "0.15.0",
"version": "0.15.3",
"description": "Gemini Nexus - Electron App",
"main": ".vite/build/main.js",
"private": true,
@@ -32,7 +32,6 @@
"@electron-forge/maker-deb": "^7.11.1",
"@electron-forge/maker-dmg": "^7.11.1",
"@electron-forge/maker-rpm": "^7.11.1",
"@electron-forge/maker-squirrel": "^7.11.1",
"@electron-forge/maker-wix": "^7.9.0",
"@electron-forge/maker-zip": "^7.11.1",
"@electron-forge/plugin-auto-unpack-natives": "^7.11.1",
@@ -171,9 +170,32 @@
"@nestjs/core",
"@sentry/cli",
"@swc/core",
"protobufjs"
"protobufjs",
"macos-alias",
"better-sqlite3",
"keytar",
"electron",
"electron-winstaller",
"esbuild",
"fs-xattr",
"appdmg"
],
"pnpm": {
"onlyBuiltDependencies": [
"@bitdisaster/exe-icon-extractor",
"@nestjs/core",
"@sentry/cli",
"@swc/core",
"protobufjs",
"macos-alias",
"better-sqlite3",
"keytar",
"electron",
"electron-winstaller",
"esbuild",
"fs-xattr",
"appdmg"
],
"overrides": {
"node-abi": "^4.28.0",
"fastify": "^5.8.5",
+2986 -8662
View File
File diff suppressed because it is too large. Load diff
+3
View File
@@ -8,5 +8,8 @@ allowBuilds:
electron-winstaller: true
esbuild: true
keytar: true
macos-alias: true
protobufjs: true
sharp: true
fs-xattr: true
appdmg: true
+2 -1
View File
@@ -16,7 +16,8 @@ import { getSwitchGuardSnapshot } from '../../ipc/switchGuard';
vi.mock('../../utils/paths', async () => {
const path = await import('path');
const agentDir = path.join(process.cwd(), 'temp_test_agent');
return {
return {
IS_DEV_ENVIRONMENT: false,
getAgentDir: vi.fn(() => agentDir),
getAccountsFilePath: vi.fn(() => path.join(agentDir, 'accounts.json')),
getBackupsDir: vi.fn(() => path.join(agentDir, 'backups')),
+2 -1
View File
@@ -57,7 +57,8 @@ vi.mock('../../ipc/database/dbConnection', () => ({
}),
}));
vi.mock('../../utils/paths', () => ({
vi.mock('../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getGeminiNexusDbPaths: () => ['mock-db'],
getCloudAccountsDbPath: () => 'mock-cloud-db',
getAgentDir: vi.fn(() => '/mock/agent/dir'),
+2 -1
View File
@@ -21,7 +21,8 @@ vi.mock('../../ipc/database/dbConnection', () => ({
}),
}));
vi.mock('../../utils/paths', () => ({
vi.mock('../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getGeminiNexusDbPaths: () => ['mock-db'],
}));
+2 -1
View File
@@ -47,7 +47,8 @@ vi.mock('../../utils/logger', () => ({
},
}));
vi.mock('../../utils/paths', () => ({
vi.mock('../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/test.vscdb']),
}));
+2 -1
View File
@@ -64,7 +64,8 @@ vi.mock('../../../ipc/database/dbConnection', () => ({
configureDatabase: vi.fn(),
}));
vi.mock('../../../utils/paths', () => ({
vi.mock('../../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
}));
+2 -1
View File
@@ -48,7 +48,8 @@ vi.mock('../../../utils/logger', () => ({
},
}));
vi.mock('../../../utils/paths', () => ({
vi.mock('../../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/test.vscdb']),
}));
+2 -1
View File
@@ -52,7 +52,8 @@ vi.mock('../../../utils/logger', () => ({
},
}));
vi.mock('../../../utils/paths', () => ({
vi.mock('../../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getGeminiNexusStoragePaths: vi.fn().mockReturnValue(['/tmp/storage.json']),
getGeminiNexusDbPaths: vi.fn().mockReturnValue(['/tmp/state.vscdb']),
getAgentDir: vi.fn().mockReturnValue('/tmp/agent'),
@@ -48,14 +48,19 @@ vi.mock('../../../ipc/proxy-advanced/service-registry', () => {
function getServiceOrThrow(key: string) {
const service = (proxyAdvancedRegistry as Record<string, unknown>)[key];
if (!service) {
throw new Error(`${key} is not registered`);
throw new Error(`ProxyAdvanced service '${key}' is not registered`);
}
return service;
}
function getServiceOptional(key: string) {
return (proxyAdvancedRegistry as Record<string, unknown>)[key];
}
return {
proxyAdvancedRegistry,
getServiceOrThrow,
getServiceOptional,
};
});
@@ -176,10 +181,10 @@ describe('Proxy Advanced Handler', () => {
});
describe('getParityCounters', () => {
it('should return error when tokenManager is null', async () => {
it('should return empty counters when tokenManager is null', async () => {
const result = await getParityCounters();
expect(result.success).toBe(false);
expect(result.error).toBe('Proxy advanced service not initialized');
expect(result.success).toBe(true);
expect(result.data?.totalRequests).toBe(0);
});
it('should return counters from tokenManager', async () => {
@@ -200,10 +205,10 @@ describe('Proxy Advanced Handler', () => {
});
describe('getCircuitBreakerStatus', () => {
it('should return error when tokenManager is null', async () => {
it('should return empty status when tokenManager is null', async () => {
const result = await getCircuitBreakerStatus();
expect(result.success).toBe(false);
expect(result.error).toBe('Proxy advanced service not initialized');
expect(result.success).toBe(true);
expect(result.data?.states).toEqual({});
});
it('should return mapped status from tokenManager', async () => {
@@ -222,10 +227,10 @@ describe('Proxy Advanced Handler', () => {
});
describe('getProxyMetrics', () => {
it('should return error when proxyMetrics is null', async () => {
it('should return zero metrics when proxyMetrics is null', async () => {
const result = await getProxyMetrics();
expect(result.success).toBe(false);
expect(result.error).toBe('Proxy advanced service not initialized');
expect(result.success).toBe(true);
expect(result.data?.totalRequests).toBe(0);
});
it('should return metrics from proxyMetrics service', async () => {
@@ -249,10 +254,10 @@ describe('Proxy Advanced Handler', () => {
});
describe('getRecentRequests', () => {
it('should return error when proxyReplay is null', async () => {
it('should return empty array when proxyReplay is null', async () => {
const result = await getRecentRequests();
expect(result.success).toBe(false);
expect(result.error).toBe('Proxy advanced service not initialized');
expect(result.success).toBe(true);
expect(result.data).toEqual([]);
});
it('should return recent requests from proxyReplay', async () => {
@@ -410,10 +415,10 @@ describe('Proxy Advanced Handler', () => {
});
describe('generateIdeConfig', () => {
it('should return error when proxyIdeConfig is null', async () => {
it('should generate fallback config when proxyIdeConfig is null', async () => {
const result = await generateIdeConfig('vscode');
expect(result.success).toBe(false);
expect(result.error).toBe('Proxy advanced service not initialized');
expect(result.success).toBe(true);
expect(result.data?.name).toBe('VS Code');
});
it('should return error for unsupported IDE', async () => {
@@ -428,7 +433,8 @@ describe('Proxy Advanced Handler', () => {
vi.mocked(proxyAdvancedRegistry).proxyIdeConfig = {
generateConfigForCurrentServer: vi.fn().mockReturnValue({
ide: 'vscode',
content: null,
format: 'json',
content: { 'openai.url': 'http://localhost:8045/v1', 'openai.apiKey': 'key' },
}),
} as any;
@@ -443,7 +449,8 @@ describe('Proxy Advanced Handler', () => {
vi.mocked(proxyAdvancedRegistry).proxyIdeConfig = {
generateConfigForCurrentServer: vi.fn().mockReturnValue({
ide: 'cursor',
content: null,
format: 'json',
content: { OPENAI_BASE_URL: 'http://localhost:8045/v1', OPENAI_API_KEY: 'key' },
}),
} as any;
@@ -453,16 +460,5 @@ describe('Proxy Advanced Handler', () => {
expect(result.data?.proxySetting).toBe('OPENAI_BASE_URL');
vi.mocked(proxyAdvancedRegistry).proxyIdeConfig = null;
});
it('should handle null result from config generator', async () => {
vi.mocked(proxyAdvancedRegistry).proxyIdeConfig = {
generateConfigForCurrentServer: vi.fn().mockReturnValue(null),
} as any;
const result = await generateIdeConfig('vscode');
expect(result.success).toBe(false);
expect(result.error).toBe('Failed to generate IDE config: server not configured');
vi.mocked(proxyAdvancedRegistry).proxyIdeConfig = null;
});
});
});
});
@@ -24,7 +24,8 @@ vi.mock('../../../ipc/database/cloudHandler', () => ({
ensureDatabaseInitialized: vi.fn(),
}));
vi.mock('../../../utils/paths', () => ({
vi.mock('../../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
}));
+2 -1
View File
@@ -4,7 +4,8 @@ import path from 'path';
vi.mock('../../utils/paths', async () => {
const path = await import('path');
return {
return {
IS_DEV_ENVIRONMENT: false,
getAgentDir: vi.fn(() => path.join(process.cwd(), 'temp_test_logs')),
};
});
+78
View File
@@ -59,3 +59,81 @@ class MockIntersectionObserver {
disconnect() {}
}
(globalThis as any).IntersectionObserver = MockIntersectionObserver;
// Universal Electron mock for testing environments
vi.mock('electron', () => {
return {
app: {
getPath: vi.fn((name) => `/mock/path/${name}`),
getName: vi.fn(() => 'Gemini Nexus Test'),
getVersion: vi.fn(() => '1.0.0'),
isPackaged: false,
getLocale: vi.fn(() => 'en-US'),
getPreferredSystemLanguages: vi.fn(() => ['en-US']),
requestSingleInstanceLock: vi.fn(() => true),
quit: vi.fn(),
disableHardwareAcceleration: vi.fn(),
setName: vi.fn(),
commandLine: {
appendSwitch: vi.fn(),
},
},
ipcMain: {
on: vi.fn(),
handle: vi.fn(),
removeHandler: vi.fn(),
removeAllListeners: vi.fn(),
},
ipcRenderer: {
on: vi.fn(),
off: vi.fn(),
once: vi.fn(),
invoke: vi.fn(),
send: vi.fn(),
postMessage: vi.fn(),
},
BrowserWindow: vi.fn().mockImplementation(() => ({
loadURL: vi.fn(),
loadFile: vi.fn(),
show: vi.fn(),
close: vi.fn(),
destroy: vi.fn(),
webContents: {
send: vi.fn(),
on: vi.fn(),
session: {
webRequest: {
onBeforeSendHeaders: vi.fn(),
}
}
},
on: vi.fn(),
})),
dialog: {
showMessageBox: vi.fn().mockResolvedValue({ response: 0 }),
showOpenDialog: vi.fn().mockResolvedValue({ canceled: true, filePaths: [] }),
showSaveDialog: vi.fn().mockResolvedValue({ canceled: true, filePath: '' }),
},
shell: {
openPath: vi.fn(),
openExternal: vi.fn(),
},
contextBridge: {
exposeInMainWorld: vi.fn(),
},
Tray: vi.fn().mockImplementation(() => ({
setToolTip: vi.fn(),
setContextMenu: vi.fn(),
on: vi.fn(),
destroy: vi.fn(),
})),
Menu: {
buildFromTemplate: vi.fn(),
},
nativeTheme: {
themeSource: 'system',
shouldUseDarkColors: true,
on: vi.fn(),
},
};
});
+2 -1
View File
@@ -25,7 +25,8 @@ vi.mock('../../ipc/database/cloudHandler', () => ({
ensureDatabaseInitialized: vi.fn(),
}));
vi.mock('../../utils/paths', () => ({
vi.mock('../../utils/paths', () => ({
IS_DEV_ENVIRONMENT: false,
getCloudAccountsDbPath: vi.fn(() => '/mock/db/path.sqlite'),
}));