Zero-.env CLI · Powered by git & gh

Delete your .env file.

GitVault encrypts your project variables in a private GitHub repository using git and gh, and loads them straight into memory with one command.

v2.0.0 · Pure Rust CLI (`gitvault` / `gv`) · Free and open source

shop-api2 files changed
.envdeleted
  1. -DATABASE_URL=postgres://app:h7Kq2x@db.internal/app
  2. -STRIPE_SECRET_KEY=sk_live_51HxQe…
  3. -OPENAI_API_KEY=sk-proj-Qz8v…
  4. -JWT_SECRET=9f2c41e0b7d3…
gitvault.jsonadded
  1. +{
  2. + "project": "shop-api",
  3. + "environment": "development"
  4. +}
Secrets now live encrypted in projects/shop-api/envs/*.enc in your private repo.
How it works

Three commands. Zero `.env` files.

Initialize your folder once, configure variables interactively, and inject secrets straight into RAM whenever you run your app.

  1. 1

    Link your project

    Run gitvault init to pick or create a project and default environment. Writes only a tiny gitvault.json.

    $ gitvault init
  2. 2

    Configure variables

    Run gitvault config to open the interactive menu, create environments, or migrate and delete legacy .env files.

    $ gitvault config
  3. 3

    Encrypted in your repo

    Each environment is sealed with AES-256-GCM + Argon2id and synced via git and gh to your private vault repo.

    projects/shop-api/envs/prod.enc
  4. 4

    Loaded straight to RAM

    Run gitvault load to export variables into your active shell or child process. Never written back to disk.

    $ gitvault load -- npm run dev
Load into memory

Works with every language and workflow

No language plugins or runtime dependencies. Use gitvault.json for zero-flag convenience or pass -p and -e anywhere.

Active shell session

Add one line to ~/.bashrc, ~/.zshrc, or fish so gitvault load injects variables into your live shell in memory.

Shell integration docs
$ eval "$(gitvault shell-init)"
$ gitvault load                  # reads gitvault.json
$ gitvault unload                # wipes variables from shell

Any language or tool

Inject secrets straight into a child process without writing a .env file or installing an SDK.

Process injection docs
$ gitvault load -- npm run dev
$ gitvault load -- cargo run
$ gitvault load -- python app.py

Explicit CLI flags

Skip gitvault.json completely and target any project or environment from anywhere on your machine.

CLI reference
$ gitvault load -p shop-api -e production -- ./deploy.sh
$ eval "$(gitvault load -p shop-api -e production --export)"
$ gitvault load -p shop-api -e production --json

Servers and CI

No interactive prompts in CI. Pass GITVAULT_PASSWORD or pipe it on stdin alongside gh authentication.

Servers and CI docs
$ GITVAULT_PASSWORD=•••••••• gitvault --non-interactive \
    load -p shop-api -e production -- ./start.sh
Interactive CLI

Built for speed in the terminal

Use interactive numbered menus when exploring, or scriptable flags when automating. Both paths use the same encrypted store.

$ gitvault init

Project:
  › 1) + Create new project
    2) billing-api
Choose 1-2 [1]: 1
Project name [shop-api]:
Default environment:
  › 1) development  2) staging  3) production
Choose 1-4 [1]: 1
✓ Initialized 'shop-api' (development) and synced
✓ Created gitvault.json (zero .env files)
$ gitvault config

GitVault Config — Project: shop-api
  › 1) Config variables
    2) Manage environments
    3) Import & migrate .env file
Choose 1-6 [1]: 1

Select or create environment:
  › 1) development (3 variable(s))
    2) staging (0 variable(s))
    3) production (5 variable(s))
    4) + Create new environment
  • Powered by git & gh

    Zero internal OAuth flows, zero stored GitHub tokens. Uses your existing git and gh CLI session.

  • Share via GitHub contributors

    Need another developer on the project? Add them as a contributor to your vault repo instead of pasting .env in chat.

  • Never lose or forget .env

    Switch laptops or reinstall your OS anytime — clone the repo, unlock once, and every variable is back.

  • Interactive config wizard

    Run gitvault config to manage variables, switch or create environments, and copy secrets across envs.

  • Per-environment AEAD

    Each environment is encrypted with AES-256-GCM bound to project and environment associated data.

  • Two-way git sync

    Auto-commits and syncs via git pull --rebase and push, with offline-safe local fallback.

Security

Your keys, your repository

How the encryption works

Never forget or lose .env again

Your encrypted secrets live safely in your GitHub vault repo — move machines or onboard new devs in seconds.

Share projects safely in one invite

Stop sending .env files over WhatsApp or Slack. Add teammates as contributors on the vault repo and they run gitvault load.

Zero .env files, zero extra accounts

Secrets load directly into RAM, stay encrypted at rest with Argon2id + AES-256-GCM, and use only git and gh.

Set up in 30 seconds

  1. Make sure git and gh are installed and signed in (gh auth login).
  2. Run gitvault init inside your project folder to create gitvault.json.
  3. Run gitvault config (or import and delete your old .env), then gitvault load.
$ gh auth login                          # once
$ gitvault init -p shop-api -e development
$ gitvault config import .env --delete-source
$ gitvault load -- npm run dev           # zero .env