A secure, user-friendly CLI for encrypting and storing local secrets and files using an encrypted SQLite vault.
Key features:
- Encrypted local secrets (AES-GCM) with per-secret salt and IV
- File secrets supported (e.g., .jks), stored with original filename as the key
- Optional plaintext workspace for working copies (explicitly import and clean)
- Git-friendly encrypted backups with
vault git_push - Configuration via
~/.vault-cli/config.json - CLI commands for setup, config, secrets and backups
Version: 0.2.0
Install via pip in editable mode for development:
pip install -e .The vault CLI entry point is setup via pyproject.toml.
Run:
vault setupYou will be prompted for:
- Where to store the encrypted vault DB (default
~/.vault-cli/vault.db) - Backup directory for encrypted backups
- An optional plaintext workspace path (user-controlled)
- Optional Git repo to store encrypted backups
Configuration is stored at:
~/.vault-cli/config.json
vault statusShows initialization status, configuration paths, and checks for repo/backup/workspace.
Show configuration values:
vault config showSet configuration values:
vault config set vault_db_path /path/to/vault.db
vault config set backup_dir /path/to/backups
vault config set workspace_dir /path/to/workspace
vault config set git_repo_path /path/to/git/repoAdd a text secret (interactive prompt for value):
vault add myapp dev SECRET_KEYGet a stored text secret (prompts for master password):
vault get myapp dev SECRET_KEYList secrets for an app/environment:
vault list myapp devFiles are stored by default using their filename as the key (including extension).
To add a file secret:
vault add_file myapp dev /full/path/to/app-release.jksTo retrieve a file secret into a secure temporary file (preserves filename and extension):
vault get_file myapp dev app-release.jksYou can copy a decrypted file into your configured workspace using --to-workspace:
vault get_file myapp dev app-release.jks --to-workspaceImport a file decrypted copy into the configured workspace:
vault workspace import myapp dev app-release.jksOpen the workspace directory in the system file explorer:
vault workspace openNote: When running in a headless CI environment (for example, GitHub Actions), the workspace open command will not attempt to launch a system file explorer and will emit a message: "Skipping opening workspace in CI environment". This prevents errors during automated testing and CI runs.
Create an encrypted backup of the vault DB:
vault backupEncrypt a backup using your passphrase (the backup is not stored in plaintext):
vault backup-encryptPush encrypted backup into a configured local Git repo:
vault git_push "daily backup"git_push will prompt to set git_repo_path if not configured.
vault_db_path: Path to SQLite DBbackup_dir: Directory used to place encrypted backupsworkspace_dir: Directory where decrypted files can be copied (optional)git_repo_path: Local git repo path to store encrypted backups
- Secrets are encrypted client-side using AES-GCM with a per-secret IV and salt
- Password-based key derivation is PBKDF2-HMAC with a configurable iteration count
- Decrypted files are written to temporary files and cleaned up after use. Files copied to workspace are user-controlled
- The DB is not stored in plaintext—only its encrypted content is stored on disk
-
Code structure:
src/vault/cli.py— CLI entry point using Clicksrc/vault/commands/— Command groups (backup, config, file, text, setup, workspace, git)src/vault/storage/— Database and backup utilitiessrc/vault/crypto/— AES and KDF utilitiessrc/vault/logging.py— Redaction-sensitive logging helpersdocs/— Developer docs and architecture overview
-
Run tests with:
pytestSee CHANGELOG.md for a full history.
- Please use
pre-commithooks (Black, Ruff, pytest). Linting and format checks run on code pushes and are executed before tests onpushevents. For ad-hoc lint checks, use theLintworkflow from the Actions tab (manual run). - Open a PR for any feature or security changes
To run the project's pre-commit hooks locally (the hooks run scripts/clean.sh, linters, formatters, and tests):
pip install -r requirements-dev.txt
pre-commit install
python -m pip install --upgrade pip setuptools wheelIf you want to run the hooks manually against all files, use:
pre-commit run --all-filesNotes:
- Pre-commit is configured to run
scripts/clean.shonce before commits, run code linters/formatters, runpytest(tests), and finally runclean.shafter the commit. - Because
pytestcan be slow, these pre-commit hooks can be disabled temporarily by usinggit commit --no-verifywhen needed, but it is recommended to keep them enabled for CI parity.
See LICENSE