nex-code 0.3.14 → 0.3.19

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 (3) hide show
  1. package/README.md +47 -4
  2. package/dist/nex-code.js +372 -298
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
  <img src="https://img.shields.io/badge/Ollama_Cloud-supported-brightgreen.svg" alt="Ollama Cloud: supported">
23
23
  <img src="https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg" alt="Node >= 18">
24
24
  <img src="https://img.shields.io/badge/dependencies-2-green.svg" alt="Dependencies: 2">
25
- <img src="https://img.shields.io/badge/tests-1752-blue.svg" alt="Tests: 1752">
25
+ <img src="https://img.shields.io/badge/tests-1825-blue.svg" alt="Tests: 1825">
26
26
  </p>
27
27
 
28
28
  ---
@@ -78,10 +78,13 @@ npm update -g nex-code
78
78
  | **Undo / Redo** | ✅ | ❌ | ❌ | ❌ |
79
79
  | **Cost tracking + budgets** | ✅ | ❌ | ❌ | ❌ |
80
80
  | **Pre-push secret detection** | ✅ | ❌ | ❌ | ❌ |
81
+ | **Browser agent (headless)** | ✅ Playwright-based | ❌ | ⚠️ Experimental | ❌ |
82
+ | **Grounded web search** | ✅ Perplexity/DDG | ❌ | ✅ Google grounded | ❌ |
83
+ | **GitHub Actions tools** | ✅ native | ❌ | ❌ | ❌ |
81
84
  | **Open-source** | ✅ MIT | ❌ | ✅ Apache 2.0 | ✅ |
82
85
  | **Runtime dependencies** | **2** (axios, dotenv) | Many | Many | Heavy (Python) |
83
86
  | **Startup time** | **~100ms** | ~400ms | ~300ms | Slow |
84
- | **Test coverage** | 1752 tests, 85% | — | — | — |
87
+ | **Test coverage** | 1825 tests, 84% | — | — | — |
85
88
 
86
89
  ---
87
90
 
@@ -142,6 +145,7 @@ OLLAMA_API_KEY=your-key # Ollama Cloud (Qwen3 Coder, Qwen3.5, DeepSeek R1,
142
145
  OPENAI_API_KEY=your-key # OpenAI (GPT-4o, GPT-4.1, o1, o3, o4-mini)
143
146
  ANTHROPIC_API_KEY=your-key # Anthropic (Claude Sonnet 4.6, Opus 4.6, Haiku 4.5)
144
147
  GEMINI_API_KEY=your-key # Google Gemini (3.1 Pro Preview, 2.5 Pro/Flash, 2.0 Flash)
148
+ PERPLEXITY_API_KEY=your-key # Perplexity (optional — enables grounded web search)
145
149
  # No key needed for local Ollama — just have it running
146
150
  ```
147
151
 
@@ -225,6 +229,36 @@ Supported formats: PNG, JPG, GIF, WebP, BMP. Works with Anthropic, OpenAI, Gemin
225
229
 
226
230
  Skip all confirmation prompts — file changes, dangerous commands, and tool permissions are auto-approved. The banner shows a `⚡ YOLO` indicator. Toggle at runtime with `/autoconfirm`.
227
231
 
232
+ ### Headless / Programmatic Mode
233
+
234
+ Run nex-code non-interactively from scripts, CI pipelines, or other processes:
235
+
236
+ ```bash
237
+ # Inline prompt
238
+ nex-code --task "refactor src/index.js to use async/await" --yolo
239
+
240
+ # Prompt from file (avoids shell-escaping issues with special characters)
241
+ nex-code --prompt-file /tmp/task.txt --yolo
242
+
243
+ # Delete the file after reading
244
+ nex-code --prompt-file /tmp/task.txt --delete-prompt-file --yolo
245
+
246
+ # JSON output for programmatic parsing
247
+ nex-code --prompt-file /tmp/task.txt --yolo --json
248
+ # → {"success":true,"response":"..."}
249
+ ```
250
+
251
+ | Flag | Description |
252
+ |------|-------------|
253
+ | `--task <prompt>` | Run a single prompt and exit |
254
+ | `--prompt-file <path>` | Read prompt from a UTF-8 file and run headless |
255
+ | `--delete-prompt-file` | Delete the prompt file after reading (use with `--prompt-file`) |
256
+ | `--auto` | Skip confirmations (non-interactive, no REPL banner) |
257
+ | `--yolo` | Skip all confirmations including dangerous commands |
258
+ | `--json` | Output `{"success":true,"response":"..."}` to stdout |
259
+ | `--max-turns <n>` | Override the agentic loop iteration limit |
260
+ | `--model <spec>` | Use a specific model (e.g. `anthropic:claude-sonnet-4-6`) |
261
+
228
262
  ---
229
263
 
230
264
  ## Providers & Models
@@ -317,13 +351,22 @@ The agent has 17 built-in tools:
317
351
  | `git_diff` | Git diff with optional path filter |
318
352
  | `git_log` | Git commit history with configurable count |
319
353
  | `web_fetch` | Fetch content from a URL |
320
- | `web_search` | Search the web via DuckDuckGo |
354
+ | `web_search` | Grounded search via Perplexity (if `PERPLEXITY_API_KEY` set) or DuckDuckGo |
321
355
  | `ask_user` | Ask the user a question and wait for input |
322
356
  | `task_list` | Create and manage task lists for multi-step operations |
323
357
  | `spawn_agents` | Run parallel sub-agents with auto model routing |
358
+ | `browser_open` | Open URL in headless browser, return text + links (JS-heavy pages) |
359
+ | `browser_screenshot` | Screenshot a URL → saved file + vision-ready path |
360
+ | `browser_click` | Click element by CSS selector or visible text |
361
+ | `browser_fill` | Fill form field and optionally submit |
362
+ | `gh_run_list` | List GitHub Actions workflow runs |
363
+ | `gh_run_view` | View run details and step logs |
364
+ | `gh_workflow_trigger` | Trigger a workflow dispatch event |
324
365
 
325
366
  **Interactive commands** (vim, top, htop, ssh, tmux, fzf, etc.) are automatically detected and spawned with full TTY passthrough — no separate handling required.
326
367
 
368
+ **Browser tools** require Playwright (`npm install playwright && npx playwright install chromium`). nex-code works without it — browser tools return a helpful install message if missing.
369
+
327
370
  Additional tools can be added via [MCP servers](#mcp) or [Skills](#skills).
328
371
 
329
372
  ---
@@ -782,7 +825,7 @@ npm test # Run all tests with coverage
782
825
  npm run test:watch # Watch mode
783
826
  ```
784
827
 
785
- 44 test suites, 1752 tests, 85% statement / 79% branch coverage.
828
+ 47 test suites, 1825 tests, 84% statement / 77% branch coverage.
786
829
 
787
830
  CI runs on GitHub Actions (Node 18/20/22).
788
831