Show HN: Dev-Vault – A secure local vault for your development secrets

10 hours ago 2

A local-first, encrypted secrets manager for development. dev-vault helps developers securely manage sensitive credentials like API keys and database passwords on a per-project basis, preventing accidental exposure and simplifying team collaboration.

  • Local-First: Secrets are stored locally in an encrypted vault file.
  • Encrypted: All secrets are encrypted at rest using strong cryptography.
  • Git-Friendly: The encrypted vault file (secrets.vault) is safe to commit to version control. The decryption key (.dev-vault.key) is automatically added to .gitignore.
  • Language Agnostic: Works by injecting secrets as environment variables, making it compatible with any programming language or framework.
  • CLI-Based: Easy-to-use command-line interface for managing secrets.

To install dev-vault, clone the repository and install it using pip:

git clone https://github.com/YOUR_USERNAME/dev-vault.git cd dev-vault python3 -m pip install -e .

Important: After installation, you might need to add the dev-vault executable to your system's PATH. The executable is typically located in $HOME/Library/Python/X.Y/bin/dev-vault on macOS (where X.Y is your Python version, e.g., 3.9). You can add it to your .bash_profile or .zshrc:

export PATH="$HOME/Library/Python/3.9/bin:$PATH" # Or, if you prefer to run it from the project directory: # export PATH="/path/to/your/dev-vault:$PATH"

Alternatively, you can create an alias:

alias dev-vault="python3 -m dev_vault.main"

Initializes a new vault in the current directory. This creates two files:

  • secrets.vault: The encrypted vault file (safe to commit).
  • .dev-vault.key: The decryption key (automatically added to .gitignore - DO NOT COMMIT!).
cd my-project dev-vault init

dev-vault set <KEY> <VALUE>

Sets a secret in the vault. If the key already exists, its value will be updated.

dev-vault set DATABASE_URL "postgres://user:pass@host/db" dev-vault set API_KEY "your_super_secret_api_key"

Retrieves and prints the decrypted value of a secret.

dev-vault get DATABASE_URL

Lists all secret keys stored in the vault.

Removes a secret from the vault.

dev-vault exec -- <COMMAND>

Executes a command with all decrypted secrets loaded as environment variables. This is the primary way to run your applications with dev-vault.

dev-vault exec -- npm start dev-vault exec -- python manage.py runserver dev-vault exec -- sh -c 'echo $DATABASE_URL'

We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.

This project is licensed under the MIT License - see the LICENSE file for details.

Read Entire Article