Skip to main content
Use detect to review your package files, then generate an SBOM, audit dependencies, or check licenses. This reference covers Alpha version 0.3.0. For help with a command, run githits-scan <command> --help. For nested commands, use the full name, such as githits-scan sbom generate --help or githits-scan license check --help.

Common options

All five commands accept these output options: Diagnostics go to stderr. Reports go to stdout or the output file. For discovery and online analysis, use these options to control file selection: Online analysis requires GITHITS_API_TOKEN. Review what Scan uploads before running it. The HTTP API reference describes upload limits, quota, and how to interpret results.

Detect

Preview the package files Scan would upload, without a token or network connection:
Scan reads the selected files locally and prepares the same selection as an upload, including eligible workspace members. The inventory distinguishes selected files from candidates that won’t be uploaded. It lists skipped directory subtrees as patterns because their file counts are unknown. After reviewing the selection, save it to your configuration:
If no package files are selected, Scan exits 1. If Scan cannot prepare an upload, JSON inventory is still available with null upload_paths and an upload_error. The command then exits 2 for usage errors or 3 for I/O errors.

Generate an SBOM

Generate a dependency inventory in the format you need:
Scan submits one analysis job and writes the complete document returned by GitHits. Use --format to choose the output:

Audit dependencies

Check vulnerabilities, deprecated releases, outdated and duplicate versions, and manifest/lockfile disagreements:
Any finding or incomplete check returns exit 1. A clean audit covers the selected package files; it does not establish that an installed build is safe. Scan shows change suggestions when GitHits supplies them. It does not edit your dependencies. JSON and saved analyses retain findings even when the human-readable output omits details. To inspect an analysis offline, save it with --save-analysis. Compact audit --json output cannot be used as a saved analysis.

Report licenses

Read license information without applying a policy:
You don’t need a license policy for this command. Exit 0 means Scan produced a report, even if license information is unknown or incomplete. Use license check to enforce a policy. The report separates reported licenses, publisher context, source observations, and coverage gaps. It does not give a policy verdict.

Check license policy

Configure a license policy, then check dependencies against it:
Without --sbom, Scan generates a CycloneDX JSON document online. With --sbom, it reads an existing document offline. Both forms require [licenses] in the selected configuration. Violations, missing or unrecognized licenses, and unresolved projects return exit 1.

Offline replay

Inspect a saved analysis, read a license report, or check an SBOM without contacting the API. These commands need no token:
Use the matching saved document for each command: Replay uses the saved information. It does not refresh data from GitHits. Compact audit JSON and policy verdict JSON are for automation and cannot be used as replay inputs.

Exit codes

Use these distinctions to handle failures in CI. Read the diagnostic before rerunning an online command: it submits a new job and can consume quota again.