A multi-user secrets management utility that uses GPG encryption and the pass password manager to securely store and share secrets within a Git repository.
- Vault-based organization — Group secrets by environment (dev, staging, production) or access level
- GPG encryption — All secrets encrypted using team members' GPG public keys
- Multi-user access control — Add or remove team members from individual vaults
- Automatic re-encryption — Secrets automatically re-encrypted when membership changes
- Export formats — Export secrets as shell variables, dotenv, or JSON
- Git-friendly — Designed to be committed alongside your code
- GPG (GnuPG 2.x recommended)
- pass (the standard Unix password manager)
- Go 1.22+ (for building from source)
Download the latest binary from the Releases page:
# Linux (amd64)
curl -Lo secrets-cli https://github.com/NuevaNext/secrets-cli/releases/latest/download/secrets-cli-linux-amd64
chmod +x secrets-cli
sudo mv secrets-cli /usr/local/bin/
# macOS (Apple Silicon)
curl -Lo secrets-cli https://github.com/NuevaNext/secrets-cli/releases/latest/download/secrets-cli-darwin-arm64
chmod +x secrets-cli
sudo mv secrets-cli /usr/local/bin/For Arch Linux users, secrets-cli is available from the AUR as secrets-cli-bin:
# Using yay
yay -S secrets-cli-bin
# Using paru
paru -S secrets-cli-bin
# Or manually
git clone https://aur.archlinux.org/secrets-cli-bin.git
cd secrets-cli-bin
makepkg -sigo install github.com/NuevaNext/secrets-cli@latestgit clone https://github.com/NuevaNext/secrets-cli.git
cd secrets-cli
make build
sudo mv secrets-cli /usr/local/bin/# Ensure you have a GPG key
gpg --list-secret-keys
# If not, generate one
gpg --gen-key
# Initialize the secrets store
secrets-cli init --email you@example.com# Create a vault
secrets-cli vault create dev --description "Development environment"
# Add secrets
secrets-cli set dev database/password "super-secret-123"
secrets-cli set dev api/key "sk-abc123xyz"
# View secrets
secrets-cli list dev
secrets-cli get dev database/password# Add a team member's key
secrets-cli key add alice@example.com
# Grant vault access
secrets-cli vault add-member dev alice@example.com# Shell format
secrets-cli export dev --format env
# Dotenv format
secrets-cli export dev --format dotenv > .env
# JSON format
secrets-cli export dev --format jsondirenv can automatically load secrets as environment variables when you cd into your project, and unload them when you leave.
- Install direnv and add the shell hook to your profile
- Create an
.envrcfile in your project root:
# .envrc
export DATABASE_PASSWORD="$(secrets-cli get dev database/password)"
export API_KEY="$(secrets-cli get dev api/key)"- Allow the file:
direnv allowFrom now on, secrets are loaded automatically when you enter the project directory and unloaded when you leave. No --email flag is needed — secrets-cli auto-detects your identity from git config user.email.
Tip: Add
.envrcto.gitignoreso each team member can choose which secrets to load.
| Command | Description |
|---|---|
init |
Initialize a new secrets store |
setup |
Configure access after cloning a repository |
vault list |
List all vaults |
vault create <name> |
Create a new vault |
vault info <vault> |
Show vault details |
vault delete <vault> |
Delete a vault |
vault add-member <vault> <email> |
Grant vault access |
vault remove-member <vault> <email> |
Revoke vault access |
key list |
List stored public keys |
key add <email> |
Add a team member's key |
key remove <email> |
Remove a key |
key import |
Import all keys to GPG |
list <vault> |
List secrets in a vault |
get <vault> <secret> |
Retrieve a secret |
set <vault> <secret> [value] |
Set a secret |
delete <vault> <secret> |
Delete a secret |
rename <vault> <old> <new> |
Rename a secret |
copy <src> <secret> <dst> |
Copy a secret to another vault |
export <vault> |
Export secrets |
sync <vault> |
Re-encrypt vault secrets |
Use secrets-cli <command> --help for detailed usage information.
- Initialize the store:
secrets-cli init --email owner@company.com - Create vaults:
secrets-cli vault create production - Add secrets:
secrets-cli set production database/url "postgresql://..." - Add team members' keys:
secrets-cli key add developer@company.com - Grant access:
secrets-cli vault add-member production developer@company.com - Commit:
git add .secrets && git commit -m "Add production secrets"
- Clone the repository:
git clone git@github.com:org/repo.git - Set up access:
secrets-cli setup --email developer@company.com - View secrets:
secrets-cli get production database/url
When adding a new team member to the secrets store, follow this workflow:
The new team member should first check if they have a GPG key, and generate one if needed:
# Check for existing GPG keys
gpg --list-secret-keys
# If no key exists, generate one
gpg --gen-keyDuring key generation, you'll be prompted for:
- Name: Your full name
- Email: Use the email address that matches your Git configuration (this must match what the admin will use)
- Passphrase: Choose a strong passphrase to protect your private key
Important: The email address used during key generation must match the email the admin will use to grant you access.
Export your public key to share with the admin:
# Export to a file
gpg --armor --export your@email.com > my-gpg-key.asc
# Or copy directly to clipboard (Linux with xclip)
gpg --armor --export your@email.com | xclip -selection clipboard
# Or copy to clipboard (macOS)
gpg --armor --export your@email.com | pbcopyThe exported key will look like this:
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGa...
...
-----END PGP PUBLIC KEY BLOCK-----
Option A: Self-Service via Pull Request (Recommended if you have repo access)
If you have repository access, you can add your own key:
# Clone the repository if you haven't already
git clone git@github.com:org/repo.git
cd repo
# Create a branch
git checkout -b add-my-gpg-key
# Add your key to secrets-cli
secrets-cli key add your@email.com
# Commit and push
git add .secrets/keys/
git commit -m "Add GPG key for your@email.com"
git push origin add-my-gpg-key
# Create a pull request for admin reviewOption B: Send Key to Admin
If you don't have repository access yet, send the exported key file (my-gpg-key.asc) or text to your admin via:
- Slack, Teams, or other team chat
- Secure file sharing service
After the user's key is added (either via merged PR or by the admin), the admin grants access to specific vaults:
# If the user sent their key directly, import and add it first
gpg --import user-gpg-key.asc
secrets-cli key add user@email.com
# Grant access to specific vaults
secrets-cli vault add-member production user@email.com
secrets-cli vault add-member dev user@email.com
# Commit and push changes
git add .secrets
git commit -m "Grant user@email.com access to production and dev vaults"
git pushThe key add command:
- Stores the user's public key in
.secrets/keys/ - Makes it available for vault encryption
The vault add-member command:
- Adds the user to the vault's member list
- Re-encrypts all secrets in that vault to include the new member's key
Security Note: Adding a key to
.secrets/keys/does NOT grant access to any secrets. The admin must explicitly grant vault access usingvault add-member.
After the admin pushes the changes, the new team member can set up their access:
# Pull the latest changes
git pull
# Set up access (imports keys and configures pass)
secrets-cli setup --email your@email.com
# Verify access by listing available vaults
secrets-cli vault list
# Test reading a secret
secrets-cli get production database/urlThe setup command will:
- Import all team members' public keys from
.secrets/keys/to your GPG keyring - Initialize the
passpassword store - Configure access to decrypt secrets in vaults you're a member of
Tip: If
git config user.email.
| Flag | Environment Variable | Description |
|---|---|---|
--secrets-dir |
SECRETS_DIR |
Path to secrets directory (default: .secrets) |
--email |
USER_EMAIL |
Your email for GPG operations |
--gpg-binary |
GPG_BINARY |
Path to GPG binary (default: gpg) |
--verbose, -v |
VERBOSE |
Enable verbose output |
If --email is not provided, secrets-cli will attempt to detect your email from:
- Git configuration (
git config user.email) - GPG default secret key
git clone https://github.com/NuevaNext/secrets-cli.git
cd secrets-cli
# Build
make build
# Build with specific version
make build VERSION=v1.0.0
# Build for all platforms
make build-all# Unit tests
make test
# End-to-end tests (requires Docker)
make test-e2e
# Verbose e2e tests
make test-e2e-verbosesecrets-cli/
├── cmd/secrets-cli/ # CLI entrypoint
├── internal/
│ ├── cmd/ # Cobra command implementations
│ ├── config/ # YAML configuration handling
│ ├── gpg/ # GPG wrapper
│ └── pass/ # pass wrapper
├── tests/
│ ├── Dockerfile # E2E test environment
│ ├── e2e-tests.sh # Test runner
│ └── test-utils.sh # Test utilities
├── Makefile
├── go.mod
└── README.md
make fmt
make lintMIT License - see LICENSE for details.