bagit.net is a C# implementation of the BagIt specification (RFC 8493).
It allows you to create BagIt bags—structured file collections with checksums for reliable storage and transfer of digital content.
It currently consists of a core library (bagit.net) and a CLI application (bagit.net.cli) for Linux, MacOS, and Windows.
⚠️ Note: This project is in early development. It currently supports the creation and validation of BagIt-formatted bags. There is currently no error handling in place and will crash if an error is encountered. See the roadmap for current project status
Create a BagIt-formatted bag from a directory.
| Option | Description |
|---|---|
--algorithm |
Specify the checksum algorithm to use: md5, sha1, sha256 (default), sha384, or sha512. |
--log |
Specify the location to write logging (default: stdout). |
Usage:
# Create a bag with default SHA-256 checksums
bagit.net create /path/to/directory
# Create a bag using MD5 checksums
bagit.net create --algorithm md5 /path/to/directory
# Log to a file
bagit.net create --log bagit.net.log /path/to/directoryValidate a BagIt-formatted bag.
| Option | Description |
|---|---|
--fast |
Validate the bag based on payload-oxum only. |
--complete |
Validate the bag based on completeness only. |
--log |
Specify the location to write logging (default: stdout). |
Usage:
# Validate a bag
bagit.net validate /path/to/directory
# Validate a bag with logging to file
bagit.net validate --log bagit.net.log /path/to/directory
# Fast validation
bagit.net validate --fast /path/to/directory
# Completeness Only validation
bagit.net validate --complete /path/to/directorynote: setting both --fast and --complete flags will cause the application to exit
Display help information.
Usage:
bagit.net helpTip: Including
--helpor-hwith any command will print the help screen.
wget https://github.com/dmnyu/bagit.net/releases/download/v0.2.5-alpha/bagit.net.cli-v0.2.5-alpha-linux-x64.tgz
tar xvzf bagit.net.cli-v0.2.5-alpha-linux-x64.tgz
cd bagit.net
sudo ./install.sh
bagit.net --helpLinux / SELinux Notes:
bagit.net single-file self-contained binaries require the ability to create and execute temporary files at runtime.
On RHEL/CentOS systems with SELinux or noexec restrictions on /tmp, these binaries may not run.
Invoke-WebRequest -Uri https://github.com/dmnyu/bagit.net/releases/download/v0.2.5-alpha/bagit.net.cli-v0.2.5-alpha-win-x64.zip -OutFile bagit.net.cli-v0.2.5-alpha-win-x64.zip
Expand-Archive bagit.net.cli-v0.2.5-alpha-win-x64.zip -DestinationPath .
cd .\bagit.net
.\bagit.net.exe --help
.\install.ps1
%LOCALAPPDATA%\bagit.net\bagit.net --versionTip: After installation on Windows, you can run
bagit.netfrom any directory by adding%LOCALAPPDATA%\bagit.netto your userPATH.
wget https://github.com/dmnyu/bagit.net/releases/download/v0.2.5-alpha/bagit.net.cli-v0.2.5-alpha-macos-arm64.tgz
tar xvzf bagit.net.cli-v0.2.5-alpha-macos-arm64.tgz
cd bagit.net
sudo ./install.sh
bagit.net --helpnote This is an automated build from Github Actions, it is not tested.
- The CLI is self-contained, so no .NET installation is required for end-users.
- On Linux and MacOS, the default install path is
/usr/local/bin/bagit.net. - On Windows, the default install path is
%LOCALAPPDATA%\bagit.net\bagit.net.exe. - For CI/CD or scripting, you can run the CLI directly from the extracted directory without installing.