OpenCredits collects the open source libraries your software is built on, checks their licenses against your policy, and publishes a credits page listing each library with its license, copyright holders, source link and full license text.
Publishing third-party notices is easy for one repository and hard for a company. Dependencies are spread across many repositories, some of which are experiments that never reach users, and most scanners give you package names and license identifiers but not the copyright notices that the licenses actually require.
OpenCredits finds the repositories that really ship and produces a page you can publish as it is, so a recurring legal obligation becomes a nightly job rather than manual work before every release.
- Fits how your repositories are organised. Scan one repository, a named list of repositories, a whole GitHub organisation, or let each team scan itself and combine the results. The scanned repositories need no changes.
- Covers any technology. A built-in npm lockfile reader, plus Syft for Java, Go, Python, .NET, Ruby, PHP, Rust, Swift, Dart and more.
- Shows real notices. For npm packages it publishes each package's own LICENSE and NOTICE file, after verifying the archive against the lockfile checksum.
- Checks your license policy. Every dependency is classified, and anything that needs a decision is reported, optionally failing the build.
- Keeps internal data internal. Repository names and versions stay in a private data directory and never reach the page.
- Produces a page anyone can use. Static HTML without JavaScript, WCAG 2.1 AA, mobile and in-app web views, dark mode, English and German.
| Who scans | Credentials needed | Example | |
|---|---|---|---|
| Solo | The repository scans itself | None | examples/single-repository |
| Central | One job scans a list of repositories, or discovers an organisation | One credential that can read them all | examples/multi-repository, examples/github-organization |
| Federated | Each repository scans itself and publishes its dataset; one job combines them | Each repository uses its own | examples/federated |
All three produce the same dataset.json, and merge combines any number of
them. A team can start solo and join a federated setup later without changing its
configuration. Merging is idempotent and order-independent, so a repository can
join or leave without touching the central configuration.
repositories ──▶ 1. Discover and filter ──▶ 2. Extract dependencies ──▶ 3. Enrich licenses
│
public page ◀── 6. Render ◀── publish guard ◀── 5. Check policy ◀── 4. Deduplicate
│ ▲
│ └── curations
└──▶ private: dataset, SPDX SBOM, audit report
- Discover and filter. For an organisation, a relevance filter includes repositories with recent successful CI runs or deployment configuration referencing your domains, and excludes archived projects, forks and playgrounds. For an explicit list, every listed repository is scanned.
- Extract. Dependency manifests and lockfiles are read from each repository's archive. Nothing is built or installed.
- Enrich. Packages get license expressions, verbatim license texts, copyright statements and repository links.
- Deduplicate across repositories and versions, and apply your curations.
- Check policy against the license ruleset.
- Render, unless the publish guard sees a suspicious drop in packages.
These instructions get you a credits page for one repository in a few minutes. See Deployment for how to publish it.
- Node.js 22 LTS or later (see
.nvmrc). - Optional: Syft, for ecosystems other than npm. The container image and the GitHub Action install it for you.
- For scanning a GitHub organisation: a GitHub App or a token with read-only access.
Add opencredits.config.json to your repository:
{
"source": { "type": "local", "paths": ["."] },
"output": { "title": "Open source licenses", "language": "en" }
}Run it:
npx @otto-de/opencredits runThe package lives on GitHub Packages, which requires a token even for public
packages. Create a personal access token
with the read:packages scope and add to ~/.npmrc:
@otto-de:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_TOKENTo avoid that setup entirely, use the GitHub Action or the container image, which need no credentials:
- uses: otto-de/opencredits@v1docker run --rm -v "$PWD:/work" -w /work ghcr.io/otto-de/opencredits:1 runOpen opencredits-site/index.html. That is the finished page.
To see it working on a prepared project first:
npm install
npm run demoThis scans examples/demo-shop, a small frontend with five
real libraries, and writes a page to demo-output/site/index.html.
List them and scan from one place:
{
"source": {
"type": "repositories",
"repositories": ["otto-de/shop-web", "otto-de/shop-checkout"],
"auth": "token"
}
}If no single credential may read all of them, use the federated setup instead:
each repository runs opencredits scan and uploads
opencredits-data/dataset.json; a central job downloads those files and runs
opencredits merge --inputs fragments.
- Create a GitHub App owned by your organisation with read-only Contents, Metadata and Actions permissions. Install it on all repositories and generate a private key.
- Create a central repository with
opencredits.config.json, an optionalcurations.jsonand the scheduled workflow. - Store credentials: the App ID as the variable
OPENCREDITS_GITHUB_APP_IDand the private key as the secretOPENCREDITS_GITHUB_APP_PRIVATE_KEY.
Review audit-summary.md after the first run: it lists excluded repositories
with reasons, failures, policy findings and packages whose notice may be
incomplete.
| Command | What it does |
|---|---|
opencredits run |
Scan, check the publish guard, render the page |
opencredits scan |
Scan only, and write the dataset other runs can merge |
opencredits merge --inputs <paths> |
Combine datasets from several scans into one page |
opencredits render --dataset <file> |
Render the page from an existing dataset |
opencredits validate |
Check the configuration |
Common options: --config (default opencredits.config.json), --data-dir
(default opencredits-data), --site-dir (default opencredits-site).
Exit codes: 0 success, 1 failure, 2 invalid configuration, 3 publish guard
blocked the result, 4 the license policy blocked it.
| Variable | Purpose |
|---|---|
OPENCREDITS_GITHUB_APP_ID |
GitHub App ID (with auth: "app") |
OPENCREDITS_GITHUB_APP_PRIVATE_KEY or ..._PATH |
GitHub App private key (PEM) |
OPENCREDITS_GITHUB_TOKEN or GITHUB_TOKEN |
Token (with auth: "token"), read-only |
OPENCREDITS_LOG_LEVEL |
debug, info (default), warn, error. JSON lines on stderr. |
| Path | Audience | Contents |
|---|---|---|
opencredits-site/index.html |
Public | The credits page |
opencredits-data/dataset.json |
Internal | Deduplicated packages with versions, repositories and quality flags. This is also the fragment merge consumes. |
opencredits-data/sbom.spdx.json |
Internal | SPDX 2.3 document for other compliance tools |
opencredits-data/audit-report.json |
Internal | Repository decisions, failures, policy findings, packages needing review |
opencredits-data/audit-summary.md |
Internal | Human-readable summary, also added to the GitHub job summary |
Never publish
opencredits-data. It names internal repositories.
Every dependency is classified into a category, and the category plus your project type decides the verdict:
| Category | Examples | Internal | Distributed or public service |
|---|---|---|---|
| Permissive | MIT, Apache-2.0, BSD, ISC | Allowed | Allowed |
| Weak copyleft | MPL-2.0, EPL-2.0, CDDL | Allowed | Allowed, publish this dependency's source and your changes |
| Strong copyleft | GPL, LGPL, OSL, QPL | Allowed | Forbidden |
| Network copyleft | AGPL, SSPL, EUPL, CPAL, RPL | Forbidden | Forbidden |
| Not open source | Commons Clause, BUSL, unlicensed | Forbidden | Forbidden |
| Case by case | Elastic 2.0 | Review | Review |
| Undetermined | no license found | Review | Review |
{
"policy": {
"guidelinesUrl": "https://github.com/otto-de/opensource/blob/main/_docs/licensing.md",
"projectType": "distributed",
"ruleset": "conservative",
"failOn": "forbidden",
"exceptions": [
{ "package": "some-gpl-tool", "reason": "Build-time only, approved by legal on 2026-10-01" }
]
}
}guidelinesUrllinks your organisation's own license guidelines. Every audit report points at it, so a reader checks the authoritative document instead of trusting this tool's defaults.ruleset: "conservative"treats the Lesser GPL as strong copyleft, matching license guidance that forbids the whole GPL family in distributed software."standard"treats it as weak copyleft instead.failOncontrols exit code 4. The page is always written first, so a policy problem never leaves you without a report.- Exceptions need a written reason and stay in the report as accepted risks.
overridesreclassifies any individual license.
SPDX expressions are evaluated by operator: MIT OR GPL-3.0-only counts as
permissive because it is a choice, while MIT AND GPL-3.0-only counts as strong
copyleft because both sets of obligations apply.
This supports compliance work; it is not legal advice. Have your legal team review the result and adjust the ruleset to your own policy.
All settings and defaults are in the
JSON Schema. Reference it with
"$schema" for editor completion. The most important ones:
| Setting | Default | Notes |
|---|---|---|
source.type |
local |
local, repositories or github |
relevance.ciWindowDays |
30 |
Recent successful CI run makes a repository relevant |
relevance.deploymentDomains |
[] |
For example ["example.com"]; subdomains match |
relevance.allowlist / denylist |
[] |
owner/repo; denylist wins |
extraction.includeDevDependencies |
false |
Dev dependencies are usually not distributed |
output.language |
en |
en or de |
output.showVersions |
false |
Versions stay in the private dataset |
output.accentColor |
#1F5F8B |
Validated for 4.5:1 contrast |
policy.guidelinesUrl |
null |
Link to your own license guidelines, shown in every report |
policy.failOn |
none |
none, forbidden or review |
guard.maxPackageDropPercent |
30 |
Blocks rendering after a suspicious drop |
Scanners cannot know everything. A curations file corrects packages and adds
components that no package manager declares, such as source files copied into a
repository. Every entry needs a reason, which appears in the audit trail. See
examples/github-organization/curations.json.
npm ci
npm testnpm test compiles the project and runs the full suite with Node's built-in test
runner. It needs no network access: GitHub and the npm registry are replaced by
local mock servers.
The suite covers the pipeline end to end, and the security-relevant cases deliberately use malicious input: path traversal and symlinks in archives, decompression bombs, script injection in package metadata, tampered package archives, and credentials being redirected to another host.
Coding style and types are checked separately:
npm run lint
npm run typecheckopencredits run writes a directory of static files, so any web server, object
storage or CDN can serve it. Publish only opencredits-site, never
opencredits-data.
Serve the page with the security headers that a meta tag cannot set: at minimum
Content-Security-Policy with frame-ancestors limited to the hosts that embed
it, X-Content-Type-Options: nosniff and Strict-Transport-Security.
In CI, the GitHub Action runs the same commands. The example workflows upload the page as a build artifact; add a deployment step for your own hosting.
The page uses semantic landmarks and headings, a skip link, an alphabetical index, native expandable sections for license texts, visible keyboard focus, touch targets of at least 44 pixels, a zoom-friendly layout, dark mode, Windows high-contrast support and print styles. It needs no JavaScript.
Automated tests check heading order, unique ids, valid in-page links and the language attribute, and the configuration rejects accent colors below 4.5:1 contrast. Test with a screen reader before each major release.
OpenCredits is designed to process untrusted repositories and package metadata safely: it never builds or installs code, extracts archives with strict limits, verifies package checksums, sends credentials only to the configured API, redacts secrets from logs, and escapes all content on the page behind a strict Content Security Policy. See the threat model and report vulnerabilities as described in SECURITY.md.
- Node.js - Runtime, 22 LTS or later
- TypeScript - Language, strict mode
- Syft - Optional, for ecosystems other than npm
OpenCredits has no runtime dependencies. Everything else uses the Node.js standard library, which keeps the supply-chain attack surface as small as possible.
- Verbatim license texts are fetched for npm packages. Other ecosystems get the license identifier from Syft and a link to the SPDX text, and are flagged for review. Enrichment from ClearlyDefined and Maven Central is planned.
- Dependencies in yarn and pnpm lockfiles are read through Syft, which does not separate development dependencies as precisely as the npm reader.
- GitHub is the only repository host so far.
- The page is a single file. Very large organisations may want pagination.
Please read CONTRIBUTING.md for details on our process for submitting pull requests to us, and please ensure you follow the CODE_OF_CONDUCT.md.
Design decisions are recorded in docs/adr, and the
release checklist tracks readiness for
publication.
We use SemVer for versioning. For the versions available, see the tags on this repository. Upgrade notes for breaking changes are in docs/migration.md.
See the MAINTAINERS file for the current maintainers, and the list of contributors who participated in this project.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details
- Thanks to @PurpleBooth for the original readme
- Thanks to the @zalando/Nakadi project for Contribution file
- Thanks to @SteveMao for Issue templates
- Thanks to the Anchore team for Syft