SDK

Embed Nerviq in your own tooling.

The SDK is the cleanest way to bring Nerviq into internal developer platforms, CI jobs, onboarding portals, or agent-control planes. It wraps the main audit, harmony, and synergy primitives with a stable programmatic interface.

@nerviq/sdkTypeScript typesProgrammatic audit surface

Install

The SDK ships as a standalone package so product teams can call Nerviq without shelling out to the CLI.

Node
Runtime
Use it in Node-based CLIs, services, internal dashboards, or build automation.
TS
Typed
TypeScript definitions ship with the package, so the main result objects are typed out of the box.
6
Primary exports
Audit, Harmony, Synergy, platform detection, catalog access, and routing.
bash
npm i @nerviq/sdk

API Surface

Every exported function is built around a practical operator question: what is installed, what is broken, what drifts, and which platform should do the next piece of work?

ExportWhat it returns
audit(dir, platform)Run a platform audit and return score, findings, category scores, and next actions.
harmonyAudit(dir)Generate cross-platform alignment data and drift-oriented recommendations.
synergyReport(dir)Return multi-platform lift analysis, routing hints, and a rendered report.
detectPlatforms(dir)Infer which agent platforms are active in a repository.
getCatalog()Return the full unified check catalog with metadata such as sourceUrl and confidence.
routeTask(description, platforms)Recommend the best platform or platform mix for a task description.

JavaScript Example

A simple audit can be one function call. Nerviq returns structured JSON-friendly results, so you can feed them straight into dashboards or policy gates.

javascript
const { audit, harmonyAudit } = require("@nerviq/sdk");

const auditResult = await audit(".", "claude");
console.log(auditResult.score);

const harmony = await harmonyAudit(".");
console.log(harmony.alignmentScore);

TypeScript Example

The package exposes type definitions for the top-level exports, so TypeScript users can model audit and routing flows without writing custom interfaces first.

typescript
import { audit, routeTask } from "@nerviq/sdk";

const result = await audit(".", "codex");
const route = await routeTask("Review trust boundaries and MCP posture", ["claude", "codex", "cursor"] );

console.log(result.results.length, route.recommendedPlatform);

Result Shapes

At a minimum, teams usually wire the SDK into one of three workflows: quality gates, cross-platform reporting, or task-routing control planes.

Per-platform

AuditResult

Includes score, passed count, check count, per-check results, category scores, quick wins, and top-next-actions for one selected platform.

Cross-platform

HarmonyResult

Includes alignment score, drift signals, canonical model data, and synchronization advice across the platforms Nerviq detects in the repo.

Decision support

RoutingResult

Includes recommended platform, rationale, companion platforms, and a confidence score for why that routing choice makes sense for the task.