nex-code 0.3.40 → 0.3.41
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/README.md +53 -19
- package/dist/nex-code.js +439 -405
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
```
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
██║╚██╗██║██╔══╝ ██╔██╗ ━ ██║ ██║ ██║██║ ██║██╔══╝
|
|
6
|
-
██║ ╚████║███████╗██╔╝ ██╗ ━ ╚██████╗╚██████╔╝██████╔╝███████╗
|
|
7
|
-
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ━ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝
|
|
2
|
+
▀▄ ▀▄ nex-code v0.3.x
|
|
3
|
+
█████ qwen3-coder:480b · /help
|
|
4
|
+
▄███▄
|
|
8
5
|
```
|
|
9
6
|
|
|
10
7
|
<p align="center">
|
|
@@ -22,7 +19,7 @@
|
|
|
22
19
|
<img src="https://img.shields.io/badge/Ollama_Cloud-supported-brightgreen.svg" alt="Ollama Cloud: supported">
|
|
23
20
|
<img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg" alt="Node >= 18">
|
|
24
21
|
<img src="https://img.shields.io/badge/dependencies-2-green.svg" alt="Dependencies: 2">
|
|
25
|
-
<img src="https://img.shields.io/badge/tests-
|
|
22
|
+
<img src="https://img.shields.io/badge/tests-2059-blue.svg" alt="Tests: 2059">
|
|
26
23
|
</p>
|
|
27
24
|
|
|
28
25
|
---
|
|
@@ -87,7 +84,7 @@ npm update -g nex-code
|
|
|
87
84
|
| **Open-source** | ✅ MIT | ❌ | ✅ Apache 2.0 | ✅ |
|
|
88
85
|
| **Runtime dependencies** | **2** (axios, dotenv) | Many | Many | Heavy (Python) |
|
|
89
86
|
| **Startup time** | **~100ms** | ~400ms | ~300ms | Slow |
|
|
90
|
-
| **Test coverage** |
|
|
87
|
+
| **Test coverage** | 2059 tests, 84% | — | — | — |
|
|
91
88
|
|
|
92
89
|
---
|
|
93
90
|
|
|
@@ -158,6 +155,7 @@ FALLBACK_CHAIN=anthropic,openai # Providers tried on failure (comma-separated)
|
|
|
158
155
|
NEX_STALE_WARN_MS=60000 # Warn if no tokens received for N ms (default: 60000)
|
|
159
156
|
NEX_STALE_ABORT_MS=120000 # Abort and retry stream after N ms of silence (default: 120000)
|
|
160
157
|
NEX_LANGUAGE=auto # Response language: "auto" (mirrors user's language, default) or e.g. "English", "Deutsch"
|
|
158
|
+
FOOTER_DEBUG=1 # Write terminal layout debug log to /tmp/footer-debug.log
|
|
161
159
|
```
|
|
162
160
|
|
|
163
161
|
### Verify
|
|
@@ -338,6 +336,7 @@ Type `/` to see inline suggestions as you type. Tab completion is supported for
|
|
|
338
336
|
| `/allow <tool>` | Auto-allow a tool |
|
|
339
337
|
| `/deny <tool>` | Block a tool |
|
|
340
338
|
| `/plan [task]` | Plan mode (analyze before executing) |
|
|
339
|
+
| `/plan edit` | Open current plan in `$EDITOR` for review/modification |
|
|
341
340
|
| `/plans` | List saved plans |
|
|
342
341
|
| `/auto [level]` | Set autonomy: interactive/semi-auto/autonomous |
|
|
343
342
|
| `/commit [msg]` | Smart commit (analyze diff, suggest message) |
|
|
@@ -346,11 +345,15 @@ Type `/` to see inline suggestions as you type. Tab completion is supported for
|
|
|
346
345
|
| `/mcp` | MCP servers and tools |
|
|
347
346
|
| `/hooks` | Show configured hooks |
|
|
348
347
|
| `/skills` | List, enable, disable skills |
|
|
348
|
+
| `/tree [depth]` | Show project file tree (default depth 3) |
|
|
349
349
|
| `/undo` | Undo last file change |
|
|
350
350
|
| `/redo` | Redo last undone change |
|
|
351
351
|
| `/history` | Show file change history |
|
|
352
|
+
| `/snapshot [name]` | Create a named git snapshot of current changes |
|
|
353
|
+
| `/restore [name\|last]` | Restore a previously created snapshot |
|
|
352
354
|
| `/review [--strict] [file]` | Deep code review: 3-phase protocol (broad scan → grep deep-dive → report), score table, diff fix snippets. `--strict` forces ≥3 critical findings. |
|
|
353
355
|
| `/k8s [user@host]` | Kubernetes overview: namespaces + pod health (remote via SSH optional) |
|
|
356
|
+
| `/setup` | Interactive setup wizard — configure provider, API keys, web search |
|
|
354
357
|
| `/exit` | Quit |
|
|
355
358
|
|
|
356
359
|
---
|
|
@@ -525,9 +528,9 @@ deploy the latest build to prod
|
|
|
525
528
|
## Features
|
|
526
529
|
|
|
527
530
|
### Compact Output
|
|
528
|
-
The agent loop uses a
|
|
531
|
+
The agent loop uses a bouncing-ball spinner (`● · · · ·` → `· ● · · ·` → …) during tool execution, then prints compact 1-line summaries:
|
|
529
532
|
```
|
|
530
|
-
|
|
533
|
+
● ▸ 3 tools: read_file, grep, edit_file
|
|
531
534
|
✓ read_file src/app.js (45 lines)
|
|
532
535
|
✓ grep TODO → 12 matches
|
|
533
536
|
✗ edit_file src/x.js → old_text not found
|
|
@@ -555,7 +558,7 @@ The system prompt enforces substantive responses: the model always presents find
|
|
|
555
558
|
- **In-Memory Indexing**: A background indexing engine (using `ripgrep` or a fast fallback) keeps project file paths in RAM for instant file discovery, path auto-fixing, and glob searches.
|
|
556
559
|
|
|
557
560
|
### Streaming Output
|
|
558
|
-
Tokens appear live as the model generates them.
|
|
561
|
+
Tokens appear live as the model generates them. Bouncing-ball spinner during connection, then real-time line-by-line rendering via `StreamRenderer` with markdown formatting and syntax highlighting (JS, TS, Python, Go, Rust, CSS, HTML, and more).
|
|
559
562
|
|
|
560
563
|
### Paste Detection
|
|
561
564
|
Automatic bracketed paste mode: pasting multi-line text into the prompt is detected and combined into a single input. A `[Pasted content — N lines]` indicator is shown with a preview of the first line. The user must press Enter to send — pasted content never auto-fires. The paste handler stores the combined text and waits for explicit submission.
|
|
@@ -635,12 +638,35 @@ The agent uses the `brain_write` tool to save discoveries automatically. All wri
|
|
|
635
638
|
### Plan Mode
|
|
636
639
|
Analyze before executing — the agent explores the codebase with read-only tools, produces a structured plan, then you approve before any changes are made:
|
|
637
640
|
```
|
|
638
|
-
/plan refactor the auth module # enter plan mode
|
|
639
|
-
/plan status # show
|
|
641
|
+
/plan refactor the auth module # enter plan mode with optional task
|
|
642
|
+
/plan status # show extracted steps with status icons
|
|
643
|
+
/plan edit # open plan in $EDITOR (nano/vim/code) to modify
|
|
640
644
|
/plan approve # approve and exit plan mode (all tools re-enabled)
|
|
641
645
|
/auto semi-auto # set autonomy level
|
|
642
646
|
```
|
|
643
|
-
Plan mode is **hard-enforced**: only read-only tools (`read_file`, `list_directory`, `search_files`, `glob`, `grep`, `web_search`, `web_fetch`, `git_status`, `git_diff`, `git_log`, `git_show`, `ask_user`) are available. Any attempt to call a write tool is blocked at the API level
|
|
647
|
+
Plan mode is **hard-enforced**: only read-only tools (`read_file`, `list_directory`, `search_files`, `glob`, `grep`, `web_search`, `web_fetch`, `git_status`, `git_diff`, `git_log`, `git_show`, `ask_user`) are available. Any attempt to call a write tool is blocked at the API level.
|
|
648
|
+
|
|
649
|
+
**Step extraction**: when the LLM outputs a numbered plan, steps are automatically parsed into a structured list. During execution the spinner shows `Plan step 2/4: Implement tests` and `/plan status` shows per-step progress (○ pending → → in progress → ✓ done). The plan text is saved to `.nex/plans/current-plan.md`.
|
|
650
|
+
|
|
651
|
+
### Snapshots
|
|
652
|
+
Named git snapshots — save and restore working-tree state at any point:
|
|
653
|
+
```
|
|
654
|
+
/snapshot before-refactor # create snapshot named "before-refactor"
|
|
655
|
+
/snapshot list # list all saved snapshots
|
|
656
|
+
/restore last # restore most recent snapshot
|
|
657
|
+
/restore before-refactor # restore by name
|
|
658
|
+
/restore list # show all available snapshots
|
|
659
|
+
```
|
|
660
|
+
Snapshots use `git stash` internally — no extra state files. The working tree is restored immediately after stashing so your changes are preserved. Use `/restore` when you want to roll back to a known-good state.
|
|
661
|
+
|
|
662
|
+
### File Tree
|
|
663
|
+
Visualize the project structure:
|
|
664
|
+
```
|
|
665
|
+
/tree # show tree at depth 3
|
|
666
|
+
/tree 2 # shallower view
|
|
667
|
+
/tree 5 # deeper view (max 8)
|
|
668
|
+
```
|
|
669
|
+
Automatically excludes `node_modules`, `.git`, `dist`, `build`, `coverage`, and all entries listed in `.gitignore`. Directories are sorted before files.
|
|
644
670
|
|
|
645
671
|
### Undo / Redo
|
|
646
672
|
In-session undo/redo for all file changes (write, edit, patch):
|
|
@@ -651,6 +677,11 @@ In-session undo/redo for all file changes (write, edit, patch):
|
|
|
651
677
|
```
|
|
652
678
|
Undo stack holds up to 50 changes. `/clear` resets the history.
|
|
653
679
|
|
|
680
|
+
> **Snapshots vs Undo**: `/undo` operates on the in-memory change stack for fine-grained per-file rollback within a session. `/snapshot` + `/restore` use git stash for broader checkpoints across multiple files or sessions.
|
|
681
|
+
|
|
682
|
+
### Desktop Notifications
|
|
683
|
+
On macOS, nex-code fires a system notification when a task completes after ≥ 30 seconds — useful when running long autonomous tasks in the background. No configuration needed; requires macOS Notification Center access.
|
|
684
|
+
|
|
654
685
|
### Task Management
|
|
655
686
|
Create structured task lists for complex multi-step operations:
|
|
656
687
|
```
|
|
@@ -668,7 +699,7 @@ When the agent creates a task list, a **live animated display** replaces the sta
|
|
|
668
699
|
◻ Update cli/index.js
|
|
669
700
|
◻ Run tests
|
|
670
701
|
```
|
|
671
|
-
-
|
|
702
|
+
- Bouncing-ball spinner (`●` ping-pong across 5 positions) with elapsed time display
|
|
672
703
|
- Per-task status icons: `✔` done, `◼` in progress, `◻` pending, `✗` failed
|
|
673
704
|
- Automatically pauses during text streaming and resumes during tool execution
|
|
674
705
|
- Falls back to the static `/tasks` view when no live display is active
|
|
@@ -897,24 +928,25 @@ cli/
|
|
|
897
928
|
├── skills.js # Skills system (prompt + script skills)
|
|
898
929
|
├── mcp.js # MCP client (JSON-RPC over stdio)
|
|
899
930
|
├── hooks.js # Hook system (pre/post events)
|
|
900
|
-
├── context.js # Auto-context (package.json, git, README)
|
|
931
|
+
├── context.js # Auto-context (package.json, git, README) + generateFileTree()
|
|
901
932
|
├── context-engine.js # Token management + context compression
|
|
902
933
|
├── session.js # Session persistence (.nex/sessions/)
|
|
903
934
|
├── memory.js # Project memory (.nex/memory/ + NEX.md)
|
|
904
935
|
├── permissions.js # Tool permission system
|
|
905
|
-
├── planner.js # Plan mode
|
|
936
|
+
├── planner.js # Plan mode, step extraction, step cursor, autonomy levels
|
|
906
937
|
├── git.js # Git intelligence (commit, diff, branch)
|
|
907
938
|
├── render.js # Markdown + syntax highlighting + StreamRenderer + EPIPE guard
|
|
908
939
|
├── format.js # Tool call formatting, result formatting, compact summaries
|
|
909
940
|
├── spinner.js # Spinner, MultiProgress, TaskProgress display components
|
|
910
941
|
├── diff.js # LCS diff (Myers + Hirschberg) + colored output + side-by-side view
|
|
911
942
|
├── fuzzy-match.js # Fuzzy text matching for edit auto-fix (Levenshtein, whitespace normalization)
|
|
912
|
-
├── file-history.js # In-session undo/redo
|
|
943
|
+
├── file-history.js # In-session undo/redo + named git snapshots
|
|
913
944
|
├── picker.js # Interactive terminal picker (model selection)
|
|
914
945
|
├── costs.js # Token cost tracking + per-provider budget limits
|
|
915
946
|
├── safety.js # Forbidden/dangerous pattern detection
|
|
916
947
|
├── tool-validator.js # Tool argument validation + auto-correction
|
|
917
948
|
├── tool-tiers.js # Dynamic tool set selection per model + model tier lookup
|
|
949
|
+
├── footer.js # Sticky footer (scroll region, status bar, input row, resize, FOOTER_DEBUG)
|
|
918
950
|
├── ui.js # ANSI colors, banner + re-exports from format.js/spinner.js
|
|
919
951
|
├── index-engine.js # In-memory file index (ripgrep/fallback)
|
|
920
952
|
├── auto-fix.js # Path resolution, edit matching, bash error hints
|
|
@@ -994,7 +1026,7 @@ npm test # Run all tests with coverage
|
|
|
994
1026
|
npm run test:watch # Watch mode
|
|
995
1027
|
```
|
|
996
1028
|
|
|
997
|
-
|
|
1029
|
+
57 test suites, 2059 tests, 84% statement / 77% branch coverage.
|
|
998
1030
|
|
|
999
1031
|
CI runs on GitHub Actions (Node 18/20/22).
|
|
1000
1032
|
|
|
@@ -1020,6 +1052,8 @@ npm install -g nex-code # global install
|
|
|
1020
1052
|
npx nex-code # or run without installing
|
|
1021
1053
|
```
|
|
1022
1054
|
|
|
1055
|
+
On first launch with no API keys configured, nex-code starts an **interactive setup wizard** that guides you through choosing a provider and entering credentials. You can re-run it anytime with `/setup`.
|
|
1056
|
+
|
|
1023
1057
|
## Roadmap
|
|
1024
1058
|
|
|
1025
1059
|
See [ROADMAP.md](ROADMAP.md) for planned features — VS Code extension, browser agent, PTY support, and more.
|