A tool for compliance with the REUSE recommendations for software licensing and copyright management.
—
REUSE provides a comprehensive command-line interface with 7 subcommands for managing REUSE compliance, licensing, and copyright information in software projects.
The main reuse command provides global configuration options that apply to all subcommands.
reuse [OPTIONS] COMMAND [ARGS]...
# Global Options:
--debug Enable debug statements
--suppress-deprecation Hide deprecation warnings
--include-submodules Do not skip Git submodules
--include-meson-subprojects Do not skip Meson subprojects
--no-multiprocessing Do not use multiprocessing
--root PATH Define project root directory
--version Show version information
--help Show help messageLint the project directory for REUSE compliance, checking all files for proper copyright and licensing information.
reuse lint [OPTIONS]
# Options:
--quiet, -q Prevent output
--json, -j Format output as JSON
--plain, -p Format output as plain text (default)
--lines, -l Format output as errors per lineUsage Example:
# Basic linting
reuse lint
# JSON output for processing
reuse lint --json > compliance-report.json
# Quiet mode (only show errors)
reuse lint --quietThe lint command examines all files in the project and reports:
Add copyright and licensing information to file headers.
reuse annotate [OPTIONS] FILE [FILE...]
# Options:
--copyright TEXT Copyright notice (can be used multiple times)
--license SPDX_IDENTIFIER SPDX license identifier (can be used multiple times)
--contributor TEXT Contributor information (can be used multiple times)
--year INTEGER Copyright year
--style [python|c|html|...] Comment style to use
--template FILE Template file for header
--force Force annotation even if file has existing info
--recursive Recursively annotate directories
--exclude-patterns TEXT Exclude files matching these patternsUsage Examples:
# Add copyright and license to a single file
reuse annotate --copyright="2023 Jane Doe" --license="MIT" src/example.py
# Add multiple copyrights and licenses
reuse annotate \
--copyright="2023 Jane Doe" \
--copyright="2023 Company Inc" \
--license="MIT" \
--license="GPL-3.0-or-later" \
src/example.py
# Annotate all Python files recursively
reuse annotate --recursive --copyright="2023 Jane Doe" --license="MIT" src/
# Use specific year
reuse annotate --copyright="Jane Doe" --license="MIT" --year=2020 old-file.py
# Force annotation (overwrite existing)
reuse annotate --force --copyright="2023 Jane Doe" --license="MIT" src/example.pyGenerate an SPDX bill of materials for the project.
reuse spdx [OPTIONS]
# Options:
--output FILE, -o FILE Output file (default: stdout)
--add-license-concluded Add license concluded field (requires creator info)
--creator-person TEXT Name of person signing off on SPDX report
--creator-organization TEXT Name of organization signing off on SPDX reportUsage Examples:
# Generate SPDX document
reuse spdx > project.spdx
# Save to file
reuse spdx --output=project.spdx
# Generate with license conclusions
reuse spdx --add-license-concluded \
--creator-person="Jane Doe" \
--output=detailed.spdx
# With organization creator
reuse spdx --add-license-concluded \
--creator-organization="Example Corp" \
--output=project.spdxDownload a license from the SPDX License List and place it in the LICENSES/ directory.
reuse download [OPTIONS] SPDX_IDENTIFIER [SPDX_IDENTIFIER...]
# Options:
--output DIRECTORY Directory to store license files (default: LICENSES/)Usage Examples:
# Download single license
reuse download MIT
# Download multiple licenses
reuse download MIT GPL-3.0-or-later Apache-2.0
# Download to specific directory
reuse download --output=licenses/ MITThe download command:
MIT.txt)List all licenses available on the SPDX License List.
reuse supported-licenses [OPTIONS]
# Options:
--format [plain|json] Output format (default: plain)Usage Examples:
# List all supported licenses
reuse supported-licenses
# JSON output for processing
reuse supported-licenses --format=json > supported-licenses.jsonConvert a .reuse/dep5 file to a REUSE.toml file format.
reuse convert-dep5 [OPTIONS]
# Options:
--no-backup Do not create backup of original file
--output FILE Output file (default: REUSE.toml)Usage Examples:
# Convert .reuse/dep5 to REUSE.toml
reuse convert-dep5
# Convert without creating backup
reuse convert-dep5 --no-backup
# Convert to specific output file
reuse convert-dep5 --output=new-reuse.tomlLint individual files for REUSE compliance instead of the entire project.
reuse lint-file [OPTIONS] FILE [FILE...]
# Options:
--json, -j Format output as JSON
--plain, -p Format output as plain text (default)
--lines, -l Format output as errors per lineUsage Examples:
# Lint specific files
reuse lint-file src/example.py src/other.py
# JSON output for individual files
reuse lint-file --json src/example.pyAll REUSE commands use standard exit codes:
The global options can be used with any subcommand:
# Debug mode with custom root
reuse --debug --root=/path/to/project lint
# Include submodules and disable multiprocessing
reuse --include-submodules --no-multiprocessing annotate --license=MIT file.py
# Suppress deprecation warnings
reuse --suppress-deprecation spdx --format=jsonREUSE_SUPPRESS_DEPRECATION: Set to suppress deprecation warnings_SUPPRESS_DEP5_WARNING: Internal variable to suppress DEP5 warnings during conversionInstall with Tessl CLI
npx tessl i tessl/pypi-reuse