Synopsis

ScanCode detects licenses, copyrights, package manifests and direct dependencies and more both in source code and binary files, by scanning the files. This section shows and explains the following:

  • Quickstart
  • Type of Options
  • Output Formats
  • Other Important Documentation

This is a synopsis of the whole section that follows, the ScanCode Command Line Referance.

Quickstart

The basic usage is:

./scancode [OPTIONS] <input> <output_file>

Note

On Windows use scancode instead of ./scancode

Warning

In later versions 3.x, this format changes significantly. Output options are different, and <output_file> precedes <input>.

The <input> file or directory is what will be scanned for origin clues. The results will be saved to the <output_file>.

Type of Options

Scancode Toolit Command Line options can be divided into these major section:

Output Formats

The output file format is set by using the -f or --format option. The default output format is JSON, the entire file being in one line, without whitespace characters.

The following example scans will show you how to run a scan with each of the result formats. For the scans, we will use the samples directory provided with the ScanCode Toolkit.

JSON file output

Scan the samples directory and save the scan to a JSON file:

./scancode --format json samples samples.json

Warning

The –format option is discontinued in later 3.x versions, where --json is used instead of --format json.

../../_images/scancode-toolkit-json-output.png

Static html output

Scan the samples directory for licenses and copyrights and save the scan results to an HTML file. When the scan is done, open samples.html in your web browser.

./scancode --format html samples samples.html
../../_images/scancode-toolkit-static-html1.png ../../_images/scancode-toolkit-static-html2.png