Getting Started
This guide gets you from zero to encrypted secrets in about 5 minutes. By the end, you’ll have:
- dotsecenv installed
- A vault configured with your GPG identity
- Your first secret stored and retrieved
Prerequisites
Section titled “Prerequisites”You need a GPG key. Most developers already have one for signing git commits. If not:
# Generate a new GPG keygpg --full-generate-key# Select: (1) RSA and RSA, 4096 bits, key does not expire# Enter your name and emailQuick Setup
Section titled “Quick Setup”-
Install dotsecenv
Terminal window brew tap dotsecenv/tapbrew install dotsecenvTerminal window # Debian/Ubuntucurl -fsSL https://get.dotsecenv.com/key.asc | \sudo gpg --dearmor -o /etc/apt/keyrings/dotsecenv.gpgecho "deb [signed-by=/etc/apt/keyrings/dotsecenv.gpg] \https://get.dotsecenv.com/apt/ ./" | \sudo tee /etc/apt/sources.list.d/dotsecenv.listsudo apt-get update && sudo apt-get install dotsecenvVerify installation:
Terminal window dotsecenv version -
Initialize configuration
Create a config file:
Terminal window dotsecenv init configThis creates
~/.config/dotsecenv/configwith default settings. -
Create a vault
Terminal window dotsecenv init vaultThis creates an encrypted vault file at
~/.config/dotsecenv/vault. -
Login with your GPG key
Find your GPG fingerprint:
Terminal window gpg --list-secret-keys --keyid-format longLook for the fingerprint (40-character hex string) and login:
Terminal window dotsecenv login YOUR_FINGERPRINTOr, if you have a single key, use this one-liner to auto-detect it:
Terminal window dotsecenv login \$(gpg --list-keys --with-colons | awk -F: '/^fpr/ {print $10; exit}') -
Store your first secret
Terminal window echo "my-secret-database-password" | dotsecenv secret put DATABASE_PASSWORDThe secret is now encrypted in your vault.
-
Retrieve the secret
Terminal window dotsecenv secret get DATABASE_PASSWORD# Output: my-secret-database-password
What Just Happened?
Section titled “What Just Happened?”- Config file (
~/.config/dotsecenv/config) stores your settings and vault location - Vault file (
~/.config/dotsecenv/vault) is an encrypted JSONL file containing:- Your identity (GPG public key fingerprint)
- Encrypted secrets
- Login associated your GPG key with dotsecenv so it knows which key to use for encryption/decryption
Next: Shell Integration
Section titled “Next: Shell Integration”The real power comes from automatic secret loading. Install the shell plugin:
curl -fsSL https://raw.githubusercontent.com/dotsecenv/plugin/main/install.sh | bashThen create a .secenv file in your project:
# .secenv - secrets loaded automatically when you cd into the directoryDATABASE_PASSWORD={dotsecenv}API_KEY={dotsecenv/MY_API_KEY}When you cd into the directory, dotsecenv prompts you to load the secrets.
Verification Checklist
Section titled “Verification Checklist”Before moving on, verify:
dotsecenv versionshows version infodotsecenv vault listshows your vault with your identitydotsecenv secret get DATABASE_PASSWORDreturns your secret
What’s Next?
Section titled “What’s Next?”- Your First Secret — Deeper dive into secrets and shell plugins
- Share a Secret — Share secrets with teammates
- Security Model — Understand how encryption works
- CLI Reference — Full command documentation