{
  "markdown": "# Gemini Context Extension\n\n> Essential context window tracking, cost estimation, and repository analysis tools for Gemini CLI\n\n[![CI](https://github.com/Beaulewis1977/gemini-context-extension/actions/workflows/ci.yml/badge.svg)](https://github.com/Beaulewis1977/gemini-context-extension/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## What It Does\n\nThis extension adds seven powerful tools to your Gemini CLI that solve critical visibility gaps:\n\n1. **Context Window Tracker** - Real-time monitoring of your token usage and context capacity across all Gemini models\n2. **Cost Estimator** - Accurate API cost calculations with comprehensive model comparisons and savings analysis\n3. **Model Comparison** - Side-by-side comparison of all Gemini models with pricing, context windows, and cost estimates\n4. **Repository Analyzer** - Comprehensive codebase analysis with tech stack detection, language statistics, and file categorization\n5. **Wiki Generator** - AI-powered documentation generation with Mermaid diagrams and customizable sections (with configuration support)\n6. **Repository Indexer** - Create semantic embeddings of your codebase for intelligent search\n7. **Semantic Code Search** - Search your repository using natural language queries powered by RAG\n\n### Why You Need This\n\n- ❌ **Before**: No idea how much context you're using, what it costs, which model to choose, or what's in your codebase\n- ✅ **After**: Complete visibility into token usage, costs, model comparison, and deep repository insights for better project understanding\n\n## Features\n\n### 🎯 Context Window Tracker\n\n- **Real-time Analysis**: See exactly how your context window is being used\n- **All Models Supported**: Track context for Gemini 2.5 Pro, 2.5 Flash, 2.5 Flash-Lite, 2.0 Flash, 1.5 Pro, and 1.5 Flash\n- **Component Breakdown**: Understand token distribution across system, tools, MCP servers, extensions, and context files\n- **Multiple Views**: Compact, standard, and detailed modes for different use cases\n- **Model-Specific Insights**: Get context window information specific to each model (1M or 2M tokens)\n- **Smart Recommendations**: Get actionable suggestions for optimization\n\n### 💰 Cost Estimator\n\n- **Accurate Pricing**: Calculate costs based on latest 2025 Gemini model pricing\n- **Latest Models**: Full support for Gemini 2.5 Pro and 2.5 Flash\n- **Tiered Pricing**: Automatically handles models with different rates for small vs large prompts\n- **Comprehensive Comparison**: See cost differences across ALL Gemini models with savings analysis\n- **Budget Planning**: Estimate costs for multiple requests\n- **Cost Breakdown**: Input vs output token costs clearly separated\n- **Smart Recommendations**: Get suggestions for cost savings by switching models\n\n### 📊 Model Comparison\n\n- **Complete Model Information**: Names, descriptions, and capabilities for all Gemini models\n- **Pricing Details**: Input and output token costs for each model\n- **Context Windows**: See maximum context capacity (1M or 2M tokens)\n- **Cost Estimates**: Calculate what each model would cost for your current usage\n- **Sorted by Cost**: Models automatically sorted from cheapest to most expensive\n- **Easy Decision Making**: Quickly find the best model for your needs and budget\n\n### 📁 Repository Analyzer\n\n- **Tech Stack Detection**: Automatically identify languages, frameworks, and package managers\n- **Codebase Statistics**: Get file counts, line counts, and directory depth metrics\n- **Language Distribution**: See line counts for each programming language in your project\n- **Dependency Analysis**: Extract all dependencies from package.json, requirements.txt, Cargo.toml, go.mod, and more\n- **File Categorization**: Automatically categorize files as code, tests, config, or documentation\n- **Smart Scanning**: Respects .gitignore patterns and skips common build directories\n- **Metadata Extraction**: Reads README, LICENSE, and project descriptions\n- **40+ Languages Supported**: TypeScript, JavaScript, Python, Go, Rust, Java, C++, and many more\n- **Framework Detection**: Identifies React, Next.js, Vue, Django, FastAPI, Express, and 20+ other frameworks\n- **No AI Required**: Pure filesystem analysis for instant results\n\n### 📝 Wiki Generator\n\n- **AI-Powered Documentation**: Generate comprehensive documentation using Gemini AI\n- **Multiple Sections**: Overview, architecture, setup, development, API reference, testing\n- **Mermaid Diagrams**: Automatically create architecture, dataflow, and directory structure diagrams\n- **Customizable**: Choose specific sections and Gemini models (2.5-flash, 2.5-pro, etc.)\n- **Cost Estimation**: See estimated API costs before generation\n- **Markdown Output**: Get ready-to-use markdown documentation with table of contents\n- **Requires API Key**: Set `GEMINI_API_KEY` environment variable (free at Google AI Studio)\n\n## Installation\n\n### Prerequisites\n\n- [Gemini CLI](https://geminicli.com/) installed and configured\n- Node.js 18+ installed\n- Git (for GitHub installation)\n\n### Install from GitHub\n\n```bash\ngemini extensions install https://github.com/Beaulewis1977/gemini-context-extension\n```\n\n### Install Locally (Development)\n\n```bash\n# Clone the repository\ngit clone https://github.com/Beaulewis1977/gemini-context-extension.git\ncd gemini-context-extension\n\n# Install dependencies\nnpm install\n\n# Build the extension\nnpm run build\n\n# Link for development\ngemini extensions link .\n```\n\n### Verify Installation\n\nAfter installation, restart your Gemini CLI and verify the tools are available:\n\n```bash\ngemini\n\n# In the CLI, list tools\n/tools list\n```\n\nYou should see `track_context_usage`, `estimate_api_cost`, `compare_gemini_models`, `analyze_repository`, `generate_repository_wiki`, `index_repository`, and `search_repository` in the list.\n\n## Usage\n\n### Context Window Tracker\n\nAsk Gemini to analyze your context usage:\n\n```\n> How much of my context window am I using?\n```\n\nThe model will automatically invoke the `track_context_usage` tool and explain the results.\n\n**With specific models:**\n\n```\n> Show me context usage for Gemini 2.5 Pro\n> Analyze my context window for Gemini 1.5 Flash\n> What's my context usage with Gemini 2.5 Flash-Lite?\n```\n\n**Modes:**\n\n- **Compact**: Quick overview of usage percentage\n- **Standard**: Detailed breakdown by component (default)\n- **Detailed**: Full analysis with optimization recommendations and model info\n\nExample with specific mode:\n\n```\n> Show me a detailed analysis of my context usage for Gemini 2.5 Pro including optimization recommendations\n```\n\n### Cost Estimator\n\nAsk Gemini to estimate your API costs:\n\n```\n> What are my current API costs?\n> Estimate costs for Gemini 2.5 Flash\n> How much would it cost with Gemini 2.5 Pro?\n```\n\n**Budget planning:**\n\n```\n> Estimate the cost if I make 100 requests with Gemini 2.5 Flash\n> What would 1000 requests cost with each model?\n```\n\n**Model comparison (automatic):**\n\nThe cost estimator automatically shows you how much you'd save (or spend) with each alternative model:\n\n```\n> Compare costs between all Gemini models\n> Show me which model is cheapest for my usage\n```\n\n### Model Comparison\n\nGet a comprehensive comparison of all available Gemini models:\n\n```\n> Compare all Gemini models\n> Show me a table of Gemini model pricing\n> Which Gemini model should I use?\n> What are the differences between Gemini 2.5 Pro and 2.5 Flash?\n```\n\nThe tool will show:\n- Complete model names and descriptions\n- Pricing for input and output tokens\n- Context window sizes\n- Estimated costs for your current usage\n- Models sorted from cheapest to most expensive\n\n### Repository Analyzer\n\nAnalyze any repository to understand its structure, tech stack, and statistics:\n\n```\n> Analyze the repository at /path/to/my-project\n> What tech stack is used in this codebase?\n> Show me statistics for the current repository\n```\n\nThe tool will provide:\n- Repository metadata (name, description, README content, license)\n- Tech stack information (primary language, all languages with line counts)\n- Framework and dependency detection\n- File statistics (total files, lines of code, directory depth)\n- File categorization (code files, test files, config files, documentation)\n\n**Advanced usage:**\n\n```\n> Analyze /path/to/repo with max depth of 5\n> What are the dependencies in this project?\n> Which frameworks are used in this codebase?\n> How many lines of TypeScript code are in this repository?\n```\n\n**Example output:**\n```jsonc\n{\n  \"metadata\": {\n    \"name\": \"my-project\",\n    \"primaryLanguage\": \"TypeScript\",\n    \"license\": \"MIT License\"\n  },\n  \"techStack\": {\n    \"languages\": {\n      \"TypeScript\": 15420,\n      \"JavaScript\": 3240,\n      \"CSS\": 1200\n    },\n    \"frameworks\": [\"React\", \"Next.js\", \"MCP\"],\n    \"packageManagers\": [\"npm\"],\n    \"dependencies\": { \"react\": \"^18.2.0\", ... }\n  },\n  \"structure\": {\n    \"totalFiles\": 145,\n    \"totalLines\": 21834,\n    \"maxDepth\": 6\n  },\n  \"statistics\": {\n    \"codeFiles\": 98,\n    \"testFiles\": 24,\n    \"configFiles\": 12,\n    \"documentationFiles\": 8\n  }\n}\n```\n\n### Wiki Generator\n\nGenerate comprehensive documentation for any repository using AI:\n\n```bash\n> Generate wiki documentation for /path/to/my-project\n> Create wiki using gemini-2.5-pro model\n> Generate only overview and architecture sections\n```\n\n**Advanced usage:**\n\n```bash\n> Generate wiki for this repository with diagrams\n> Create documentation in JSON format\n```\n\nThe tool will:\n- Analyze the repository structure and tech stack\n- Generate detailed documentation sections using Gemini AI\n- Create Mermaid diagrams for visualization\n- Compile everything into markdown format\n\n**Example output:** Markdown document with:\n- Table of contents\n- Overview and project description\n- Architecture and design patterns\n- Setup and installation instructions\n- Development guide and best practices\n- API reference and documentation\n- Testing guide and strategies\n- Mermaid diagrams (architecture, dataflow, directory structure)\n\n**Note:** Requires `GEMINI_API_KEY` environment variable. Get a free key at [Google AI Studio](https://aistudio.google.com/app/apikey).\n\n### 🔧 Wiki Configuration (Phase 3)\n\nCustomize wiki generation with `.gemini/wiki.json` configuration file:\n\n- **Custom Sections**: Define which sections to generate and their order\n- **Section-Specific Models**: Use different Gemini models for different sections (e.g., Pro for architecture, Flash for setup)\n- **Custom Prompts**: Add custom sections with your own prompts\n- **Repository Notes**: Provide additional context that informs all documentation\n- **Path Exclusions**: Skip specific files or directories during analysis\n- **Metadata Overrides**: Override repository title and description\n\n**Example `.gemini/wiki.json`:**\n```json\n{\n  \"version\": \"1.0\",\n  \"metadata\": {\n    \"title\": \"My Awesome Project\",\n    \"description\": \"Custom description\"\n  },\n  \"repoNotes\": \"Important context about this project...\",\n  \"sections\": [\n    { \"type\": \"overview\", \"enabled\": true },\n    { \"type\": \"architecture\", \"model\": \"gemini-2.5-pro\" },\n    {\n      \"type\": \"custom\",\n      \"title\": \"Security Considerations\",\n      \"prompt\": \"Analyze security measures in {LANGUAGE}...\"\n    }\n  ],\n  \"diagrams\": { \"enabled\": true, \"types\": [\"architecture\", \"dataflow\"] },\n  \"exclude\": { \"paths\": [\"node_modules/**\", \"dist/**\"] }\n}\n```\n\nSee `.gemini/wiki.json.example` for a complete configuration template.\n\n### 🔍 Semantic Code Search (Phase 4)\n\nSearch your codebase using natural language powered by AI embeddings:\n\n#### Index Your Repository\n\n```bash\n> Index the repository at /path/to/my-project for semantic search\n```\n\nThe indexer will:\n- Scan all code files in your repository\n- Create semantic chunks respecting function/class boundaries\n- Generate embeddings using Gemini's text-embedding-004 model\n- Cache embeddings locally in `.gemini/embeddings.json`\n- Display progress and indexing statistics\n\n#### Search Your Code\n\n```bash\n> Search for \"authentication implementation\" in /path/to/my-project\n> How does error handling work in this codebase?\n> Find examples of API endpoint definitions\n```\n\n**Search Features:**\n- **Natural Language Queries**: Ask questions in plain English\n- **Semantic Understanding**: Finds conceptually similar code, not just keyword matches\n- **Ranked Results**: Results sorted by relevance score\n- **Context Awareness**: See exactly which file and lines match your query\n- **Fast**: Uses cached embeddings for instant search\n- **Incremental Updates**: Re-index only changed files\n\n**Advanced Options:**\n```bash\n> Search with top 10 results and minimum score 0.7\n> Include surrounding context in search results\n```\n\n**Example Output:**\n```json\n{\n  \"query\": \"authentication implementation\",\n  \"resultsCount\": 5,\n  \"results\": [\n    {\n      \"file\": \"src/auth/login.ts\",\n      \"lines\": \"45-78\",\n      \"language\": \"TypeScript\",\n      \"similarity\": \"0.892\",\n      \"content\": \"async function authenticateUser(credentials) {...}\"\n    }\n  ]\n}\n```\n\n**Requirements:**\n- Requires `GEMINI_API_KEY` environment variable\n- Repository must be indexed first using `index_repository` tool\n- Embeddings cached locally for fast subsequent searches\n\n## 📚 Documentation\n\nComprehensive documentation is available in the [`docs/`](docs/) directory:\n\n### Getting Started\n- **[Installation Guide](docs/getting-started/INSTALLATION.md)** - Detailed installation instructions for all platforms\n- **[Quick Start](docs/getting-started/QUICK_START.md)** - 5-minute guide to get up and running\n- **[Configuration](docs/getting-started/CONFIGURATION.md)** - API keys, wiki config, and settings\n\n### User Guides\n- **[Tools Overview](docs/user-guide/TOOLS_OVERVIEW.md)** - Complete reference for all 7 tools\n- **[Repository Analysis](docs/user-guide/REPOSITORY_ANALYSIS.md)** - How to analyze codebases\n- **[Wiki Generation](docs/user-guide/WIKI_GENERATION.md)** - Creating AI-powered documentation\n- **[Semantic Search](docs/user-guide/SEMANTIC_SEARCH.md)** - Natural language code search\n- **[Context Tracking](docs/user-guide/CONTEXT_TRACKING.md)** - Monitor token usage\n- **[Cost Estimation](docs/user-guide/COST_ESTIMATION.md)** - Calculate API costs\n- **[Examples](docs/user-guide/EXAMPLES.md)** - Real-world usage examples\n\n### Architecture & Development\n- **[Architecture Overview](docs/architecture/OVERVIEW.md)** - System design and components\n- **[MCP Integration](docs/architecture/MCP_INTEGRATION.md)** - Protocol implementation details\n- **[Data Flow](docs/architecture/DATA_FLOW.md)** - How data flows through the system\n- **[API Design](docs/architecture/API_DESIGN.md)** - Internal API patterns\n\n### For Contributors\n- **[Development Setup](docs/development/SETUP.md)** - Set up your dev environment\n- **[Testing Guide](docs/development/TESTING.md)** - E2E tests with Jest\n- **[Contributing](docs/development/CONTRIBUTING.md)** - Contribution guidelines\n- **[Code Style](docs/development/CODE_STYLE.md)** - TypeScript style guide\n\n### API Reference\n- **[Tools API](docs/api-reference/TOOLS.md)** - Complete MCP tool API reference\n- **[Utilities](docs/api-reference/UTILITIES.md)** - Utility functions\n- **[Type Definitions](docs/api-reference/TYPE_DEFINITIONS.md)** - TypeScript types\n\n### Security\n- **[Security Audit](docs/audit/SECURITY_AUDIT.md)** - Comprehensive security review and findings\n\n## Supported Models\n\n### Gemini 2.5 Series (Latest - 2025)\n- **gemini-2.5-pro**: Most capable model for complex reasoning and coding tasks\n  - Input: $1.25/M (≤200k tokens), $2.50/M (>200k tokens)\n  - Output: $10/M (≤200k tokens), $15/M (>200k tokens)\n  - Context: 1M tokens\n  \n- **gemini-2.5-flash**: Balanced speed and performance for everyday tasks\n  - Input: $0.30/M\n  - Output: $2.50/M\n  - Context: 1M tokens\n  \n- **gemini-2.5-flash-lite**: Most cost-effective for high-volume tasks\n  - Input: $0.10/M\n  - Output: $0.40/M\n  - Context: 1M tokens\n\n### Gemini 2.0 Series\n- **gemini-2.0-flash-exp**: Experimental multimodal model\n  - Input: $0.10/M\n  - Output: $0.40/M\n  - Context: 1M tokens\n\n### Gemini 1.5 Series\n- **gemini-1.5-pro**: High-context model with 2M token window\n  - Input: $1.25/M (≤128k tokens), $2.50/M (>128k tokens)\n  - Output: $5/M (≤128k tokens), $10/M (>128k tokens)\n  - Context: 2M tokens\n  \n- **gemini-1.5-flash**: Cost-efficient model with long context support\n  - Input: $0.075/M (≤128k tokens), $0.15/M (>128k tokens)\n  - Output: $0.30/M (≤128k tokens), $0.60/M (>128k tokens)\n  - Context: 1M tokens\n\n## Platform-Specific Instructions\n\n### Linux & macOS\n\nThe extension works out of the box on Unix-like systems. The manifest uses path variables that automatically resolve correctly.\n\n### Windows\n\nThe extension supports Windows through cross-platform path variables (`${pathSeparator}`). If you encounter issues:\n\n1. Ensure Node.js is in your PATH\n2. Use PowerShell or CMD (not Git Bash for Gemini CLI)\n3. Verify the extension installed correctly:\n   ```powershell\n   dir %USERPROFILE%\\.gemini\\extensions\\gemini-context-extension\n   ```\n\n### WSL (Windows Subsystem for Linux)\n\nWSL is fully supported. Install and use the extension as you would on Linux:\n\n```bash\ngemini extensions install https://github.com/Beaulewis1977/gemini-context-extension\n```\n\nThe extension will automatically detect the WSL environment and configure paths appropriately.\n\n## Configuration\n\n### Accurate Token Counting (Optional)\n\nBy default, the extension uses heuristic estimation (~3.5 characters per token) for token counting. For **accurate real-time token counts**, you can enable Gemini API integration:\n\n#### Enable API-Based Token Counting\n\n> **⚠️ Security Warning**: Never commit API keys to version control or hardcode them in your code. Always use environment variables and add your `.env` files to `.gitignore`.\n\n1. **Get a Gemini API key** (free):\n   - Visit [Google AI Studio](https://aistudio.google.com/app/apikey)\n   - Create a new API key\n   - **Keep it secure** - treat it like a password\n\n2. **Set the environment variable**:\n\n   **Linux/macOS/WSL**:\n   ```bash\n   export GEMINI_API_KEY='your-api-key-here'\n   ```\n\n   **Windows (PowerShell)**:\n   ```powershell\n   $env:GEMINI_API_KEY='your-api-key-here'\n   ```\n\n   **Windows (CMD)**:\n   ```cmd\n   set GEMINI_API_KEY=your-api-key-here\n   ```\n\n3. **Restart your Gemini CLI**\n\n#### Benefits of API Integration\n\n- ✅ **Accurate Token Counts**: Real counts from Gemini API instead of estimates\n- ✅ **Precise Cost Calculations**: Budget planning with exact token usage\n- ✅ **Model-Specific Counting**: Counts match the exact tokenization for each model\n- ✅ **Automatic Fallback**: If API is unavailable, falls back to estimation automatically\n- ✅ **FREE**: The countTokens API endpoint has no cost (3000 requests/min limit)\n\n#### Verify API Integration\n\nAfter setting your API key, check if it's working:\n\n```bash\n# The extension will log whether it's using API or estimation\ngemini\n```\n\n### Extension Settings\n\nThe extension automatically loads configuration from:\n\n- `gemini-extension.json`: Core extension manifest\n- `GEMINI.md`: Contextual instructions for the AI model\n- `GEMINI_API_KEY` environment variable (optional): For accurate token counting\n\n### Pricing Updates\n\nThe extension includes the latest pricing (as of November 2025) for all Gemini models:\n- Gemini 2.5 Pro, 2.5 Flash, 2.5 Flash-Lite\n- Gemini 2.0 Flash (Experimental)\n- Gemini 1.5 Pro, 1.5 Flash\n\nModel pricing is defined in `src/tools/cost-estimator.ts`. To update pricing:\n\n1. Edit the `PRICING` constant with new rates\n2. Rebuild: `npm run build`\n3. Update the extension: `gemini extensions update gemini-context-extension`\n\nThe pricing structure supports:\n- Simple flat-rate pricing (e.g., Gemini 2.5 Flash)\n- Tiered pricing based on prompt size (e.g., Gemini 2.5 Pro has different rates for prompts ≤200k vs >200k tokens)\n\n## Development\n\n### Setup\n\n```bash\n# Install dependencies\nnpm install\n\n# Start development mode (watch for changes)\nnpm run dev\n```\n\n### Scripts\n\n- `npm run build` - Compile TypeScript to JavaScript\n- `npm run dev` - Watch mode for development\n- `npm run lint` - Run ESLint\n- `npm run format` - Format code with Prettier\n- `npm run format:check` - Check formatting without modifying files\n\n### Project Structure\n\n```\ngemini-context-extension/\n├── src/\n│   ├── server.ts                 # MCP server entry point\n│   ├── tools/\n│   │   ├── context-tracker.ts    # Context analysis tool\n│   │   ├── cost-estimator.ts     # Cost estimation tool\n│   │   ├── repo-analyzer.ts      # Repository analyzer tool (Phase 1)\n│   │   ├── wiki-generator.ts     # Wiki generator tool (Phase 2 & 3)\n│   │   └── repo-search.ts        # Semantic search tool (Phase 4)\n│   └── utils/\n│       ├── token-counter.ts      # Token estimation utilities\n│       ├── project-detection.ts  # Gemini directory finder\n│       ├── file-scanner.ts       # Filesystem scanning utilities\n│       ├── prompt-builder.ts     # AI prompt construction\n│       ├── code-chunker.ts       # Code chunking for embeddings (Phase 4)\n│       └── embedding-cache.ts    # Embedding storage (Phase 4)\n├── dist/                         # Compiled JavaScript (generated)\n├── .gemini/\n│   └── wiki.json.example         # Example wiki configuration (Phase 3)\n├── gemini-extension.json         # Extension manifest\n├── GEMINI.md                     # Context instructions\n├── package.json                  # Node.js package config\n├── tsconfig.json                 # TypeScript config\n├── WIKI_GENERATOR_PLAN.md        # Implementation plan for wiki features\n├── AGENT_PROMPT_WIKI_IMPLEMENTATION.md  # Agent instructions\n└── .github/\n    └── workflows/\n        └── ci.yml                # GitHub Actions CI/CD\n```\n\n### Pre-commit Hooks\n\nThe project uses Husky for pre-commit hooks that automatically:\n\n- Format code with Prettier\n- Run ESLint checks\n\nTo set up hooks after cloning:\n\n```bash\nnpm install\nnpm run prepare\n```\n\n## Troubleshooting\n\n### Extension Not Loading\n\n1. **Check Installation**:\n   ```bash\n   # List installed extensions\n   gemini extensions list\n   ```\n\n2. **Verify Build Output**:\n   ```bash\n   ls dist/server.js\n   # Should exist and be a valid JavaScript file\n   ```\n\n3. **Check Manifest**:\n   Ensure `gemini-extension.json` is in the extension root directory.\n\n4. **Restart CLI**:\n   Extension changes require a full CLI restart.\n\n### Tools Not Appearing\n\n1. **Check Tool Registration**:\n   ```\n   /tools list\n   ```\n   Look for `track_context_usage`, `estimate_api_cost`, `compare_gemini_models`, `analyze_repository`, and `generate_repository_wiki`.\n\n2. **Check MCP Server Logs**:\n   The server logs to stderr. Check your terminal for error messages.\n\n3. **Verify Node Version**:\n   ```bash\n   node --version\n   # Should be 18.x or higher\n   ```\n\n### Path Issues on Windows\n\nIf you see path-related errors on Windows:\n\n1. Verify the extension manifest uses `${pathSeparator}`:\n   ```json\n   \"args\": [\"${extensionPath}${pathSeparator}dist${pathSeparator}server.js\"]\n   ```\n\n2. Check that backslashes are handled correctly in the resolved path.\n\n### Token Counting Accuracy\n\n**With API Key (Recommended)**:\n- Set `GEMINI_API_KEY` environment variable to use real Gemini API token counting\n- Provides exact token counts from Google's official tokenization\n- Free to use (no cost for countTokens API)\n\n**Without API Key (Default)**:\n- Uses heuristic estimation (~3.5 characters per token)\n- Good for general usage and development\n- No external API calls required\n\nTo enable accurate counting, see the [Configuration](#accurate-token-counting-optional) section above.\n\n## Contributing\n\nContributions are welcome! Please:\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Make your changes\n4. Run tests: `npm run lint && npm run build`\n5. Commit with clear messages: `git commit -m 'Add amazing feature'`\n6. Push: `git push origin feature/amazing-feature`\n7. Open a Pull Request\n\n### Code Style\n\n- Use TypeScript for all source files\n- Follow existing code style (enforced by ESLint + Prettier)\n- Add comments for complex logic\n- Keep functions small and focused\n\n## Roadmap\n\nSee [ROADMAP.md](ROADMAP.md) for planned features and future development.\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Issues**: [GitHub Issues](https://github.com/Beaulewis1977/gemini-context-extension/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/Beaulewis1977/gemini-context-extension/discussions)\n- **Documentation**: [Gemini CLI Docs](https://geminicli.com/docs/extensions/)\n\n## Acknowledgments\n\n- Built with the [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk)\n- Inspired by the need for better visibility in AI CLI tools\n- Thanks to the Gemini CLI team for building an extensible platform\n\n---\n\n**Made with ❤️ for the Gemini CLI community**\n",
  "bytes": 24839,
  "sha": "16f323126d10001b03fe63d90efa730278ebd2f20b8a184a80299bd7d1921fbc",
  "repo_slug": "beaulewis1977/gemini-context-extension",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_beaulewis1977_gemini_context_extension_178ec76f/readme"
}