Command-line interface

swh scanner scan

Scan a source code project to discover files and directories already present in the archive.

The source code project can be checked using different policies that can be set using the -p/–policy option:

auto: it selects the best policy based on the source code, for codebase(s)
with less than 1000 file/dir contents all the nodes will be queried.

bfs: scan the source code in the BFS order, checking unknown directories only.

greedybfs: same as “bfs” policy, but lookup the status of source code artifacts
in chunks, in order to minimize the number of Web API round-trips with the
archive.
filepriority: scan all the source code file contents, checking only unset
directories. (useful if the codebase contains a lot of source files)

dirpriority: scan all the source code directories and check only unknown directory contents.

Other information about software artifacts could be specified with the -e/ –extra-info option:

origin: search the origin url of each source code files/dirs using the in-memory
compressed graph.
swh scanner scan [OPTIONS] ROOT_PATH

Options

-u, --api-url <API_URL>

URL for the api request

-x, --exclude <PATTERN>

Exclude directories using glob patterns (e.g., *.git to exclude all .git directories)

-f, --output-format <out_fmt>

The output format

Default

text

Options

text | json | ndjson | sunburst

-i, --interactive

Show the result in a dashboard

-p, --policy <policy>

The scan policy.

Default

auto

Options

auto | bfs | greedybfs | filepriority | dirpriority

-e, --extra-info <extra_info>

Add selected additional information about known software artifacts.

Options

origin

Arguments

ROOT_PATH

Required argument