Skip to content

Getting Started

This guide takes you from zero to an encrypted, auto-loading secret in about 5 minutes. By the end you will have dotsecenv installed, a vault with your identity, and a .secenv file that loads secrets automatically when you enter your project directory.

You need a GPG key. Most developers already have one for signing git commits. If not:

Terminal window
# Generate a new GPG key with dotsecenv (after install below)
dotsecenv identity create
# Enter your name and email when prompted

This uses FIPS-compliant defaults (P-384 curve, 2-year expiration). See identity create for algorithm options.

  1. Install dotsecenv

    Terminal window
    curl -fsSL https://get.dotsecenv.com/install.sh | bash

    The installer downloads the binary, verifies signatures, and installs the shell plugin, completions, and man pages. See the installation reference for all options.

    Verify installation:

    Terminal window
    dotsecenv version
  2. Activate the shell plugin

    Add the source line the installer printed to your shell configuration:

    Terminal window
    echo 'source ~/.local/share/dotsecenv/plugin/dotsecenv.plugin.zsh' >> ~/.zshrc

    Reload your shell:

    Terminal window
    exec $SHELL
  3. Initialize and login

    Terminal window
    dotsecenv init config
    dotsecenv init vault
    dotsecenv login # select your GPG key interactively
  4. Store a secret

    Terminal window
    echo "s3cr3t-db-pass" | dotsecenv secret store DATABASE_PASSWORD
  5. Create a .secenv file

    Terminal window
    mkdir -p ~/my-project
    echo 'DATABASE_PASSWORD={dotsecenv}' > ~/my-project/.secenv

    This tells the shell plugin to fetch DATABASE_PASSWORD from your vault whenever you enter the directory.

  6. Watch it auto-load

    Terminal window
    cd ~/my-project
    # dotsecenv: found .secenv in /home/you/my-project
    # Load secrets? [y]es / [n]o / [a]lways: a
    # dotsecenv: loaded 1 secret(s) from .secenv: DATABASE_PASSWORD
    echo $DATABASE_PASSWORD
    # Output: s3cr3t-db-pass
    cd ~
    # dotsecenv: unloaded 1 secret(s): DATABASE_PASSWORD
    echo $DATABASE_PASSWORD
    # Output: (empty)
  • Your secret is encrypted at rest in the vault using your GPG key (AES-256-GCM)
  • The shell plugin auto-loads secrets when you cd into a directory with a .secenv file
  • Secrets are auto-unloaded when you leave the directory tree
  • The vault file is safe to commit to git — it’s just encrypted JSONL

Before moving on, verify:

  • dotsecenv version shows version info
  • dotsecenv vault describe shows your vault with your identity
  • dotsecenv secret get DATABASE_PASSWORD returns your secret