2026-06-16 11:36:04 -04:00
2026-06-22 09:28:30 -04:00
2025-11-03 18:22:13 -05:00
2026-06-19 17:33:43 -04:00
2026-06-16 10:47:57 -04:00
2026-06-19 17:33:43 -04:00
2026-06-19 17:33:43 -04:00
2026-06-19 13:45:55 -04:00
2025-10-28 18:39:06 -04:00
2026-06-19 17:33:43 -04:00
2026-06-19 17:33:43 -04:00
2026-06-24 17:06:14 -04:00
2026-06-16 11:36:04 -04:00
2026-06-24 11:42:31 -04:00
2026-06-16 11:43:36 -04:00

envr - Backup your env files

Have you ever wanted to back up all your .env files in case your hard drive gets nuked? envr makes it easier.

envr is a binary application that tracks your .env files in an encyrpted sqlite database. Changes can be effortlessly synced with envr sync, and restored with envr restore.

envr puts all your .env files in one safe place, so you can back them up with the tool of your choosing.

Features

  • Encrypted Storage: All .env files are encrypted using your ssh key and libsodium.
  • Automatic Sync: Update the database with one command, which can easily be run on a cron.
  • Smart Scanning: Automatically discover and import .env files in your home directory.
  • Rename Detection: Automatically find and updates renamed/moved repositories.

TODOS

  • Rename Detection: automatically update moved files.
  • Allow use of keys from ssh-agent
  • Allow configuration of ssh key.
  • Allow multiple ssh keys.

Installation

You will need an SSH key pair for encryption and decryption. You can generate one with ssh-keygen -t ed25519. It will be saved to ~/.ssh/id_ed25519.

With Odin

If you already have odin installed:

# You'll need libsodium and sqlite
odin build -o:speed
envr init

With Nix

If you are a nix user

Try it out

nix run github.com:sbrow/envr --

Install it

# /etc/nixos/configuration.nix
{ config, envr, system, ... }: {
  environment.systemPackages = [
    envr.packages.${system}.default
  ];
}

Quick Start

Check out the man page for the quick setup guide.

Disclaimers

Caution

Do not lose your SSH key pair! Your backup will be lost forever.

Commands

See the docs for the current list of available commands.

Configuration

The configuration file is created during initialization:

# Example ~/.envr/config.json
{
  "keys": [
    {
      "private": "/home/ubuntu/.ssh/id_ed25519",
      "public": "/home/ubuntu/.ssh/id_ed25519.pub"
    }
  ],
  "scan": {
    "matcher": "\\.env",
    "exclude": [
      "*\\.envrc",
      "\\.local/",
      "node_modules",
      "vendor"       
    ],
    "include": "~"
  }
}

Backup Options

envr merely gathers your .env files in one local place. It is up to you to back up the database (found at ~/.envr/data.envr) to a secure and remote location.

Git

envr preserves inodes when updating the database, so you can safely hardlink ~/.envr/data.envr into your GNU Stow, Home Manager, or NixOS repository.

Caution

For maximum security, only save your data.envr file to a local (i.e. non-cloud) git server that you personally control.

I take no responsibility if you push all your secrets to a public GitHub repo.

restic

restic.

License

This project is licensed under the MIT License.

Support

For issues, feature requests, or questions, please open an issue.

Description
Manage and Backup your .env files with ease!
Readme MIT 2.6 MiB
Languages
Odin 95.3%
Makefile 2.1%
Nix 1.7%
Nushell 0.9%