/cdxgen:sbom-generatefrom cdxgen
Generates CycloneDX SBOMs from source code using OWASP cdxgen. Handles project-type selection across 30+ ecosystems, monorepo recursion, lifecycle phases, generation profiles, component filtering, and spec-version targeting. Useful for creating dependency inventories, resolving licenses, or exporting SPDX from source.
Ships in cdxgen. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill for the common case: a user wants a CycloneDX SBOM for a
repository or directory. For containers and binaries use container-sbom; for
live hosts use os-hardware-inventory; to improve an SBOM that came back thin
use sbom-fidelity-loop.
These rules apply to every command this skill produces, including commands that are only shown to the user. reference/safety.md explains each one.
--dry-run --activity-report json first, summarize what it would do, and
ask before the real run.-o.--no-install-deps or
--lifecycle pre-build.--allow-fs-read="*" or
--allow-fs-write="*".CDXGEN_<OPTION> environment variables, which
win over .cdxgenrc and .cdxgen.json. License fetching is switched on by
the FETCH_LICENSE=true variable; there is no --fetch-license flag.@cdxgen/cdxgen.Claude Code replaces the ${user_config.*} values in this table with the
options the user set for the plugin. Other clients show the text as written. A
value counts as set only when it is not empty and does not start with ${;
otherwise ignore it and follow the "When not set" column. The settings hold no
keys or tokens, and the rule against asking for, printing or writing one still
applies.
| Setting | Value | When not set |
|---|---|---|
Default --spec-version | ${user_config.spec_version} | Omit the flag; cdxgen defaults to 1.7 |
| Preferred runtime | ${user_config.runtime} | Use cdxgen on PATH |
When the spec version is set, add --spec-version <value> to the real run,
unless the user asks for another version. When the runtime is container, run
cdxgen from the image instead of the local CLI, with the project mounted at
/app and /app paths in the command:
docker run --rm -v /absolute/path/to/project:/app:rw \
ghcr.io/cdxgen/cdxgen:master /app -o /app/bom.json
Apply the dry-run-first rule to this form too, by adding --dry-run --activity-report json.
cdxgen [path] [options]
path defaults to .. Every boolean flag accepts a --no- prefix to invert it.
cdxgen /absolute/path/to/project --dry-run --activity-report json
Summarize what the run would read, write, execute, and fetch. Ask before the
real run. Pay particular attention to whether the preview shows package-manager
installs; if it does, offer --no-install-deps or --lifecycle pre-build.
cdxgen /absolute/path/to/project -o /absolute/path/to/bom.json
Auto-detection handles most projects. Reach for flags when it does not.
Omit -t and let cdxgen detect. Pass it when detection is wrong, when you want
to constrain a large monorepo, or when the target is not source code.
# Restrict a polyglot repo to two ecosystems
cdxgen -t java -t python -o /absolute/path/to/bom.json /absolute/path/to/project
# Exclude one ecosystem instead of listing the rest
cdxgen --exclude-type mcp -o /absolute/path/to/bom.json /absolute/path/to/project
Common aliases (the full matrix is at https://cdxgen.github.io/cdxgen/#/PROJECT_TYPES):
| Ecosystem | Types |
|---|---|
| Node.js | npm, pnpm, yarn, bun, deno, js, ts, nodejs, rush |
| JVM | java, kotlin, scala, groovy, gradle, maven, sbt, mill |
| Python | python, uv, poetry, pdm, hatch, pixi, rye, conda |
| Go | go, golang, gomod |
| Rust | rust, cargo, rs |
| .NET | csharp, dotnet, vbnet, fsharp |
| Ruby | ruby, bundler, gems |
| PHP | php, composer, wordpress |
| C/C++ | c, cpp, conan, collider |
| Others | dart, elixir, haskell, clojure, nix, zig, gleam, mojo |
| CI/config | github, actions, helm |
Pinned toolchains are supported as types too: java21, python312,
maven3.9.9, gradle8.14, ruby3.4.0. cdxgen installs the pinned tool with
sdkman and uses it instead of the project's wrapper. This is the fix when a
project's wrapper is broken or targets an unsupported JDK.
--recurse defaults to true. For large repos this is often the wrong default:
# Single project at the root only
cdxgen --no-recurse -t java -o /absolute/path/to/bom.json /absolute/path/to/project
Combine --no-recurse with explicit -t values, or use --exclude to skip
directories. See https://cdxgen.github.io/cdxgen/#/MONOREPO.
| Phase | Behavior |
|---|---|
pre-build | No package installations. Manifests and lockfiles only. |
build | Default. May invoke the package manager. |
post-build | Binaries and containers rather than source. |
cdxgen --lifecycle pre-build -o /absolute/path/to/bom.json /absolute/path/to/project
pre-build is the right choice for CI, containers, air-gapped hosts, and any
run where modifying the project is unacceptable.
--profile presets a bundle of flags for an intended audience.
| Profile | Intent |
|---|---|
generic | Default |
appsec | Application-security review |
research | Deep security research, maximum evidence |
operational | Operations and runtime inventory |
threat-modeling | Threat-model inputs |
license-compliance | License resolution and compliance |
ml / ml-deep / ml-tiny | Machine-learning inventory at three depths |
introspect | Grade the scan's own fidelity and rank remediations |
cdxgen --profile license-compliance -o /absolute/path/to/bom.json /absolute/path/to/project
cdxgen --profile research --evidence -o /absolute/path/to/bom.json /absolute/path/to/project
Use --profile introspect when the user's real question is "why is my SBOM
incomplete?" — then follow sbom-fidelity-loop.
| Flag | Effect |
|---|---|
--required-only | Production/non-dev dependencies only |
--filter <text> | Exclude components matching the text in purl or property values |
--only <text> | Include only components matching the text in the purl |
--exclude <glob> | Skip paths |
--exclude-type <t> | Drop an ecosystem or overlay from the result |
cdxgen --required-only -o /absolute/path/to/bom.json /absolute/path/to/project
--spec-version defaults to 1.7. Accepted generation targets are 1.6,
1.7, and 2.0. 1.4 and 1.5 are rejected as generation targets — if a
consumer needs a legacy document, generate at a supported version and downgrade
the serialized output with cdx-convert (see bom-convert-validate).
# SPDX 3.0.1 JSON-LD directly
cdxgen --format spdx -o /absolute/path/to/bom.spdx.json /absolute/path/to/project
# Protobuf export alongside JSON
cdxgen --export-proto --proto-bin-file /absolute/path/to/bom.cdx -o /absolute/path/to/bom.json /absolute/path/to/project
Other output controls: -p / --print for a human-readable table or tree,
--json-pretty, --tui for the interactive terminal view, --quiet.
| Flag | Adds |
|---|---|
--evidence | Occurrence and callstack evidence; produces a SaaSBOM |
--include-crypto | Cryptographic assets and certificates (see crypto-bom) |
--include-formulation | Git metadata and build-tool versions |
--include-release-notes | Release notes for resolved components |
--resolve-class | Class-to-namespace mapping; writes <output>.map |
--deep | Deep parsing for C/C++, OS, OCI, and live systems |
--bom-audit | Embed supply-chain findings during generation (see bom-audit) |
--tlp-classification | CLEAR, GREEN, AMBER, AMBER_AND_STRICT, RED |
--license-policy | Evaluate against a license policy file |
--validate is on by default; the BOM is schema-checked before cdxgen exits.
| Symptom | First thing to check |
|---|---|
| Hangs or exits with a thin BOM | Atom availability. Native-binary platforms need no JDK; on jar-based triples (darwin-amd64, windows-arm64, linux-arm64-musl) check java -version — Java >= 23 is required and fails silently below that. |
| Registry or network timeouts | Set HTTP_PROXY / HTTPS_PROXY; cdxgen's HTTP client honors them automatically. Do not auto-retry without asking. |
| Only direct dependencies | The build tool could not resolve transitives. Run --profile introspect and follow sbom-fidelity-loop. |
| Fails in CI or a container | --install-deps defaulted on. Use --no-install-deps or --lifecycle pre-build. |
| Missing build toolchain | Suggest the container image, or a pinned type such as -t java21. |
| Permission errors | Check whether CDXGEN_SECURE_MODE is set; see reference/safety.md. |
More at https://cdxgen.github.io/cdxgen/#/TROUBLESHOOTING.
Offer the natural next step rather than stopping at the file:
bom-explorebom-auditbom-signingbom-convert-validatebom-evidencesbom-fidelity-loopdependency-track-uploadWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
sbom, cyclonedx, dependency-inventory, license-resolution, cdxgen
14 skills in this plugin
/ai-bomGenerates AI-BOM, MCP inventory, AI skill inventory, and AI authorship provenance documents with cdxgen, cataloging models, inference services, Hugging Face purls, MCP servers and their tools/prompts/resources, agent instruction files, and cdx:ai:codegen provenance signals, then audits them with AI-focused rule packs. Use when asked to inventory AI or ML usage, catalog MCP servers, audit agent instruction or skill files, assess AI supply-chain risk, or detect AI-generated code authorship./bom-auditRuns supply-chain risk analysis on CycloneDX BOMs with cdx-audit predictive auditing and cdxgen --bom-audit embedded rules, covering npm and PyPI package compromise posture, CI permission risk, dependency source integrity, license policy violations, and SARIF or JSON reporting for code scanning. Use when asked to audit an SBOM, assess supply-chain or dependency risk, check for compromised or malicious packages, triage which dependencies to review first, or produce SARIF from a BOM./bom-convert-validateConverts CycloneDX BOMs to SPDX 3.0.1 JSON-LD or between CycloneDX spec versions with cdx-convert, and validates BOMs against JSON schema, deep consistency checks, and OWASP SCVS and EU Cyber Resilience Act compliance benchmarks with cdx-validate, emitting SARIF for code scanning. Use when asked to convert an SBOM to SPDX, downgrade or upgrade a BOM spec version, validate or lint a BOM, check SCVS or CRA compliance, or score SBOM quality.npx claudepluginhub cdxgen/cdxgen --plugin cdxgenOther plugins' skills for the same job