blitzcoder 1.0.0__py3-none-any.whl
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.
- blitzcoder/__init__.py +24 -0
- blitzcoder/cli/__init__.py +17 -0
- blitzcoder/cli/cli_coder.py +268 -0
- blitzcoder-1.0.0.dist-info/METADATA +228 -0
- blitzcoder-1.0.0.dist-info/RECORD +11 -0
- blitzcoder-1.0.0.dist-info/WHEEL +5 -0
- blitzcoder-1.0.0.dist-info/entry_points.txt +2 -0
- blitzcoder-1.0.0.dist-info/licenses/LICENSE +21 -0
- blitzcoder-1.0.0.dist-info/top_level.txt +2 -0
- main/__init__.py +9 -0
- main/graphapi.py +1416 -0
blitzcoder/__init__.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BlitzCoder - AI-Powered Development Assistant
|
|
3
|
+
|
|
4
|
+
A comprehensive AI-powered development assistant that helps with code generation,
|
|
5
|
+
refactoring, project scaffolding, and development tasks.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
__version__ = "1.0.0"
|
|
9
|
+
__author__ = "BlitzCoder Team"
|
|
10
|
+
__author_email__ = "raghunandanerukulla@gmail.com"
|
|
11
|
+
__description__ = "AI-Powered Development Assistant"
|
|
12
|
+
__url__ = "https://github.com/Raghu6798/Blitz_Coder"
|
|
13
|
+
__license__ = "MIT"
|
|
14
|
+
__keywords__ = ["ai", "code-generation", "development", "assistant", "cli"]
|
|
15
|
+
|
|
16
|
+
# Import main components
|
|
17
|
+
from . import cli
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"cli",
|
|
21
|
+
"__version__",
|
|
22
|
+
"__author__",
|
|
23
|
+
"__description__",
|
|
24
|
+
]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""
|
|
2
|
+
BlitzCoder CLI - AI-Powered Development Assistant
|
|
3
|
+
|
|
4
|
+
A command-line interface for AI-powered code generation, refactoring, and project management.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .cli_coder import cli, run_agent_with_memory, search_memories_cli
|
|
8
|
+
|
|
9
|
+
__version__ = "1.0.0"
|
|
10
|
+
__author__ = "BlitzCoder Team"
|
|
11
|
+
__description__ = "AI-Powered Development Assistant CLI"
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"cli",
|
|
15
|
+
"run_agent_with_memory",
|
|
16
|
+
"search_memories_cli"
|
|
17
|
+
]
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import uuid
|
|
3
|
+
import click
|
|
4
|
+
from rich.console import Console
|
|
5
|
+
from rich.panel import Panel
|
|
6
|
+
from rich.prompt import Prompt
|
|
7
|
+
from rich.markdown import Markdown
|
|
8
|
+
from rich.progress import Progress, SpinnerColumn, BarColumn, TimeElapsedColumn
|
|
9
|
+
|
|
10
|
+
from langgraph.graph import StateGraph, START, END, MessagesState
|
|
11
|
+
from langgraph.store.memory import InMemoryStore
|
|
12
|
+
from langgraph.checkpoint.memory import InMemorySaver
|
|
13
|
+
from langgraph.prebuilt import ToolNode, tools_condition
|
|
14
|
+
from langgraph.store.base import BaseStore
|
|
15
|
+
|
|
16
|
+
from langchain_google_genai import ChatGoogleGenerativeAI
|
|
17
|
+
from langchain_core.runnables import RunnableConfig
|
|
18
|
+
from langchain_core.messages import AIMessage, HumanMessage, SystemMessage
|
|
19
|
+
|
|
20
|
+
# --- Console ---
|
|
21
|
+
console = Console()
|
|
22
|
+
|
|
23
|
+
# --- Your tools ---
|
|
24
|
+
from main.graphapi import (
|
|
25
|
+
print_welcome_banner, show_info, run_agent_with_memory, search_memories,
|
|
26
|
+
run_uvicorn_and_capture_logs, current_directory, change_directory,
|
|
27
|
+
navigate_entire_codebase_given_path, extract_content_within_a_file,
|
|
28
|
+
refactoring_code, explain_code, execute_python_code, error_detection,
|
|
29
|
+
agent_refactor_code, run_shell_commands, generate_project_structure,
|
|
30
|
+
generate_architecture_plan, generate_folder_creation_script,
|
|
31
|
+
generate_file_content, scaffold_and_generate_files,
|
|
32
|
+
look_for_file_or_directory, create_or_delete_file, write_code_to_file,
|
|
33
|
+
inspect_a_file, look_for_directory, windows_powershell_command,
|
|
34
|
+
semantic_memory_store, SYSTEM_PROMPT
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
class AgentState(MessagesState):
|
|
38
|
+
documents: list[str]
|
|
39
|
+
|
|
40
|
+
tools = [
|
|
41
|
+
run_uvicorn_and_capture_logs,
|
|
42
|
+
current_directory,
|
|
43
|
+
change_directory,
|
|
44
|
+
navigate_entire_codebase_given_path,
|
|
45
|
+
extract_content_within_a_file,
|
|
46
|
+
refactoring_code,
|
|
47
|
+
explain_code,
|
|
48
|
+
execute_python_code,
|
|
49
|
+
error_detection,
|
|
50
|
+
agent_refactor_code,
|
|
51
|
+
run_shell_commands,
|
|
52
|
+
generate_project_structure,
|
|
53
|
+
generate_architecture_plan,
|
|
54
|
+
generate_folder_creation_script,
|
|
55
|
+
generate_file_content,
|
|
56
|
+
scaffold_and_generate_files,
|
|
57
|
+
look_for_file_or_directory,
|
|
58
|
+
create_or_delete_file,
|
|
59
|
+
write_code_to_file,
|
|
60
|
+
inspect_a_file,
|
|
61
|
+
look_for_directory,
|
|
62
|
+
windows_powershell_command
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
def validate_google_api_key(api_key: str) -> bool:
|
|
66
|
+
try:
|
|
67
|
+
model = ChatGoogleGenerativeAI(model="gemini-2.0-flash", api_key=api_key)
|
|
68
|
+
response = model.invoke(["Hello"]) # Simple call
|
|
69
|
+
return True
|
|
70
|
+
except Exception as e:
|
|
71
|
+
print(f"[bold red]API key validation failed:[/bold red] {e}")
|
|
72
|
+
return False
|
|
73
|
+
|
|
74
|
+
def print_agent_response(text: str, title: str = "BlitzCoder"):
|
|
75
|
+
"""Display agent output inside a Rich panel box with orange color"""
|
|
76
|
+
console.print(Panel.fit(Markdown(text), title=f"[bold orange1]{title}[/bold orange1]", border_style="orange1"))
|
|
77
|
+
|
|
78
|
+
def update_memory(state: AgentState, config: RunnableConfig, *, store: BaseStore):
|
|
79
|
+
user_id = config["configurable"].get("user_id", "default")
|
|
80
|
+
namespace = (user_id, "memories")
|
|
81
|
+
messages = state["messages"]
|
|
82
|
+
|
|
83
|
+
if len(messages) >= 2:
|
|
84
|
+
user_msg = messages[-2] if isinstance(messages[-2], HumanMessage) else None
|
|
85
|
+
ai_msg = messages[-1] if isinstance(messages[-1], AIMessage) else None
|
|
86
|
+
|
|
87
|
+
if user_msg and ai_msg:
|
|
88
|
+
memory_id = str(uuid.uuid4())
|
|
89
|
+
memory_content = {
|
|
90
|
+
"memory": f"User asked: {user_msg.content} | Assistant responded: {ai_msg.content[:200]}...",
|
|
91
|
+
"context": "conversation",
|
|
92
|
+
"user_query": user_msg.content,
|
|
93
|
+
"ai_response": ai_msg.content,
|
|
94
|
+
"timestamp": str(uuid.uuid4()), # Replace with actual timestamp if needed
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
store.put(
|
|
98
|
+
namespace,
|
|
99
|
+
memory_id,
|
|
100
|
+
memory_content,
|
|
101
|
+
index=["memory", "context", "user_query"],
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
return state
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def retrieve_and_enhance_context(state: AgentState, config: RunnableConfig, *, store: BaseStore):
|
|
110
|
+
user_id = config["configurable"].get("user_id", "default")
|
|
111
|
+
namespace = (user_id, "memories")
|
|
112
|
+
latest_message = state["messages"][-1]
|
|
113
|
+
|
|
114
|
+
if isinstance(latest_message, HumanMessage):
|
|
115
|
+
query = latest_message.content
|
|
116
|
+
memories = store.search(namespace, query=query, limit=5)
|
|
117
|
+
if memories:
|
|
118
|
+
memory_context = [
|
|
119
|
+
f"Previous context: {memory.value.get('memory', '')}" for memory in memories
|
|
120
|
+
]
|
|
121
|
+
context_info = "\n".join(memory_context)
|
|
122
|
+
enhanced_query = f"""Based on our previous conversations:
|
|
123
|
+
{context_info}
|
|
124
|
+
|
|
125
|
+
Current question: {query}
|
|
126
|
+
|
|
127
|
+
Please respond considering our conversation history and any relevant context from previous interactions."""
|
|
128
|
+
|
|
129
|
+
enhanced_messages = state["messages"][:-1] + [HumanMessage(content=enhanced_query)]
|
|
130
|
+
return {"messages": enhanced_messages}
|
|
131
|
+
|
|
132
|
+
return state
|
|
133
|
+
|
|
134
|
+
def enhanced_tool_calling_llm(state: AgentState, config: RunnableConfig, *, store: BaseStore):
|
|
135
|
+
api_key = os.environ.get("GOOGLE_API_KEY")
|
|
136
|
+
if not api_key:
|
|
137
|
+
raise RuntimeError("GOOGLE_API_KEY is not set. Please provide it.")
|
|
138
|
+
|
|
139
|
+
gemini_model = ChatGoogleGenerativeAI(
|
|
140
|
+
model="gemini-2.0-flash",
|
|
141
|
+
api_key=api_key,
|
|
142
|
+
max_tokens=100000
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
enhanced_state = retrieve_and_enhance_context(state, config, store=store)
|
|
146
|
+
messages = [
|
|
147
|
+
msg for msg in enhanced_state["messages"]
|
|
148
|
+
if not (hasattr(msg, "role") and getattr(msg, "role", None) == "system")
|
|
149
|
+
]
|
|
150
|
+
messages = [SystemMessage(content=SYSTEM_PROMPT)] + messages
|
|
151
|
+
llm_with_tool = gemini_model.bind_tools(tools)
|
|
152
|
+
response = llm_with_tool.invoke(messages)
|
|
153
|
+
return {"messages": [response]}
|
|
154
|
+
|
|
155
|
+
builder = StateGraph(AgentState)
|
|
156
|
+
builder.add_node("enhanced_llm", enhanced_tool_calling_llm)
|
|
157
|
+
builder.add_node("update_memory", update_memory)
|
|
158
|
+
builder.add_node("tools", ToolNode(tools))
|
|
159
|
+
builder.add_edge(START, "enhanced_llm")
|
|
160
|
+
builder.add_conditional_edges("enhanced_llm", tools_condition, {"tools": "tools", "__end__": "update_memory"})
|
|
161
|
+
builder.add_edge("tools", "enhanced_llm")
|
|
162
|
+
builder.add_edge("update_memory", END)
|
|
163
|
+
|
|
164
|
+
checkpointer = InMemorySaver()
|
|
165
|
+
semantic_graph = builder.compile(checkpointer=checkpointer, store=semantic_memory_store)
|
|
166
|
+
|
|
167
|
+
def run_agent_with_memory(query: str, user_id: str = "default", thread_id: str = None):
|
|
168
|
+
if thread_id is None:
|
|
169
|
+
thread_id = str(uuid.uuid4())
|
|
170
|
+
|
|
171
|
+
config = {
|
|
172
|
+
"configurable": {"thread_id": thread_id, "user_id": user_id},
|
|
173
|
+
"recursion_limit": 100
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
output_buffer = ""
|
|
177
|
+
|
|
178
|
+
with Progress(
|
|
179
|
+
SpinnerColumn(),
|
|
180
|
+
"[progress.description]{task.description}",
|
|
181
|
+
BarColumn(),
|
|
182
|
+
TimeElapsedColumn(),
|
|
183
|
+
console=console,
|
|
184
|
+
transient=True
|
|
185
|
+
) as progress:
|
|
186
|
+
task = progress.add_task("[cyan]Initializing AI agent...", total=None)
|
|
187
|
+
progress.update(task, description="[yellow]Retrieving relevant memories...")
|
|
188
|
+
|
|
189
|
+
for chunk, metadata in semantic_graph.stream(
|
|
190
|
+
{"messages": [HumanMessage(content=query)]},
|
|
191
|
+
config=config,
|
|
192
|
+
stream_mode="messages",
|
|
193
|
+
):
|
|
194
|
+
if hasattr(chunk, "content") and chunk.content:
|
|
195
|
+
if not output_buffer:
|
|
196
|
+
progress.update(task, description="[green]Receiving AI response...")
|
|
197
|
+
output_buffer += chunk.content
|
|
198
|
+
|
|
199
|
+
progress.stop()
|
|
200
|
+
|
|
201
|
+
if output_buffer.strip():
|
|
202
|
+
print_agent_response(output_buffer.strip())
|
|
203
|
+
|
|
204
|
+
@click.group()
|
|
205
|
+
def cli():
|
|
206
|
+
"""BlitzCoder CLI - AI-Powered Dev Assistant"""
|
|
207
|
+
pass
|
|
208
|
+
|
|
209
|
+
@cli.command()
|
|
210
|
+
@click.option('--google-api-key', help='Google API key for Gemini model')
|
|
211
|
+
def chat(google_api_key):
|
|
212
|
+
"""Start interactive chat with BlitzCoder AI agent."""
|
|
213
|
+
if google_api_key:
|
|
214
|
+
if validate_google_api_key(google_api_key):
|
|
215
|
+
os.environ["GOOGLE_API_KEY"] = google_api_key
|
|
216
|
+
else:
|
|
217
|
+
console.print("[bold red]❌ Invalid API key. Please try again.[/bold red]")
|
|
218
|
+
exit(1)
|
|
219
|
+
else:
|
|
220
|
+
google_api_key = Prompt.ask("🔑 [bold green]Paste your API key[/bold green]", password=True)
|
|
221
|
+
if validate_google_api_key(google_api_key):
|
|
222
|
+
os.environ["GOOGLE_API_KEY"] = google_api_key
|
|
223
|
+
else:
|
|
224
|
+
console.print("[bold red]❌ Invalid API key. Please try again.[/bold red]")
|
|
225
|
+
exit(1)
|
|
226
|
+
|
|
227
|
+
print_welcome_banner()
|
|
228
|
+
user_id = str(uuid.uuid4())
|
|
229
|
+
thread_id = str(uuid.uuid4())
|
|
230
|
+
|
|
231
|
+
while True:
|
|
232
|
+
query = Prompt.ask("[bold orange1]Enter your query[/bold orange1]", console=console)
|
|
233
|
+
if query.lower() in {"bye", "exit"}:
|
|
234
|
+
show_info("Exiting interactive agent loop.")
|
|
235
|
+
break
|
|
236
|
+
if query.startswith("search:"):
|
|
237
|
+
search_query = query[7:].strip()
|
|
238
|
+
search_memories(user_id, search_query)
|
|
239
|
+
continue
|
|
240
|
+
run_agent_with_memory(query, user_id, thread_id)
|
|
241
|
+
|
|
242
|
+
@cli.command()
|
|
243
|
+
@click.option('--user-id', default=None, help='User ID for memory search')
|
|
244
|
+
@click.option('--query', prompt='Search query', help='Query to search in memories')
|
|
245
|
+
@click.option('--google-api-key', help='Google API key for Gemini model')
|
|
246
|
+
def search_memories_cli(user_id, query, google_api_key):
|
|
247
|
+
"""Search your agent memories."""
|
|
248
|
+
if google_api_key:
|
|
249
|
+
os.environ["GOOGLE_API_KEY"] = google_api_key
|
|
250
|
+
else:
|
|
251
|
+
console.print(Panel.fit(
|
|
252
|
+
"[bold orange1]🔑 Google API Key Required[/bold orange1]\n\n"
|
|
253
|
+
"Please paste your API key below (input is hidden):",
|
|
254
|
+
border_style="red"
|
|
255
|
+
))
|
|
256
|
+
google_api_key = Prompt.ask("🔑 [bold green]Paste your API key[/bold green]", password=True)
|
|
257
|
+
if validate_google_api_key(google_api_key):
|
|
258
|
+
os.environ["GOOGLE_API_KEY"] = google_api_key
|
|
259
|
+
else:
|
|
260
|
+
console.print("[bold red]❌ Invalid API key. Please try again.[/bold red]")
|
|
261
|
+
exit(1)
|
|
262
|
+
|
|
263
|
+
if not user_id:
|
|
264
|
+
user_id = str(uuid.uuid4())
|
|
265
|
+
search_memories(user_id, query)
|
|
266
|
+
|
|
267
|
+
if __name__ == "__main__":
|
|
268
|
+
cli()
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blitzcoder
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: AI-powered development assistant for code generation, refactoring, and project management
|
|
5
|
+
Home-page: https://github.com/Raghu6798/Blitz_Coder
|
|
6
|
+
Author: BlitzCoder Team
|
|
7
|
+
Author-email: BlitzCoder Team <raghunandanerukulla@gmail.com>
|
|
8
|
+
Maintainer-email: Raghu Nandan Erukulla <raghunandanerukulla@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
Project-URL: Homepage, https://github.com/Raghu6798/BlitzCoder
|
|
11
|
+
Project-URL: Repository, https://github.com/Raghu6798/BlitzCoder
|
|
12
|
+
Project-URL: Documentation, https://github.com/Raghu6798/BlitzCoder#readme
|
|
13
|
+
Project-URL: Bug Tracker, https://github.com/Raghu6798/BlitzCoder/issues
|
|
14
|
+
Keywords: ai,code-generation,development,assistant,cli
|
|
15
|
+
Classifier: Development Status :: 4 - Beta
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
26
|
+
Requires-Python: >=3.9
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: python-dotenv>=0.0.1
|
|
30
|
+
Requires-Dist: langgraph>=0.4.9
|
|
31
|
+
Requires-Dist: langchain-groq>=0.3.4
|
|
32
|
+
Requires-Dist: langchain-sambanova>=0.1.5
|
|
33
|
+
Requires-Dist: langchain>=0.3.26
|
|
34
|
+
Requires-Dist: loguru>=0.7.3
|
|
35
|
+
Requires-Dist: langchain-google-genai>=2.1.5
|
|
36
|
+
Requires-Dist: mem0ai>=0.1.111
|
|
37
|
+
Requires-Dist: click>=8.1.8
|
|
38
|
+
Requires-Dist: click-help-colors>=0.9.4
|
|
39
|
+
Requires-Dist: rich>=14.0.0
|
|
40
|
+
Requires-Dist: langfuse>=3.0.5
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
44
|
+
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
45
|
+
Requires-Dist: isort>=5.0.0; extra == "dev"
|
|
46
|
+
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
48
|
+
Dynamic: author
|
|
49
|
+
Dynamic: home-page
|
|
50
|
+
Dynamic: license-file
|
|
51
|
+
Dynamic: requires-python
|
|
52
|
+
|
|
53
|
+
# BlitzCoder
|
|
54
|
+
|
|
55
|
+
⚡ **AI-Powered Development Assistant** - A comprehensive CLI tool for code generation, refactoring, and project management.
|
|
56
|
+
|
|
57
|
+
## Features
|
|
58
|
+
|
|
59
|
+
- 🤖 **AI-Powered Code Generation** - Generate code using Google's Gemini model
|
|
60
|
+
- 🔧 **Code Refactoring** - Automatically refactor and improve existing code
|
|
61
|
+
- 📁 **Project Scaffolding** - Create complete project structures with architecture plans
|
|
62
|
+
- 🧠 **Memory System** - Remember previous conversations and context
|
|
63
|
+
- 🛠️ **Development Tools** - File inspection, execution, and management tools
|
|
64
|
+
- 🔍 **Code Analysis** - Explain and analyze code functionality
|
|
65
|
+
|
|
66
|
+
## Installation
|
|
67
|
+
|
|
68
|
+
### Option 1: Install from Source (Recommended)
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Clone the repository
|
|
72
|
+
git clone https://github.com/Raghu6798/Blitz_Coder.git
|
|
73
|
+
cd BlitzCoder/blitz_cli
|
|
74
|
+
|
|
75
|
+
# Install in development mode
|
|
76
|
+
python install.py
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Option 2: Manual Installation
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
cd blitz_cli
|
|
83
|
+
pip install -e .
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Option 3: Direct Script Execution
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Windows
|
|
90
|
+
python scripts/blitzcoder.bat
|
|
91
|
+
|
|
92
|
+
# Linux/Mac
|
|
93
|
+
python scripts/blitzcoder
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Quick Start
|
|
97
|
+
|
|
98
|
+
### 1. Set up your API Keys
|
|
99
|
+
|
|
100
|
+
You'll need a Google API key for the Gemini model:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Set environment variable
|
|
104
|
+
export GOOGLE_API_KEY="your-api-key-here"
|
|
105
|
+
|
|
106
|
+
# Or on Windows
|
|
107
|
+
set GOOGLE_API_KEY=your-api-key-here
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 2. Start Interactive Chat
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
blitzcoder chat
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. Search Memories
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
blitzcoder search-memories --query "your search term"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Usage Examples
|
|
123
|
+
|
|
124
|
+
### Interactive Chat Mode
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
blitzcoder chat
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
This starts an interactive session where you can:
|
|
131
|
+
- Ask questions about code
|
|
132
|
+
- Request code generation
|
|
133
|
+
- Get help with refactoring
|
|
134
|
+
- Search through previous conversations
|
|
135
|
+
|
|
136
|
+
### Search Previous Conversations
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
blitzcoder search-memories --query "React component"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Use with API Key Parameter
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
blitzcoder chat --google-api-key "your-api-key"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Available Commands
|
|
149
|
+
|
|
150
|
+
| Command | Description |
|
|
151
|
+
|---------|-------------|
|
|
152
|
+
| `chat` | Start interactive AI chat session |
|
|
153
|
+
| `search-memories` | Search through conversation history |
|
|
154
|
+
|
|
155
|
+
## Development
|
|
156
|
+
|
|
157
|
+
### Project Structure
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
blitz_cli/
|
|
161
|
+
├── src/
|
|
162
|
+
│ └── blitzcoder/
|
|
163
|
+
│ ├── cli/
|
|
164
|
+
│ │ ├── __init__.py
|
|
165
|
+
│ │ └── cli_coder.py
|
|
166
|
+
│ └── __init__.py
|
|
167
|
+
├── config/
|
|
168
|
+
│ └── templates/
|
|
169
|
+
├── scripts/
|
|
170
|
+
│ ├── blitzcoder
|
|
171
|
+
│ └── blitzcoder.bat
|
|
172
|
+
├── setup.py
|
|
173
|
+
├── pyproject.toml
|
|
174
|
+
└── install.py
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Running Tests
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
# Install development dependencies
|
|
181
|
+
pip install -e ".[dev]"
|
|
182
|
+
|
|
183
|
+
# Run tests
|
|
184
|
+
pytest
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Code Formatting
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# Format code
|
|
191
|
+
black src/
|
|
192
|
+
isort src/
|
|
193
|
+
|
|
194
|
+
# Type checking
|
|
195
|
+
mypy src/
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Configuration
|
|
199
|
+
|
|
200
|
+
The package uses environment variables for configuration:
|
|
201
|
+
|
|
202
|
+
- `GOOGLE_API_KEY` - Required for Gemini model access
|
|
203
|
+
- `GROQ_API_KEY` - Optional for additional models
|
|
204
|
+
- `NOVITA_API_KEY` - Optional for embeddings
|
|
205
|
+
|
|
206
|
+
## Contributing
|
|
207
|
+
|
|
208
|
+
1. Fork the repository
|
|
209
|
+
2. Create a feature branch
|
|
210
|
+
3. Make your changes
|
|
211
|
+
4. Add tests if applicable
|
|
212
|
+
5. Submit a pull request
|
|
213
|
+
|
|
214
|
+
## License
|
|
215
|
+
|
|
216
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
217
|
+
|
|
218
|
+
## Support
|
|
219
|
+
|
|
220
|
+
- 📧 Email: raghunandanerukulla@gmail.com
|
|
221
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/Raghu6798/BlitzCoder/issues)
|
|
222
|
+
- 📖 Documentation: [GitHub README](https://github.com/Raghu6798/BlitzCoder#readme)
|
|
223
|
+
|
|
224
|
+
## Acknowledgments
|
|
225
|
+
|
|
226
|
+
- Built with [LangGraph](https://github.com/langchain-ai/langgraph)
|
|
227
|
+
- Powered by [Google Gemini](https://ai.google.dev/)
|
|
228
|
+
- Enhanced with [Rich](https://github.com/Textualize/rich) for beautiful CLI output
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
blitzcoder/__init__.py,sha256=sCFGHGooTUEgyh0kJpxvYUs4H7XZV9KggOmskqWAQV4,654
|
|
2
|
+
blitzcoder/cli/__init__.py,sha256=nlr4GF2Wexad3gFuJXNVbWNMMJfwimeSkDpxfNIvM7M,435
|
|
3
|
+
blitzcoder/cli/cli_coder.py,sha256=YZTTBu3Vi2X_LJHntEuRl1pAwJ7Hft9bwodCyXpAHZc,9872
|
|
4
|
+
blitzcoder-1.0.0.dist-info/licenses/LICENSE,sha256=1M-_Pyfb8aMu69WmyeaGvl6tfPEBTQDB3yh6rBJ9u3o,1092
|
|
5
|
+
main/__init__.py,sha256=3xDRz8e-8BxSuvhWMt7PkbK_j26KoypeTmrPkq3svE4,178
|
|
6
|
+
main/graphapi.py,sha256=7QDbcMblebVs51A6vIUGmHGh7L5D4nVy3NTrQkxydLo,53276
|
|
7
|
+
blitzcoder-1.0.0.dist-info/METADATA,sha256=4D8QU4E_WD80wiDlundMTpeZjmnoXb1_mNaGr8hj0jM,5994
|
|
8
|
+
blitzcoder-1.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
blitzcoder-1.0.0.dist-info/entry_points.txt,sha256=9ut47J-ccJUi6hJoRK11atEgiQh870fPwUb7MJkyF8I,60
|
|
10
|
+
blitzcoder-1.0.0.dist-info/top_level.txt,sha256=vtMqG24lFn7wtg0bPLsSRpyHjVzAKw8fqzNShubqL-I,16
|
|
11
|
+
blitzcoder-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 BlitzCoder Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|