svault 0.1.0

Svault — a content-addressed multimedia archive tool
svault-0.1.0 is not a library.

svault-cli

Command-line interface for Svault — a content-addressed multimedia archive.

Quick start

# Initialize a vault
svault init

# Import photos from a directory or device
svault import /path/to/photos

# Check vault health
svault status
svault verify

Global flags

Flag Description
--output human|json Output format
--dry-run Preview changes without writing
--yes Skip confirmation prompts
--quiet Suppress non-error output
--progress Emit JSON progress events to stderr
--config <PATH> Path to config file
--vault <PATH> Override vault root directory

Commands

init

Initialize a new vault in the current directory by creating .svault/ and the database.

import <SOURCE>

Import media files from a source directory or device.

  • Vault discovery: svault walks up from --target (or CWD) to find .svault/vault.db.
  • Path template: svault.toml controls the destination path. Default is $year/$mon-$day/$device.
    • $year / $mon / $day — from EXIF DateTimeOriginal, or file mtime if missing.
    • $device — EXIF camera model, or "Unknown Device".
  • Transfer strategy: --strategy reflink,hardlink (default reflink; copy always falls back).
  • Hash algorithm: -H xxh3_128|sha256 for full-file collision resolution.
  • Manifest: every import writes a timestamped manifest to <vault_root>/manifest/.

Svault never deletes your originals. Review the manifest and delete source files yourself.

recheck <SOURCE>

Compare source files against the vault when everything hits the CRC32C cache. Computes full-file hashes and writes a report to .svault/staging/. Use this when you suspect previously-imported vault files may be corrupt, or when you want to verify that your source files are still intact. No files are imported or deleted — review the report and act manually.

add <PATH>

Register files already physically inside the vault without moving them. Use this when you have manually copied files into the vault directory.

sync <SOURCE_VAULT>

Pull files and database records from another vault. Event logs are compared directly, so duplicates are detected without re-hashing. No files are deleted on either side.

reconcile --root <PATH>

Locate files that were moved outside svault and update their paths in the database.

verify

Check every file in the vault against its stored hash.

Option Description
-H sha256|xxh3_128 Hash algorithm
--file <PATH> Verify a single file
--recent <SECONDS> Verify files imported in the last N seconds

verify-source

Compare source files with the import manifest to detect post-import changes or deletions.

status

Show a summary of the vault: imported files, duplicates, pending hashes, events, and DB size.

history

Query the immutable event log. All changes are stored as events with a tamper-evident hash chain.

background-hash

Compute SHA-256 for files that were imported without it. Safe to run when the system is idle.

clone --target <DIR>

Copy a filtered subset of the vault to a local working directory (e.g. for offline editing).

mtp ls [PATH] / mtp tree <PATH>

Browse MTP devices (Android phones, cameras) before importing. Use svault import mtp://... to actually import files.

db

Database maintenance subcommands:

  • db verify-chain — verify the event-log hash chain.
  • db replay — rebuild materialised views from the event log.
  • db dump [TABLES] — export table contents for debugging.