Single Go binary · Zero runtime dependencies

Keep .env secrets encrypted. Inject at runtime only.

airgapvault stores secrets in a single encrypted .agv vault file and loads them straight into child process memory via airgapvault run — no cloud account, no daemon, and no plaintext .env left on disk.

Encryption
Argon2id + AES-256-GCM
Targets
macOS · Linux · Windows
Storage
~/.airgapvault/vault.agv
session · airgapvault
# 1. Initialize your encrypted vault $ airgapvault init Enter new master passphrase: Confirm master passphrase: Initialized empty vault at /home/user/.airgapvault/vault.agv # 2. Run your app with zero .env files on disk $ airgapvault run -p myapp -e prod -- node server.js Enter master passphrase: [server] listening on :8080 (DB_HOST injected in memory)

Install & First Vault

Download the v0.1 static binary directly from GitHub Releases (verify with checksums.txt) or build from source.

Downloads darwin-arm64 (Apple Silicon) or darwin-amd64 (Intel) from v0.1 and installs to /usr/local/bin:

case "$(uname -m)" in arm64|aarch64) ARCH=arm64;; *) ARCH=amd64;; esac
curl -fsSL -o airgapvault \
  "https://github.com/ertroz/airgapvault/releases/download/v0.1/airgapvault-darwin-${ARCH}"
chmod +x airgapvault
sudo mv airgapvault /usr/local/bin/airgapvault
airgapvault --help
01

Initialize Vault

Creates ~/.airgapvault/vault.agv (mode 0600) protected by a masked passphrase entered twice.

airgapvault init
02

Import & Remove .env

Parses comments, quotes, and export lines into project/env, then deletes the plaintext file.

airgapvault import myapp/dev .env --delete-source
03

Add Secrets Without Shell History

Omit =VALUE to enter the secret interactively with terminal echo disabled.

airgapvault set myapp/prod API_SECRET
04

Run App in Memory

Decrypts secrets into the child process env and forwards SIGINT, SIGTERM, and exit code.

airgapvault run -p myapp -e dev -- npm run dev

Vault File Format & Security Model

.agv files use a compact binary envelope so header parameters and ciphertext are authenticated together before decryption.

AGV1 Binary File Layout
4 bytes Magic "AGV1"
4 bytes (uint32) HeaderLen
HeaderLen bytes (AAD) JSON: kdf, salt, nonce
Remaining bytes AES-256-GCM Ciphertext + Tag

Argon2id + AAD Authentication

Keys are derived with Argon2id (memory=64 MiB, time=3, threads=4). The JSON header is passed as Additional Authenticated Data to AES-256-GCM so metadata tampering fails authentication.

Atomic Writes & Permissions

Each mutation generates a fresh random salt and nonce, writes to a 0600 temporary file inside the 0700 vault directory, calls fsync, and atomically renames over the target vault.

Memory Zeroing & Keyfiles

Passphrase and decrypted vault buffers are zeroed with clear() after use. Airgapped CI or containers can unlock non-interactively via --keyfile <path> and AIRGAPVAULT_FILE.

CLI Reference

All 9 subcommands and global flags supported by airgapvault.

Showing 9 of 9 commands
Command Behavior
airgapvault init [--force] Create a new encrypted vault with a master passphrase (prompted twice) or --keyfile.
airgapvault set <proj>/<env> <KEY>[=<VAL>] Add or update a secret. Omit =<VAL> for masked interactive input without shell history.
airgapvault get <proj>/<env> <KEY> Print a single secret value to stdout (omits trailing newline when piped).
airgapvault list [<proj>[/<env>]] [--reveal] List projects, environments, or keys. Pass --reveal to print values as KEY=VAL.
airgapvault rm <proj>[/<env> [<KEY>]] [-y] Remove a key, environment, or project. Prompts for confirmation unless -y / --yes is set.
airgapvault import <proj>/<env> <.env> [--delete-source] Import an existing .env file (comments, export, quotes) and optionally delete the source file.
airgapvault run -p <proj> -e <env> -- <cmd...> Decrypt in memory, inject into child process env, and forward SIGINT/SIGTERM and exit code.
airgapvault export <proj>/<env> --format dotenv Fallback export that prints .env formatted secrets to stdout.
airgapvault passwd [--new-keyfile <path>] Rotate the master passphrase or keyfile and re-encrypt the vault with a fresh salt and nonce.
No commands match that filter. Try init, run, import, or passwd.
Global flags: --vault <path> (overrides AIRGAPVAULT_FILE and ~/.airgapvault/vault.agv) --keyfile <path> (non-interactive unlock)