sandtrace sbom
Generate a CycloneDX SBOM for a project or monorepo by discovering common package manifests and lockfiles.
Usage
sandtrace sbom ./my-project
sandtrace sbom ./my-project --output bom.json
sandtrace sbom ./workspace --no-pretty
Options
| Flag | Default | Description |
|---|---|---|
TARGET | (required) | Directory to inspect |
--format cyclonedx-json | cyclonedx-json | Output format |
-o, --output FILE | stdout | Write JSON to a file |
--no-pretty | false | Emit compact JSON |
What It Detects
Current SBOM generation supports:
npm-shrinkwrap.json,package-lock.json,package-lock.yaml, andpackage.jsonfor npm projectspnpm-lock.yamlfor pnpm projectsyarn.lockfor Yarn projectsCargo.lockandCargo.tomlfor Rust projectsrequirements.txt,poetry.lock,uv.lock,pylock.toml,pyproject.toml,Pipfile.lock, andPipfilefor Python projectsconda-lock.yml,conda-lock.yaml,explicit.txt,explicit-*.txt,*-explicit.txt,environment.yml, andenvironment.yamlfor Conda environmentscomposer.lockandcomposer.jsonfor Composer projectsGemfile.lock,Gemfile, and.gemspecfor Ruby projectsgo.sumandgo.modfor Go projectsmix.lockandmix.exsfor Elixir projectsbun.lockfor Bun projects, withbun.lockbfalling back topackage.jsondeno.json,deno.jsonc, anddeno.lockfor Deno projects, includingnpm:,jsr:, and remote URL importspom.xml,gradle.lockfile, and Gradle build files for Java projectspackages.lock.jsonand.csprojfor .NET projectsPackage.resolvedandPackage.swiftfor Swift projects
When a text lockfile is present, sandtrace sbom prefers resolved package versions. When only a manifest is available, it emits the dependency with a sandtrace:version_spec property when the version is a range or other unresolved specifier.
Output
The command emits CycloneDX 1.5 JSON with:
- metadata about the scanned application
- discovered library components
- a root dependency list for direct dependencies when they can be inferred
Example:
sandtrace sbom . --output bom.json
jq '.bomFormat, .metadata.component.name, (.components | length)' bom.json
Notes
- Hidden and generated directories such as
node_modules,target,vendor,.git, and common cache folders are skipped during discovery. - The current implementation focuses on inventory generation, not vulnerability matching. Use
sandtrace auditandsandtrace runfor behavioral and static detection.