{"_id":"@chameleon-nexus-tech/gemini-cli-openrouter","name":"@chameleon-nexus-tech/gemini-cli-openrouter","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@chameleon-nexus-tech/gemini-cli-openrouter","version":"0.0.1","engines":{"node":">=20.0.0"},"type":"module","workspaces":["packages/*"],"repository":{"type":"git","url":"git+https://github.com/chameleon-nexus/gemini-cli-openrouter.git"},"description":"Gemini CLI - OpenRouter Edition: Access 200+ AI models through OpenRouter's unified API. Enhanced version of Google Gemini CLI with multi-engine support.","keywords":["gemini","openrouter","ai","cli","chatbot","assistant","multi-engine","gpt-4","claude","llama"],"author":{"name":"Chameleon Nexus Tech"},"license":"Apache-2.0","config":{"sandboxImageUri":"us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.7.0-nightly.20250918.2722473a"},"scripts":{"start":"cross-env node scripts/start.js","start:a2a-server":"CODER_AGENT_PORT=41242 npm run start --workspace @google/gemini-cli-a2a-server","debug":"cross-env DEBUG=1 node --inspect-brk scripts/start.js","auth:npm":"npx google-artifactregistry-auth","auth:docker":"gcloud auth configure-docker us-west1-docker.pkg.dev","auth":"npm run auth:npm && npm run auth:docker","generate":"node scripts/generate-git-commit-info.js","build":"node scripts/build.js","build-and-start":"npm run build && npm run start","build:vscode":"node scripts/build_vscode_companion.js","build:all":"npm run build && npm run build:sandbox && npm run build:vscode","build:packages":"npm run build --workspaces","build:sandbox":"node scripts/build_sandbox.js --skip-npm-install-build","bundle":"npm run generate && node esbuild.config.js && node scripts/copy_bundle_assets.js","test":"npm run test --workspaces --if-present --parallel","test:ci":"npm run test:ci --workspaces --if-present --parallel && npm run test:scripts","test:scripts":"vitest run --config ./scripts/tests/vitest.config.ts","test:e2e":"cross-env VERBOSE=true KEEP_OUTPUT=true npm run test:integration:sandbox:none","test:integration:all":"npm run test:integration:sandbox:none && npm run test:integration:sandbox:docker && npm run test:integration:sandbox:podman","test:integration:sandbox:none":"cross-env GEMINI_SANDBOX=false vitest run --root ./integration-tests","test:integration:sandbox:docker":"cross-env GEMINI_SANDBOX=docker npm run build:sandbox && cross-env GEMINI_SANDBOX=docker vitest run --root ./integration-tests","test:integration:sandbox:podman":"cross-env GEMINI_SANDBOX=podman vitest run --root ./integration-tests","lint":"eslint . --ext .ts,.tsx && eslint integration-tests","lint:fix":"eslint . --fix && eslint integration-tests --fix","lint:ci":"eslint . --ext .ts,.tsx --max-warnings 0 && eslint integration-tests --max-warnings 0","lint:all":"node scripts/lint.js","format":"prettier --experimental-cli --write .","typecheck":"npm run typecheck --workspaces --if-present","preflight":"npm run clean && npm ci && npm run format && npm run lint:ci && npm run build && npm run typecheck && npm run test:ci","prepare":"npm run bundle","prepare:package":"node scripts/prepare-package.js","release:version":"node scripts/version.js","telemetry":"node scripts/telemetry.js","check:lockfile":"node scripts/check-lockfile.js","clean":"node scripts/clean.js"},"bin":{"gemini":"bundle/gemini.js"},"devDependencies":{"@types/marked":"^5.0.2","@types/mime-types":"^3.0.1","@types/minimatch":"^5.1.2","@types/mock-fs":"^4.13.4","@types/shell-quote":"^1.7.5","@vitest/coverage-v8":"^3.1.1","@vitest/eslint-plugin":"^1.3.4","cross-env":"^7.0.3","esbuild":"^0.25.0","eslint":"^9.24.0","eslint-config-prettier":"^10.1.2","eslint-plugin-import":"^2.31.0","eslint-plugin-license-header":"^0.8.0","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","glob":"^10.4.5","globals":"^16.0.0","google-artifactregistry-auth":"^3.4.0","json":"^11.0.0","memfs":"^4.17.2","mnemonist":"^0.40.3","mock-fs":"^5.5.0","msw":"^2.10.4","npm-run-all":"^4.1.5","prettier":"^3.5.3","react-devtools-core":"^4.28.5","tsx":"^4.20.3","typescript-eslint":"^8.30.1","vitest":"^3.2.4","yargs":"^17.7.2"},"dependencies":{"simple-git":"^3.28.0"},"optionalDependencies":{"@lydell/node-pty":"1.1.0","@lydell/node-pty-darwin-arm64":"1.1.0","@lydell/node-pty-darwin-x64":"1.1.0","@lydell/node-pty-linux-x64":"1.1.0","@lydell/node-pty-win32-arm64":"1.1.0","@lydell/node-pty-win32-x64":"1.1.0","node-pty":"^1.0.0"},"_id":"@chameleon-nexus-tech/gemini-cli-openrouter@0.0.1","gitHead":"0baf16766171c15150a15c58d4b10b0c215be426","bugs":{"url":"https://github.com/chameleon-nexus/gemini-cli-openrouter/issues"},"homepage":"https://github.com/chameleon-nexus/gemini-cli-openrouter#readme","_nodeVersion":"22.15.0","_npmVersion":"11.3.0","dist":{"integrity":"sha512-q5lkDCrqFSiE7kILzccbI9cJkUUrlFDcMbFKUl7RE0Dqy2Rhg5DGfjMnvJnMovbnvAtpQXuYub/8svLd1JEs3Q==","shasum":"c95f03c8c9bb1bcacda0a3877c76a27a6af09128","tarball":"https://registry.npmjs.org/@chameleon-nexus-tech/gemini-cli-openrouter/-/gemini-cli-openrouter-0.0.1.tgz","fileCount":14,"unpackedSize":17456328,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCpygV0pk16Z4zR9qV3TUhZ+HoK6fmY2fsugpJdb70QdwIgfNrVV6wvvv+EoDT6OwGiecizMRFv8KWTznqO21vOD5Q="}]},"_npmUser":{"name":"chameleon-nexus","email":"mythicscribe2014@gmail.com"},"directories":{},"maintainers":[{"name":"chameleon-nexus","email":"mythicscribe2014@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gemini-cli-openrouter_0.0.1_1759025786487_0.3402841793839746"},"_hasShrinkwrap":true}},"time":{"created":"2025-09-28T02:16:26.388Z","0.0.1":"2025-09-28T02:16:26.772Z","modified":"2025-09-28T02:16:27.051Z"},"maintainers":[{"name":"chameleon-nexus","email":"mythicscribe2014@gmail.com"}],"description":"Gemini CLI - OpenRouter Edition: Access 200+ AI models through OpenRouter's unified API. Enhanced version of Google Gemini CLI with multi-engine support.","homepage":"https://github.com/chameleon-nexus/gemini-cli-openrouter#readme","keywords":["gemini","openrouter","ai","cli","chatbot","assistant","multi-engine","gpt-4","claude","llama"],"repository":{"type":"git","url":"git+https://github.com/chameleon-nexus/gemini-cli-openrouter.git"},"author":{"name":"Chameleon Nexus Tech"},"bugs":{"url":"https://github.com/chameleon-nexus/gemini-cli-openrouter/issues"},"license":"Apache-2.0","readme":"# Gemini CLI - OpenRouter Edition\n\n[![npm version](https://badge.fury.io/js/%40chameleon-nexus-tech%2Fgemini-cli.svg)](https://badge.fury.io/js/%40chameleon-nexus-tech%2Fgemini-cli)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**🚀 Enhanced Gemini CLI with OpenRouter Support - Access 200+ AI Models Through One Interface**\n\n> ⚠️ **Important Notice**: This is a modified version of [Google Gemini CLI](https://github.com/google-gemini/gemini-cli). Original project copyright belongs to Google LLC under Apache 2.0 License.\n\n## 🌐 Language Switch\n\n| 🇺🇸 **English** | 🇻🇳 [Tiếng Việt](docs/translations/README.vi.md) | 🇯🇵 [日本語](docs/translations/README.ja.md) | 🇩🇪 [Deutsch](docs/translations/README.de.md) | 🇸🇦 [العربية](docs/translations/README.ar.md) | 🇨🇳 [中文](docs/translations/README.zh.md) |\n\n## 🌟 Core Features\n\n- 🎯 **OpenRouter Integration**: Access 200+ AI models through OpenRouter's unified API\n- 🔄 **Model Flexibility**: Switch between GPT-4, Claude, Llama, Mistral, and many more\n- 🌍 **Global Model Coverage**: Supports all major AI models from OpenAI, Anthropic, Meta, Google, and more\n- 🔧 **Simple Configuration**: Single API key for all models\n- 📊 **Complete Functionality**: Streaming/non-streaming, token counting, function calling all supported\n- 🚀 **Enhanced Performance**: Optimized for OpenRouter's high-performance infrastructure\n\n## 📦 Installation\n\n```bash\nnpm install -g @chameleon-nexus-tech/gemini-cli\n```\n\n## 🎛️ OpenRouter Integration\n\n### 🌐 OpenRouter - Your Gateway to 200+ AI Models\n\nOpenRouter provides access to the world's most advanced AI models through a single, unified API. This enhanced Gemini CLI leverages OpenRouter to give you instant access to:\n\n**🔥 Popular Models Available:**\n- `anthropic/claude-3.5-sonnet` (default) - Anthropic's most capable model\n- `openai/gpt-4` - OpenAI's flagship model\n- `openai/gpt-4-turbo` - Faster GPT-4 variant\n- `meta-llama/llama-3.1-8b-instruct` - Meta's latest Llama model\n- `meta-llama/llama-3.1-70b-instruct` - Meta's most powerful Llama\n- `mistralai/mistral-7b-instruct` - Mistral's efficient model\n- `mistralai/mixtral-8x7b-instruct` - Mixtral's mixture of experts\n- `google/gemini-pro` - Google's Gemini model\n- `google/gemini-pro-vision` - Google's multimodal model\n- `cohere/command-r-plus` - Cohere's advanced model\n- `deepseek/deepseek-coder` - Specialized coding model\n- And 190+ more models from leading AI companies!\n\n**🎯 Why OpenRouter?**\n- **Single API Key**: Access all models with one credential\n- **Best Pricing**: Competitive rates across all providers\n- **High Availability**: 99.9% uptime with global infrastructure\n- **Model Comparison**: Easy switching between models for testing\n- **Enterprise Features**: Rate limiting, usage analytics, and more\n\n## ⚙️ Configuration\n\n### 🔧 Required Environment Variables\n\nYou only need to set these **4 environment variables** to get started:\n\n```bash\n# 1. Set AI engine to OpenRouter\nexport AI_ENGINE=\"openrouter\"\n\n# 2. Set your OpenRouter API key (get from https://openrouter.ai/keys)\nexport AI_API_KEY=\"your-openrouter-api-key\"\n\n# 3. Choose your preferred model\nexport AI_MODEL=\"openai/gpt-4o\"\n\n# 4. Set any value to skip Gemini API validation\nexport GEMINI_API_KEY=\"any-value-here\"\n```\n\n### 🪟 Windows PowerShell Configuration\n\n```powershell\n# Set the 4 required environment variables\n$env:AI_ENGINE=\"openrouter\"\n$env:AI_API_KEY=\"your-openrouter-api-key\"\n$env:AI_MODEL=\"openai/gpt-4o\"\n$env:GEMINI_API_KEY=\"any-value-here\"\n```\n\n### 🎯 Quick Setup\n\nThat's it! These 4 variables are all you need:\n- `AI_ENGINE=\"openrouter\"` - Tells the system to use OpenRouter\n- `AI_API_KEY=\"your-key\"` - Your OpenRouter API key\n- `AI_MODEL=\"model-name\"` - The AI model you want to use\n- `GEMINI_API_KEY=\"anything\"` - Set to any value to skip validation\n\n## 🚀 Usage\n\n### 💬 Direct Question Mode\n\n```bash\ngemini \"Hello, please introduce yourself\"\n```\n\n### 🔄 Interactive Mode\n\n```bash\ngemini\n```\n\nThen select \"2. Use Gemini API Key\" and press Enter to start chatting.\n\n## 🧪 Model Testing Examples\n\n### 🌐 Testing with GPT-4o\n\n```bash\n# Set the 4 required environment variables\nexport AI_ENGINE=\"openrouter\"\nexport AI_API_KEY=\"your-openrouter-api-key\"\nexport AI_MODEL=\"openai/gpt-4o\"\nexport GEMINI_API_KEY=\"any-value-here\"\n\n# Test command\ngemini \"Hello, please introduce yourself and tell me which AI model you are.\"\n```\n\n\n## 🏗️ Technical Architecture\n\n### 🎯 OpenRouter Integration Architecture\n\nThis project features a **specialized OpenRouter integration** that provides seamless access to 200+ AI models:\n\n```\nOpenRouter Integration\n├── OpenrouterContentGenerator    (Primary OpenRouter adapter)\n├── ContentGeneratorFactory       (Engine selection and management)\n├── Tool Execution System        (Function calling support)\n└── Streaming Response Handler    (Real-time response processing)\n```\n\n### 🔧 Core Features\n\n✅ **OpenRouter Integration**: Direct access to 200+ AI models through OpenRouter's unified API  \n✅ **Model Flexibility**: Easy switching between different AI models with a single environment variable  \n✅ **Automatic Format Conversion**: Seamless conversion between Gemini format and OpenRouter API format  \n✅ **Streaming Response Support**: Real-time streaming responses for all supported models  \n✅ **Function Calling**: Full support for tool/function calling across all models  \n✅ **Intelligent Error Handling**: Comprehensive error handling with detailed messages  \n✅ **Configuration Priority**: OpenRouter-specific config > Unified config > Default config  \n\n### 📁 Core File Structure\n\n```\npackages/core/src/core/\n├── contentGenerator.ts              # ContentGenerator interface definition\n├── contentGeneratorFactory.ts       # Engine factory with OpenRouter priority\n├── openrouterContentGenerator.ts    # OpenRouter adapter (primary)\n├── coreToolScheduler.ts            # Tool execution and function calling\n└── [other adapters]                 # Additional engine support\n```\n\n### 🔄 OpenRouter API Integration\n\n**Request Conversion Flow**:\n```\nGemini Request → OpenRouter Adapter → OpenRouter API → 200+ AI Models\n```\n\n**Response Conversion Flow**:\n```\nAI Model Response → OpenRouter API → OpenRouter Adapter → Gemini Response Format\n```\n\n**Supported OpenRouter Features**:\n- **Model Selection**: Easy switching between 200+ models\n- **Function Calling**: Full tool/function calling support\n- **Streaming**: Real-time response streaming\n- **Token Counting**: Automatic token usage tracking\n- **Error Handling**: Comprehensive error management\n- **Rate Limiting**: Built-in rate limiting and retry logic\n\n## 📋 License Compliance\n\nThis project is based on [Google Gemini CLI](https://github.com/google-gemini/gemini-cli) and follows Apache 2.0 License requirements:\n\n### Original Project Information\n\n- **Original Project**: Google Gemini CLI\n- **Original Copyright**: Copyright 2025 Google LLC  \n- **Original License**: Apache License 2.0\n- **Original Repository**: https://github.com/google-gemini/gemini-cli\n\n### Modification Statement\n\nIn accordance with Apache 2.0 License Section 4:\n\n- ✅ Retained original Apache 2.0 license\n- ✅ Retained original copyright notices\n- ✅ Clearly marked modifications\n- ✅ Included complete license text\n\n## 🔄 Migration from Original Gemini CLI\n\nIf you're migrating from the original Google Gemini CLI:\n\n1. **Uninstall original version**: `npm uninstall -g @google/gemini-cli`\n2. **Install this version**: `npm install -g @chameleon-nexus-tech/gemini-cli`\n3. **Get OpenRouter API key**: Sign up at [OpenRouter](https://openrouter.ai/keys)\n4. **Set the 4 required environment variables**:\n   ```bash\n   export AI_ENGINE=\"openrouter\"\n   export AI_API_KEY=\"your-openrouter-api-key\"\n   export AI_MODEL=\"openai/gpt-4o\"\n   export GEMINI_API_KEY=\"any-value-here\"\n   ```\n5. **Use as before**: All commands remain the same, now with access to 200+ models!\n\n## 🧪 Testing OpenRouter Integration\n\n### 🚀 Quick Test Script\n\nCreate a simple test script to verify your OpenRouter setup:\n\n```bash\n#!/bin/bash\n# test-openrouter.sh\n\n# Set the 4 required environment variables\nexport AI_ENGINE=\"openrouter\"\nexport AI_API_KEY=\"your-openrouter-api-key\"\nexport AI_MODEL=\"openai/gpt-4o\"\nexport GEMINI_API_KEY=\"any-value-here\"\n\necho \"Testing OpenRouter with GPT-4o...\"\ngemini \"Hello, please introduce yourself and tell me which AI model you are.\"\n```\n\n### 🔧 Model Comparison Test\n\nTest different models to compare their responses:\n\n```bash\n#!/bin/bash\n# compare-models.sh\n\n# Set up the base configuration (set once)\nexport AI_ENGINE=\"openrouter\"\nexport AI_API_KEY=\"your-openrouter-api-key\"\nexport GEMINI_API_KEY=\"any-value-here\"\n\n# Test GPT-4o\necho \"=== Testing GPT-4o ===\"\nexport AI_MODEL=\"openai/gpt-4o\"\ngemini \"Write a haiku about artificial intelligence.\"\n```\n\n## 🔗 Related Links\n\n- [Original Project (Google Gemini CLI)](https://github.com/google-gemini/gemini-cli)\n- [OpenRouter](https://openrouter.ai/) - Access 200+ AI models\n- [OpenRouter API Documentation](https://openrouter.ai/docs)\n- [OpenRouter Model List](https://openrouter.ai/models)\n- [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0)\n\n## 🐛 Issue Reporting\n\nIf you encounter any issues, please report them on [GitHub Issues](https://github.com/chameleon-nexus/gemini-cli/issues).\n\n## 🤝 Contributing\n\nContributions are welcome! Please ensure:\n\n1. Follow the original project's code style\n2. Include appropriate tests\n3. Update relevant documentation\n4. Respect the Apache 2.0 license terms\n\n\n## 🌟 Project Highlights\n\n- 🚀 **OpenRouter Integration**: Direct access to 200+ AI models through one API\n- 🎯 **Model Flexibility**: Easy switching between GPT-4, Claude, Llama, and more\n- 🔄 **Simple Configuration**: Single API key for all models\n- 🌍 **Global Coverage**: Access to models from OpenAI, Anthropic, Meta, Google, and more\n- 📊 **Enterprise Grade**: Complete error handling and configuration management\n- 🔧 **Function Calling**: Full support for tool/function calling across all models\n\n---\n\n**Disclaimer**: This project is not affiliated with Google or OpenRouter. Please comply with the terms of service of the respective platforms when using this software.","readmeFilename":"README.md","_rev":"1-42f491c671799c8426d7f062ab08b9e0"}