@nerviq/cli 1.12.0 → 1.13.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/README.md +224 -210
- package/bin/cli.js +2 -1
- package/package.json +3 -2
- package/src/aider/freshness.js +65 -20
- package/src/audit/instruction-files.js +180 -0
- package/src/audit/recommendations.js +531 -0
- package/src/audit.js +19 -722
- package/src/codex/freshness.js +84 -25
- package/src/copilot/freshness.js +57 -20
- package/src/cursor/freshness.js +65 -20
- package/src/freshness.js +74 -21
- package/src/gemini/freshness.js +66 -21
- package/src/mcp-server.js +95 -59
- package/src/opencode/freshness.js +66 -21
- package/src/setup/analysis.js +619 -0
- package/src/setup/runtime.js +172 -0
- package/src/setup.js +28 -748
- package/src/windsurf/freshness.js +36 -21
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@nerviq/cli)
|
|
6
6
|
[](LICENSE)
|
|
7
|
-
[](https://github.com/nerviq/nerviq)
|
|
7
|
+
[](https://github.com/nerviq/nerviq)
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -64,32 +64,32 @@ Nerviq scores your AI coding agent setup from 0 to 100, finds what's missing, an
|
|
|
64
64
|
Next: nerviq setup
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
## Quick Start
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npx @nerviq/cli --beginner # Show only the 5 starter commands
|
|
71
|
-
npx @nerviq/cli audit # Quick scan: score + top 3 actions
|
|
72
|
-
npx @nerviq/cli audit --full # Full audit with all checks + badge
|
|
73
|
-
npx @nerviq/cli audit --snapshot --tag "pre-refactor" # Save a named snapshot for history/compare/trend
|
|
74
|
-
npx @nerviq/cli audit --diff-only # PR/working-tree audit: changed files + linked governance/config surfaces only
|
|
75
|
-
npx @nerviq/cli compare # Detailed per-check diff between latest 2 audit snapshots
|
|
76
|
-
npx @nerviq/cli audit --webhook https://hooks.slack.com/services/... # Push audit results to Slack/Discord/generic HTTP
|
|
77
|
-
npx @nerviq/cli audit --workspace packages/* # Monorepo: root governance + stack-specific workspace profiles
|
|
78
|
-
npx @nerviq/cli setup # Generate starter-safe baseline
|
|
79
|
-
npx @nerviq/cli augment # Improvement plan, no writes
|
|
80
|
-
npx @nerviq/cli governance # Permission profiles + policy packs
|
|
81
|
-
npx @nerviq/cli benchmark # Baseline vs projected score in isolated copy
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
No install required. Zero dependencies.
|
|
85
|
-
|
|
86
|
-
Text-mode CLI output explains terms like `MCP`, `hooks`, `deny rules`, and `governance` inline when they appear, so a first audit is easier to read.
|
|
87
|
-
|
|
88
|
-
If you want the shortest possible command list inside the terminal, start with:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
npx @nerviq/cli --beginner
|
|
92
|
-
```
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npx @nerviq/cli --beginner # Show only the 5 starter commands
|
|
71
|
+
npx @nerviq/cli audit # Quick scan: score + top 3 actions
|
|
72
|
+
npx @nerviq/cli audit --full # Full audit with all checks + badge
|
|
73
|
+
npx @nerviq/cli audit --snapshot --tag "pre-refactor" # Save a named snapshot for history/compare/trend
|
|
74
|
+
npx @nerviq/cli audit --diff-only # PR/working-tree audit: changed files + linked governance/config surfaces only
|
|
75
|
+
npx @nerviq/cli compare # Detailed per-check diff between latest 2 audit snapshots
|
|
76
|
+
npx @nerviq/cli audit --webhook https://hooks.slack.com/services/... # Push audit results to Slack/Discord/generic HTTP
|
|
77
|
+
npx @nerviq/cli audit --workspace packages/* # Monorepo: root governance + stack-specific workspace profiles
|
|
78
|
+
npx @nerviq/cli setup # Generate starter-safe baseline
|
|
79
|
+
npx @nerviq/cli augment # Improvement plan, no writes
|
|
80
|
+
npx @nerviq/cli governance # Permission profiles + policy packs
|
|
81
|
+
npx @nerviq/cli benchmark # Baseline vs projected score in isolated copy
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
No install required. Zero dependencies.
|
|
85
|
+
|
|
86
|
+
Text-mode CLI output explains terms like `MCP`, `hooks`, `deny rules`, and `governance` inline when they appear, so a first audit is easier to read.
|
|
87
|
+
|
|
88
|
+
If you want the shortest possible command list inside the terminal, start with:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx @nerviq/cli --beginner
|
|
92
|
+
```
|
|
93
93
|
|
|
94
94
|
## Get Started by Role
|
|
95
95
|
|
|
@@ -99,7 +99,7 @@ npx @nerviq/cli --beginner
|
|
|
99
99
|
| **Team lead / DevEx** | `nerviq governance` → `nerviq audit --json` | CI threshold + `nerviq watch` |
|
|
100
100
|
| **Enterprise / Platform** | `nerviq harmony-audit` → `nerviq harmony-drift` | Policy packs + `nerviq certify` |
|
|
101
101
|
|
|
102
|
-
## 2,441 Checks Across 96 Categories (8 Platforms × ~300 Governance Rules)
|
|
102
|
+
## 2,441 Checks Across 96 Categories (8 Platforms × ~300 Governance Rules)
|
|
103
103
|
|
|
104
104
|
| Category Group | Checks | Examples |
|
|
105
105
|
|----------------|--------|---------|
|
|
@@ -142,91 +142,105 @@ npx @nerviq/cli synergy-report # Multi-agent synergy analysis
|
|
|
142
142
|
|
|
143
143
|
Synergy evaluates compound audit results, discovers compensation patterns (where one platform covers another's gaps), and ranks recommendations by cross-platform impact.
|
|
144
144
|
|
|
145
|
-
## SDK — `@nerviq/sdk` `BETA`
|
|
146
|
-
|
|
147
|
-
Programmatic access to all Nerviq capabilities:
|
|
148
|
-
|
|
149
|
-
```js
|
|
150
|
-
const { audit, harmonyAudit, detectPlatforms } = require('@nerviq/sdk');
|
|
151
|
-
|
|
152
|
-
async function main() {
|
|
153
|
-
try {
|
|
154
|
-
const result = await audit('.', 'claude');
|
|
155
|
-
console.log(`Score: ${result.score}/100`);
|
|
156
|
-
|
|
157
|
-
const platforms = detectPlatforms('.');
|
|
158
|
-
console.log(`Active platforms: ${platforms.join(', ') || 'none detected'}`);
|
|
159
|
-
|
|
160
|
-
const harmony = await harmonyAudit('.');
|
|
161
|
-
console.log(`Harmony score: ${harmony.harmonyScore}/100`);
|
|
162
|
-
} catch (error) {
|
|
163
|
-
console.error(error instanceof Error ? error.message : 'Unknown SDK error');
|
|
164
|
-
process.exitCode = 1;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
main();
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Stable SDK surfaces: `audit`, `harmonyAudit`, `detectPlatforms`, `getCatalog`
|
|
172
|
-
Experimental SDK surfaces: `synergyReport`, `routeTask`
|
|
173
|
-
|
|
174
|
-
See [sdk/README.md](sdk/README.md) for full JavaScript examples, error handling guidance, and TypeScript usage.
|
|
175
|
-
|
|
176
|
-
## Integration Contract Pack
|
|
177
|
-
|
|
178
|
-
Nerviq publishes a compact integration pack so external systems do not need to scrape CLI text:
|
|
179
|
-
|
|
180
|
-
- OpenAPI 3.1 contract from `nerviq serve` via `GET /api/openapi.json`
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
- a
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
145
|
+
## SDK — `@nerviq/sdk` `BETA`
|
|
146
|
+
|
|
147
|
+
Programmatic access to all Nerviq capabilities:
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
const { audit, harmonyAudit, detectPlatforms } = require('@nerviq/sdk');
|
|
151
|
+
|
|
152
|
+
async function main() {
|
|
153
|
+
try {
|
|
154
|
+
const result = await audit('.', 'claude');
|
|
155
|
+
console.log(`Score: ${result.score}/100`);
|
|
156
|
+
|
|
157
|
+
const platforms = detectPlatforms('.');
|
|
158
|
+
console.log(`Active platforms: ${platforms.join(', ') || 'none detected'}`);
|
|
159
|
+
|
|
160
|
+
const harmony = await harmonyAudit('.');
|
|
161
|
+
console.log(`Harmony score: ${harmony.harmonyScore}/100`);
|
|
162
|
+
} catch (error) {
|
|
163
|
+
console.error(error instanceof Error ? error.message : 'Unknown SDK error');
|
|
164
|
+
process.exitCode = 1;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
main();
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Stable SDK surfaces: `audit`, `harmonyAudit`, `detectPlatforms`, `getCatalog`
|
|
172
|
+
Experimental SDK surfaces: `synergyReport`, `routeTask`
|
|
173
|
+
|
|
174
|
+
See [sdk/README.md](sdk/README.md) for full JavaScript examples, error handling guidance, and TypeScript usage.
|
|
175
|
+
|
|
176
|
+
## Integration Contract Pack
|
|
177
|
+
|
|
178
|
+
Nerviq publishes a compact integration pack so external systems do not need to scrape CLI text:
|
|
179
|
+
|
|
180
|
+
- OpenAPI 3.1 contract from `nerviq serve` via `GET /api/openapi.json`
|
|
181
|
+
- Separate `nerviq-mcp` stdio JSON-RPC 2.0 transport for MCP hosts
|
|
182
|
+
- Generic audit webhook schema at [`contracts/audit-webhook-event.schema.json`](contracts/audit-webhook-event.schema.json)
|
|
183
|
+
- CI reference patterns in [`docs/ci-integration.md`](docs/ci-integration.md)
|
|
184
|
+
- SDK usage guide in [`sdk/README.md`](sdk/README.md)
|
|
185
|
+
- First-tier release gate in [`docs/first-tier-integration-gate.md`](docs/first-tier-integration-gate.md)
|
|
186
|
+
|
|
187
|
+
See [`docs/integration-contracts.md`](docs/integration-contracts.md) for the full pack.
|
|
188
|
+
|
|
189
|
+
## Category Definition Kit
|
|
190
|
+
|
|
191
|
+
Nerviq is positioned as the control plane for AI-enabled development:
|
|
192
|
+
|
|
193
|
+
- a repo-native governance layer for AI coding agents
|
|
194
|
+
- a cross-platform drift detector and operating model
|
|
195
|
+
- not a full SAST scanner, prompt library, or single-vendor IDE plugin
|
|
196
|
+
|
|
197
|
+
See [`docs/category-definition-kit.md`](docs/category-definition-kit.md) for the category language, comparison matrix, operating model, and adoption playbook.
|
|
198
|
+
|
|
199
|
+
## HTTP API — `nerviq serve`
|
|
200
|
+
|
|
201
|
+
Nerviq ships with a built-in local HTTP API for dashboards, wrappers, scripts, and language-neutral integrations:
|
|
201
202
|
|
|
202
203
|
```bash
|
|
203
204
|
npx @nerviq/cli serve --port 3000
|
|
204
205
|
```
|
|
205
206
|
|
|
206
|
-
Endpoints:
|
|
207
|
-
- `GET /api/openapi.json` — Live OpenAPI 3.1 contract for this `serve` instance
|
|
208
|
-
- `GET /api/health` — Server health check
|
|
209
|
-
- `GET /api/catalog` — Full check catalog
|
|
210
|
-
- `GET /api/audit` — Run audit on a directory and platform via query params
|
|
211
|
-
- `GET /api/harmony` — Cross-platform harmony data
|
|
212
|
-
|
|
213
|
-
All successful operational responses are wrapped in a JSON envelope:
|
|
214
|
-
|
|
215
|
-
```json
|
|
216
|
-
{
|
|
217
|
-
"data": {},
|
|
218
|
-
"meta": {
|
|
219
|
-
"version": "1.
|
|
220
|
-
"timestamp": "2026-04-
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
Pull the contract directly into Swagger UI, Postman, or internal tooling:
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
curl http://127.0.0.1:3000/api/openapi.json > nerviq-openapi.json
|
|
229
|
-
```
|
|
207
|
+
Endpoints:
|
|
208
|
+
- `GET /api/openapi.json` — Live OpenAPI 3.1 contract for this `serve` instance
|
|
209
|
+
- `GET /api/health` — Server health check
|
|
210
|
+
- `GET /api/catalog` — Full check catalog
|
|
211
|
+
- `GET /api/audit` — Run audit on a directory and platform via query params
|
|
212
|
+
- `GET /api/harmony` — Cross-platform harmony data
|
|
213
|
+
|
|
214
|
+
All successful operational responses are wrapped in a JSON envelope:
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"data": {},
|
|
219
|
+
"meta": {
|
|
220
|
+
"version": "1.13.0",
|
|
221
|
+
"timestamp": "2026-04-10T12:00:00.000Z"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Pull the contract directly into Swagger UI, Postman, or internal tooling:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
curl http://127.0.0.1:3000/api/openapi.json > nerviq-openapi.json
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
This HTTP surface is separate from the MCP transport. If your host expects Model Context Protocol over stdio, register the `nerviq-mcp` binary instead of pointing it at `nerviq serve`:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"mcpServers": {
|
|
237
|
+
"nerviq": {
|
|
238
|
+
"command": "npx",
|
|
239
|
+
"args": ["-y", "-p", "@nerviq/cli", "nerviq-mcp"]
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
230
244
|
|
|
231
245
|
## Plugin System — `nerviq.config.js`
|
|
232
246
|
|
|
@@ -293,37 +307,37 @@ Levels:
|
|
|
293
307
|
|
|
294
308
|
| Command | What it does |
|
|
295
309
|
|---------|-------------|
|
|
296
|
-
| `nerviq audit` | Score 0-100 — quick scan with top 3 actions and milestone coaching (default) |
|
|
297
|
-
| `nerviq audit --full` | Full audit with all checks, weakest areas, confidence labels, and milestone coaching |
|
|
298
|
-
| `nerviq audit --diff-only` | Analyze only changed files plus linked governance/config surfaces from git diff / working tree |
|
|
299
|
-
| `nerviq fix <key>` | Auto-fix a specific check (shows score impact) |
|
|
300
|
-
| `nerviq fix --all-critical` | Fix all critical issues at once |
|
|
310
|
+
| `nerviq audit` | Score 0-100 — quick scan with top 3 actions and milestone coaching (default) |
|
|
311
|
+
| `nerviq audit --full` | Full audit with all checks, weakest areas, confidence labels, and milestone coaching |
|
|
312
|
+
| `nerviq audit --diff-only` | Analyze only changed files plus linked governance/config surfaces from git diff / working tree |
|
|
313
|
+
| `nerviq fix <key>` | Auto-fix a specific check (shows score impact) |
|
|
314
|
+
| `nerviq fix --all-critical` | Fix all critical issues at once |
|
|
301
315
|
| `nerviq rollback` | Undo the most recent apply (delete created files) |
|
|
302
316
|
| `nerviq rollback --list` | Show available rollback points |
|
|
303
|
-
| `nerviq setup` | Generate starter-safe CLAUDE.md + hooks + commands |
|
|
304
|
-
| `nerviq augment` | Repo-aware improvement plan with archetype profiling, operating profile, and adopt/defer/ignore guidance (no writes) |
|
|
305
|
-
| `nerviq suggest-only` | Structured report for sharing, including repo archetype, operating profile, and adopt/defer/ignore guidance |
|
|
317
|
+
| `nerviq setup` | Generate starter-safe CLAUDE.md + hooks + commands |
|
|
318
|
+
| `nerviq augment` | Repo-aware improvement plan with archetype profiling, operating profile, and adopt/defer/ignore guidance (no writes) |
|
|
319
|
+
| `nerviq suggest-only` | Structured report for sharing, including repo archetype, operating profile, and adopt/defer/ignore guidance |
|
|
306
320
|
| `nerviq plan` | Export proposal bundles with previews |
|
|
307
321
|
| `nerviq apply` | Apply proposals with rollback |
|
|
308
322
|
| `nerviq governance` | Permission profiles, hooks, policy packs |
|
|
309
|
-
| `nerviq benchmark` | Baseline vs projected score in isolated temp copy |
|
|
323
|
+
| `nerviq benchmark` | Baseline vs projected score in isolated temp copy |
|
|
310
324
|
| `nerviq check-health` | Detect regressions between audit snapshots |
|
|
311
|
-
| `nerviq deep-review` | AI-powered config review (opt-in) |
|
|
312
|
-
| `nerviq deep-review --behavioral` | Local behavioral drift review with outcome-layer heuristics |
|
|
325
|
+
| `nerviq deep-review` | AI-powered config review (opt-in) |
|
|
326
|
+
| `nerviq deep-review --behavioral` | Local behavioral drift review with outcome-layer heuristics |
|
|
313
327
|
| `nerviq interactive` | Step-by-step guided wizard |
|
|
314
328
|
| `nerviq watch` | Live monitoring with score delta |
|
|
315
|
-
| `nerviq history` | Audit snapshot history from saved snapshots |
|
|
316
|
-
| `nerviq compare` | Compare latest vs previous audit snapshot |
|
|
317
|
-
| `nerviq trend` | Export audit snapshot trend report |
|
|
329
|
+
| `nerviq history` | Audit snapshot history from saved snapshots |
|
|
330
|
+
| `nerviq compare` | Compare latest vs previous audit snapshot |
|
|
331
|
+
| `nerviq trend` | Export audit snapshot trend report |
|
|
318
332
|
| `nerviq feedback` | Record recommendation outcomes |
|
|
319
333
|
| `nerviq anti-patterns` | Detect anti-patterns in current project |
|
|
320
334
|
| `nerviq freshness` | Show verification freshness for all checks |
|
|
321
335
|
| `nerviq rules-export` | Export recommendation rules (human summary or --json) |
|
|
322
|
-
| `nerviq badge` | shields.io badge for README |
|
|
323
|
-
| `nerviq certify` | Certification level + badge |
|
|
324
|
-
| `nerviq scan dir1 dir2` | Compare multiple repos |
|
|
325
|
-
| `nerviq org scan dir1 dir2` | Aggregate multiple repos into one score table |
|
|
326
|
-
| `nerviq org policy` | Inspect resolved org/team/repo policy layers |
|
|
336
|
+
| `nerviq badge` | shields.io badge for README |
|
|
337
|
+
| `nerviq certify` | Certification level + badge |
|
|
338
|
+
| `nerviq scan dir1 dir2` | Compare multiple repos |
|
|
339
|
+
| `nerviq org scan dir1 dir2` | Aggregate multiple repos into one score table |
|
|
340
|
+
| `nerviq org policy` | Inspect resolved org/team/repo policy layers |
|
|
327
341
|
| `nerviq harmony-audit` | Cross-platform DX audit |
|
|
328
342
|
| `nerviq harmony-sync` | Sync config across platforms |
|
|
329
343
|
| `nerviq harmony-drift` | Detect platform drift |
|
|
@@ -332,104 +346,104 @@ Levels:
|
|
|
332
346
|
| `nerviq harmony-governance` | Unified platform governance |
|
|
333
347
|
| `nerviq synergy-report` | Multi-agent synergy analysis |
|
|
334
348
|
| `nerviq catalog` | Show check catalog for all 8 platforms |
|
|
335
|
-
| `nerviq doctor` | Self-diagnostics for install health, freshness, platform detection, declared MCP servers, and hook runtime |
|
|
349
|
+
| `nerviq doctor` | Self-diagnostics for install health, freshness, platform detection, declared MCP servers, and hook runtime |
|
|
336
350
|
| `nerviq convert` | Convert config between platforms |
|
|
337
351
|
| `nerviq migrate` | Migrate platform config versions |
|
|
338
|
-
| `nerviq serve` | Start local
|
|
352
|
+
| `nerviq serve` | Start local HTTP API + OpenAPI contract |
|
|
339
353
|
|
|
340
354
|
## Options
|
|
341
355
|
|
|
342
356
|
| Flag | Effect |
|
|
343
357
|
|------|--------|
|
|
344
|
-
| `--full` | Full audit output (all checks, weakest areas, confidence labels, milestone coaching) |
|
|
358
|
+
| `--full` | Full audit output (all checks, weakest areas, confidence labels, milestone coaching) |
|
|
345
359
|
| `--verbose` | Full audit + medium-priority recommendations |
|
|
346
360
|
| `--threshold N` | Exit 1 if score < N (for CI) |
|
|
347
361
|
| `--json` | Machine-readable JSON output |
|
|
348
|
-
| `--out FILE` | Write output to file |
|
|
349
|
-
| `--webhook URL` | POST audit results to Slack, Discord, or a generic JSON endpoint |
|
|
350
|
-
| `--webhook-header NAME:VALUE` | Add a custom webhook header; repeat the flag for multiple headers |
|
|
351
|
-
| `--webhook-retries N` | Retry transient webhook failures (`429`, `5xx`, timeouts) up to `N` extra times |
|
|
352
|
-
| `--snapshot` | Save audit snapshot for trending |
|
|
353
|
-
| `--tag LABEL` | Label a saved snapshot (repeat the flag for multiple tags) |
|
|
354
|
-
| `--behavioral` | Run the opt-in local behavioral drift review via `deep-review` |
|
|
355
|
-
| `--history` | With `deep-review --behavioral`, show behavioral snapshot history |
|
|
356
|
-
| `--compare` | With `deep-review --behavioral`, compare the latest two behavioral snapshots |
|
|
357
|
-
| `--diff-only` | Run a changed-file audit instead of a full repo audit |
|
|
358
|
-
| `--diff-base SHA` | Base SHA for `--diff-only` PR comparisons (defaults to CI env vars when present) |
|
|
359
|
-
| `--diff-head SHA` | Head SHA for `--diff-only` PR comparisons (defaults to `GITHUB_SHA` or `HEAD`) |
|
|
360
|
-
| `--dry-run` | Preview changes without writing files |
|
|
361
|
-
| `--config-only` | Only write config files, never source code |
|
|
362
|
-
| `--auto` | Apply without prompts |
|
|
362
|
+
| `--out FILE` | Write output to file |
|
|
363
|
+
| `--webhook URL` | POST audit results to Slack, Discord, or a generic JSON endpoint |
|
|
364
|
+
| `--webhook-header NAME:VALUE` | Add a custom webhook header; repeat the flag for multiple headers |
|
|
365
|
+
| `--webhook-retries N` | Retry transient webhook failures (`429`, `5xx`, timeouts) up to `N` extra times |
|
|
366
|
+
| `--snapshot` | Save audit snapshot for trending |
|
|
367
|
+
| `--tag LABEL` | Label a saved snapshot (repeat the flag for multiple tags) |
|
|
368
|
+
| `--behavioral` | Run the opt-in local behavioral drift review via `deep-review` |
|
|
369
|
+
| `--history` | With `deep-review --behavioral`, show behavioral snapshot history |
|
|
370
|
+
| `--compare` | With `deep-review --behavioral`, compare the latest two behavioral snapshots |
|
|
371
|
+
| `--diff-only` | Run a changed-file audit instead of a full repo audit |
|
|
372
|
+
| `--diff-base SHA` | Base SHA for `--diff-only` PR comparisons (defaults to CI env vars when present) |
|
|
373
|
+
| `--diff-head SHA` | Head SHA for `--diff-only` PR comparisons (defaults to `GITHUB_SHA` or `HEAD`) |
|
|
374
|
+
| `--dry-run` | Preview changes without writing files |
|
|
375
|
+
| `--config-only` | Only write config files, never source code |
|
|
376
|
+
| `--auto` | Apply without prompts |
|
|
363
377
|
| `--only A,B` | Limit apply to selected proposal IDs |
|
|
364
378
|
| `--format sarif` | SARIF output for code scanning |
|
|
365
379
|
| `--platform NAME` | Target platform (claude, codex, gemini, copilot, cursor, windsurf, aider, opencode) |
|
|
366
|
-
| `--workspace GLOB` | Audit workspaces separately as package-level live audits with summary-only JSON rows (e.g. packages/*) |
|
|
367
|
-
| `--external PATH` | Benchmark an external repo |
|
|
368
|
-
|
|
369
|
-
Webhook delivery automatically retries transient failures twice by default. For authenticated internal endpoints, you can add custom headers such as:
|
|
370
|
-
|
|
371
|
-
```bash
|
|
372
|
-
npx @nerviq/cli audit \
|
|
373
|
-
--webhook https://ops.example.com/nerviq/audit \
|
|
374
|
-
--webhook-header "Authorization: Bearer $NERVIQ_WEBHOOK_TOKEN" \
|
|
375
|
-
--webhook-header "X-Nerviq-Environment: production" \
|
|
376
|
-
--webhook-retries 4
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
Generic webhook endpoints now receive a stable `nerviq.audit.completed` event envelope with:
|
|
380
|
-
|
|
381
|
-
- backward-compatible top-level `platform`, `score`, `passed`, `failed`, and `results`
|
|
382
|
-
- nested `data` and `meta` blocks for new consumers
|
|
383
|
-
- schema versioning through `schemaVersion`
|
|
384
|
-
|
|
385
|
-
For PR-focused audits, you can scope Nerviq to the working tree or an explicit base/head range:
|
|
386
|
-
|
|
387
|
-
```bash
|
|
388
|
-
npx @nerviq/cli audit --diff-only
|
|
389
|
-
npx @nerviq/cli audit --diff-only --diff-base origin/main --diff-head HEAD
|
|
390
|
-
```
|
|
391
|
-
|
|
392
|
-
`--diff-only` is intentionally a scoped review surface. It reports a `diff-only changed-file audit` score, lists the changed files it considered, and reminds you to run a full `nerviq audit` for the complete repo posture. Because diff-only scores are not directly comparable to full audit history, Nerviq blocks `--diff-only --snapshot`.
|
|
393
|
-
|
|
394
|
-
For multi-repo governance, Nerviq also supports inherited policy layers:
|
|
395
|
-
|
|
396
|
-
- `.nerviq/org-policy.json` in an ancestor directory for org defaults
|
|
397
|
-
- `.nerviq/team-policy.json` in the repo for team overrides
|
|
398
|
-
- `.nerviq/repo-policy.json` in the repo for repo-specific overrides
|
|
399
|
-
|
|
400
|
-
Inspect the resolved contract with:
|
|
401
|
-
|
|
402
|
-
```bash
|
|
403
|
-
npx @nerviq/cli org policy
|
|
404
|
-
npx @nerviq/cli org scan ./app ./api ./infra --json
|
|
405
|
-
```
|
|
406
|
-
|
|
407
|
-
For opt-in outcome-layer inspection, Nerviq can also run a local behavioral drift review:
|
|
408
|
-
|
|
409
|
-
```bash
|
|
410
|
-
npx @nerviq/cli deep-review --behavioral
|
|
411
|
-
npx @nerviq/cli deep-review --behavioral --snapshot --milestone baseline --tag "behavioral-baseline"
|
|
412
|
-
npx @nerviq/cli deep-review --behavioral --history
|
|
413
|
-
npx @nerviq/cli deep-review --behavioral --compare
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
Behavioral drift mode is intentionally guarded:
|
|
417
|
-
|
|
418
|
-
- It analyzes repository structure and instruction-vs-outcome mismatch heuristics
|
|
419
|
-
- It does not claim agent attribution without explicit evidence
|
|
420
|
-
- It is not marketed as SAST, semantic code review, or runtime analysis
|
|
421
|
-
|
|
422
|
-
`nerviq setup` now seeds a trust-boundary section in `CLAUDE.md` and an `injection-defense` starter hook for `WebFetch`, `WebSearch`, `Read`, `Grep`, `Glob`, and MCP-backed external-content flows. `nerviq doctor` validates that the declared starter hook still runs and logs suspicious prompt-injection patterns correctly.
|
|
380
|
+
| `--workspace GLOB` | Audit workspaces separately as package-level live audits with summary-only JSON rows (e.g. packages/*) |
|
|
381
|
+
| `--external PATH` | Benchmark an external repo |
|
|
382
|
+
|
|
383
|
+
Webhook delivery automatically retries transient failures twice by default. For authenticated internal endpoints, you can add custom headers such as:
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
npx @nerviq/cli audit \
|
|
387
|
+
--webhook https://ops.example.com/nerviq/audit \
|
|
388
|
+
--webhook-header "Authorization: Bearer $NERVIQ_WEBHOOK_TOKEN" \
|
|
389
|
+
--webhook-header "X-Nerviq-Environment: production" \
|
|
390
|
+
--webhook-retries 4
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Generic webhook endpoints now receive a stable `nerviq.audit.completed` event envelope with:
|
|
394
|
+
|
|
395
|
+
- backward-compatible top-level `platform`, `score`, `passed`, `failed`, and `results`
|
|
396
|
+
- nested `data` and `meta` blocks for new consumers
|
|
397
|
+
- schema versioning through `schemaVersion`
|
|
398
|
+
|
|
399
|
+
For PR-focused audits, you can scope Nerviq to the working tree or an explicit base/head range:
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
npx @nerviq/cli audit --diff-only
|
|
403
|
+
npx @nerviq/cli audit --diff-only --diff-base origin/main --diff-head HEAD
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
`--diff-only` is intentionally a scoped review surface. It reports a `diff-only changed-file audit` score, lists the changed files it considered, and reminds you to run a full `nerviq audit` for the complete repo posture. Because diff-only scores are not directly comparable to full audit history, Nerviq blocks `--diff-only --snapshot`.
|
|
407
|
+
|
|
408
|
+
For multi-repo governance, Nerviq also supports inherited policy layers:
|
|
409
|
+
|
|
410
|
+
- `.nerviq/org-policy.json` in an ancestor directory for org defaults
|
|
411
|
+
- `.nerviq/team-policy.json` in the repo for team overrides
|
|
412
|
+
- `.nerviq/repo-policy.json` in the repo for repo-specific overrides
|
|
413
|
+
|
|
414
|
+
Inspect the resolved contract with:
|
|
415
|
+
|
|
416
|
+
```bash
|
|
417
|
+
npx @nerviq/cli org policy
|
|
418
|
+
npx @nerviq/cli org scan ./app ./api ./infra --json
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
For opt-in outcome-layer inspection, Nerviq can also run a local behavioral drift review:
|
|
422
|
+
|
|
423
|
+
```bash
|
|
424
|
+
npx @nerviq/cli deep-review --behavioral
|
|
425
|
+
npx @nerviq/cli deep-review --behavioral --snapshot --milestone baseline --tag "behavioral-baseline"
|
|
426
|
+
npx @nerviq/cli deep-review --behavioral --history
|
|
427
|
+
npx @nerviq/cli deep-review --behavioral --compare
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
Behavioral drift mode is intentionally guarded:
|
|
431
|
+
|
|
432
|
+
- It analyzes repository structure and instruction-vs-outcome mismatch heuristics
|
|
433
|
+
- It does not claim agent attribution without explicit evidence
|
|
434
|
+
- It is not marketed as SAST, semantic code review, or runtime analysis
|
|
435
|
+
|
|
436
|
+
`nerviq setup` now seeds a trust-boundary section in `CLAUDE.md` and an `injection-defense` starter hook for `WebFetch`, `WebSearch`, `Read`, `Grep`, `Glob`, and MCP-backed external-content flows. `nerviq doctor` validates that the declared starter hook still runs and logs suspicious prompt-injection patterns correctly.
|
|
423
437
|
|
|
424
438
|
## Backed by Research
|
|
425
439
|
|
|
426
440
|
Nerviq is built on the NERVIQ knowledge engine — the largest verified catalog of AI coding agent techniques:
|
|
427
441
|
|
|
428
|
-
- **
|
|
429
|
-
- **
|
|
430
|
-
- **2,441 checks** across 8 platforms (~300 unique governance rules × 8 platform adaptations), each with `sourceUrl` and `confidence` level (0.0-1.0)
|
|
442
|
+
- **540+ research documents** covering all 8 platforms
|
|
443
|
+
- **400+ experiments** with tested, rated results
|
|
444
|
+
- **2,441 checks** across 8 platforms (~300 unique governance rules × 8 platform adaptations), each with `sourceUrl` and `confidence` level (0.0-1.0)
|
|
431
445
|
- Every check is traceable to primary documentation or verified experiment
|
|
432
|
-
-
|
|
446
|
+
- **Freshness:** daily changelog scanning across all 8 platforms, weekly liveness sweep (6 automated checks), monthly quality review, quarterly cross-validation — items older than 90 days are confidence-weighted
|
|
433
447
|
|
|
434
448
|
## Safety Modes
|
|
435
449
|
|
|
@@ -450,7 +464,7 @@ Every write command supports `--snapshot` for automatic backup before changes.
|
|
|
450
464
|
|
|
451
465
|
- **Zero dependencies** — nothing to audit
|
|
452
466
|
- **Runs locally** — audit, setup, plan, apply, governance, benchmark all run on your machine
|
|
453
|
-
- **Deep review is opt-in** — `deep-review` sends selected config for AI analysis, while `deep-review --behavioral` stays local and uses heuristic outcome-layer analysis only
|
|
467
|
+
- **Deep review is opt-in** — `deep-review` sends selected config for AI analysis, while `deep-review --behavioral` stays local and uses heuristic outcome-layer analysis only
|
|
454
468
|
- **AGPL-3.0 Licensed** — open source
|
|
455
469
|
|
|
456
470
|
## Links
|
|
@@ -470,9 +484,9 @@ If Nerviq helped you, consider giving it a ⭐ on [GitHub](https://github.com/ne
|
|
|
470
484
|
|
|
471
485
|
**Not designed for:** Deeply customized setups with 20+ skills, agent teams, and bespoke MCP integrations. If you've already built advanced agent workflows, you may not need this.
|
|
472
486
|
|
|
473
|
-
**Strongest at:** AI agent governance, configuration intelligence, workflow policy hygiene, cross-platform alignment, and setup standardization.
|
|
474
|
-
|
|
475
|
-
**Not a replacement for:** Deep architectural review of business logic, runtime performance profiling, full SAST coverage, secret scanning, or security penetration testing. Nerviq focuses on how your AI coding agents are configured and governed — not on what your application code does.
|
|
487
|
+
**Strongest at:** AI agent governance, configuration intelligence, workflow policy hygiene, cross-platform alignment, and setup standardization.
|
|
488
|
+
|
|
489
|
+
**Not a replacement for:** Deep architectural review of business logic, runtime performance profiling, full SAST coverage, secret scanning, or security penetration testing. Nerviq focuses on how your AI coding agents are configured and governed — not on what your application code does.
|
|
476
490
|
|
|
477
491
|
**Confidence levels:** Every check includes a `confidence` score (0.0–1.0) and a `sourceUrl` linking to primary documentation. Checks marked `heuristic` are pattern-based and may produce false positives on non-standard project structures.
|
|
478
492
|
|
package/bin/cli.js
CHANGED
|
@@ -650,7 +650,7 @@ const HELP = `
|
|
|
650
650
|
ADVANCED
|
|
651
651
|
nerviq deep-review AI-powered config review (opt-in, uses API key)
|
|
652
652
|
nerviq deep-review --behavioral Local behavioral drift review (opt-in, no API)
|
|
653
|
-
nerviq serve --port 3000 Start local Nerviq
|
|
653
|
+
nerviq serve --port 3000 Start local Nerviq HTTP API server + OpenAPI contract
|
|
654
654
|
nerviq badge Generate shields.io badge markdown
|
|
655
655
|
nerviq rules-export Export recommendation rules as JSON
|
|
656
656
|
nerviq rules-export --out F Save rules to file
|
|
@@ -1598,6 +1598,7 @@ async function main() {
|
|
|
1598
1598
|
console.log(` nerviq API listening on http://127.0.0.1:${resolvedPort}`);
|
|
1599
1599
|
console.log(' Endpoints: /api/openapi.json, /api/health, /api/catalog, /api/audit, /api/harmony');
|
|
1600
1600
|
console.log(` Contract: http://127.0.0.1:${resolvedPort}/api/openapi.json`);
|
|
1601
|
+
console.log(' MCP hosts should use nerviq-mcp (stdio JSON-RPC 2.0), not this HTTP server.');
|
|
1601
1602
|
console.log('');
|
|
1602
1603
|
|
|
1603
1604
|
const closeServer = () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nerviq/cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "The intelligent nervous system for AI coding agents — 2,441 checks (8 platforms × ~300 governance rules), 10 languages, 62 domain packs. Audit, align, and amplify.",
|
|
3
|
+
"version": "1.13.0",
|
|
4
|
+
"description": "The intelligent nervous system for AI coding agents — 2,441 checks (8 platforms × ~300 governance rules), 10 languages, 62 domain packs. Audit, align, and amplify.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nerviq": "bin/cli.js",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"start": "node bin/cli.js",
|
|
18
18
|
"build": "npm pack --dry-run",
|
|
19
19
|
"test": "node test/run.js",
|
|
20
|
+
"verify:release-metadata": "node tools/validate-release-metadata.js",
|
|
20
21
|
"test:jest": "jest",
|
|
21
22
|
"test:coverage": "jest --coverage",
|
|
22
23
|
"test:all": "npm test && npx jest && node test/check-matrix.js && node test/codex-check-matrix.js && node test/gemini-check-matrix.js && node test/copilot-check-matrix.js && node test/cursor-check-matrix.js && node test/windsurf-check-matrix.js && node test/aider-check-matrix.js && node test/opencode-check-matrix.js && node test/golden-matrix.js && node test/codex-golden-matrix.js && node test/gemini-golden-matrix.js && node test/copilot-golden-matrix.js && node test/cursor-golden-matrix.js && node test/windsurf-golden-matrix.js && node test/aider-golden-matrix.js && node test/opencode-golden-matrix.js",
|