autobom
v0.1.1
Published
Node.js microservice engine that orchestrates syft and cyclonedx-cli to generate, validate, and surface SBOMs for mixed-language workspaces.
Maintainers
Readme
AutoBOM
A Node.js/TypeScript microservice engine that orchestrates existing open-source tools to generate, validate, and surface Software Bills of Materials (SBOMs) for mixed-language workspaces (Node/React/Angular, Python, Go, Rust, Java, Ruby).
AutoBOM is a thin, production-hardened orchestration layer — it does not reimplement SBOM generation. It drives:
syft— SBOM generationcyclonedx-cli— schema validation- OWASP Dependency-Track — dashboard rendering (optional)
Pipeline
analyze → lockfile guard → generate (syft) → validate (cyclonedx-cli) → surface- Dynamic Target Analyzer — detects ecosystems by manifest/lockfile signatures.
- Lockfile Enforcement Guard — warns on, or auto-generates, missing lockfiles
so transitive dependencies are captured (
npm shrinkwrap,pip-compile,go mod download). - Core Generation Engine — runs
syftand emits CycloneDX JSON (1.5 or 1.6). - Validation Gate — runs
cyclonedx-cli validate; the run fails closed on schema errors. - Dashboard Integration Layer
- A ready-to-send Dependency-Track
PUT /api/v1/bomrequest (or direct upload). - A client-side dependency tree helper that structures
componentsinto a multi-tier, expandable list for a custom UI.
- A ready-to-send Dependency-Track
Prerequisites
- Node.js >= 20
syfton PATH (releases)cyclonedx-clion PATH (releases) — tested against v0.32.0- (optional, for
--enforce-lockfiles)npm,pip-compile(pip-tools), orgo
Windows note: the release ships
cyclonedx-win-x64.exe; rename it tocyclonedx-cli.exeand place it on PATH. AutoBOM invokescyclonedx-cli validate --input-format json --input-file <path> --fail-on-errors.
Install & build
npm install
npm run buildCLI
# Inspect a workspace
npx autobom analyze ./path/to/workspace
# Full pipeline, persist the validated BOM
npx autobom generate ./path/to/workspace --spec 1.6 --out bom.cdx.json --tree
# Auto-generate missing lockfiles first
npx autobom generate ./path/to/workspace --enforce-lockfilesExit code is 1 if validation fails (unless --no-validate).
See docs/CLI.md for the full command reference (all flags, exit
codes, npm link setup, and monorepo usage).
HTTP service
npm start # listens on :8080 (PORT env to override)| Method | Route | Body |
|--------|------------|--------------------------------------------------------|
| GET | /health | — |
| POST | /analyze | { "workspacePath": "..." } |
| POST | /sbom | { "workspacePath": "...", "specVersion": "1.6", ... }|
| POST | /tree | { "bom": <CycloneDX JSON> } |
POST /sbom options: specVersion (1.5/1.6), lockfileMode (warn/enforce),
requireValid, buildTree, includeBom, and dependencyTrack
({ baseUrl, apiKey, projectName, projectVersion, autoCreate }).
MCP server
AutoBOM ships a Model Context Protocol server
(stdio transport) so AI clients like Claude Code can drive SBOM generation
directly. Build first (npm run build), then run:
npm run mcp # node dist/mcp.js (stdio)Tools exposed: analyze_workspace, generate_sbom, validate_sbom,
build_dependency_tree, upload_to_dependency_track.
The server auto-adds the bundled ./.tools dir (from scripts/bootstrap) to its
PATH so it finds syft/cyclonedx-cli without extra configuration.
Claude Code: this repo includes a project-scoped .mcp.json, so opening the
workspace registers the autobom server automatically (approve it when prompted).
To register elsewhere:
claude mcp add autobom -- node /abs/path/to/autobom/dist/mcp.jsClaude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"autobom": { "command": "node", "args": ["C:/MyProjects/autobom/dist/mcp.js"] }
}
}Library
import { runPipeline, buildDependencyTree } from "autobom";
const result = await runPipeline("./workspace", {
specVersion: "1.6",
lockfileMode: "enforce",
dependencyTrack: {
baseUrl: "https://dtrack.example.com",
apiKey: process.env.DT_API_KEY!,
projectName: "my-app",
projectVersion: "1.0.0",
},
});
console.log(result.validation.valid, result.tree?.totalComponents);Errors
Every failure is an AutoBomError with a stable code
(WORKSPACE_NOT_FOUND, NO_MANIFEST_DETECTED, BINARY_NOT_FOUND, SCANNER_FAILED,
VALIDATION_FAILED, DTRACK_UPLOAD_FAILED, INTERNAL). All logs are prefixed [AutoBOM].
Set AUTOBOM_LOG_LEVEL=debug for verbose output.
Test
npm test