Browse documentation
Command reference

gitvaulty materialize

Create persistent local plaintext copies of encrypted files you can access.

View source ↗

Create persistent local plaintext copies of encrypted files you can access.

Usage

npx gitvaulty materialize [-f|--force] [paths...]

Examples:

npx gitvaulty materialize
npx gitvaulty materialize .env config/secrets.yaml
npx gitvaulty materialize --force .env

Selection

Pass logical plaintext paths as positional arguments to select specific files. With no paths, GitVaulty selects every registered file your current user can access. A selected path must be accessible and cannot be repeated.

OptionMeaning
-f, --forceReplace modified, untracked regular plaintext with the encrypted source.

What it does

GitVaulty decrypts the selected ciphertext and inspects each plaintext destination:

  • missing: creates the plaintext file with mode 0600;
  • current: leaves identical bytes in place and enforces mode 0600;
  • modified: stops unless --force is supplied;
  • tracked or unsafe: always stops without overwriting the destination.

GitVaulty validates all selected files before creating any missing plaintext. If creation later fails partway through, plaintext files created by that attempt are cleaned up when still unchanged.

Every selected plaintext path is added to the clone-local .git/info/exclude. This does not modify the committed .gitignore, and other clones do not inherit the entries.

Forced restoration

Use --force only when the encrypted version should replace independent local changes. GitVaulty atomically restores the selected modified files with mode 0600 and reports each restored path.

Force does not bypass authorization or path safety. The command still rejects symlinked paths, non-regular destinations, Git-tracked plaintext, missing ciphertext, duplicate paths, and unauthorized selections. It validates every selected file before writing any destination.