Keynest
Stop committing secrets by accident.
A simple, offline secrets manager that replaces .env files.
Run any command with encrypted secrets — no cloud, no setup.
Why Keynest?
| Problem | Solution |
|---|---|
.env files leak secrets |
Encrypted local storage |
| Vault is overkill | Single binary, no setup |
| 1Password CLI requires account | Local, no account needed |
| Secrets in code/prompts | Runtime injection |
Run Commands with Secrets
Inject secrets into any process as environment variables:
→ your app receives secrets via environment variables
Works with:
- Docker
- Node.js
- Python
- shell scripts
- CI pipelines
- AI agents
No .env files needed.
Philosophy
- No cloud
- No accounts
- No background services
- Just a simple encrypted file
Your secrets stay on your machine.
Try it in 30 seconds
Output: test123
AI & Agent Usage
Use Keynest as a secure local secret store for AI agents.
Access secrets via environment variables (e.g. API_KEY):
=
Keeps secrets out of:
- source code
- logs
- prompts
- LLM context
Works well with:
- LangChain
- AutoGPT
- custom agents
Installation
Pre-built binaries
Download the latest release from GitHub: keynest/releases/latest
From crates.io
From source
Or build locally:
Quick Start
# Initialize a new keystore
# Store a secret (three ways)
# Retrieve a secret
# List all keys
# Update a secret
# Remove a secret
# Run command with secrets as environment variables
# Show keystore info (KDF params, creation date)
# Change password (and optionally KDF parameters)
# Import/Export secrets
CLI Commands
| Command | Description |
|---|---|
init |
Initialize a new keystore |
set <key> [<value>] |
Store a secret (value, --file, or --prompt) |
get <key> |
Retrieve a secret (exits 1 if not found) |
get <key> --clip |
Copy secret to clipboard (auto-clears after 15s) |
update <key> <value> |
Update existing secret |
list [--all] |
List keys (--all shows values & timestamps) |
remove <key> |
Remove a secret |
exec -- <cmd> |
Run command with secrets as environment variables |
info |
Show keystore information (KDF params, creation date) |
rekey |
Change password and/or KDF parameters |
import <file> |
Import secrets from file (env or json) |
export [file] |
Export secrets to file or stdout |
All commands support --json for structured output (get, list, info).
Security
- Key Derivation: Argon2id with configurable parameters
- Secure Memory: Keys and passwords are zeroized after use
- Encryption: XChaCha20-Poly1305 AEAD
Security Notes
- Uses well-established cryptographic primitives (Argon2id, XChaCha20-Poly1305)
- No network access
- No telemetry
- Zero-config — works out of the box
CLI Options
--store <path>- Specify custom keystore location
KDF Options (for init/rekey)
--argon-mem <kb>- Memory cost in KiB (default: 65536)--argon-time <n>- Time cost / iterations (default: 3)--argon-parallelism <n>- Parallelism (default: 1)
Password Input
Keynest accepts passwords via:
- Environment variable:
KEYNEST_PASSWORD="secret" keynest get key - Stdin:
echo "secret" | keynest get key - Interactive prompt (default)
Library Usage
Add as Dependency
use ;
use Zeroizing;
Storage Location
Default keystore locations by OS:
- Linux:
~/.local/share/keynest/.keynest.db - macOS:
~/Library/Application Support/keynest/.keynest.db - Windows:
%APPDATA%\keynest\.keynest.db
Use --store <path> to override.
Development
# Build
# Test
# Format
# Lint
Star History
If you find Keynest useful, consider giving it a star ⭐
License
Licensed under either of:
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.