nimcode 0.1.6__tar.gz → 0.1.10__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.
- {nimcode-0.1.6 → nimcode-0.1.10}/PKG-INFO +1 -1
- nimcode-0.1.10/README.md +134 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/setup.py +1 -1
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/agent.py +20 -14
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/repl.py +72 -31
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode.egg-info/PKG-INFO +1 -1
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_repl.py +1 -5
- nimcode-0.1.6/README.md +0 -68
- {nimcode-0.1.6 → nimcode-0.1.10}/setup.cfg +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/__init__.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/cli.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/config.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/lenient_parser.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/mcp_client.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/memory.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/nim_client.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/permissions.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode/tools.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode.egg-info/SOURCES.txt +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode.egg-info/dependency_links.txt +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode.egg-info/entry_points.txt +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode.egg-info/requires.txt +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/src/nimcode.egg-info/top_level.txt +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_agent.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_cli.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_config.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_lenient_parser.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_mcp_client.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_memory.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_nim_client.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_permissions.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_repl_extra.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_repl_trust.py +0 -0
- {nimcode-0.1.6 → nimcode-0.1.10}/tests/test_tools.py +0 -0
nimcode-0.1.10/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🚀 NimCode
|
|
4
|
+
|
|
5
|
+
**The Autonomous AI Coding Assistant for the NVIDIA NIM Ecosystem**
|
|
6
|
+
|
|
7
|
+
[](https://badge.fury.io/py/nimcode)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
|
|
10
|
+
*A powerful, standalone REPL and CLI agent that writes, edits, and plans code like a senior developer—powered by LLaMa 3.1 70B (and other cutting-edge models) and the lightning-fast NVIDIA NIM API.*
|
|
11
|
+
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 🌟 Overview
|
|
17
|
+
|
|
18
|
+
NimCode is your autonomous coding pair-programmer. Built with a rich interactive terminal interface, it doesn't just autocomplete code—it plans architectures, executes terminal commands, writes complete files, formats code automatically, and manages your workspace.
|
|
19
|
+
|
|
20
|
+
### 🛠️ What We've Built So Far
|
|
21
|
+
- **Robust Interactive REPL**: Multiline support (Alt+Enter), syntax highlighting, and beautiful `rich`-powered UI menus.
|
|
22
|
+
- **Smart Permission Engine**: Granular control over what the AI can do, with interactive diff previews for file modifications and the brand new `/trust` mode for unhindered execution.
|
|
23
|
+
- **Automated Workflows**: Automatic linting and formatting using `black`, `flake8`, and `prettier` behind the scenes with crash-resistant execution.
|
|
24
|
+
- **CI/CD Integration**: A complete automated pipeline pushing to PyPI and creating GitHub Releases automatically on version tags.
|
|
25
|
+
- **Extensive Tool Ecosystem**: The agent is equipped with Bash execution, AST Replacement, Semantic Search, Web Browsing, Interactive Terminal management, and much more.
|
|
26
|
+
- **Model Context Protocol (MCP)**: Native integration for MCP tools allowing infinite extensibility.
|
|
27
|
+
|
|
28
|
+
### 🚀 What We're Working On (Roadmap)
|
|
29
|
+
- **Sub-agent Swarms**: Perfecting `/delegate` and `/swarm` to distribute complex tasks among specialized AI roles.
|
|
30
|
+
- **Advanced Diagnostics**: Refining `/bughunter`, `/security-review`, and `/doctor` for automated codebase auditing.
|
|
31
|
+
- **Test-Driven Development**: Upgrading `/tdd` and `/testgen` to automatically write tests and ensure 100% coverage before committing.
|
|
32
|
+
- **Infrastructure & DevOps**: Implementing `/terraform-god` and `/sql-tune` for automated cloud provisioning and database query optimization.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 📦 Installation
|
|
37
|
+
|
|
38
|
+
NimCode is available globally via PyPI. You can install it anywhere in seconds:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install nimcode
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 🚀 Quick Start
|
|
45
|
+
|
|
46
|
+
1. **Get an API Key**: Grab a free NVIDIA API key from [build.nvidia.com](https://build.nvidia.com/).
|
|
47
|
+
2. **Login**: Connect your local environment by running:
|
|
48
|
+
```bash
|
|
49
|
+
nimcode login
|
|
50
|
+
```
|
|
51
|
+
3. **Start Coding**:
|
|
52
|
+
- Launch the interactive REPL:
|
|
53
|
+
```bash
|
|
54
|
+
nimcode
|
|
55
|
+
```
|
|
56
|
+
- Or run a one-off task directly from the command line:
|
|
57
|
+
```bash
|
|
58
|
+
nimcode /plan "Build a classic Snake game using HTML5 Canvas"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 💻 Complete Command Reference
|
|
64
|
+
|
|
65
|
+
Inside the `nimcode` REPL, you can type natural language or use any of the following slash commands to trigger specific workflows:
|
|
66
|
+
|
|
67
|
+
### Mode Toggles & Execution
|
|
68
|
+
- **`/code`**: Enter standard coding mode (default mode, prompts for dangerous actions).
|
|
69
|
+
- **`/plan`**: Enter planning mode (read-only safe mode). The AI will research and write a markdown plan before modifying code.
|
|
70
|
+
- **`/trust`**: Enter trust mode. The AI will run commands and edit files completely autonomously without asking for `(a)ccept / (r)eject`.
|
|
71
|
+
- **`/untrust`**: Disable trust mode and restore permission prompts.
|
|
72
|
+
|
|
73
|
+
### Interface & Settings
|
|
74
|
+
- **`/models`**: Open an interactive UI to select your preferred NVIDIA NIM model (e.g., meta/llama-3.1-70b-instruct).
|
|
75
|
+
- **`/theme`**: Open an interactive UI to change your syntax highlighting theme (e.g., monokai, dracula, nord, github).
|
|
76
|
+
- **`/config`**: View and edit global NimCode configuration settings.
|
|
77
|
+
|
|
78
|
+
### Workspace & Context Management
|
|
79
|
+
- **`/clear`**: Clear the current conversation history to reset context.
|
|
80
|
+
- **`/compact`**: Compact the context window to save tokens while keeping essential memories.
|
|
81
|
+
- **`/context`**: View and manage the loaded context window.
|
|
82
|
+
- **`/rewind`**: Rewind the conversation history by a few steps.
|
|
83
|
+
- **`/undo`**: Revert the last file modification made by the AI.
|
|
84
|
+
|
|
85
|
+
### Project & Search
|
|
86
|
+
- **`/index`**: Index the current project files to enable lightning-fast Semantic Search.
|
|
87
|
+
- **`/map`**: Generate a high-level semantic architecture map of the codebase.
|
|
88
|
+
- **`/research`**: Enter deep-research mode for reading documentation or large files.
|
|
89
|
+
|
|
90
|
+
### Automation & Git
|
|
91
|
+
- **`/commit`**: Analyze all staged git changes and automatically generate a conventional commit message.
|
|
92
|
+
- **`/fix`**: Run a specific shell command and let the AI automatically iterate to fix any resulting errors.
|
|
93
|
+
- **`/autofix-pr`**: Pulls the current active GitHub Pull Request, reads comments, and automatically fixes the mentioned issues.
|
|
94
|
+
|
|
95
|
+
### Advanced Development Modes
|
|
96
|
+
- **`/testgen <file>`**: Generate unit tests for a specific file, aiming for 100% coverage.
|
|
97
|
+
- **`/tdd`**: Enter Test-Driven Development mode. The AI will write tests first, verify they fail, and then implement the code to pass them.
|
|
98
|
+
- **`/bughunter`**: Initiate an automated search for logical bugs and edge cases across the codebase.
|
|
99
|
+
- **`/security-review`**: Audit the codebase for common vulnerabilities (e.g., OWASP top 10).
|
|
100
|
+
- **`/sql-tune`**: Database telepathy mode. Analyzes and auto-tunes SQL queries for maximum performance.
|
|
101
|
+
- **`/terraform-god`**: Cloud architect mode. Auto-provisions scalable best-practice Terraform infrastructure.
|
|
102
|
+
- **`/decompile <binary>`**: Reverse engineering mode using tools like `objdump` and `radare2`.
|
|
103
|
+
|
|
104
|
+
### AI & Agents
|
|
105
|
+
- **`/delegate <role> <task>`**: Spawn an independent sub-agent with a specific role to handle a background task.
|
|
106
|
+
- **`/swarm`**: Orchestrate multiple sub-agents to tackle a complex architectural epic simultaneously.
|
|
107
|
+
- **`/grill-me`**: Interrogation mode. The AI will ask *you* hard questions to refine your system design and edge cases.
|
|
108
|
+
- **`/learn`**: Teach NimCode a new persistent skill or framework rule that it will remember for future sessions.
|
|
109
|
+
- **`/vision`**: Capture the screen and analyze UI elements using Vision AI models.
|
|
110
|
+
- **`/voice`**: Record your voice for 5 seconds and transcribe it as a prompt.
|
|
111
|
+
- **`/mcp install`**: Install and configure new Model Context Protocol tools.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## ⚙️ How it Works
|
|
116
|
+
|
|
117
|
+
NimCode creates a `.nimcode` directory inside your projects. This directory acts as the "brain" for that specific workspace:
|
|
118
|
+
- `.nimcode/plans/`: All your generated step-by-step markdown plans live here.
|
|
119
|
+
- `.nimcode/skills/`: Any custom guidelines, framework rules, or memories you teach the agent.
|
|
120
|
+
- `.nimcode/history/`: File backups for `/undo` capabilities.
|
|
121
|
+
|
|
122
|
+
## 🛡️ Requirements
|
|
123
|
+
|
|
124
|
+
- Python 3.8+
|
|
125
|
+
- An NVIDIA NIM API Key (`NIM_API_KEY`)
|
|
126
|
+
|
|
127
|
+
## 🤝 Contributing
|
|
128
|
+
|
|
129
|
+
Contributions, issues, and feature requests are welcome! Feel free to check out our [issues page](#).
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
<div align="center">
|
|
133
|
+
<i>Built with ❤️ for the open-source developer community.</i>
|
|
134
|
+
</div>
|
|
@@ -333,23 +333,29 @@ class Agent:
|
|
|
333
333
|
file_path = tool_call.get("args", {}).get("file_path", "")
|
|
334
334
|
if file_path.endswith(".py"):
|
|
335
335
|
import subprocess
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
336
|
+
try:
|
|
337
|
+
subprocess.run(["black", "-q", file_path], capture_output=True, timeout=10)
|
|
338
|
+
lint = subprocess.run(["flake8", "--select=E9,F821,F822,F823", file_path], capture_output=True, text=True, timeout=10)
|
|
339
|
+
if lint.returncode != 0:
|
|
340
|
+
import sys
|
|
341
|
+
if sys.stdin.isatty():
|
|
342
|
+
from rich.prompt import Confirm
|
|
343
|
+
c.print(f"\n[bold yellow]Linter found errors in {file_path}:[/bold yellow]\n{lint.stdout}")
|
|
344
|
+
if Confirm.ask("Would you like to auto-fix these errors?"):
|
|
345
|
+
result += f"\n\nAuto-Linter found errors:\n{lint.stdout}\nPlease fix them."
|
|
346
|
+
c.print(f"[bold red]Auto-fixing...[/bold red]")
|
|
347
|
+
else:
|
|
348
|
+
c.print("[dim]Ignoring linter errors.[/dim]")
|
|
346
349
|
else:
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
+
result += f"\n\nAuto-Linter found errors:\n{lint.stdout}\nPlease fix them."
|
|
351
|
+
except Exception as e:
|
|
352
|
+
pass
|
|
350
353
|
elif file_path.endswith((".js", ".ts", ".jsx", ".tsx")):
|
|
351
354
|
import subprocess
|
|
352
|
-
|
|
355
|
+
try:
|
|
356
|
+
subprocess.run(["npx", "--yes", "prettier", "--write", file_path], capture_output=True, timeout=10)
|
|
357
|
+
except Exception:
|
|
358
|
+
pass
|
|
353
359
|
except KeyboardInterrupt:
|
|
354
360
|
c.print("\n[yellow]Tool execution interrupted by user.[/yellow]")
|
|
355
361
|
result = "Tool execution was interrupted by the user via Ctrl+C. Ask the user what to do next."
|
|
@@ -180,11 +180,21 @@ class NimcodeREPL:
|
|
|
180
180
|
console.print()
|
|
181
181
|
|
|
182
182
|
style = Style.from_dict({
|
|
183
|
-
'prompt': '#
|
|
184
|
-
'bottom-toolbar': '#
|
|
185
|
-
'toolbar_title': '#ffffff bg:#
|
|
186
|
-
'toolbar_text': '#cccccc bg:#
|
|
187
|
-
'toolbar_shortcut': '#
|
|
183
|
+
'prompt': '#00ffff bold',
|
|
184
|
+
'bottom-toolbar': '#999999 bg:#1e1e1e',
|
|
185
|
+
'toolbar_title': '#ffffff bg:#5c2d91 bold',
|
|
186
|
+
'toolbar_text': '#cccccc bg:#1e1e1e',
|
|
187
|
+
'toolbar_shortcut': '#888888 bg:#2d2d2d',
|
|
188
|
+
|
|
189
|
+
# Claude Code inspired Autocompletion Menu
|
|
190
|
+
'completion-menu': 'bg:#2b2b2b #eeeeee',
|
|
191
|
+
'completion-menu.completion': 'bg:#2b2b2b #eeeeee',
|
|
192
|
+
'completion-menu.completion.current': 'bg:#5c2d91 #ffffff bold',
|
|
193
|
+
'scrollbar.background': 'bg:#1e1e1e',
|
|
194
|
+
'scrollbar.button': 'bg:#5c2d91',
|
|
195
|
+
|
|
196
|
+
# Auto-suggestion (greyed out ghost text)
|
|
197
|
+
'auto-suggestion': '#666666 italic',
|
|
188
198
|
})
|
|
189
199
|
|
|
190
200
|
from prompt_toolkit.key_binding import KeyBindings
|
|
@@ -290,7 +300,7 @@ class NimcodeREPL:
|
|
|
290
300
|
|
|
291
301
|
while True:
|
|
292
302
|
try:
|
|
293
|
-
user_input = await session.prompt_async("
|
|
303
|
+
user_input = await session.prompt_async("❯ ")
|
|
294
304
|
if user_input.lower() in ["/exit", "/quit"]:
|
|
295
305
|
self.agent.save_history()
|
|
296
306
|
break
|
|
@@ -303,6 +313,8 @@ class NimcodeREPL:
|
|
|
303
313
|
table.add_row("/help", "Show this help menu")
|
|
304
314
|
table.add_row("/plan", "Enter planning mode (safe mode)")
|
|
305
315
|
table.add_row("/code", "Enter coding mode (all tools enabled)")
|
|
316
|
+
table.add_row("/trust", "Enter trust mode (runs all tools without permission)")
|
|
317
|
+
table.add_row("/untrust", "Disable trust mode (ask for permission)")
|
|
306
318
|
table.add_row("/models", "Select NVIDIA NIM model")
|
|
307
319
|
table.add_row("/theme <name>", "Change syntax theme (e.g., monokai)")
|
|
308
320
|
table.add_row("/clear", "Clear current context history")
|
|
@@ -530,6 +542,14 @@ class NimcodeREPL:
|
|
|
530
542
|
console.print("[bold magenta]Entering Code mode.[/bold magenta] Standard permissions restored.")
|
|
531
543
|
self.messages.append({"role": "system", "content": "You are now in coding mode. You may use all available tools."})
|
|
532
544
|
continue
|
|
545
|
+
elif user_input.strip() == "/trust":
|
|
546
|
+
self.agent.permission_engine.mode = PermissionMode.BYPASS
|
|
547
|
+
console.print("[bold red]🚨 TRUST MODE ACTIVATED: NimCode will now run all tools without asking for permission! 🚨[/bold red]")
|
|
548
|
+
continue
|
|
549
|
+
elif user_input.strip() == "/untrust":
|
|
550
|
+
self.agent.permission_engine.mode = PermissionMode.DEFAULT
|
|
551
|
+
console.print("[bold green]🛡️ Trust mode disabled. NimCode will ask for permission again.[/bold green]")
|
|
552
|
+
continue
|
|
533
553
|
elif user_input.strip().startswith("/theme"):
|
|
534
554
|
parts = user_input.strip().split()
|
|
535
555
|
if len(parts) > 1:
|
|
@@ -537,15 +557,22 @@ class NimcodeREPL:
|
|
|
537
557
|
save_global_setting("theme", parts[1])
|
|
538
558
|
console.print(f"[green]Theme updated to '{parts[1]}'[/green]")
|
|
539
559
|
else:
|
|
540
|
-
from
|
|
560
|
+
from rich.table import Table
|
|
561
|
+
from rich.prompt import Prompt
|
|
562
|
+
|
|
541
563
|
themes = ['monokai', 'dracula', 'nord', 'github']
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
564
|
+
table = Table(title="🎨 Available Syntax Themes", show_header=True, header_style="bold magenta")
|
|
565
|
+
table.add_column("ID", style="cyan", width=4)
|
|
566
|
+
table.add_column("Theme Name", style="white")
|
|
567
|
+
|
|
568
|
+
for idx, t in enumerate(themes, 1):
|
|
569
|
+
table.add_row(str(idx), t)
|
|
570
|
+
|
|
571
|
+
console.print(table)
|
|
572
|
+
|
|
573
|
+
choice = Prompt.ask("Select a theme by ID", choices=[str(i) for i in range(1, len(themes) + 1)], default="1")
|
|
574
|
+
if choice:
|
|
575
|
+
selected_theme = themes[int(choice) - 1]
|
|
549
576
|
self.settings["theme"] = selected_theme
|
|
550
577
|
save_global_setting("theme", selected_theme)
|
|
551
578
|
console.print(f"[green]Theme updated to '{selected_theme}'[/green]")
|
|
@@ -554,22 +581,36 @@ class NimcodeREPL:
|
|
|
554
581
|
continue
|
|
555
582
|
elif user_input.strip() == "/models":
|
|
556
583
|
console.print("[bold yellow]Fetching available models from NVIDIA NIM...[/bold yellow]")
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
584
|
+
try:
|
|
585
|
+
models = await self.client.get_available_models()
|
|
586
|
+
if not models:
|
|
587
|
+
console.print("[red]No models returned from API.[/red]")
|
|
588
|
+
continue
|
|
589
|
+
|
|
590
|
+
from rich.table import Table
|
|
591
|
+
from rich.prompt import Prompt
|
|
592
|
+
|
|
593
|
+
table = Table(title="🤖 Available NVIDIA NIM Models", show_header=True, header_style="bold magenta")
|
|
594
|
+
table.add_column("ID", style="cyan", width=4)
|
|
595
|
+
table.add_column("Model Name", style="white")
|
|
596
|
+
|
|
597
|
+
for idx, m in enumerate(models, 1):
|
|
598
|
+
table.add_row(str(idx), m)
|
|
599
|
+
|
|
600
|
+
console.print(table)
|
|
601
|
+
|
|
602
|
+
choice = Prompt.ask("Select a model by ID (or press Enter to cancel)", choices=[str(i) for i in range(1, len(models) + 1)] + [""], default="")
|
|
603
|
+
|
|
604
|
+
if choice:
|
|
605
|
+
selected_model = models[int(choice) - 1]
|
|
606
|
+
self.client.model = selected_model
|
|
607
|
+
self.model = selected_model
|
|
608
|
+
save_global_setting("model", selected_model)
|
|
609
|
+
console.print(f"[bold green]Model changed to: {selected_model}[/bold green]")
|
|
610
|
+
else:
|
|
611
|
+
console.print("[yellow]Model selection cancelled.[/yellow]")
|
|
612
|
+
except Exception as e:
|
|
613
|
+
console.print(f"[bold red]Failed to fetch models: {e}[/bold red]")
|
|
573
614
|
continue
|
|
574
615
|
elif user_input.strip() == "/commit":
|
|
575
616
|
import subprocess
|
|
@@ -937,7 +978,7 @@ class NimcodeREPL:
|
|
|
937
978
|
continue
|
|
938
979
|
elif user_input.strip().startswith("/"):
|
|
939
980
|
import difflib
|
|
940
|
-
valid_commands = ["/help", "/plan", "/code", "/models", "/theme", "/clear", "/compact", "/commit", "/fix", "/exit", "/quit", "/config", "/alias", "/add", "/rewind", "/fork", "/testgen", "/vision", "/voice", "/index", "/research", "/mcp install", "/swarm", "/tdd", "/learn", "/cost", "/effort", "/thinking", "/grill-me", "/teleport", "/buddy", "/ultraplan", "/bughunter", "/security-review", "/doctor", "/permissions", "/graph", "/guardian", "/thinkback", "/autofix-pr", "/terraform-god", "/sql-tune", "/decompile"]
|
|
981
|
+
valid_commands = ["/help", "/plan", "/code", "/trust", "/untrust", "/models", "/theme", "/clear", "/compact", "/commit", "/fix", "/exit", "/quit", "/config", "/alias", "/add", "/rewind", "/fork", "/testgen", "/vision", "/voice", "/index", "/research", "/mcp install", "/swarm", "/tdd", "/learn", "/cost", "/effort", "/thinking", "/grill-me", "/teleport", "/buddy", "/ultraplan", "/bughunter", "/security-review", "/doctor", "/permissions", "/graph", "/guardian", "/thinkback", "/autofix-pr", "/terraform-god", "/sql-tune", "/decompile"]
|
|
941
982
|
cmd_name = user_input.strip().split()[0]
|
|
942
983
|
matches = difflib.get_close_matches(cmd_name, valid_commands, n=1, cutoff=0.5)
|
|
943
984
|
if matches:
|
|
@@ -189,11 +189,7 @@ async def test_start_repl_commands(agent):
|
|
|
189
189
|
# Mock run to avoid actually executing queries
|
|
190
190
|
agent.run = AsyncMock()
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
async def run_async(self):
|
|
194
|
-
return "model1"
|
|
195
|
-
|
|
196
|
-
with patch("prompt_toolkit.shortcuts.radiolist_dialog", return_value=MockDialog()):
|
|
192
|
+
with patch("rich.prompt.Prompt.ask", return_value="1"):
|
|
197
193
|
try:
|
|
198
194
|
from nimcode.repl import NimcodeREPL
|
|
199
195
|
repl = NimcodeREPL(agent)
|
nimcode-0.1.6/README.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
|
-
# 🚀 NimCode
|
|
4
|
-
|
|
5
|
-
**The Autonomous AI Coding Assistant for the NVIDIA NIM Ecosystem**
|
|
6
|
-
|
|
7
|
-
[](https://badge.fury.io/py/nimcode)
|
|
8
|
-
[](https://opensource.org/licenses/MIT)
|
|
9
|
-
|
|
10
|
-
*A powerful, standalone REPL and CLI agent that writes, edits, and plans code like a senior developer—powered by LLaMa 3.1 70B and the lightning-fast NVIDIA NIM API.*
|
|
11
|
-
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## 🌟 Features
|
|
17
|
-
|
|
18
|
-
- 🧠 **Smart Planning (`/plan`)**: Generates comprehensive, step-by-step architectural plans directly into `.nimcode/plans/`.
|
|
19
|
-
- 🛠️ **Autonomous Execution (`/code`)**: Reads, writes, and tests code across your entire workspace.
|
|
20
|
-
- 📸 **Vision Support (`/vision`)**: Analyze screenshots to debug UI issues or write code from design mockups.
|
|
21
|
-
- 🎙️ **Voice Commands (`/voice`)**: Speak your requirements and let the agent do the typing.
|
|
22
|
-
- 💾 **Continuous Learning**: Saves custom rules and instructions to `.nimcode/skills/` so it gets smarter over time.
|
|
23
|
-
- 🤖 **Auto-Commits (`/commit`)**: Automatically writes descriptive, conventional git commits for your changes.
|
|
24
|
-
|
|
25
|
-
## 📦 Installation
|
|
26
|
-
|
|
27
|
-
NimCode is available globally via PyPI. You can install it anywhere in seconds:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
pip install nimcode
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## 🚀 Quick Start
|
|
34
|
-
|
|
35
|
-
1. **Get an API Key**: Grab a free NVIDIA API key from [build.nvidia.com](https://build.nvidia.com/).
|
|
36
|
-
2. **Login**: Connect your local environment by running:
|
|
37
|
-
```bash
|
|
38
|
-
nimcode login
|
|
39
|
-
```
|
|
40
|
-
3. **Start Coding**:
|
|
41
|
-
- Launch the interactive REPL:
|
|
42
|
-
```bash
|
|
43
|
-
nimcode
|
|
44
|
-
```
|
|
45
|
-
- Or run a one-off task directly from the command line:
|
|
46
|
-
```bash
|
|
47
|
-
nimcode /plan "Build a classic Snake game using HTML5 Canvas"
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## ⚙️ How it Works
|
|
51
|
-
|
|
52
|
-
NimCode creates a `.nimcode` directory inside your projects. This directory acts as the "brain" for that specific workspace:
|
|
53
|
-
- `.nimcode/plans/`: All your generated step-by-step markdown plans live here.
|
|
54
|
-
- `.nimcode/skills/`: Any custom guidelines, framework rules, or memories you teach the agent.
|
|
55
|
-
|
|
56
|
-
## 🛡️ Requirements
|
|
57
|
-
|
|
58
|
-
- Python 3.8+
|
|
59
|
-
- An NVIDIA NIM API Key (NIM_API_KEY)
|
|
60
|
-
|
|
61
|
-
## 🤝 Contributing
|
|
62
|
-
|
|
63
|
-
Contributions, issues, and feature requests are welcome! Feel free to check out our [issues page](#).
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
<div align="center">
|
|
67
|
-
<i>Built with ❤️ for the open-source developer community.</i>
|
|
68
|
-
</div>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|