@nerviq/cli 1.6.5 → 1.7.1

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 CHANGED
@@ -224,10 +224,12 @@ Levels:
224
224
 
225
225
  | Command | What it does |
226
226
  |---------|-------------|
227
- | `nerviq audit` | Score 0-100 against 2,431 checks |
228
- | `nerviq audit --lite` | Quick top-3 scan |
227
+ | `nerviq audit` | Score 0-100 quick scan with top 3 actions (default) |
228
+ | `nerviq audit --full` | Full audit with all checks, weakest areas, confidence labels |
229
229
  | `nerviq fix <key>` | Auto-fix a specific check (shows score impact) |
230
230
  | `nerviq fix --all-critical` | Fix all critical issues at once |
231
+ | `nerviq rollback` | Undo the most recent apply (delete created files) |
232
+ | `nerviq rollback --list` | Show available rollback points |
231
233
  | `nerviq setup` | Generate starter-safe CLAUDE.md + hooks + commands |
232
234
  | `nerviq augment` | Repo-aware improvement plan (no writes) |
233
235
  | `nerviq suggest-only` | Structured report for sharing |
@@ -235,6 +237,7 @@ Levels:
235
237
  | `nerviq apply` | Apply proposals with rollback |
236
238
  | `nerviq governance` | Permission profiles, hooks, policy packs |
237
239
  | `nerviq benchmark` | Before/after in isolated temp copy |
240
+ | `nerviq check-health` | Detect regressions between audit snapshots |
238
241
  | `nerviq deep-review` | AI-powered config review (opt-in) |
239
242
  | `nerviq interactive` | Step-by-step guided wizard |
240
243
  | `nerviq watch` | Live monitoring with score delta |
@@ -242,9 +245,13 @@ Levels:
242
245
  | `nerviq compare` | Compare latest vs previous |
243
246
  | `nerviq trend` | Export trend report |
244
247
  | `nerviq feedback` | Record recommendation outcomes |
248
+ | `nerviq anti-patterns` | Detect anti-patterns in current project |
249
+ | `nerviq freshness` | Show verification freshness for all checks |
250
+ | `nerviq rules-export` | Export recommendation rules (human summary or --json) |
245
251
  | `nerviq badge` | shields.io badge for README |
246
252
  | `nerviq certify` | Certification level + badge |
247
253
  | `nerviq scan dir1 dir2` | Compare multiple repos |
254
+ | `nerviq org scan dir1 dir2` | Aggregate multiple repos into one score table |
248
255
  | `nerviq harmony-audit` | Cross-platform DX audit |
249
256
  | `nerviq harmony-sync` | Sync config across platforms |
250
257
  | `nerviq harmony-drift` | Detect platform drift |
@@ -262,20 +269,24 @@ Levels:
262
269
 
263
270
  | Flag | Effect |
264
271
  |------|--------|
272
+ | `--full` | Full audit output (all checks, weakest areas, confidence labels) |
273
+ | `--verbose` | Full audit + medium-priority recommendations |
265
274
  | `--threshold N` | Exit 1 if score < N (for CI) |
266
275
  | `--json` | Machine-readable JSON output |
267
276
  | `--out FILE` | Write output to file |
268
277
  | `--snapshot` | Save audit snapshot for trending |
269
- | `--lite` | Compact top-3 quick scan |
270
- | `--dry-run` | Preview apply without writing |
278
+ | `--dry-run` | Preview changes without writing files |
279
+ | `--config-only` | Only write config files, never source code |
271
280
  | `--auto` | Apply without prompts |
272
- | `--verbose` | Show all recommendations |
281
+ | `--only A,B` | Limit apply to selected proposal IDs |
273
282
  | `--format sarif` | SARIF output for code scanning |
274
283
  | `--platform NAME` | Target platform (claude, codex, gemini, copilot, cursor, windsurf, aider, opencode) |
284
+ | `--workspace GLOB` | Audit workspaces separately (e.g. packages/*) |
285
+ | `--external PATH` | Benchmark an external repo |
275
286
 
276
287
  ## Backed by Research
277
288
 
278
- Nerviq is built on the CLAUDEX knowledge engine — the largest verified catalog of AI coding agent techniques:
289
+ Nerviq is built on the NERVIQ knowledge engine — the largest verified catalog of AI coding agent techniques:
279
290
 
280
291
  - **448+ research documents** covering all 8 platforms
281
292
  - **332+ experiments** with tested, rated results
package/bin/cli.js CHANGED
@@ -26,7 +26,7 @@ const COMMAND_ALIASES = {
26
26
  gov: 'governance',
27
27
  outcome: 'feedback',
28
28
  };
29
- const KNOWN_COMMANDS = ['audit', 'org', 'setup', 'augment', 'suggest-only', 'plan', 'apply', 'fix', 'governance', 'benchmark', 'deep-review', 'interactive', 'watch', 'badge', 'insights', 'history', 'compare', 'trend', 'scan', 'feedback', 'doctor', 'convert', 'migrate', 'catalog', 'certify', 'serve', 'check-health', 'harmony-audit', 'harmony-sync', 'harmony-drift', 'harmony-advise', 'harmony-watch', 'harmony-governance', 'harmony-add', 'synergy-report', 'anti-patterns', 'rules-export', 'freshness', 'help', 'version'];
29
+ const KNOWN_COMMANDS = ['audit', 'org', 'setup', 'augment', 'suggest-only', 'plan', 'apply', 'fix', 'rollback', 'governance', 'benchmark', 'deep-review', 'interactive', 'watch', 'badge', 'insights', 'history', 'compare', 'trend', 'scan', 'feedback', 'doctor', 'convert', 'migrate', 'catalog', 'certify', 'serve', 'check-health', 'harmony-audit', 'harmony-sync', 'harmony-drift', 'harmony-advise', 'harmony-watch', 'harmony-governance', 'harmony-add', 'synergy-report', 'anti-patterns', 'rules-export', 'freshness', 'help', 'version'];
30
30
 
31
31
  function levenshtein(a, b) {
32
32
  const matrix = Array.from({ length: a.length + 1 }, () => Array(b.length + 1).fill(0));
@@ -313,6 +313,9 @@ const HELP = `
313
313
  nerviq fix <key> Auto-fix a specific check (with score impact)
314
314
  nerviq fix --all-critical Fix all critical issues at once
315
315
  nerviq fix --dry-run Preview fixes without writing
316
+ nerviq rollback Undo the most recent apply (delete created files)
317
+ nerviq rollback --list Show available rollback points
318
+ nerviq rollback --dry-run Preview what would be deleted
316
319
 
317
320
  IMPROVE
318
321
  nerviq augment Improvement plan (no writes)
@@ -784,6 +787,88 @@ async function main() {
784
787
  }
785
788
  console.log('');
786
789
  }
790
+ } else if (normalizedCommand === 'rollback') {
791
+ const fsMod = require('fs');
792
+ const pathMod = require('path');
793
+ const rollbackDir = pathMod.join(options.dir, '.nerviq', 'rollbacks');
794
+
795
+ if (!fsMod.existsSync(rollbackDir)) {
796
+ console.log('\n No rollback artifacts found. Run `nerviq apply` first to create rollback data.\n');
797
+ process.exit(0);
798
+ }
799
+
800
+ const rollbackFiles = fsMod.readdirSync(rollbackDir)
801
+ .filter(f => f.endsWith('.json'))
802
+ .sort()
803
+ .reverse();
804
+
805
+ if (rollbackFiles.length === 0) {
806
+ console.log('\n No rollback artifacts found.\n');
807
+ process.exit(0);
808
+ }
809
+
810
+ // --list mode
811
+ if (flags.includes('--list')) {
812
+ console.log(`\n Rollback points (${rollbackFiles.length}):\n`);
813
+ for (const f of rollbackFiles) {
814
+ try {
815
+ const data = JSON.parse(fsMod.readFileSync(pathMod.join(rollbackDir, f), 'utf8'));
816
+ const created = (data.createdFiles || []).length;
817
+ const patched = (data.patchedFiles || []).length;
818
+ console.log(` ${f.replace('.json', '')} (${created} created, ${patched} patched)`);
819
+ } catch {
820
+ console.log(` ${f} (unreadable)`);
821
+ }
822
+ }
823
+ console.log(`\n Run \`nerviq rollback\` to undo the most recent.\n`);
824
+ process.exit(0);
825
+ }
826
+
827
+ // Execute rollback of most recent
828
+ const latestFile = rollbackFiles[0];
829
+ const latestPath = pathMod.join(rollbackDir, latestFile);
830
+ let rollbackData;
831
+ try {
832
+ rollbackData = JSON.parse(fsMod.readFileSync(latestPath, 'utf8'));
833
+ } catch (e) {
834
+ console.error(`\n Error: Cannot parse rollback file: ${e.message}\n`);
835
+ process.exit(1);
836
+ }
837
+
838
+ const createdFiles = rollbackData.createdFiles || [];
839
+ if (createdFiles.length === 0) {
840
+ console.log('\n Rollback artifact has no files to remove.\n');
841
+ process.exit(0);
842
+ }
843
+
844
+ if (options.dryRun) {
845
+ console.log(`\n [dry-run] Would delete ${createdFiles.length} files:\n`);
846
+ for (const f of createdFiles) {
847
+ console.log(` - ${f}`);
848
+ }
849
+ console.log('');
850
+ process.exit(0);
851
+ }
852
+
853
+ let deleted = 0;
854
+ let missing = 0;
855
+ console.log('');
856
+ for (const relPath of createdFiles) {
857
+ const fullPath = pathMod.join(options.dir, relPath);
858
+ if (fsMod.existsSync(fullPath)) {
859
+ fsMod.unlinkSync(fullPath);
860
+ console.log(` 🗑️ Deleted: ${relPath}`);
861
+ deleted++;
862
+ } else {
863
+ missing++;
864
+ }
865
+ }
866
+
867
+ // Remove rollback artifact after use
868
+ fsMod.unlinkSync(latestPath);
869
+
870
+ console.log(`\n Rollback complete: ${deleted} files deleted${missing > 0 ? `, ${missing} already missing` : ''}.\n`);
871
+
787
872
  } else if (normalizedCommand === 'apply') {
788
873
  if (flags.includes('--rollback')) {
789
874
  console.error('\n Error: --rollback is not yet supported as a flag.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nerviq/cli",
3
- "version": "1.6.5",
3
+ "version": "1.7.1",
4
4
  "description": "The intelligent nervous system for AI coding agents — 2,431 checks across 8 platforms, 10 languages, and 62 domain packs. Audit, align, and amplify.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
package/src/benchmark.js CHANGED
@@ -145,7 +145,9 @@ function buildExecutiveSummary(before, after, workflowEvidence) {
145
145
  const scoreDelta = after.score - before.score;
146
146
  const organicDelta = after.organicScore - before.organicScore;
147
147
  const workflowCoverage = workflowEvidence.summary.coverageScore;
148
- let headline = 'Benchmark did not improve the score in this run.';
148
+ let headline = before.score >= 60
149
+ ? 'Setup is already applied — benchmark shows no additional improvement. Run benchmark on a project before running setup to see the full delta.'
150
+ : 'Benchmark did not improve the score in this run.';
149
151
 
150
152
  if (scoreDelta < 0) {
151
153
  headline = `Warning: score decreased by ${Math.abs(scoreDelta)} points. Setup may have introduced a regression.`;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "synced_from": "claudex",
3
- "synced_at": "2026-04-06T08:01:13Z",
3
+ "synced_at": "2026-04-06T10:42:47Z",
4
4
  "total_items": 1118,
5
5
  "tested": 948,
6
6
  "last_id": 1137