Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .github/workflows/deploy-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,6 @@ jobs:
api-key: ${{ secrets.EDGE_API_KEY }}
client-id: ${{ secrets.EDGE_CLIENT_ID }}
upload-only: true
notes-for-certification: |
v${{ needs.validate.outputs.version }} release
- Bug fixes and performance improvements
- CSS isolation fixes
- GitHub API optimization

GitHub: https://github.com/AhmedV20/codemind

- name: βœ… Upload success
if: success()
Expand Down
7 changes: 4 additions & 3 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ CodeMind is a browser extension that provides AI-powered analysis of GitHub repo

### What We Collect
- **API Keys:** Stored locally in your browser using Chrome's storage API. Never transmitted to our servers.
- **Repository Data:** Temporarily fetched from GitHub's public API for analysis. Not stored permanently.
- **GitHub Token (Optional):** If you add a GitHub token for rate limit handling, it's stored locally only.
- **Repository Data:** Temporarily fetched from GitHub for analysis. Not stored permanently.
- **Cached Analyses:** Stored locally and automatically expire after 24 hours.

### What We Don't Collect
- Personal information
Expand All @@ -28,9 +28,10 @@ All data is stored **locally on your device**:
## Third-Party Services

CodeMind connects to:
1. **GitHub API** - To fetch public repository information
1. **GitHub** - To fetch public repository information (no authentication required)
2. **AI Providers** (user-selected):
- Google Gemini API
- OpenAI API
- Anthropic Claude API
- HuggingFace Inference API
- OpenRouter API
Expand Down
54 changes: 40 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div align="center">

[![Stars](https://img.shields.io/github/stars/AhmedV20/codemind?style=social)](https://github.com/AhmedV20/codemind/stargazers)
[![Version](https://img.shields.io/badge/version-1.1.1-blue)](https://github.com/AhmedV20/codemind/releases)
[![Version](https://img.shields.io/badge/version-1.2.0-blue)](https://github.com/AhmedV20/codemind/releases)
[![Build](https://img.shields.io/github/actions/workflow/status/AhmedV20/codemind/ci.yml?label=CI/Build)](https://github.com/AhmedV20/codemind/actions)
[![Privacy](https://img.shields.io/badge/Privacy-Protected-green)](PRIVACY.md)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
Expand Down Expand Up @@ -38,32 +38,31 @@
</td>
<td align="center" width="50%">
<br>
<img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/firefox/firefox_48x48.png" width="65">
<img src="https://raw.githubusercontent.com/alrra/browser-logos/main/src/chrome/chrome_48x48.png" width="65">
<br>
<img src="https://img.shields.io/badge/Firefox-Coming_Soon-FF7139?style=for-the-badge&logo=firefoxbrowser&logoColor=white" alt="Firefox">
<img src="https://img.shields.io/badge/Chrome-Manual_Install-4285F4?style=for-the-badge&logo=googlechrome&logoColor=white" alt="Chrome">
<br><br>
<p><b>πŸ“ In Progress</b></p>
<p>Firefox submission is underway. We'll notify you once it's available!</p>
<p><b>πŸ”§ Developer Mode</b></p>
<p>Install manually via <a href="#-manual-installation">instructions below</a></p>
</td>
</tr>
</table>

<br>

> πŸ’‘ **Want to try CodeMind now?** See the [Manual Installation](#-manual-installation) guide below for Chrome/Edge.

</div>

---

### πŸ’‘ What is CodeMind?
## πŸ’‘ What is CodeMind?

CodeMind is a powerful browser extension that uses AI to instantly understand any GitHub repository. Simply click a button and get:

- **Smart Summaries** β€” Understand what the project does, who it's for, and its key features
- **Code Structure Analysis** β€” Learn how the codebase is organized
- **Tech Stack Detection** β€” See all languages, frameworks, and dependencies at a glance
- **Interactive Q&A** β€” Ask follow-up questions and get detailed answers about any part of the code
- **Analyzed Files View** β€” See exactly which files were analyzed (new in v1.2.0!)

<!-- Demo GIF - Replace with your actual demo recording
<p align="center">
Expand All @@ -78,7 +77,7 @@ CodeMind is a powerful browser extension that uses AI to instantly understand an
1. Install from the [Edge Add-ons Store](https://microsoftedge.microsoft.com/addons/detail/hfggelncfoaompalbnkgbincglagmbnj) or [manually](#-manual-installation)
2. Navigate to any GitHub repository
3. Click the **CodeMind** button next to the Insights tab
4. Configure your AI provider (Gemini, Claude, HuggingFace, or OpenRouter)
4. Configure your AI provider (Gemini, OpenAI, Claude, HuggingFace, or OpenRouter)
5. Click **Analyze Repository** to get your summary

---
Expand All @@ -90,21 +89,37 @@ CodeMind is a powerful browser extension that uses AI to instantly understand an
- **AI Summaries** β€” Get instant, readable explanations of complex code
- **Interactive Chat** β€” Ask follow-up questions about the repository
- **Smart Caching** β€” Results saved for 24 hours
- **Analyzed Files Dropdown** β€” See which files were included in the analysis

### AI Providers
| Provider | Free Tier | Description |
|----------|-----------|-------------|
| **Gemini** | βœ… Yes | Google's AI with generous free tier |
| **OpenAI** | ❌ Paid | GPT-4o with streaming support (new!) |
| **OpenRouter** | βœ… Yes | Access 100+ models (DeepSeek, Qwen, etc.) |
| **Claude** | ❌ Paid | Anthropic's Claude models |
| **HuggingFace** | βœ… Yes | Open-source models |

### v1.1.0 Highlights
### v1.2.0 Highlights
- πŸ€– **OpenAI Support** β€” GPT-4o integration with streaming
- πŸ“‚ **Analyzed Files Dropdown** β€” See which files were analyzed with glow animation
- 🌐 **No GitHub Token Required** β€” Works on public repos without authentication
- 🎯 **Smart File Selection** β€” Intelligent 80k token budget with file prioritization
- 🧠 **ThinkingBox** β€” See AI reasoning process in collapsible box
- 🎨 **Redesigned UI** β€” New Analyze button with status colors
- ⏱️ **Request Throttling** β€” Built-in cooldown to prevent rate limits

### Previous Versions
<details>
<summary>v1.1.x Features</summary>

- 🧠 **ThinkingBox** β€” See AI reasoning process in collapsible box
- πŸ”‘ **GitHub Token** β€” Handle rate limits with personal access token
- 🎨 **Glass UI** β€” Modern glassmorphism design throughout
- ⚠️ **Error Handling** β€” Clear error messages with retry options

</details>

---

## πŸ”’ Privacy Policy
Expand All @@ -114,6 +129,7 @@ Your privacy matters. CodeMind:
- βœ… Never sends data to external servers (except AI providers you choose)
- βœ… Uses HTTPS for all API communications
- βœ… Allows you to clear all data anytime
- βœ… No GitHub token required for public repositories

Read the full [Privacy Policy](PRIVACY.md).

Expand All @@ -137,11 +153,23 @@ npm run dev
npm run build
```

### πŸ“ Project Structure
```
src/
β”œβ”€β”€ background/ # Service worker & API calls
β”‚ β”œβ”€β”€ api/ # AI provider implementations
β”‚ └── services/ # Analysis, cache, strategies
β”œβ”€β”€ content/ # UI components & hooks
β”‚ β”œβ”€β”€ components/ # React components
β”‚ └── utils/ # DOM scrapers, parsers
β”œβ”€β”€ shared/ # Types & constants
└── popup/ # Extension popup
```

---

### πŸ”§ Manual Installation


**Step 1: Build the extension**
```bash
npm run build
Expand All @@ -164,11 +192,9 @@ npm run build
**Step 3: Configure**

1. Click the CodeMind extension icon in your toolbar
2. Add your AI API key (Gemini, OpenRouter, Claude, or HuggingFace)
2. Add your AI API key (Gemini, OpenAI, OpenRouter, Claude, or HuggingFace)
3. Navigate to any GitHub repo and start analyzing!

</details>

---

## 🀝 Contributing
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codemind",
"version": "1.1.1",
"version": "1.2.0",
"description": "AI-Powered Repository Analyzer for GitHub",
"type": "module",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "CodeMind - AI Repository Analyzer",
"version": "1.1.1",
"version": "1.2.0",
"description": "Understand any GitHub repository in seconds with AI-powered analysis.",
"icons": {
"16": "icons/icon16.png",
Expand All @@ -20,6 +20,7 @@
"https://generativelanguage.googleapis.com/*",
"https://router.huggingface.co/*",
"https://openrouter.ai/*",
"https://api.openai.com/*",
"https://raw.githubusercontent.com/*"
],
"background": {
Expand Down
31 changes: 19 additions & 12 deletions src/background/api/ai-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export interface ChatContext {
repoData: RepositoryData;
analysis: Analysis;
history: Array<{ role: 'user' | 'assistant'; content: string }>;
conversationMemory?: import('@shared/types').ConversationMemory;
optimizedPrompt?: string;
}

/**
Expand Down Expand Up @@ -311,38 +313,43 @@ ${releases[0].assets.length > 0 ? releases[0].assets.map(a => `- **${a.name}** (
* Build a chat prompt for follow-up questions
*/
export function buildChatPrompt(question: string, context: ChatContext): string {
const { repoData, analysis, history } = context;
const { repoData, analysis, history, conversationMemory, optimizedPrompt } = context;

// Build conversation history
const historyText = history
.slice(-10) // Keep last 10 messages for context
.map(msg => `**${msg.role === 'user' ? 'User' : 'CodeMind'}:** ${msg.content}`)
.join('\n\n');

// Include key files in context for better answers
// Build memory context from previous conversations
const memoryContext = conversationMemory && conversationMemory.facts.length > 0
? `\n\n## Previous Conversation Context\n${conversationMemory.facts.slice(-5).map(f => `- ${f.fact}`).join('\n')}`
: '';

// Use CACHED files (not trying to fetch missing ones) - show with βœ…
const keyFilesContext = repoData.keyFiles.length > 0
? `\n\nKey files available for reference:\n${repoData.keyFiles.map(f => `- ${f.path}`).join('\n')}`
? `\n\n## Files Analyzed in Repository\n${repoData.keyFiles.map(f => `βœ… ${f.path}`).join('\n')}`
: '';

return `You are CodeMind, an AI assistant helping users understand the GitHub repository "${repoData.metadata.fullName}".

## Repository Summary
${analysis.content.slice(0, 5000)}
## Repository Analysis Summary
${analysis.content.slice(0, 3000)}
${keyFilesContext}
${memoryContext}

${history.length > 0 ? `## Previous Conversation\n${historyText}\n` : ''}

## Current Question
**User asks:** "${question}"

## Instructions
1. Answer based on the repository data and your previous analysis
2. Be specific and reference actual files/features when relevant
3. If you need to show code or commands, use proper markdown code blocks
4. If you're not sure about something, say so clearly
5. Keep your response focused and helpful
6. For technical questions, provide accurate details
7. For beginner questions, explain concepts simply
1. Answer based on the analyzed files and previous analysis
2. Reference ONLY the files listed above (marked with βœ…)
3. Use conversation memory to provide continuity
4. Be specific and accurate
5. If a file wasn't analyzed, say so clearly - don't make assumptions
6. Keep responses focused and helpful

Provide your response:`;
}
Loading