TypeScript client for the Supermodel API - code graph generation and static analysis.
npm install @supermodeltools/sdkGet your API key from the Supermodel Dashboard and set it as SUPERMODEL_API_KEY.
import { Configuration, DefaultApi } from '@supermodeltools/sdk';
import { readFile } from 'node:fs/promises';
const config = new Configuration({
basePath: 'https://api.supermodeltools.com',
apiKey: process.env.SUPERMODEL_API_KEY,
});
const api = new DefaultApi(config);
// Create a ZIP of your repo: git archive -o /tmp/repo.zip HEAD
const file = new Blob([await readFile('/tmp/repo.zip')], { type: 'application/zip' });
const result = await api.generateSupermodelGraph({
idempotencyKey: 'my-repo:supermodel:abc123',
file,
});
console.log(result.graph.nodes.length, 'nodes');| Method | Description |
|---|---|
generateDependencyGraph |
File-level dependency graph |
generateCallGraph |
Function-level call graph |
generateDomainGraph |
Domain model classification |
generateParseGraph |
AST parse tree relationships |
generateSupermodelGraph |
Full Supermodel IR bundle |
All methods require idempotencyKey (string) and file (Blob) parameters.