nimcode 0.5.0__tar.gz → 0.5.2__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.
Files changed (48) hide show
  1. {nimcode-0.5.0 → nimcode-0.5.2}/PKG-INFO +237 -226
  2. {nimcode-0.5.0 → nimcode-0.5.2}/README.md +216 -205
  3. {nimcode-0.5.0 → nimcode-0.5.2}/setup.cfg +4 -4
  4. {nimcode-0.5.0 → nimcode-0.5.2}/setup.py +33 -33
  5. nimcode-0.5.2/src/nimcode/__version__.py +1 -0
  6. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/agent.py +648 -648
  7. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/cli.py +192 -192
  8. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/config.py +69 -69
  9. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/lenient_parser.py +107 -107
  10. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/memory.py +71 -71
  11. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/model_registry.py +54 -54
  12. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/nim_client.py +166 -166
  13. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/permissions.py +134 -134
  14. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/plugin_manager.py +53 -53
  15. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/rag.py +121 -121
  16. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/repl.py +1274 -1274
  17. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/repo_map.py +97 -97
  18. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/tools.py +915 -915
  19. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/updater.py +39 -39
  20. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/watcher.py +81 -81
  21. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode.egg-info/PKG-INFO +237 -226
  22. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_agent.py +300 -300
  23. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_cli.py +149 -149
  24. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_config.py +77 -77
  25. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_lenient_parser.py +67 -67
  26. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_mcp_client.py +135 -135
  27. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_memory.py +79 -79
  28. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_model_registry.py +38 -38
  29. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_nim_client.py +149 -149
  30. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_permissions.py +86 -86
  31. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_plan_injection.py +152 -152
  32. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_plugin_manager.py +53 -53
  33. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_repl.py +394 -394
  34. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_repl_extra.py +142 -142
  35. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_repl_fixes.py +168 -168
  36. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_repl_trust.py +55 -55
  37. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_repo_map.py +93 -93
  38. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_tools.py +338 -338
  39. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_updater.py +41 -41
  40. {nimcode-0.5.0 → nimcode-0.5.2}/tests/test_version.py +25 -25
  41. nimcode-0.5.0/src/nimcode/__version__.py +0 -1
  42. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/__init__.py +0 -0
  43. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode/mcp_client.py +0 -0
  44. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode.egg-info/SOURCES.txt +0 -0
  45. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode.egg-info/dependency_links.txt +0 -0
  46. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode.egg-info/entry_points.txt +0 -0
  47. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode.egg-info/requires.txt +0 -0
  48. {nimcode-0.5.0 → nimcode-0.5.2}/src/nimcode.egg-info/top_level.txt +0 -0
@@ -1,226 +1,237 @@
1
- Metadata-Version: 2.4
2
- Name: nimcode
3
- Version: 0.5.0
4
- Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
- Home-page: https://github.com/Batunash/nimcode
6
- Author: Autonomous Agent
7
- Requires-Python: >=3.8
8
- Description-Content-Type: text/markdown
9
- Requires-Dist: httpx>=0.27.0
10
- Requires-Dist: rich>=13.7.0
11
- Requires-Dist: prompt_toolkit>=3.0.0
12
- Requires-Dist: mcp>=1.2.0
13
- Requires-Dist: watchdog>=3.0.0
14
- Dynamic: author
15
- Dynamic: description
16
- Dynamic: description-content-type
17
- Dynamic: home-page
18
- Dynamic: requires-dist
19
- Dynamic: requires-python
20
- Dynamic: summary
21
-
22
- <div align="center">
23
-
24
- # 🚀 NimCode
25
-
26
- **The Autonomous AI Coding Assistant for the NVIDIA NIM Ecosystem**
27
-
28
- [![PyPI version](https://badge.fury.io/py/nimcode.svg)](https://badge.fury.io/py/nimcode)
29
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
30
-
31
- *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.*
32
-
33
- </div>
34
-
35
- ---
36
-
37
- ## 🌟 Overview
38
-
39
- NimCode is your autonomous coding pair-programmer. Built with a rich interactive terminal interface, it doesn't just autocomplete code—it plans architectures based on real documents (SDD, PRD, RFC), executes terminal commands, writes complete files, and manages your workspace.
40
-
41
- ### ✅ What Works Right Now
42
- - **OS-Aware Agent**: Automatically detects Windows/Linux/macOS and uses the correct shell commands. No more `mkdir -p` on Windows.
43
- - **SDD/PRD-Aware Planning**: `/plan` mode reads your actual documents and produces implementation plans grounded in real file names, modules, and requirements—not generic PM templates.
44
- - **Paginated File Reading**: Large files (like SDDs) are read in chunks with `offset`/`limit` so nothing gets truncated.
45
- - **VS Code Deep Integration**: Native IPC communication allowing NimCode to read active editors, send patches, and act as your intelligent coding panel within VS Code.
46
- - **RAG & Semantic Search**: Zero-dependency TF-IDF/BM25 based indexer that instantly scans massive workspaces and retrieves context-aware code snippets.
47
- - **Autonomous Auto-Fixer**: The `/fix` command creates a self-healing feedback loop—runs your broken commands, analyzes tracebacks, and automatically iterates on code patches until the build passes.
48
- - **Multi-Model & Local Support**: Flexible `api_base_url` configuration to seamlessly switch between NVIDIA NIM, Ollama, or vLLM endpoints. Dynamic model list fetched from the API at runtime.
49
- - **Smart Permission Engine**: Granular control over file writes and command executions, featuring an auto-bypass mechanism and interactive `(a)ccept / (r)eject` diff previews. Non-interactive/CI mode is secure by default (Bash denied unless explicitly allowed).
50
- - **Robust Interactive REPL**: Multiline support (Alt+Enter), syntax highlighting, and beautiful `rich`-powered UI menus.
51
- - **Automated Workflows**: Automatic linting and formatting using `black`, `flake8`, and `prettier` behind the scenes.
52
- - **Model Context Protocol (MCP)**: Native integration for MCP tools allowing infinite extensibility.
53
- - **Context Management**: Auto-compact with per-model context window awareness. `/thinkback` shows real session statistics.
54
- - **Live Sync**: Workspace watcher automatically updates the repo map in the agent's context when files change.
55
-
56
- ### 🚀 What We're Working On (Roadmap)
57
- - **Sub-agent Swarms**: Perfecting `/delegate` and `/swarm` to distribute complex tasks among specialized AI roles.
58
- - **Advanced Diagnostics**: Refining `/bughunter`, `/security-review`, and `/doctor` for automated codebase auditing.
59
- - **Test-Driven Development**: Upgrading `/tdd` and `/testgen` to automatically write tests and ensure 100% coverage before committing.
60
- - **Infrastructure & DevOps**: Implementing `/terraform-god` and `/sql-tune` for automated cloud provisioning and database query optimization.
61
-
62
- ---
63
-
64
- ## 📦 Installation & Update
65
-
66
- ```bash
67
- # First time install
68
- pip install nimcode
69
-
70
- # Update to latest version
71
- pip install --upgrade nimcode
72
- ```
73
-
74
- > **⚠️ If NimCode shows an old version number at startup**, you likely have an older install. Run `pip install --upgrade nimcode` to get the latest fixes.
75
-
76
- ## 🚀 Quick Start
77
-
78
- 1. **Get an API Key**: Grab a free NVIDIA API key from [build.nvidia.com](https://build.nvidia.com/).
79
- 2. **Login**: Connect your local environment by running:
80
- ```bash
81
- nimcode login
82
- ```
83
- 3. **Start Coding**:
84
- - Launch the interactive REPL:
85
- ```bash
86
- nimcode
87
- ```
88
- - Or run a one-off task directly from the command line:
89
- ```bash
90
- nimcode /plan "Build a classic Snake game using HTML5 Canvas"
91
- ```
92
-
93
- ---
94
-
95
- ## 💻 Complete Command Reference
96
-
97
- Inside the `nimcode` REPL, you can type natural language or use any of the following slash commands:
98
-
99
- ### Mode Toggles & Execution
100
- - **`/code`**: Enter standard coding mode (default mode, prompts for dangerous actions).
101
- - **`/plan`**: Enter planning mode. NimCode will **read your actual documents/files first**, then write a concrete implementation plan to `.nimcode/plans/`.
102
- - **`/trust`**: Enter trust mode. The AI will run commands and edit files completely autonomously without asking for `(a)ccept / (r)eject`. Turn limit removed.
103
- - **`/untrust`**: Disable trust mode and restore permission prompts.
104
-
105
- ### Interface & Settings
106
- - **`/models`**: Open an interactive UI to select your preferred NVIDIA NIM model.
107
- - **`/theme`**: Open an interactive UI to change your syntax highlighting theme.
108
- - **`/config`**: View and edit global NimCode configuration settings.
109
-
110
- ### Workspace & Context Management
111
- - **`/clear`**: Clear the current conversation history to reset context.
112
- - **`/compact`**: Compact the context window to save tokens while keeping essential memories.
113
- - **`/context`**: View and manage the loaded context window.
114
- - **`/rewind`**: Rewind the conversation history by a few steps.
115
- - **`/undo`**: Revert the last file modification made by the AI.
116
- - **`/thinkback`**: View real session statistics (turns, token estimates, message history).
117
-
118
- ### Project & Search
119
- - **`/index`**: Index the current project files to enable lightning-fast Semantic Search.
120
- - **`/map`**: Generate a high-level semantic architecture map of the codebase.
121
- - **`/research`**: Enter deep-research mode for reading documentation or large files.
122
-
123
- ### Automation & Git
124
- - **`/commit`**: Analyze all staged git changes and automatically generate a conventional commit message.
125
- - **`/fix`**: Run a specific shell command and let the AI automatically iterate to fix any resulting errors.
126
- - **`/autofix-pr`**: Pulls the current active GitHub Pull Request, reads comments, and automatically fixes the mentioned issues.
127
-
128
- ### Advanced Development Modes
129
- - **`/testgen <file>`**: Generate unit tests for a specific file, aiming for 100% coverage.
130
- - **`/tdd`**: Enter Test-Driven Development mode. The AI will write tests first, verify they fail, and then implement the code to pass them.
131
- - **`/bughunter`**: Initiate an automated search for logical bugs and edge cases across the codebase.
132
- - **`/security-review`**: Audit the codebase for common vulnerabilities (e.g., OWASP top 10).
133
- - **`/ultraplan <task>`**: Generate a master ultra-detailed, dependency-graphed execution plan.
134
-
135
- ### AI & Agents
136
- - **`/delegate <role> <task>`**: Spawn an independent sub-agent with a specific role to handle a background task.
137
- - **`/swarm`**: Orchestrate multiple sub-agents to tackle a complex architectural epic simultaneously.
138
- - **`/grill-me`**: Interrogation mode. The AI will ask *you* hard questions to refine your system design and edge cases.
139
- - **`/learn`**: Teach NimCode a new persistent skill or framework rule that it will remember for future sessions.
140
- - **`/vision`**: Capture the screen and analyze UI elements using Vision AI models.
141
- - **`/mcp install`**: Install and configure new Model Context Protocol tools.
142
-
143
- ---
144
-
145
- ## ⚙️ How it Works
146
-
147
- NimCode creates a `.nimcode` directory inside your projects. This directory acts as the **agent's personal workspace**, not your project's source code:
148
- - `.nimcode/plans/`: All generated step-by-step markdown plans live here.
149
- - `.nimcode/skills/`: Custom guidelines, framework rules, or memories you teach the agent.
150
- - `.nimcode/history/`: File backups for `/undo` capabilities.
151
-
152
- > **Important**: NimCode writes your actual source code to your project root, not inside `.nimcode/`. The `.nimcode/` folder is only for the agent's internal notes.
153
-
154
- ### Advanced Configuration
155
-
156
- NimCode's behavior can be fully customized through `~/.nimcode/settings.json` (global) or `.nimcode/settings.json` (per-project). Setting any timeout to `0` disables it (infinite).
157
-
158
- ```json
159
- {
160
- "model": "meta/llama-3.1-70b-instruct",
161
- "api_base_url": "https://integrate.api.nvidia.com/v1",
162
- "timeout_command": 1200,
163
- "timeout_llm": 120,
164
- "timeout_format": 10,
165
- "timeout_browser": 15000,
166
- "timeout_updater": 3,
167
- "max_turns": 200,
168
- "max_tokens": 120000,
169
- "max_retries": 15,
170
- "retry_base_delay": 2.0,
171
- "retry_max_delay": 60.0,
172
- "allow_bash_non_interactive": false
173
- }
174
- ```
175
-
176
- | Setting | Default | Description |
177
- |---------|---------|-------------|
178
- | `model` | `meta/llama-3.1-70b-instruct` | Default LLM model |
179
- | `api_base_url` | NVIDIA NIM endpoint | Switch to Ollama/vLLM by changing this |
180
- | `timeout_command` | 1200 | Max seconds for bash commands (0 = infinite) |
181
- | `timeout_llm` | 120 | Max seconds for LLM API calls (0 = infinite) |
182
- | `timeout_format` | 10 | Max seconds for formatters like black/prettier |
183
- | `timeout_browser` | 15000 | Max ms for browser actions |
184
- | `timeout_updater` | 3 | Max seconds for update checks |
185
- | `max_turns` | 200 | Max agent turns per session (0 = unlimited) |
186
- | `max_tokens` | 120000 | Token budget before auto-compact |
187
- | `max_retries` | 15 | Max API retry attempts on transient errors |
188
- | `retry_base_delay` | 2.0 | Base delay for exponential backoff (seconds) |
189
- | `retry_max_delay` | 60.0 | Max delay cap for backoff (seconds) |
190
- | `allow_bash_non_interactive` | false | Allow Bash commands in non-interactive/CI mode |
191
-
192
- ---
193
-
194
- ## 📋 Changelog
195
-
196
- ### v0.4.0 (Latest)
197
- - 🐛 **System prompt is now OS-aware**: Correctly uses Windows (`mkdir`, `copy`) or Unix (`mkdir -p`, `cp`) commands based on the detected OS
198
- - 🐛 **Plan quality massively improved**: `/plan` mode now reads your actual documents (SDD, PRD, etc.) and generates concrete plans with real file paths and code not generic PM templates
199
- - 🐛 **Fixed `_distill_memory` 400 error**: Context compaction no longer crashes with a Bad Request error
200
- - 🐛 **Fixed version tracking**: `CURRENT_VERSION` was hardcoded as `3.0.0`; now reads from a single source of truth
201
- - 🐛 **`/thinkback` shows real data**: Previously showed hardcoded fake table; now shows actual session statistics
202
- - 🐛 **LiveSync fixed**: `repo_map` module was missing, causing the workspace watcher to silently fail
203
- - 🔒 **Security**: Non-interactive mode no longer auto-approves Bash commands
204
- - ⚙️ **Fully configurable**: `max_turns`, `max_tokens`, `max_retries`, retry delays all configurable via settings
205
- - ⚙️ **Dynamic model list**: Fetched from NIM API at runtime with fallback to known models
206
- - ⚙️ **Paginated file reading**: `Read` tool supports `offset`/`limit` for large files
207
- - ✅ **178 tests passing**
208
-
209
- ### v0.3.4
210
- - All timeouts configurable via settings (0 = infinite)
211
-
212
- ---
213
-
214
- ## 🛡️ Requirements
215
-
216
- - Python 3.8+
217
- - An NVIDIA NIM API Key (`NIM_API_KEY`)
218
-
219
- ## 🤝 Contributing
220
-
221
- Contributions, issues, and feature requests are welcome! Feel free to check out our [issues page](#).
222
-
223
- ---
224
- <div align="center">
225
- <i>Built with ❤️ for the open-source developer community.</i>
226
- </div>
1
+ Metadata-Version: 2.4
2
+ Name: nimcode
3
+ Version: 0.5.2
4
+ Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
+ Home-page: https://github.com/Batunash/nimcode
6
+ Author: Autonomous Agent
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: httpx>=0.27.0
10
+ Requires-Dist: rich>=13.7.0
11
+ Requires-Dist: prompt_toolkit>=3.0.0
12
+ Requires-Dist: mcp>=1.2.0
13
+ Requires-Dist: watchdog>=3.0.0
14
+ Dynamic: author
15
+ Dynamic: description
16
+ Dynamic: description-content-type
17
+ Dynamic: home-page
18
+ Dynamic: requires-dist
19
+ Dynamic: requires-python
20
+ Dynamic: summary
21
+
22
+ <div align="center">
23
+
24
+ # 🚀 NimCode
25
+
26
+ **The Autonomous AI Coding Assistant for the NVIDIA NIM Ecosystem**
27
+
28
+ [![PyPI version](https://img.shields.io/pypi/v/nimcode.svg)](https://pypi.org/project/nimcode/)
29
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
30
+
31
+ *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.*
32
+
33
+ </div>
34
+
35
+ ---
36
+
37
+ ## 🌟 Overview
38
+
39
+ NimCode is your autonomous coding pair-programmer. Built with a rich interactive terminal interface, it doesn't just autocomplete code—it plans architectures based on real documents (SDD, PRD, RFC), executes terminal commands, writes complete files, and manages your workspace.
40
+
41
+ ### ✅ What Works Right Now
42
+ - **OS-Aware Agent**: Automatically detects Windows/Linux/macOS and uses the correct shell commands. No more `mkdir -p` on Windows.
43
+ - **SDD/PRD-Aware Planning**: `/plan` mode reads your actual documents and produces implementation plans grounded in real file names, modules, and requirements—not generic PM templates.
44
+ - **Paginated File Reading**: Large files (like SDDs) are read in chunks with `offset`/`limit` so nothing gets truncated.
45
+ - **VS Code Deep Integration**: Native IPC communication allowing NimCode to read active editors, send patches, and act as your intelligent coding panel within VS Code.
46
+ - **RAG & Semantic Search**: Zero-dependency TF-IDF/BM25 based indexer that instantly scans massive workspaces and retrieves context-aware code snippets.
47
+ - **Autonomous Auto-Fixer**: The `/fix` command creates a self-healing feedback loop—runs your broken commands, analyzes tracebacks, and automatically iterates on code patches until the build passes.
48
+ - **Multi-Model & Local Support**: Flexible `api_base_url` configuration to seamlessly switch between NVIDIA NIM, Ollama, or vLLM endpoints. Dynamic model list fetched from the API at runtime.
49
+ - **Smart Permission Engine**: Granular control over file writes and command executions, featuring an auto-bypass mechanism and interactive `(a)ccept / (r)eject` diff previews. Non-interactive/CI mode is secure by default (Bash denied unless explicitly allowed).
50
+ - **Robust Interactive REPL**: Multiline support (Alt+Enter), syntax highlighting, and beautiful `rich`-powered UI menus.
51
+ - **Automated Workflows**: Automatic linting and formatting using `black`, `flake8`, and `prettier` behind the scenes.
52
+ - **Model Context Protocol (MCP)**: Native integration for MCP tools allowing infinite extensibility.
53
+ - **Context Management**: Auto-compact with per-model context window awareness. `/thinkback` shows real session statistics.
54
+ - **Live Sync**: Workspace watcher automatically updates the repo map in the agent's context when files change.
55
+
56
+ ### 🚀 What We're Working On (Roadmap)
57
+ - **Sub-agent Swarms**: Perfecting `/delegate` and `/swarm` to distribute complex tasks among specialized AI roles.
58
+ - **Advanced Diagnostics**: Refining `/bughunter`, `/security-review`, and `/doctor` for automated codebase auditing.
59
+ - **Test-Driven Development**: Upgrading `/tdd` and `/testgen` to automatically write tests and ensure 100% coverage before committing.
60
+ - **Infrastructure & DevOps**: Implementing `/terraform-god` and `/sql-tune` for automated cloud provisioning and database query optimization.
61
+
62
+ ---
63
+
64
+ ## 📦 Installation & Update
65
+
66
+ ```bash
67
+ # First time install
68
+ pip install nimcode
69
+
70
+ # Update to latest version
71
+ pip install --upgrade nimcode
72
+ ```
73
+
74
+ > **⚠️ If NimCode shows an old version number at startup**, you likely have an older install. Run `pip install --upgrade nimcode` to get the latest fixes.
75
+
76
+ ## 🚀 Quick Start
77
+
78
+ 1. **Get an API Key**: Grab a free NVIDIA API key from [build.nvidia.com](https://build.nvidia.com/).
79
+ 2. **Login**: Connect your local environment by running:
80
+ ```bash
81
+ nimcode login
82
+ ```
83
+ 3. **Start Coding**:
84
+ - Launch the interactive REPL:
85
+ ```bash
86
+ nimcode
87
+ ```
88
+ - Or run a one-off task directly from the command line:
89
+ ```bash
90
+ nimcode /plan "Build a classic Snake game using HTML5 Canvas"
91
+ ```
92
+
93
+ ---
94
+
95
+ ## 💻 Complete Command Reference
96
+
97
+ Inside the `nimcode` REPL, you can type natural language or use any of the following slash commands:
98
+
99
+ ### Mode Toggles & Execution
100
+ - **`/code`**: Enter standard coding mode (default mode, prompts for dangerous actions).
101
+ - **`/plan`**: Enter planning mode. NimCode will **read your actual documents/files first**, then write a concrete implementation plan to `.nimcode/plans/`.
102
+ - **`/trust`**: Enter trust mode. The AI will run commands and edit files completely autonomously without asking for `(a)ccept / (r)eject`. Turn limit removed.
103
+ - **`/untrust`**: Disable trust mode and restore permission prompts.
104
+
105
+ ### Interface & Settings
106
+ - **`/models`**: Open an interactive UI to select your preferred NVIDIA NIM model.
107
+ - **`/theme`**: Open an interactive UI to change your syntax highlighting theme.
108
+ - **`/config`**: View and edit global NimCode configuration settings.
109
+
110
+ ### Workspace & Context Management
111
+ - **`/clear`**: Clear the current conversation history to reset context.
112
+ - **`/compact`**: Compact the context window to save tokens while keeping essential memories.
113
+ - **`/context`**: View and manage the loaded context window.
114
+ - **`/rewind`**: Rewind the conversation history by a few steps.
115
+ - **`/undo`**: Revert the last file modification made by the AI.
116
+ - **`/thinkback`**: View real session statistics (turns, token estimates, message history).
117
+
118
+ ### Project & Search
119
+ - **`/index`**: Index the current project files to enable lightning-fast Semantic Search.
120
+ - **`/map`**: Generate a high-level semantic architecture map of the codebase.
121
+ - **`/research`**: Enter deep-research mode for reading documentation or large files.
122
+
123
+ ### Automation & Git
124
+ - **`/commit`**: Analyze all staged git changes and automatically generate a conventional commit message.
125
+ - **`/fix`**: Run a specific shell command and let the AI automatically iterate to fix any resulting errors.
126
+ - **`/autofix-pr`**: Pulls the current active GitHub Pull Request, reads comments, and automatically fixes the mentioned issues.
127
+
128
+ ### Advanced Development Modes
129
+ - **`/testgen <file>`**: Generate unit tests for a specific file, aiming for 100% coverage.
130
+ - **`/tdd`**: Enter Test-Driven Development mode. The AI will write tests first, verify they fail, and then implement the code to pass them.
131
+ - **`/bughunter`**: Initiate an automated search for logical bugs and edge cases across the codebase.
132
+ - **`/security-review`**: Audit the codebase for common vulnerabilities (e.g., OWASP top 10).
133
+ - **`/ultraplan <task>`**: Generate a master ultra-detailed, dependency-graphed execution plan.
134
+
135
+ ### AI & Agents
136
+ - **`/delegate <role> <task>`**: Spawn an independent sub-agent with a specific role to handle a background task.
137
+ - **`/swarm`**: Orchestrate multiple sub-agents to tackle a complex architectural epic simultaneously.
138
+ - **`/grill-me`**: Interrogation mode. The AI will ask *you* hard questions to refine your system design and edge cases.
139
+ - **`/learn`**: Teach NimCode a new persistent skill or framework rule that it will remember for future sessions.
140
+ - **`/vision`**: Capture the screen and analyze UI elements using Vision AI models.
141
+ - **`/mcp install`**: Install and configure new Model Context Protocol tools.
142
+
143
+ ---
144
+
145
+ ## ⚙️ How it Works
146
+
147
+ NimCode creates a `.nimcode` directory inside your projects. This directory acts as the **agent's personal workspace**, not your project's source code:
148
+ - `.nimcode/plans/`: All generated step-by-step markdown plans live here.
149
+ - `.nimcode/skills/`: Custom guidelines, framework rules, or memories you teach the agent.
150
+ - `.nimcode/history/`: File backups for `/undo` capabilities.
151
+
152
+ > **Important**: NimCode writes your actual source code to your project root, not inside `.nimcode/`. The `.nimcode/` folder is only for the agent's internal notes.
153
+
154
+ ### Advanced Configuration
155
+
156
+ NimCode's behavior can be fully customized through `~/.nimcode/settings.json` (global) or `.nimcode/settings.json` (per-project). Setting any timeout to `0` disables it (infinite).
157
+
158
+ ```json
159
+ {
160
+ "model": "meta/llama-3.1-70b-instruct",
161
+ "api_base_url": "https://integrate.api.nvidia.com/v1",
162
+ "timeout_command": 1200,
163
+ "timeout_llm": 120,
164
+ "timeout_format": 10,
165
+ "timeout_browser": 15000,
166
+ "timeout_updater": 3,
167
+ "max_turns": 200,
168
+ "max_tokens": 120000,
169
+ "max_retries": 15,
170
+ "retry_base_delay": 2.0,
171
+ "retry_max_delay": 60.0,
172
+ "allow_bash_non_interactive": false
173
+ }
174
+ ```
175
+
176
+ | Setting | Default | Description |
177
+ |---------|---------|-------------|
178
+ | `model` | `meta/llama-3.1-70b-instruct` | Default LLM model |
179
+ | `api_base_url` | NVIDIA NIM endpoint | Switch to Ollama/vLLM by changing this |
180
+ | `timeout_command` | 1200 | Max seconds for bash commands (0 = infinite) |
181
+ | `timeout_llm` | 120 | Max seconds for LLM API calls (0 = infinite) |
182
+ | `timeout_format` | 10 | Max seconds for formatters like black/prettier |
183
+ | `timeout_browser` | 15000 | Max ms for browser actions |
184
+ | `timeout_updater` | 3 | Max seconds for update checks |
185
+ | `max_turns` | 200 | Max agent turns per session (0 = unlimited) |
186
+ | `max_tokens` | 120000 | Token budget before auto-compact |
187
+ | `max_retries` | 15 | Max API retry attempts on transient errors |
188
+ | `retry_base_delay` | 2.0 | Base delay for exponential backoff (seconds) |
189
+ | `retry_max_delay` | 60.0 | Max delay cap for backoff (seconds) |
190
+ | `allow_bash_non_interactive` | false | Allow Bash commands in non-interactive/CI mode |
191
+
192
+ ---
193
+
194
+ ## 📋 Changelog
195
+
196
+ ### v0.5.2 (Latest)
197
+ - 🧠 **Autonomous Marathon Runner**: Capable of running non-stop for 5-6 hours without drifting from the main plan.
198
+ - 🧪 **Native TestRunner**: NimCode can now run your test suites (`pytest`, `npm test`, `go test`) and self-heal its code until the tests pass.
199
+ - 🗺️ **Semantic AST Explorer**: `GetCodeOutline` tool added for instant navigation within large files (functions/classes with line numbers) instead of reading thousands of lines.
200
+ - 🛡️ **Stuck-Loop Breaker**: AI no longer gets stuck repeating the same failing action. Auto-detects 3x repeated errors and forces a strategy change.
201
+ - 🧭 **Plan-Drift Radar**: Automatically pings the agent every 15 turns to ensure strict compliance with the `.nimcode/active_plan.txt` and prevents hallucinations.
202
+ - 🚨 **Anti-Laziness Firewall**: Advanced regex intercepts lazy code (e.g., `// TODO`, `pass`) before it's written and forces the AI to output complete logic.
203
+ - **Self-Correcting Auto-Linters**: Seamless multi-language support. Formats and validates code in the background using `go vet`, `prettier`, and `python` syntax checks.
204
+ - 🧠 **Semantic Context RAG**: Automatically pins the directory tree and database schemas into the system prompt to cure agent amnesia.
205
+ - 📝 **ReplaceBlock Tool**: Precision line-based editing replaces the buggy exact-string `Replace` tool, completely solving indentation mismatch errors.
206
+ - **195 tests passing**
207
+
208
+ ### v0.4.0
209
+ - 🐛 **System prompt is now OS-aware**: Correctly uses Windows (`mkdir`, `copy`) or Unix (`mkdir -p`, `cp`) commands based on the detected OS
210
+ - 🐛 **Plan quality massively improved**: `/plan` mode now reads your actual documents (SDD, PRD, etc.) and generates concrete plans with real file paths and code — not generic PM templates
211
+ - 🐛 **Fixed `_distill_memory` 400 error**: Context compaction no longer crashes with a Bad Request error
212
+ - 🐛 **Fixed version tracking**: `CURRENT_VERSION` was hardcoded as `3.0.0`; now reads from a single source of truth
213
+ - 🐛 **`/thinkback` shows real data**: Previously showed hardcoded fake table; now shows actual session statistics
214
+ - 🐛 **LiveSync fixed**: `repo_map` module was missing, causing the workspace watcher to silently fail
215
+ - 🔒 **Security**: Non-interactive mode no longer auto-approves Bash commands
216
+ - ⚙️ **Fully configurable**: `max_turns`, `max_tokens`, `max_retries`, retry delays all configurable via settings
217
+ - ⚙️ **Dynamic model list**: Fetched from NIM API at runtime with fallback to known models
218
+ - ⚙️ **Paginated file reading**: `Read` tool supports `offset`/`limit` for large files
219
+
220
+ ### v0.3.4
221
+ - All timeouts configurable via settings (0 = infinite)
222
+
223
+ ---
224
+
225
+ ## 🛡️ Requirements
226
+
227
+ - Python 3.8+
228
+ - An NVIDIA NIM API Key (`NIM_API_KEY`)
229
+
230
+ ## 🤝 Contributing
231
+
232
+ Contributions, issues, and feature requests are welcome! Feel free to check out our [issues page](#).
233
+
234
+ ---
235
+ <div align="center">
236
+ <i>Built with ❤️ for the open-source developer community.</i>
237
+ </div>