Documentation The sc command line

One command scans a repository. Two more show the report and download it.

Install

  • macOS

    Intel and Apple silicon. Run it in Terminal.

    curl -fsSL https://scancodebase.com/install.sh | sh
  • Linux

    x86-64 and ARM64. Any distribution.

    curl -fsSL https://scancodebase.com/install.sh | sh
  • Windows

    Windows 10 and 11. Run it in PowerShell.

    irm https://scancodebase.com/install.ps1 | iex

The installer detects your system, downloads a single file called sc and adds it to your PATH. It needs nothing else: no Docker, no runtime.

Open a new terminal and check that it works.

sc version

Sign in

sc login      # Opens the browser to sign in
sc whoami     # Shows the account and the plan
sc logout     # Removes the session from this machine

On a machine without a browser, such as a CI runner, use an access token instead. Set it in the SC_TOKEN environment variable and sc uses it without asking.

Scan your code

Give sc code a folder or the URL of a repository.

sc code .                               # The project in the current folder
sc code ./services/api                  # One folder of a larger project
sc code https://github.com/you/myapp    # A repository by its URL
sc code ./myapp.zip                     # A zip file of the code
  • Files listed in your .gitignore are left out.
  • Your code is read, never executed.
  • For a private repository by URL, connect your code platform in your account first. A local folder needs no connection.
  • The code is deleted when the analysis ends.

What you see

The scan ends with a verdict, the fixes in order of importance and the link to the report.

$ sc code .

  myapp

  Almost ready. Fix 3 things first.

  1. Fix the query in users.js
     Line 43 builds a SQL query by joining strings with user input.
     db.query('SELECT * FROM users WHERE id = ?', [id])

  2. Take the key out of users.js
     Line 41 has it written in the code, so it is in every copy of the repo.
     const KEY = process.env.API_KEY

  3. Update lodash
     Line 40 imports a version with known vulnerabilities.
     npm install lodash@latest

  31 low-risk notes can wait.

  Report     https://platform.scancodebase.com/reports/r_8f3k2a
  Download   sc download r_8f3k2a --format pdf

Options

OptionWhat it does
--fail-on <level>Ends with exit code 1 when there is a finding of this level or higher: critical, high, medium or low. Use it to stop a pipeline.
--format <format>Prints the result as text, json or sarif. The default is text.
--output <file>Writes the result to a file instead of the terminal.
--no-waitStarts the scan and returns at once with the report ID.
--quietPrints only the verdict and the link to the report.
--helpShows the help for any command.

Settings file

To avoid repeating options, put them in a file called .sc.yml in the folder where you run sc. Options on the command line win over the file.

# .sc.yml
fail-on: high        # Same as --fail-on high
format: text         # text, json or sarif
exclude:             # Folders and files to leave out
  - docs/
  - "**/*.test.js"

Output for other tools

With the json format, sc prints the same data the API returns, ready for jq or for your own scripts.

sc code . --format json
{
  "id": "r_8f3k2a",
  "target": "myapp",
  "created": "2026-11-17T10:42:00Z",
  "verdict": "almost_ready",
  "findings": {"critical": 1, "high": 2, "medium": 0, "low": 31},
  "fix_first": [
    {"title": "Fix the query in users.js", "fix": "db.query('SELECT * FROM users WHERE id = ?', [id])"}
  ],
  "url": "https://platform.scancodebase.com/reports/r_8f3k2a"
}

See your reports

sc reports                  # Lists your latest reports
sc report last              # Shows the latest report in the terminal
sc report r_8f3k2a          # Shows one report by its ID
sc report r_8f3k2a --open   # Opens it in the browser
$ sc reports

ID         DATE               TARGET          VERDICT
r_8f3k2a   2026-11-17 10:42   myapp           Almost ready
r_7c1m9d   2026-11-16 18:05   billing-api     Ready
r_5t0q2x   2026-11-14 09:30   web-shop        Not ready

Download a report

sc download last --format pdf                         # Saves the latest report as PDF
sc download r_8f3k2a --format json                    # Saves one report as JSON
sc download r_8f3k2a --format sarif --output scan.sarif   # Chooses the file name
FormatWhat you get
pdfThe report as a document to send or file.
htmlThe report as a single page that opens in any browser.
jsonEvery finding as data, for your own tools.
sarifFindings for GitHub, GitLab and Azure DevOps code scanning.

The formats you can download depend on your plan. Free accounts get the simple report.

Other commands

CommandWhat it does
sc usageShows the scans used and the scans left this month.
sc delete r_8f3k2aDeletes a report from your account for good.
sc completion zshPrints the completion script for your shell: bash, zsh, fish or powershell.
sc updateUpdates sc to the latest version.
sc versionShows the installed version.

Exit codes

CodeMeaning
0The scan finished and nothing reached the level set with --fail-on.
1The scan finished and at least one finding reached that level.
2The scan could not run: wrong arguments, no session or no network.
3The limit of your plan was reached.

Environment variables

VariableWhat it does
SC_TOKENThe access token to use instead of the session from sc login.
NO_COLORTurns colours off in the output.

Recipes

# Scan before every push: save this as .git/hooks/pre-push
#!/bin/sh
sc code . --fail-on high --quiet

# Scan only one service of a monorepo
sc code ./services/api --fail-on high

# Keep a PDF of every scan
sc code . && sc download last --format pdf --output scan.pdf

One tool for images and code

The same tool works with scancontainer and with scancodebase: sc image scans a container image and sc code scans source code.

If something goes wrong

What you seeWhat to do
command not found: scOpen a new terminal. If it is still missing, run the installer again.
No sessionRun sc login, or check that SC_TOKEN is set and has not been revoked.
Limit reachedRun sc usage to see what is left. The scan runs when the limit resets or when you add scans.
Cannot read the repositoryCheck the path, or the URL and that your code platform is connected.
Part of the repository could not be readThe report lists it as a gap instead of passing it as clean.

Scan yours before the next merge.