cognify-code 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cognify_code-0.2.5/src/cognify_code.egg-info → cognify_code-0.2.6}/PKG-INFO +94 -161
- cognify_code-0.2.6/README.md +253 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/pyproject.toml +2 -1
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/code_agent.py +0 -333
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/cli.py +73 -8
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/base.py +94 -4
- {cognify_code-0.2.5 → cognify_code-0.2.6/src/cognify_code.egg-info}/PKG-INFO +94 -161
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/cognify_code.egg-info/requires.txt +1 -0
- cognify_code-0.2.5/README.md +0 -321
- {cognify_code-0.2.5 → cognify_code-0.2.6}/LICENSE +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/MANIFEST.in +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/setup.cfg +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/code_generator.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/code_reviewer.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/diff_engine.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/file_manager.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/agent/intent_classifier.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/chat/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/chat/agent_session.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/chat/session.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/config.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/context/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/context/analyzer.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/context/selector.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/editor/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/editor/diff_handler.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/editor/file_editor.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/editor/prompts.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/generator/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/generator/code_gen.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/generator/prompts.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/git/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/git/commit_generator.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/git/manager.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/llm.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/cerebras.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/factory.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/google.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/groq.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/ollama.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/openai.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/providers/openrouter.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/py.typed +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/refactor/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/refactor/analyzer.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/refactor/change_plan.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/refactor/multi_file_editor.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/refactor/prompts.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/retrieval/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/retrieval/chunker.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/retrieval/indexer.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/retrieval/search.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/reviewer/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/reviewer/analyzer.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/reviewer/prompts.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/utils/__init__.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/utils/file_handler.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/ai_code_assistant/utils/formatters.py +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/cognify_code.egg-info/SOURCES.txt +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/cognify_code.egg-info/dependency_links.txt +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/cognify_code.egg-info/entry_points.txt +0 -0
- {cognify_code-0.2.5 → cognify_code-0.2.6}/src/cognify_code.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognify-code
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: Your local AI-powered code assistant. Review, generate, search, and refactor code with an intelligent AI agent—all running locally with complete privacy.
|
|
5
5
|
Author-email: Ashok Kumar <akkssy@users.noreply.github.com>
|
|
6
6
|
Maintainer-email: Ashok Kumar <akkssy@users.noreply.github.com>
|
|
@@ -39,6 +39,7 @@ Requires-Dist: rich>=13.0.0
|
|
|
39
39
|
Requires-Dist: pyyaml>=6.0
|
|
40
40
|
Requires-Dist: pydantic>=2.0.0
|
|
41
41
|
Requires-Dist: pydantic-settings>=2.0.0
|
|
42
|
+
Requires-Dist: tenacity>=8.0.0
|
|
42
43
|
Requires-Dist: chromadb>=0.4.0
|
|
43
44
|
Requires-Dist: sentence-transformers>=2.0.0
|
|
44
45
|
Requires-Dist: watchdog>=4.0.0
|
|
@@ -68,11 +69,11 @@ Dynamic: license-file
|
|
|
68
69
|
|
|
69
70
|
<p align="center">
|
|
70
71
|
<a href="#features">Features</a> •
|
|
72
|
+
<a href="#vscode-extension">VSCode Extension</a> •
|
|
71
73
|
<a href="#installation">Installation</a> •
|
|
72
74
|
<a href="#providers">Providers</a> •
|
|
73
75
|
<a href="#usage">Usage</a> •
|
|
74
|
-
<a href="#documentation">Docs</a>
|
|
75
|
-
<a href="#contributing">Contributing</a>
|
|
76
|
+
<a href="#documentation">Docs</a>
|
|
76
77
|
</p>
|
|
77
78
|
|
|
78
79
|
<p align="center">
|
|
@@ -80,11 +81,12 @@ Dynamic: license-file
|
|
|
80
81
|
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License">
|
|
81
82
|
<img src="https://img.shields.io/badge/tests-144%20passed-brightgreen.svg" alt="Tests">
|
|
82
83
|
<img src="https://img.shields.io/badge/providers-6%20supported-purple.svg" alt="6 Providers">
|
|
84
|
+
<img src="https://img.shields.io/badge/VSCode-Extension-blue.svg" alt="VSCode Extension">
|
|
83
85
|
</p>
|
|
84
86
|
|
|
85
87
|
---
|
|
86
88
|
|
|
87
|
-
A powerful CLI tool that brings AI-powered code cognition to your
|
|
89
|
+
A powerful CLI tool and **VSCode extension** that brings AI-powered code cognition to your development workflow. Review code, generate functions, search your codebase semantically, and refactor projects—with support for **multiple LLM providers** including local (Ollama) and cloud options with free tiers.
|
|
88
90
|
|
|
89
91
|
## ✨ Features
|
|
90
92
|
|
|
@@ -95,10 +97,67 @@ A powerful CLI tool that brings AI-powered code cognition to your terminal. Revi
|
|
|
95
97
|
| 🔎 **Semantic Search** | Search your codebase using natural language queries |
|
|
96
98
|
| 📝 **AI File Editing** | Edit files with natural language instructions |
|
|
97
99
|
| 🔄 **Multi-File Refactor** | Refactor across multiple files at once |
|
|
98
|
-
|
|
|
100
|
+
| ✏️ **Symbol Renaming** | Rename functions, classes, variables across your project |
|
|
99
101
|
| 💬 **Interactive Chat** | Chat with AI about your code |
|
|
100
102
|
| 📊 **Codebase Indexing** | Create searchable semantic index with RAG |
|
|
101
103
|
| 🌐 **Multi-Provider** | Support for 6 LLM providers (local & cloud) |
|
|
104
|
+
| 🖥️ **VSCode Extension** | Full IDE integration with sidebar chat |
|
|
105
|
+
|
|
106
|
+
## 🖥️ VSCode Extension
|
|
107
|
+
|
|
108
|
+
<p align="center">
|
|
109
|
+
<img src="vscode-extension/images/icon.png" width="64" alt="Cognify VSCode">
|
|
110
|
+
</p>
|
|
111
|
+
|
|
112
|
+
The Cognify AI VSCode extension brings all the power of Cognify directly into your IDE with a beautiful sidebar chat interface.
|
|
113
|
+
|
|
114
|
+
### Extension Features
|
|
115
|
+
|
|
116
|
+
- ⚛️ **Sidebar Chat Panel** - Chat with AI directly in VSCode sidebar
|
|
117
|
+
- 📎 **Add Context** - Include code from your editor in conversations
|
|
118
|
+
- 🔍 **Code Review** - Review files with inline diagnostics
|
|
119
|
+
- ✨ **Code Generation** - Generate code from descriptions
|
|
120
|
+
- 💡 **Code Explanation** - Get explanations for selected code
|
|
121
|
+
- ✏️ **AI Editing** - Edit code with natural language
|
|
122
|
+
|
|
123
|
+
### Quick Actions
|
|
124
|
+
- 📋 Review current file
|
|
125
|
+
- 💡 Explain selected code
|
|
126
|
+
- ✨ Suggest improvements
|
|
127
|
+
- 🧪 Generate tests
|
|
128
|
+
|
|
129
|
+
### Install VSCode Extension
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Build from source
|
|
133
|
+
cd vscode-extension
|
|
134
|
+
npm install
|
|
135
|
+
npm run package
|
|
136
|
+
|
|
137
|
+
# Install the extension
|
|
138
|
+
code --install-extension cognify-ai-0.2.0.vsix
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Or install via VSCode:
|
|
142
|
+
1. Open VSCode
|
|
143
|
+
2. Go to Extensions sidebar
|
|
144
|
+
3. Click "..." → "Install from VSIX..."
|
|
145
|
+
4. Select `cognify-ai-0.2.0.vsix`
|
|
146
|
+
|
|
147
|
+
### Using the Extension
|
|
148
|
+
|
|
149
|
+
1. Click the ⚛️ Cognify icon in the Activity Bar (left sidebar)
|
|
150
|
+
2. Use quick actions or type your question
|
|
151
|
+
3. Click "📎 Add Context" to include code from your editor
|
|
152
|
+
4. Press Enter or click Send
|
|
153
|
+
|
|
154
|
+
**Keyboard Shortcuts:**
|
|
155
|
+
| Command | Mac | Windows/Linux |
|
|
156
|
+
|---------|-----|---------------|
|
|
157
|
+
| Review File | `Cmd+Shift+R` | `Ctrl+Shift+R` |
|
|
158
|
+
| Generate Code | `Cmd+Shift+G` | `Ctrl+Shift+G` |
|
|
159
|
+
| Explain Code | `Cmd+Shift+E` | `Ctrl+Shift+E` |
|
|
160
|
+
| Open Chat | `Cmd+Shift+C` | `Ctrl+Shift+C` |
|
|
102
161
|
|
|
103
162
|
## 🤖 Supported Providers
|
|
104
163
|
|
|
@@ -153,87 +212,46 @@ pip install -e .
|
|
|
153
212
|
|
|
154
213
|
```bash
|
|
155
214
|
# Check status and available providers
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## 🌐 Provider Management
|
|
161
|
-
|
|
162
|
-
### List Available Providers
|
|
163
|
-
```bash
|
|
164
|
-
ai-assist providers
|
|
215
|
+
cognify status
|
|
216
|
+
cognify providers
|
|
165
217
|
```
|
|
166
|
-
Shows all providers with their models, free tier status, and API key requirements.
|
|
167
|
-
|
|
168
|
-
### Switch Providers
|
|
169
|
-
```bash
|
|
170
|
-
# Switch to Groq (fast cloud inference)
|
|
171
|
-
ai-assist use-provider groq --test
|
|
172
218
|
|
|
173
|
-
|
|
174
|
-
ai-assist use-provider google --model gemini-1.5-pro --test
|
|
175
|
-
|
|
176
|
-
# Use OpenRouter with free DeepSeek R1
|
|
177
|
-
ai-assist use-provider openrouter --model deepseek/deepseek-r1:free --test
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Test Provider Connection
|
|
181
|
-
```bash
|
|
182
|
-
ai-assist test-provider
|
|
183
|
-
ai-assist test-provider --provider groq --prompt "Hello world"
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## 📖 Usage
|
|
219
|
+
## 📖 CLI Usage
|
|
187
220
|
|
|
188
221
|
### Code Review
|
|
189
222
|
```bash
|
|
190
|
-
|
|
191
|
-
|
|
223
|
+
cognify review path/to/file.py
|
|
224
|
+
cognify review src/ --format json
|
|
192
225
|
```
|
|
193
226
|
|
|
194
227
|
### Code Generation
|
|
195
228
|
```bash
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
ai-assist generate "unit tests for calculator" --mode test
|
|
229
|
+
cognify generate "binary search function" --language python
|
|
230
|
+
cognify generate "REST API client class" --mode class
|
|
199
231
|
```
|
|
200
232
|
|
|
201
233
|
### Semantic Search
|
|
202
234
|
```bash
|
|
203
235
|
# First, index your codebase
|
|
204
|
-
|
|
236
|
+
cognify index .
|
|
205
237
|
|
|
206
238
|
# Then search
|
|
207
|
-
|
|
208
|
-
ai-assist search "database connection" -k 10
|
|
239
|
+
cognify search "error handling"
|
|
209
240
|
```
|
|
210
241
|
|
|
211
242
|
### File Editing
|
|
212
243
|
```bash
|
|
213
|
-
|
|
214
|
-
ai-assist edit utils.py "add type hints" --backup
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### Multi-File Refactoring
|
|
218
|
-
```bash
|
|
219
|
-
ai-assist refactor "add docstrings to all functions" -p "src/**/*.py" --dry-run
|
|
220
|
-
ai-assist refactor "convert print to logging" --pattern "**/*.py" --confirm
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### Symbol Renaming
|
|
224
|
-
```bash
|
|
225
|
-
ai-assist rename old_function new_function --type function --dry-run
|
|
226
|
-
ai-assist rename MyClass BetterClass --type class -p "src/**/*.py"
|
|
244
|
+
cognify edit config.py "add logging to all functions" --preview
|
|
227
245
|
```
|
|
228
246
|
|
|
229
247
|
### Interactive Chat
|
|
230
248
|
```bash
|
|
231
|
-
|
|
249
|
+
cognify chat
|
|
232
250
|
```
|
|
233
251
|
|
|
234
252
|
### All Commands
|
|
235
253
|
```bash
|
|
236
|
-
|
|
254
|
+
cognify --help
|
|
237
255
|
```
|
|
238
256
|
|
|
239
257
|
## ⚙️ Configuration
|
|
@@ -242,32 +260,11 @@ Configuration is managed via `config.yaml`:
|
|
|
242
260
|
|
|
243
261
|
```yaml
|
|
244
262
|
llm:
|
|
245
|
-
provider: "ollama"
|
|
263
|
+
provider: "ollama"
|
|
246
264
|
model: "deepseek-coder:6.7b"
|
|
247
|
-
base_url: "http://localhost:11434"
|
|
265
|
+
base_url: "http://localhost:11434"
|
|
248
266
|
temperature: 0.1
|
|
249
267
|
max_tokens: 4096
|
|
250
|
-
timeout: 120
|
|
251
|
-
|
|
252
|
-
review:
|
|
253
|
-
severity_levels: [critical, warning, suggestion]
|
|
254
|
-
categories: [bugs, security, performance, style]
|
|
255
|
-
|
|
256
|
-
generation:
|
|
257
|
-
include_type_hints: true
|
|
258
|
-
include_docstrings: true
|
|
259
|
-
|
|
260
|
-
retrieval:
|
|
261
|
-
embedding_model: "all-MiniLM-L6-v2"
|
|
262
|
-
chunk_size: 50
|
|
263
|
-
|
|
264
|
-
editor:
|
|
265
|
-
create_backup: true
|
|
266
|
-
show_diff: true
|
|
267
|
-
|
|
268
|
-
refactor:
|
|
269
|
-
max_files: 20
|
|
270
|
-
require_confirmation: true
|
|
271
268
|
```
|
|
272
269
|
|
|
273
270
|
Or use environment variables:
|
|
@@ -281,100 +278,36 @@ export GROQ_API_KEY="your-key"
|
|
|
281
278
|
|
|
282
279
|
```
|
|
283
280
|
cognify-ai/
|
|
284
|
-
├── src/ai_code_assistant/
|
|
285
|
-
│ ├── cli.py
|
|
286
|
-
│ ├──
|
|
287
|
-
│ ├──
|
|
288
|
-
│ ├──
|
|
289
|
-
│
|
|
290
|
-
│
|
|
291
|
-
│
|
|
292
|
-
|
|
293
|
-
│
|
|
294
|
-
│
|
|
295
|
-
│
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
│ ├── retrieval/ # Semantic search & indexing (RAG)
|
|
300
|
-
│ ├── editor/ # AI file editing
|
|
301
|
-
│ ├── refactor/ # Multi-file refactoring
|
|
302
|
-
│ ├── chat/ # Interactive chat
|
|
303
|
-
│ └── utils/ # Utilities & formatters
|
|
304
|
-
├── tests/ # 144 unit tests
|
|
305
|
-
├── docs/ # Documentation
|
|
306
|
-
├── config.yaml # Configuration
|
|
307
|
-
└── pyproject.toml # Dependencies
|
|
281
|
+
├── src/ai_code_assistant/ # Core Python package
|
|
282
|
+
│ ├── cli.py # Command-line interface
|
|
283
|
+
│ ├── providers/ # LLM providers
|
|
284
|
+
│ ├── reviewer/ # Code review
|
|
285
|
+
│ ├── generator/ # Code generation
|
|
286
|
+
│ ├── retrieval/ # Semantic search
|
|
287
|
+
│ ├── editor/ # AI file editing
|
|
288
|
+
│ └── chat/ # Interactive chat
|
|
289
|
+
├── vscode-extension/ # VSCode Extension
|
|
290
|
+
│ ├── src/ # Extension source
|
|
291
|
+
│ ├── images/ # Icons
|
|
292
|
+
│ └── package.json # Extension manifest
|
|
293
|
+
├── tests/ # Unit tests
|
|
294
|
+
├── docs/ # Documentation
|
|
295
|
+
└── config.yaml # Configuration
|
|
308
296
|
```
|
|
309
297
|
|
|
310
298
|
## 🧪 Testing
|
|
311
299
|
|
|
312
300
|
```bash
|
|
313
|
-
# Run all tests
|
|
314
301
|
PYTHONPATH=src pytest tests/ -v
|
|
315
|
-
|
|
316
|
-
# Run with coverage
|
|
317
|
-
PYTHONPATH=src pytest tests/ --cov=ai_code_assistant
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
## 🛠️ Tech Stack
|
|
321
|
-
|
|
322
|
-
| Component | Technology |
|
|
323
|
-
|-----------|------------|
|
|
324
|
-
| LLM Framework | LangChain |
|
|
325
|
-
| Local LLM | Ollama |
|
|
326
|
-
| Cloud LLMs | Google, Groq, OpenRouter, OpenAI |
|
|
327
|
-
| Vector Database | ChromaDB |
|
|
328
|
-
| Embeddings | Sentence Transformers |
|
|
329
|
-
| CLI | Click + Rich |
|
|
330
|
-
| Config | Pydantic |
|
|
331
|
-
| Testing | Pytest |
|
|
332
|
-
|
|
333
|
-
## 🐛 Troubleshooting
|
|
334
|
-
|
|
335
|
-
**"Connection refused" error (Ollama)**
|
|
336
|
-
```bash
|
|
337
|
-
ollama serve # Make sure Ollama is running
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
**API Key errors**
|
|
341
|
-
```bash
|
|
342
|
-
ai-assist providers # Check which API keys are set
|
|
343
|
-
export GROQ_API_KEY="your-key" # Set the appropriate key
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
**Test provider connection**
|
|
347
|
-
```bash
|
|
348
|
-
ai-assist test-provider --provider groq
|
|
349
|
-
```
|
|
350
|
-
|
|
351
|
-
**Import errors**
|
|
352
|
-
```bash
|
|
353
|
-
pip install -e ".[dev]"
|
|
354
302
|
```
|
|
355
303
|
|
|
356
304
|
## 🤝 Contributing
|
|
357
305
|
|
|
358
306
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
359
307
|
|
|
360
|
-
1. Fork the repository
|
|
361
|
-
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
362
|
-
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
363
|
-
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
364
|
-
5. Open a Pull Request
|
|
365
|
-
|
|
366
308
|
## 📄 License
|
|
367
309
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
## 🙏 Acknowledgments
|
|
371
|
-
|
|
372
|
-
- [Ollama](https://ollama.ai) - Local LLM runtime
|
|
373
|
-
- [LangChain](https://langchain.com) - LLM framework
|
|
374
|
-
- [Google AI Studio](https://aistudio.google.com) - Gemini models
|
|
375
|
-
- [Groq](https://groq.com) - Fast inference
|
|
376
|
-
- [OpenRouter](https://openrouter.ai) - Multi-provider access
|
|
377
|
-
- [ChromaDB](https://www.trychroma.com) - Vector database
|
|
310
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
378
311
|
|
|
379
312
|
---
|
|
380
313
|
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# 🧠 Cognify AI
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<strong>Code Cognition — Your AI-Powered Code Assistant</strong>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="#features">Features</a> •
|
|
9
|
+
<a href="#vscode-extension">VSCode Extension</a> •
|
|
10
|
+
<a href="#installation">Installation</a> •
|
|
11
|
+
<a href="#providers">Providers</a> •
|
|
12
|
+
<a href="#usage">Usage</a> •
|
|
13
|
+
<a href="#documentation">Docs</a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python 3.9+">
|
|
18
|
+
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License">
|
|
19
|
+
<img src="https://img.shields.io/badge/tests-144%20passed-brightgreen.svg" alt="Tests">
|
|
20
|
+
<img src="https://img.shields.io/badge/providers-6%20supported-purple.svg" alt="6 Providers">
|
|
21
|
+
<img src="https://img.shields.io/badge/VSCode-Extension-blue.svg" alt="VSCode Extension">
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
A powerful CLI tool and **VSCode extension** that brings AI-powered code cognition to your development workflow. Review code, generate functions, search your codebase semantically, and refactor projects—with support for **multiple LLM providers** including local (Ollama) and cloud options with free tiers.
|
|
27
|
+
|
|
28
|
+
## ✨ Features
|
|
29
|
+
|
|
30
|
+
| Feature | Description |
|
|
31
|
+
|---------|-------------|
|
|
32
|
+
| 🔍 **Code Review** | Analyze code for bugs, security issues, and style problems |
|
|
33
|
+
| ⚡ **Code Generation** | Generate functions, classes, and tests from natural language |
|
|
34
|
+
| 🔎 **Semantic Search** | Search your codebase using natural language queries |
|
|
35
|
+
| 📝 **AI File Editing** | Edit files with natural language instructions |
|
|
36
|
+
| 🔄 **Multi-File Refactor** | Refactor across multiple files at once |
|
|
37
|
+
| ✏️ **Symbol Renaming** | Rename functions, classes, variables across your project |
|
|
38
|
+
| 💬 **Interactive Chat** | Chat with AI about your code |
|
|
39
|
+
| 📊 **Codebase Indexing** | Create searchable semantic index with RAG |
|
|
40
|
+
| 🌐 **Multi-Provider** | Support for 6 LLM providers (local & cloud) |
|
|
41
|
+
| 🖥️ **VSCode Extension** | Full IDE integration with sidebar chat |
|
|
42
|
+
|
|
43
|
+
## 🖥️ VSCode Extension
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<img src="vscode-extension/images/icon.png" width="64" alt="Cognify VSCode">
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
The Cognify AI VSCode extension brings all the power of Cognify directly into your IDE with a beautiful sidebar chat interface.
|
|
50
|
+
|
|
51
|
+
### Extension Features
|
|
52
|
+
|
|
53
|
+
- ⚛️ **Sidebar Chat Panel** - Chat with AI directly in VSCode sidebar
|
|
54
|
+
- 📎 **Add Context** - Include code from your editor in conversations
|
|
55
|
+
- 🔍 **Code Review** - Review files with inline diagnostics
|
|
56
|
+
- ✨ **Code Generation** - Generate code from descriptions
|
|
57
|
+
- 💡 **Code Explanation** - Get explanations for selected code
|
|
58
|
+
- ✏️ **AI Editing** - Edit code with natural language
|
|
59
|
+
|
|
60
|
+
### Quick Actions
|
|
61
|
+
- 📋 Review current file
|
|
62
|
+
- 💡 Explain selected code
|
|
63
|
+
- ✨ Suggest improvements
|
|
64
|
+
- 🧪 Generate tests
|
|
65
|
+
|
|
66
|
+
### Install VSCode Extension
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Build from source
|
|
70
|
+
cd vscode-extension
|
|
71
|
+
npm install
|
|
72
|
+
npm run package
|
|
73
|
+
|
|
74
|
+
# Install the extension
|
|
75
|
+
code --install-extension cognify-ai-0.2.0.vsix
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Or install via VSCode:
|
|
79
|
+
1. Open VSCode
|
|
80
|
+
2. Go to Extensions sidebar
|
|
81
|
+
3. Click "..." → "Install from VSIX..."
|
|
82
|
+
4. Select `cognify-ai-0.2.0.vsix`
|
|
83
|
+
|
|
84
|
+
### Using the Extension
|
|
85
|
+
|
|
86
|
+
1. Click the ⚛️ Cognify icon in the Activity Bar (left sidebar)
|
|
87
|
+
2. Use quick actions or type your question
|
|
88
|
+
3. Click "📎 Add Context" to include code from your editor
|
|
89
|
+
4. Press Enter or click Send
|
|
90
|
+
|
|
91
|
+
**Keyboard Shortcuts:**
|
|
92
|
+
| Command | Mac | Windows/Linux |
|
|
93
|
+
|---------|-----|---------------|
|
|
94
|
+
| Review File | `Cmd+Shift+R` | `Ctrl+Shift+R` |
|
|
95
|
+
| Generate Code | `Cmd+Shift+G` | `Ctrl+Shift+G` |
|
|
96
|
+
| Explain Code | `Cmd+Shift+E` | `Ctrl+Shift+E` |
|
|
97
|
+
| Open Chat | `Cmd+Shift+C` | `Ctrl+Shift+C` |
|
|
98
|
+
|
|
99
|
+
## 🤖 Supported Providers
|
|
100
|
+
|
|
101
|
+
| Provider | Free Tier | API Key | Best For |
|
|
102
|
+
|----------|-----------|---------|----------|
|
|
103
|
+
| **Ollama** | ✅ Unlimited | ❌ None | Privacy, offline use |
|
|
104
|
+
| **Google AI** | ✅ Generous | ✅ Required | 1M+ token context |
|
|
105
|
+
| **Groq** | ✅ 1000 req/day | ✅ Required | Fastest inference |
|
|
106
|
+
| **Cerebras** | ✅ Available | ✅ Required | Fast inference |
|
|
107
|
+
| **OpenRouter** | ✅ Free models | ✅ Required | Model variety |
|
|
108
|
+
| **OpenAI** | ❌ Paid only | ✅ Required | GPT-4 quality |
|
|
109
|
+
|
|
110
|
+
## 🚀 Quick Start
|
|
111
|
+
|
|
112
|
+
### Option 1: Local with Ollama (No API Key)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Install Ollama from https://ollama.ai
|
|
116
|
+
ollama pull deepseek-coder:6.7b
|
|
117
|
+
ollama serve
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Option 2: Cloud with Free Tier
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Google AI Studio (1M token context, free)
|
|
124
|
+
export GOOGLE_API_KEY="your-key" # Get from https://aistudio.google.com/apikey
|
|
125
|
+
|
|
126
|
+
# OR Groq (fastest inference, free tier)
|
|
127
|
+
export GROQ_API_KEY="your-key" # Get from https://console.groq.com/keys
|
|
128
|
+
|
|
129
|
+
# OR OpenRouter (free models available)
|
|
130
|
+
export OPENROUTER_API_KEY="your-key" # Get from https://openrouter.ai/keys
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Installation
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Clone the repository
|
|
137
|
+
git clone https://github.com/akkssy/cognify-ai.git
|
|
138
|
+
cd cognify-ai
|
|
139
|
+
|
|
140
|
+
# Create virtual environment
|
|
141
|
+
python -m venv .venv
|
|
142
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
143
|
+
|
|
144
|
+
# Install the package
|
|
145
|
+
pip install -e .
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Verify Installation
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Check status and available providers
|
|
152
|
+
cognify status
|
|
153
|
+
cognify providers
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## 📖 CLI Usage
|
|
157
|
+
|
|
158
|
+
### Code Review
|
|
159
|
+
```bash
|
|
160
|
+
cognify review path/to/file.py
|
|
161
|
+
cognify review src/ --format json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Code Generation
|
|
165
|
+
```bash
|
|
166
|
+
cognify generate "binary search function" --language python
|
|
167
|
+
cognify generate "REST API client class" --mode class
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Semantic Search
|
|
171
|
+
```bash
|
|
172
|
+
# First, index your codebase
|
|
173
|
+
cognify index .
|
|
174
|
+
|
|
175
|
+
# Then search
|
|
176
|
+
cognify search "error handling"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### File Editing
|
|
180
|
+
```bash
|
|
181
|
+
cognify edit config.py "add logging to all functions" --preview
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Interactive Chat
|
|
185
|
+
```bash
|
|
186
|
+
cognify chat
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### All Commands
|
|
190
|
+
```bash
|
|
191
|
+
cognify --help
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## ⚙️ Configuration
|
|
195
|
+
|
|
196
|
+
Configuration is managed via `config.yaml`:
|
|
197
|
+
|
|
198
|
+
```yaml
|
|
199
|
+
llm:
|
|
200
|
+
provider: "ollama"
|
|
201
|
+
model: "deepseek-coder:6.7b"
|
|
202
|
+
base_url: "http://localhost:11434"
|
|
203
|
+
temperature: 0.1
|
|
204
|
+
max_tokens: 4096
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Or use environment variables:
|
|
208
|
+
```bash
|
|
209
|
+
export AI_ASSISTANT_LLM_PROVIDER="groq"
|
|
210
|
+
export AI_ASSISTANT_LLM_MODEL="llama-3.3-70b-versatile"
|
|
211
|
+
export GROQ_API_KEY="your-key"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## 📁 Project Structure
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
cognify-ai/
|
|
218
|
+
├── src/ai_code_assistant/ # Core Python package
|
|
219
|
+
│ ├── cli.py # Command-line interface
|
|
220
|
+
│ ├── providers/ # LLM providers
|
|
221
|
+
│ ├── reviewer/ # Code review
|
|
222
|
+
│ ├── generator/ # Code generation
|
|
223
|
+
│ ├── retrieval/ # Semantic search
|
|
224
|
+
│ ├── editor/ # AI file editing
|
|
225
|
+
│ └── chat/ # Interactive chat
|
|
226
|
+
├── vscode-extension/ # VSCode Extension
|
|
227
|
+
│ ├── src/ # Extension source
|
|
228
|
+
│ ├── images/ # Icons
|
|
229
|
+
│ └── package.json # Extension manifest
|
|
230
|
+
├── tests/ # Unit tests
|
|
231
|
+
├── docs/ # Documentation
|
|
232
|
+
└── config.yaml # Configuration
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
## 🧪 Testing
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
PYTHONPATH=src pytest tests/ -v
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## 🤝 Contributing
|
|
242
|
+
|
|
243
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
244
|
+
|
|
245
|
+
## 📄 License
|
|
246
|
+
|
|
247
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
<p align="center">
|
|
252
|
+
Made with ❤️ for developers who want flexible AI-powered coding assistance
|
|
253
|
+
</p>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "cognify-code"
|
|
7
|
-
version = "0.2.
|
|
7
|
+
version = "0.2.6"
|
|
8
8
|
description = "Your local AI-powered code assistant. Review, generate, search, and refactor code with an intelligent AI agent—all running locally with complete privacy."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
@@ -60,6 +60,7 @@ dependencies = [
|
|
|
60
60
|
"pyyaml>=6.0",
|
|
61
61
|
"pydantic>=2.0.0",
|
|
62
62
|
"pydantic-settings>=2.0.0",
|
|
63
|
+
"tenacity>=8.0.0",
|
|
63
64
|
# RAG / Codebase Search
|
|
64
65
|
"chromadb>=0.4.0",
|
|
65
66
|
"sentence-transformers>=2.0.0",
|