neuro-cli 4.1.0
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.
- package/LICENSE +21 -0
- package/README.md +510 -0
- package/dist/advisor/advisor.d.ts +50 -0
- package/dist/advisor/advisor.js +178 -0
- package/dist/agents/base.d.ts +62 -0
- package/dist/agents/base.js +215 -0
- package/dist/agents/orchestrator.d.ts +46 -0
- package/dist/agents/orchestrator.js +192 -0
- package/dist/agents/team.d.ts +51 -0
- package/dist/agents/team.js +210 -0
- package/dist/api/models.d.ts +23 -0
- package/dist/api/models.js +514 -0
- package/dist/api/ollama.d.ts +153 -0
- package/dist/api/ollama.js +751 -0
- package/dist/api/openrouter.d.ts +55 -0
- package/dist/api/openrouter.js +223 -0
- package/dist/commands/commands.d.ts +43 -0
- package/dist/commands/commands.js +308 -0
- package/dist/config/config.d.ts +8 -0
- package/dist/config/config.js +311 -0
- package/dist/context/compaction.d.ts +54 -0
- package/dist/context/compaction.js +251 -0
- package/dist/context/custom-agents.d.ts +107 -0
- package/dist/context/custom-agents.js +397 -0
- package/dist/context/custom-tools.d.ts +120 -0
- package/dist/context/custom-tools.js +564 -0
- package/dist/context/git-checkpoint.d.ts +52 -0
- package/dist/context/git-checkpoint.js +240 -0
- package/dist/context/neuro-md.d.ts +48 -0
- package/dist/context/neuro-md.js +202 -0
- package/dist/context/neuroignore.d.ts +102 -0
- package/dist/context/neuroignore.js +441 -0
- package/dist/context/repo-map.d.ts +38 -0
- package/dist/context/repo-map.js +220 -0
- package/dist/context/skill-standard.d.ts +262 -0
- package/dist/context/skill-standard.js +1156 -0
- package/dist/context/skill-system.d.ts +75 -0
- package/dist/context/skill-system.js +578 -0
- package/dist/context/tree-sitter.d.ts +99 -0
- package/dist/context/tree-sitter.js +1956 -0
- package/dist/core/acp.d.ts +325 -0
- package/dist/core/acp.js +1498 -0
- package/dist/core/api-server.d.ts +143 -0
- package/dist/core/api-server.js +550 -0
- package/dist/core/approval.d.ts +81 -0
- package/dist/core/approval.js +432 -0
- package/dist/core/auto-compact.d.ts +127 -0
- package/dist/core/auto-compact.js +436 -0
- package/dist/core/auto-mode.d.ts +232 -0
- package/dist/core/auto-mode.js +831 -0
- package/dist/core/background-session.d.ts +166 -0
- package/dist/core/background-session.js +696 -0
- package/dist/core/cicd.d.ts +257 -0
- package/dist/core/cicd.js +1443 -0
- package/dist/core/cloud-sync.d.ts +156 -0
- package/dist/core/cloud-sync.js +582 -0
- package/dist/core/code-review.d.ts +132 -0
- package/dist/core/code-review.js +1191 -0
- package/dist/core/completion.d.ts +49 -0
- package/dist/core/completion.js +384 -0
- package/dist/core/context.d.ts +38 -0
- package/dist/core/context.js +144 -0
- package/dist/core/diff-preview.d.ts +35 -0
- package/dist/core/diff-preview.js +173 -0
- package/dist/core/doom-loop.d.ts +51 -0
- package/dist/core/doom-loop.js +179 -0
- package/dist/core/engine.d.ts +183 -0
- package/dist/core/engine.js +942 -0
- package/dist/core/extended-thinking.d.ts +103 -0
- package/dist/core/extended-thinking.js +269 -0
- package/dist/core/fallback.d.ts +54 -0
- package/dist/core/fallback.js +104 -0
- package/dist/core/git-worktree.d.ts +139 -0
- package/dist/core/git-worktree.js +614 -0
- package/dist/core/headless.d.ts +30 -0
- package/dist/core/headless.js +101 -0
- package/dist/core/i18n.d.ts +83 -0
- package/dist/core/i18n.js +739 -0
- package/dist/core/linting.d.ts +129 -0
- package/dist/core/linting.js +699 -0
- package/dist/core/model-router.d.ts +109 -0
- package/dist/core/model-router.js +581 -0
- package/dist/core/multi-model.d.ts +243 -0
- package/dist/core/multi-model.js +1099 -0
- package/dist/core/multi-session.d.ts +144 -0
- package/dist/core/multi-session.js +442 -0
- package/dist/core/multimodal.d.ts +125 -0
- package/dist/core/multimodal.js +286 -0
- package/dist/core/observability.d.ts +93 -0
- package/dist/core/observability.js +737 -0
- package/dist/core/os-sandbox.d.ts +122 -0
- package/dist/core/os-sandbox.js +1193 -0
- package/dist/core/outcome-grading.d.ts +228 -0
- package/dist/core/outcome-grading.js +1123 -0
- package/dist/core/output-styles.d.ts +57 -0
- package/dist/core/output-styles.js +382 -0
- package/dist/core/parallel-agents.d.ts +183 -0
- package/dist/core/parallel-agents.js +563 -0
- package/dist/core/plugin-bundle.d.ts +236 -0
- package/dist/core/plugin-bundle.js +887 -0
- package/dist/core/plugin-sdk.d.ts +139 -0
- package/dist/core/plugin-sdk.js +273 -0
- package/dist/core/prompt-cache.d.ts +163 -0
- package/dist/core/prompt-cache.js +599 -0
- package/dist/core/sandbox.d.ts +127 -0
- package/dist/core/sandbox.js +369 -0
- package/dist/core/scheduled-tasks.d.ts +151 -0
- package/dist/core/scheduled-tasks.js +502 -0
- package/dist/core/security-scanner.d.ts +160 -0
- package/dist/core/security-scanner.js +1494 -0
- package/dist/core/session.d.ts +83 -0
- package/dist/core/session.js +269 -0
- package/dist/core/shell-completion.d.ts +51 -0
- package/dist/core/shell-completion.js +674 -0
- package/dist/core/smart-monitor.d.ts +146 -0
- package/dist/core/smart-monitor.js +1199 -0
- package/dist/core/spec-driven.d.ts +233 -0
- package/dist/core/spec-driven.js +1485 -0
- package/dist/core/spending-warnings.d.ts +123 -0
- package/dist/core/spending-warnings.js +456 -0
- package/dist/core/sub-agent.d.ts +298 -0
- package/dist/core/sub-agent.js +1023 -0
- package/dist/core/telemetry.d.ts +157 -0
- package/dist/core/telemetry.js +412 -0
- package/dist/core/terminal-ux.d.ts +134 -0
- package/dist/core/terminal-ux.js +649 -0
- package/dist/core/testing.d.ts +146 -0
- package/dist/core/testing.js +1200 -0
- package/dist/core/types.d.ts +439 -0
- package/dist/core/types.js +6 -0
- package/dist/core/undo-redo.d.ts +112 -0
- package/dist/core/undo-redo.js +290 -0
- package/dist/core/updater.d.ts +159 -0
- package/dist/core/updater.js +608 -0
- package/dist/core/vim-mode.d.ts +151 -0
- package/dist/core/vim-mode.js +771 -0
- package/dist/core/voice.d.ts +137 -0
- package/dist/core/voice.js +538 -0
- package/dist/core/web-dashboard.d.ts +109 -0
- package/dist/core/web-dashboard.js +484 -0
- package/dist/hooks/hooks.d.ts +74 -0
- package/dist/hooks/hooks.js +160 -0
- package/dist/hooks/llm-evaluator.d.ts +165 -0
- package/dist/hooks/llm-evaluator.js +560 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1186 -0
- package/dist/lsp/lsp-manager.d.ts +63 -0
- package/dist/lsp/lsp-manager.js +351 -0
- package/dist/mcp/client.d.ts +133 -0
- package/dist/mcp/client.js +684 -0
- package/dist/mcp/mcp-apps.d.ts +70 -0
- package/dist/mcp/mcp-apps.js +1007 -0
- package/dist/tools/bash.d.ts +5 -0
- package/dist/tools/bash.js +195 -0
- package/dist/tools/browser.d.ts +92 -0
- package/dist/tools/browser.js +1570 -0
- package/dist/tools/extended.d.ts +6 -0
- package/dist/tools/extended.js +191 -0
- package/dist/tools/file.d.ts +10 -0
- package/dist/tools/file.js +382 -0
- package/dist/tools/github.d.ts +389 -0
- package/dist/tools/github.js +759 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.js +40 -0
- package/dist/tools/memory.d.ts +6 -0
- package/dist/tools/memory.js +197 -0
- package/dist/tools/registry.d.ts +29 -0
- package/dist/tools/registry.js +64 -0
- package/dist/tools/web.d.ts +6 -0
- package/dist/tools/web.js +150 -0
- package/dist/ui/renderer.d.ts +97 -0
- package/dist/ui/renderer.js +279 -0
- package/dist/ui/theme.d.ts +27 -0
- package/dist/ui/theme.js +106 -0
- package/package.json +83 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 NeuroCLI
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://img.shields.io/badge/version-4.0.0-blue" alt="version">
|
|
3
|
+
<img src="https://img.shields.io/badge/models-23%20free-green" alt="models">
|
|
4
|
+
<img src="https://img.shields.io/badge/license-MIT-yellow" alt="license">
|
|
5
|
+
<img src="https://img.shields.io/badge/TypeScript-5.9-blue" alt="typescript">
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<h1 align="center">NeuroCLI v4.0</h1>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="docs/neuro-hero.png" alt="NeuroCLI Terminal Screenshot" width="700">
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center"><strong>Advanced AI Terminal Coding Assistant</strong></p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
Multi-agent orchestration • Sub-agent spawning • ACP protocol • OS-level sandboxing<br>
|
|
18
|
+
Spec-driven development • Smart monitoring • Multi-model routing • 23+ free models
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## What's New in v4.0
|
|
24
|
+
|
|
25
|
+
| System | Description |
|
|
26
|
+
|--------|-------------|
|
|
27
|
+
| **Sub-Agent Spawning** | Hierarchical agent delegation with scoped tool access, file restrictions, and resource limits |
|
|
28
|
+
| **ACP Protocol** | Agent Client Protocol — "LSP for AI agents" — enables IDE integration (VS Code, Zed, JetBrains) |
|
|
29
|
+
| **OS-Level Sandbox** | Docker-based and native OS sandboxing with network isolation, command filtering, and audit logging |
|
|
30
|
+
| **Spec-Driven Development** | Generate requirements → design → implementation plan → code → verification pipeline |
|
|
31
|
+
| **LLM Evaluator Hooks** | Hooks that invoke LLM-based evaluators to approve/deny/modify actions in real-time |
|
|
32
|
+
| **MCP Apps** | Interactive tool UI extensions — forms, tables, charts, progress bars in terminal |
|
|
33
|
+
| **Multi-Model Orchestrator** | Orchestrator/worker pattern — expensive planner + cheap executor = 50-70% cost savings |
|
|
34
|
+
| **Smart Monitor** | LLM-based action evaluation bridging manual and auto mode with risk scoring |
|
|
35
|
+
| **Outcome Grading** | Rubric-based quality evaluation with revision loops and isolated evaluator |
|
|
36
|
+
| **OpenTelemetry** | Standard observability — OTLP traces/metrics export to Datadog, Jaeger, Grafana |
|
|
37
|
+
| **Auto-Compact** | Model-aware automatic context compaction when approaching context window limits |
|
|
38
|
+
| **Terminal UX** | OSC 52 clipboard, split-pane TUI, syntax highlighting, embedded interactive commands |
|
|
39
|
+
| **Multi-Session** | Parallel independent agent sessions with separate context and inter-session messaging |
|
|
40
|
+
| **Git Worktree** | Agent-worktree binding for parallel development with conflict detection and auto-merge |
|
|
41
|
+
|
|
42
|
+
## Architecture Overview
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
┌─────────────────────────────────────────────────────────┐
|
|
46
|
+
│ NeuroEngine v4.0 │
|
|
47
|
+
├──────────┬──────────┬──────────┬───────────┬────────────┤
|
|
48
|
+
│ CLI / │ Agent │ Model │ Context │ Tools │
|
|
49
|
+
│ REPL │ System │ Layer │ Engine │ Engine │
|
|
50
|
+
├──────────┼──────────┼──────────┼───────────┼────────────┤
|
|
51
|
+
│Commander │Orchestr. │OpenRouter│5-Layer │18 Built-in │
|
|
52
|
+
│Inquirer │Sub-Agent │Ollama │Auto-Compact│+ MCP │
|
|
53
|
+
│Headless │Team │Multi- │Compaction │+ Custom │
|
|
54
|
+
│ACP Server│Custom │Model │NEURO.md │+ Browser │
|
|
55
|
+
│TerminalUX│Agents │Router │Repo Map │+ GitHub │
|
|
56
|
+
├──────────┴──────────┴──────────┴───────────┴────────────┤
|
|
57
|
+
│ Infrastructure Layer │
|
|
58
|
+
├─────────┬──────────┬───────────┬──────────┬─────────────┤
|
|
59
|
+
│ Sandbox │ Hooks │ Observab. │ Skills │ Config │
|
|
60
|
+
│ OS-Level│LLM Eval │OpenTelem. │SKILL.md │ Global/ │
|
|
61
|
+
│ Docker │Lifecycle │OTLP Export│Registry │ Project │
|
|
62
|
+
│ Network │Events │Traces │Auto- │ .neuro/ │
|
|
63
|
+
│ Audit │20+ Events│Metrics │Discovery │ YAML/JSON │
|
|
64
|
+
└─────────┴──────────┴───────────┴──────────┴─────────────┘
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
### 23 Free Models via OpenRouter
|
|
70
|
+
|
|
71
|
+
| Model | Context | Best For |
|
|
72
|
+
|-------|---------|----------|
|
|
73
|
+
| Qwen3 Coder | 1M tokens | Complex coding, planning |
|
|
74
|
+
| NVIDIA Nemotron 3 | 120B/550B | Powerful reasoning |
|
|
75
|
+
| Google Gemma 4 | 31B | Fast execution, multimodal |
|
|
76
|
+
| Cohere North Mini Code | — | Quick code generation |
|
|
77
|
+
| DeepSeek R1T Chimera | — | Chain-of-thought reasoning |
|
|
78
|
+
| + 18 more | — | Various specializations |
|
|
79
|
+
|
|
80
|
+
**$0 cost per developer per day** with free models.
|
|
81
|
+
|
|
82
|
+
### Sub-Agent Spawning (GAP-27)
|
|
83
|
+
|
|
84
|
+
Spawn child agents with scoped capabilities:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const result = await subAgentManager.spawn({
|
|
88
|
+
name: 'test-writer',
|
|
89
|
+
systemPrompt: 'Write comprehensive tests...',
|
|
90
|
+
allowedTools: ['read_file', 'write_file', 'run_command'],
|
|
91
|
+
deniedTools: ['delete_file'],
|
|
92
|
+
fileScope: {
|
|
93
|
+
allowedPaths: ['src/', 'tests/'],
|
|
94
|
+
deniedPaths: ['src/production/'],
|
|
95
|
+
},
|
|
96
|
+
resourceLimits: { maxTokens: 50000, maxTurns: 10, timeoutMs: 120000 },
|
|
97
|
+
maxDepth: 2,
|
|
98
|
+
mode: 'sequential',
|
|
99
|
+
}, 'Write tests for the auth module');
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### ACP Protocol (GAP-28)
|
|
103
|
+
|
|
104
|
+
Connect any IDE to NeuroCLI as a backend:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Start ACP server for VS Code extension
|
|
108
|
+
neuro acp --transport stdio
|
|
109
|
+
|
|
110
|
+
# Or via WebSocket
|
|
111
|
+
neuro acp --transport websocket --port 7654
|
|
112
|
+
|
|
113
|
+
# Or via HTTP
|
|
114
|
+
neuro acp --transport http --port 7654
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### OS-Level Sandbox (GAP-29)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Docker-based sandbox with network isolation
|
|
121
|
+
neuro --sandbox-type docker --sandbox-network blocked
|
|
122
|
+
|
|
123
|
+
# Native OS sandbox (Linux namespaces / macOS sandbox-exec)
|
|
124
|
+
neuro --sandbox-type os-native
|
|
125
|
+
|
|
126
|
+
# Custom network policy
|
|
127
|
+
neuro --sandbox-type docker --sandbox-allowed-domains "api.github.com,registry.npmjs.org"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Spec-Driven Development (GAP-30)
|
|
131
|
+
|
|
132
|
+
Generate specs before writing code:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Full pipeline: prompt → requirements → design → plan → code → verify
|
|
136
|
+
neuro spec "Build a REST API with authentication"
|
|
137
|
+
|
|
138
|
+
# Step by step
|
|
139
|
+
neuro spec requirements "Build a REST API" # Generate requirements
|
|
140
|
+
neuro spec design spec-001 # Generate design doc
|
|
141
|
+
neuro spec plan spec-001 # Generate implementation plan
|
|
142
|
+
neuro spec implement spec-001 # Execute the plan
|
|
143
|
+
neuro spec verify spec-001 # Verify against requirements
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Specs are stored in `.neuro/specs/` as Markdown with YAML frontmatter.
|
|
147
|
+
|
|
148
|
+
### Multi-Model Orchestrator (GAP-33)
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# Use architect mode — expensive planner + cheap executor
|
|
152
|
+
neuro --orchestrator architect
|
|
153
|
+
|
|
154
|
+
# Equivalent to:
|
|
155
|
+
# orchestrator: qwen3-coder (planning)
|
|
156
|
+
# worker: gemma-4-31b (execution)
|
|
157
|
+
# evaluator: qwen3-coder (quality check)
|
|
158
|
+
# reviewer: qwen3-coder (code review)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Smart Monitor (GAP-34)
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
# Smart mode — LLM evaluates each action dynamically
|
|
165
|
+
neuro --permission smart
|
|
166
|
+
|
|
167
|
+
# Risk thresholds are adjustable
|
|
168
|
+
neuro --permission smart --auto-approve-below 30 --ask-user-above 70
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Outcome Grading (GAP-35)
|
|
172
|
+
|
|
173
|
+
Define rubrics for quality evaluation:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Grade output against built-in rubrics
|
|
177
|
+
neuro grade --rubric code-quality
|
|
178
|
+
neuro grade --rubric security
|
|
179
|
+
neuro grade --rubric test-coverage
|
|
180
|
+
|
|
181
|
+
# Custom rubrics in .neuro/rubrics/
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### OpenTelemetry Integration (GAP-36)
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Export traces to Jaeger/Datadog/Grafana
|
|
188
|
+
neuro --otel-endpoint http://localhost:4318/v1/traces
|
|
189
|
+
|
|
190
|
+
# Console exporter for development
|
|
191
|
+
neuro --otel-console
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### MCP Protocol (stdio/SSE/HTTP + Apps)
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
neuro mcp add myserver "npx -y @modelcontextprotocol/server-everything"
|
|
198
|
+
neuro mcp add remote "https://mcp.example.com/sse" -t sse
|
|
199
|
+
/mcp list /mcp health /mcp connect myserver
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 8+ Specialized Agents
|
|
203
|
+
|
|
204
|
+
| Agent | Specialty |
|
|
205
|
+
|-------|-----------|
|
|
206
|
+
| Planner | Task decomposition |
|
|
207
|
+
| Coder | Code generation & modification |
|
|
208
|
+
| Reviewer | Code quality & security |
|
|
209
|
+
| Researcher | Information gathering |
|
|
210
|
+
| Tester | Test generation & execution |
|
|
211
|
+
| Debugger | Bug investigation & fixing |
|
|
212
|
+
| Architect | System design |
|
|
213
|
+
| DevOps | Deployment & infrastructure |
|
|
214
|
+
| **Custom** | Define your own in `.neuro/agents/` |
|
|
215
|
+
|
|
216
|
+
### 18+ Built-in Tools
|
|
217
|
+
|
|
218
|
+
| Category | Tools |
|
|
219
|
+
|----------|-------|
|
|
220
|
+
| File | read, write, edit, delete, list, search, apply_diff |
|
|
221
|
+
| Shell | run_command, git_operation |
|
|
222
|
+
| Web | web_search, web_fetch, doc_search |
|
|
223
|
+
| Memory | save/recall memory, project_context |
|
|
224
|
+
| Browser | navigate, click, type, screenshot, evaluate |
|
|
225
|
+
| GitHub | PR, Issue, repo management via `gh` CLI |
|
|
226
|
+
| Extended | Todo, AskUser, Monitor |
|
|
227
|
+
|
|
228
|
+
### 4 Permission Modes (+ Smart)
|
|
229
|
+
|
|
230
|
+
- **Manual** — Ask for every action
|
|
231
|
+
- **Auto** — Auto-approve safe operations
|
|
232
|
+
- **Smart** — LLM-based dynamic evaluation (new!)
|
|
233
|
+
- **Plan** — Read-only mode
|
|
234
|
+
- **Yolo** — Auto-approve everything
|
|
235
|
+
|
|
236
|
+
### 4 Terminal Themes
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
neuro --theme dracula # Purple-accented dark theme
|
|
240
|
+
neuro --theme dark # Classic dark theme
|
|
241
|
+
neuro --theme nord # Blue-accented dark theme
|
|
242
|
+
neuro --theme light # Light background theme
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## Installation
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
git clone https://github.com/muhammedturan65/neuro-cli.git
|
|
249
|
+
cd neuro-cli
|
|
250
|
+
npm install
|
|
251
|
+
npm run build
|
|
252
|
+
npm link
|
|
253
|
+
|
|
254
|
+
# Configure API key
|
|
255
|
+
neuro config --set-key YOUR_OPENROUTER_API_KEY
|
|
256
|
+
|
|
257
|
+
# Or use environment variable
|
|
258
|
+
export OPENROUTER_API_KEY=YOUR_KEY
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Usage
|
|
262
|
+
|
|
263
|
+
### Interactive Mode
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
neuro # Start interactive session
|
|
267
|
+
neuro -c # Continue last session
|
|
268
|
+
neuro -r session_abc123 # Resume specific session
|
|
269
|
+
neuro --effort high # High-effort model routing
|
|
270
|
+
neuro --style explanatory # Detailed explanations
|
|
271
|
+
neuro --thinking # Enable extended thinking
|
|
272
|
+
neuro --cache # Enable prompt caching
|
|
273
|
+
neuro --sandbox # Start with sandbox enabled
|
|
274
|
+
neuro --ollama # Use local Ollama models
|
|
275
|
+
neuro --orchestrator architect # Multi-model orchestrator
|
|
276
|
+
neuro --permission smart # Smart monitor mode
|
|
277
|
+
neuro --otel-console # Enable observability console
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Headless/CI Mode
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
neuro run "Create a REST API" --format json --auto
|
|
284
|
+
neuro run "Run tests" --max-turns 5 --allowed-tools "run_command,read_file"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Spec-Driven Development
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
neuro spec "Build authentication system" # Full pipeline
|
|
291
|
+
neuro spec requirements "Add caching layer" # Generate requirements only
|
|
292
|
+
neuro spec implement spec-001 # Implement approved spec
|
|
293
|
+
neuro spec verify spec-001 # Verify implementation
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### All Slash Commands
|
|
297
|
+
|
|
298
|
+
| Command | Description |
|
|
299
|
+
|---------|-------------|
|
|
300
|
+
| `/help` | Show help message |
|
|
301
|
+
| `/model [id]` | Switch or list models |
|
|
302
|
+
| `/agent [name]` | Switch or list agents |
|
|
303
|
+
| `/permission [mode]` | Set/cycle permission mode |
|
|
304
|
+
| `/resume [id]` | Resume previous session |
|
|
305
|
+
| `/fork` | Fork current session |
|
|
306
|
+
| `/compact` | Compact context |
|
|
307
|
+
| `/undo` | Undo last change |
|
|
308
|
+
| `/redo` | Redo undone change |
|
|
309
|
+
| `/rewind [n]` | Rewind n changes |
|
|
310
|
+
| `/mcp [cmd]` | Manage MCP servers |
|
|
311
|
+
| `/init` | Initialize NEURO.md |
|
|
312
|
+
| `/sandbox` | Toggle sandbox mode |
|
|
313
|
+
| `/style [name]` | Switch output style |
|
|
314
|
+
| `/thinking [mode]` | Toggle thinking mode |
|
|
315
|
+
| `/effort [level]` | Set effort level |
|
|
316
|
+
| `/skills [cmd]` | Manage skills |
|
|
317
|
+
| `/cache [cmd]` | Manage prompt cache |
|
|
318
|
+
| `/spending` | Show spending report |
|
|
319
|
+
| `/cost` | Show cost + cache savings |
|
|
320
|
+
| `/ignore [cmd]` | Manage .neuroignore |
|
|
321
|
+
| `/ollama` | List local Ollama models |
|
|
322
|
+
| `/commit-push-pr` | Commit + push + create PR |
|
|
323
|
+
| `/code-review` | Multi-agent code review |
|
|
324
|
+
| `/spec [cmd]` | Spec-driven development |
|
|
325
|
+
| `/doctor` | Health check |
|
|
326
|
+
| `/export [path]` | Export session as JSON |
|
|
327
|
+
| `/import <path>` | Import session from JSON |
|
|
328
|
+
| `/stats` | Session statistics |
|
|
329
|
+
|
|
330
|
+
## Project Structure
|
|
331
|
+
|
|
332
|
+
```
|
|
333
|
+
src/
|
|
334
|
+
├── index.ts CLI entry point (v4.0)
|
|
335
|
+
├── core/
|
|
336
|
+
│ ├── engine.ts NeuroEngine v4.0 (all systems)
|
|
337
|
+
│ ├── types.ts Shared interfaces
|
|
338
|
+
│ ├── sub-agent.ts Sub-agent spawning (GAP-27)
|
|
339
|
+
│ ├── acp.ts Agent Client Protocol (GAP-28)
|
|
340
|
+
│ ├── os-sandbox.ts OS-level sandboxing (GAP-29)
|
|
341
|
+
│ ├── spec-driven.ts Spec-driven development (GAP-30)
|
|
342
|
+
│ ├── multi-model.ts Multi-model orchestrator (GAP-33)
|
|
343
|
+
│ ├── smart-monitor.ts Smart auto monitor (GAP-34)
|
|
344
|
+
│ ├── outcome-grading.ts Rubric-based grading (GAP-35)
|
|
345
|
+
│ ├── observability.ts OpenTelemetry integration (GAP-36)
|
|
346
|
+
│ ├── auto-compact.ts Auto context compaction (GAP-37)
|
|
347
|
+
│ ├── terminal-ux.ts Rich terminal UX (GAP-38)
|
|
348
|
+
│ ├── multi-session.ts Multi-session manager (GAP-39)
|
|
349
|
+
│ ├── git-worktree.ts Git worktree integration (GAP-40)
|
|
350
|
+
│ ├── auto-mode.ts Autonomous mode with safety
|
|
351
|
+
│ ├── scheduled-tasks.ts Cron-style task scheduling
|
|
352
|
+
│ ├── parallel-agents.ts Parallel agent execution
|
|
353
|
+
│ ├── background-session.ts Background session management
|
|
354
|
+
│ ├── approval.ts Interactive approval + diff preview
|
|
355
|
+
│ ├── completion.ts Tab completion (35+ commands)
|
|
356
|
+
│ ├── undo-redo.ts Undo/Redo system
|
|
357
|
+
│ ├── prompt-cache.ts SHA-256 prompt caching
|
|
358
|
+
│ ├── model-router.ts Auto model routing + effort levels
|
|
359
|
+
│ ├── output-styles.ts 8 output style presets
|
|
360
|
+
│ ├── extended-thinking.ts Thinking mode support
|
|
361
|
+
│ ├── spending-warnings.ts Spending monitor + limits
|
|
362
|
+
│ ├── shell-completion.ts bash/zsh/fish completion
|
|
363
|
+
│ ├── diff-preview.ts Diff preview UI
|
|
364
|
+
│ ├── doom-loop.ts Doom loop protection
|
|
365
|
+
│ ├── fallback.ts Fallback model chain
|
|
366
|
+
│ ├── headless.ts Headless/CI mode
|
|
367
|
+
│ ├── context.ts Context window manager
|
|
368
|
+
│ ├── session.ts Session persistence
|
|
369
|
+
│ ├── sandbox.ts Basic sandbox mode
|
|
370
|
+
│ ├── plugin-sdk.ts Plugin/custom tools SDK
|
|
371
|
+
│ ├── plugin-bundle.ts Plugin bundle system
|
|
372
|
+
│ ├── code-review.ts Pattern-based code review
|
|
373
|
+
│ ├── security-scanner.ts 200+ security rules
|
|
374
|
+
│ ├── linting.ts Linting integration
|
|
375
|
+
│ ├── testing.ts Testing integration
|
|
376
|
+
│ ├── cicd.ts CI/CD integration
|
|
377
|
+
│ ├── telemetry.ts Usage telemetry
|
|
378
|
+
│ ├── vim-mode.ts Vim keybindings
|
|
379
|
+
│ ├── i18n.ts Internationalization
|
|
380
|
+
│ ├── multimodal.ts Image/vision support
|
|
381
|
+
│ ├── voice.ts Voice I/O (TTS/STT)
|
|
382
|
+
│ ├── api-server.ts HTTP + WebSocket API
|
|
383
|
+
│ ├── cloud-sync.ts GitHub Gist sync
|
|
384
|
+
│ └── web-dashboard.ts Real-time web dashboard
|
|
385
|
+
├── api/
|
|
386
|
+
│ ├── models.ts 36 model registry (23 free)
|
|
387
|
+
│ ├── openrouter.ts OpenRouter client + streaming
|
|
388
|
+
│ └── ollama.ts Ollama local model provider
|
|
389
|
+
├── agents/
|
|
390
|
+
│ ├── base.ts BaseAgent (tool loop)
|
|
391
|
+
│ ├── orchestrator.ts Multi-agent orchestrator
|
|
392
|
+
│ └── team.ts Inter-agent messaging
|
|
393
|
+
├── mcp/
|
|
394
|
+
│ ├── client.ts MCP client (stdio/SSE/HTTP)
|
|
395
|
+
│ └── mcp-apps.ts MCP Apps interactive UI (GAP-32)
|
|
396
|
+
├── hooks/
|
|
397
|
+
│ ├── hooks.ts 20 lifecycle events
|
|
398
|
+
│ └── llm-evaluator.ts LLM evaluator hooks (GAP-31)
|
|
399
|
+
├── tools/
|
|
400
|
+
│ ├── file.ts 7 file tools
|
|
401
|
+
│ ├── bash.ts Shell command tools
|
|
402
|
+
│ ├── web.ts Web search & fetch
|
|
403
|
+
│ ├── browser.ts CDP browser automation
|
|
404
|
+
│ ├── github.ts GitHub PR/Issue/Repo
|
|
405
|
+
│ ├── memory.ts Memory & project context
|
|
406
|
+
│ ├── extended.ts Todo, AskUser, Monitor
|
|
407
|
+
│ ├── registry.ts Tool registry
|
|
408
|
+
│ └── index.ts Tool registration hub
|
|
409
|
+
├── context/
|
|
410
|
+
│ ├── compaction.ts 5-layer context compaction
|
|
411
|
+
│ ├── skill-system.ts 8 built-in skills
|
|
412
|
+
│ ├── skill-standard.ts SKILL.md standard (agentskills.io)
|
|
413
|
+
│ ├── custom-agents.ts .neuro/agents/ loader
|
|
414
|
+
│ ├── custom-tools.ts .neuro/tools/ loader
|
|
415
|
+
│ ├── git-checkpoint.ts Auto-commit & checkpoint
|
|
416
|
+
│ ├── neuro-md.ts NEURO.md project context
|
|
417
|
+
│ ├── neuroignore.ts .neuroignore support
|
|
418
|
+
│ ├── repo-map.ts Code map generator
|
|
419
|
+
│ └── tree-sitter.ts Symbol extraction (regex-based)
|
|
420
|
+
├── config/
|
|
421
|
+
│ └── config.ts Configuration system
|
|
422
|
+
├── ui/
|
|
423
|
+
│ ├── renderer.ts Terminal UI + streaming
|
|
424
|
+
│ └── theme.ts 4 themes (Dracula, Dark, Nord, Light)
|
|
425
|
+
├── commands/
|
|
426
|
+
│ └── commands.ts 25+ slash commands
|
|
427
|
+
├── lsp/
|
|
428
|
+
│ └── lsp-manager.ts LSP integration
|
|
429
|
+
└── advisor/
|
|
430
|
+
└── advisor.ts Second-model advisor
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## Configuration
|
|
434
|
+
|
|
435
|
+
### Global Config (`~/.neuro/config.json`)
|
|
436
|
+
|
|
437
|
+
```json
|
|
438
|
+
{
|
|
439
|
+
"apiKey": "sk-or-v1-...",
|
|
440
|
+
"defaultModel": "qwen/qwen3-coder",
|
|
441
|
+
"theme": "dracula",
|
|
442
|
+
"permissionMode": "auto",
|
|
443
|
+
"sandbox": false,
|
|
444
|
+
"observability": {
|
|
445
|
+
"enabled": false,
|
|
446
|
+
"endpoint": "http://localhost:4318/v1/traces"
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
### Project Config (`.neuro/`)
|
|
452
|
+
|
|
453
|
+
```
|
|
454
|
+
.neuro/
|
|
455
|
+
├── NEURO.md # Project context & instructions
|
|
456
|
+
├── .neuroignore # gitignore-style exclusion patterns
|
|
457
|
+
├── agents/ # Custom agent definitions (YAML frontmatter)
|
|
458
|
+
│ └── reviewer.md # Agent with scoped tools
|
|
459
|
+
├── tools/ # Custom tool definitions (JSON)
|
|
460
|
+
│ └── deploy.json # Custom deploy tool
|
|
461
|
+
├── skills/ # SKILL.md standard skills
|
|
462
|
+
│ └── react/
|
|
463
|
+
│ └── SKILL.md # React development skill
|
|
464
|
+
├── hooks/ # LLM evaluator hooks (YAML)
|
|
465
|
+
│ └── security.yml # Security check before writes
|
|
466
|
+
├── specs/ # Spec-driven development artifacts
|
|
467
|
+
│ └── spec-001.md # Requirements → design → plan
|
|
468
|
+
└── rubrics/ # Outcome grading rubrics (JSON)
|
|
469
|
+
└── quality.json # Code quality rubric
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
## Comparison with Alternatives
|
|
473
|
+
|
|
474
|
+
| Feature | NeuroCLI | Claude Code | Codex CLI | Gemini CLI | Aider |
|
|
475
|
+
|---------|----------|-------------|-----------|------------|-------|
|
|
476
|
+
| Free Models | 23 | 0 | 0 | 1 | 0 |
|
|
477
|
+
| Sub-Agent Spawning | ✅ | ✅ | ⚠️ | ❌ | ❌ |
|
|
478
|
+
| ACP Protocol | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
479
|
+
| OS-Level Sandbox | ✅ | ❌ | ✅ | ❌ | ❌ |
|
|
480
|
+
| Spec-Driven Dev | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
481
|
+
| LLM Evaluator Hooks | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
482
|
+
| MCP Apps | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
483
|
+
| Multi-Model Orch. | ✅ | ⚠️ | ❌ | ❌ | ✅ |
|
|
484
|
+
| Smart Monitor | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
485
|
+
| Outcome Grading | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
486
|
+
| OpenTelemetry | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
487
|
+
| Auto-Compact | ✅ | ❌ | ❌ | ✅ | ❌ |
|
|
488
|
+
| Git Worktree | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
489
|
+
| Local Models (Ollama) | ✅ | ❌ | ❌ | ❌ | ✅ |
|
|
490
|
+
| Browser Automation | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
491
|
+
| GitHub Integration | ✅ | ⚠️ | ⚠️ | ❌ | ❌ |
|
|
492
|
+
| Security Scanner | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
493
|
+
| CI/CD Integration | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
494
|
+
| Voice I/O | ✅ | ❌ | ❌ | ❌ | ✅ |
|
|
495
|
+
| Vim Mode | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
496
|
+
|
|
497
|
+
## Tech Stack
|
|
498
|
+
|
|
499
|
+
- **TypeScript 5.9** + Node.js ESM
|
|
500
|
+
- **Commander.js** — CLI framework
|
|
501
|
+
- **Chalk** — Terminal styling
|
|
502
|
+
- **OpenRouter API** — 23 free + 13 premium models
|
|
503
|
+
- **Ollama API** — Local model support
|
|
504
|
+
- **CDP** — Chrome DevTools Protocol for browser automation
|
|
505
|
+
- **JSON-RPC 2.0** — ACP protocol
|
|
506
|
+
- **OTLP JSON** — OpenTelemetry export
|
|
507
|
+
|
|
508
|
+
## License
|
|
509
|
+
|
|
510
|
+
MIT
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { OpenRouterClient, TokenUsage } from '../api/openrouter.js';
|
|
2
|
+
import { Message } from '../core/types.js';
|
|
3
|
+
export interface AdvisorConfig {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
model: string;
|
|
6
|
+
consultOn: AdvisorTrigger[];
|
|
7
|
+
maxConsultations: number;
|
|
8
|
+
}
|
|
9
|
+
export type AdvisorTrigger = 'before_approach' | 'recurring_error' | 'before_complete' | 'complex_decision' | 'security_sensitive' | 'manual';
|
|
10
|
+
export interface AdvisorResult {
|
|
11
|
+
advice: string;
|
|
12
|
+
shouldProceed: boolean;
|
|
13
|
+
suggestedChanges?: string;
|
|
14
|
+
usage: TokenUsage;
|
|
15
|
+
}
|
|
16
|
+
export declare class AdvisorSystem {
|
|
17
|
+
private client;
|
|
18
|
+
private config;
|
|
19
|
+
private consultationCount;
|
|
20
|
+
private recentErrors;
|
|
21
|
+
constructor(client: OpenRouterClient, config?: Partial<AdvisorConfig>);
|
|
22
|
+
/**
|
|
23
|
+
* Check if advisor should be consulted for a given trigger
|
|
24
|
+
*/
|
|
25
|
+
shouldConsult(trigger: AdvisorTrigger): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Consult the advisor model
|
|
28
|
+
*/
|
|
29
|
+
consult(conversation: Message[], trigger: AdvisorTrigger, currentAction: string, context?: string): Promise<AdvisorResult>;
|
|
30
|
+
/**
|
|
31
|
+
* Track errors for recurring error detection
|
|
32
|
+
*/
|
|
33
|
+
trackError(error: string): void;
|
|
34
|
+
/**
|
|
35
|
+
* Check if an error is recurring
|
|
36
|
+
*/
|
|
37
|
+
isRecurringError(error: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get consultation count
|
|
40
|
+
*/
|
|
41
|
+
getConsultationCount(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Reset for new task
|
|
44
|
+
*/
|
|
45
|
+
reset(): void;
|
|
46
|
+
private summarizeConversation;
|
|
47
|
+
private extractSuggestions;
|
|
48
|
+
private computeSimilarity;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=advisor.d.ts.map
|