Command-line interface

Shared command-line interface

swh

Command line interface for Software Heritage.

swh [OPTIONS] COMMAND [ARGS]...

Options

-l, --log-level <log_levels>

Log level (defaults to INFO). Can override the log level for a specific module, by using the specific.module:LOGLEVEL syntax (e.g. --log-level swh.core:DEBUG will enable DEBUG logging for swh.core).

--log-config <log_config>

Python yaml logging configuration file.

--sentry-dsn <sentry_dsn>

DSN of the Sentry instance to report to

Commands

auth

Software Heritage Authentication tools.

counters

Software Heritage Counters tools.

db

Software Heritage database generic tools.

deposit

Deposit main command

fs

Software Heritage virtual file system

graph

Software Heritage graph tools.

identify

Compute the Software Heritage persistent…

indexer

Software Heritage Indexer tools.

lister

Software Heritage Lister tools.

loader

Loader cli tools

objstorage

Software Heritage Objstorage tools.

scanner

Software Heritage Scanner tools.

scheduler

Software Heritage Scheduler tools.

search

Software Heritage Search tools.

storage

Software Heritage Storage tools.

vault

Software Heritage Vault tools.

web

Software Heritage web client

Database initialization utilities

swh db init

Initialize a database for the Software Heritage <module>.

Example:

swh db init -d swh-test storage

If you want to specify non-default postgresql connection parameters, please provide them using standard environment variables. See psql(1) man page (section ENVIRONMENTS) for details.

Examples:

PGPORT=5434 swh db init indexer
swh db init -d postgresql://user:passwd@pghost:5433/swh-storage storage
swh db init --flavor read_replica -d swh-storage storage
swh db init [OPTIONS] MODULE

Options

-d, --dbname, --db-name <dbname>

Database name.

Default

softwareheritage-dev

--flavor <flavor>

Database flavor.

Arguments

MODULE

Required argument

swh db-init

Initialize a database for the Software Heritage <module>.

Example:

swh db init -d swh-test storage

If you want to specify non-default postgresql connection parameters, please provide them using standard environment variables. See psql(1) man page (section ENVIRONMENTS) for details.

Examples:

PGPORT=5434 swh db init indexer
swh db init -d postgresql://user:passwd@pghost:5433/swh-storage storage
swh db init --flavor read_replica -d swh-storage storage
swh db-init [OPTIONS] MODULE

Options

-d, --dbname, --db-name <dbname>

Database name.

Default

softwareheritage-dev

--flavor <flavor>

Database flavor.

Arguments

MODULE

Required argument