Holecard
Secure CLI password manager with dual-key encryption.
Features
- Dual-key encryption: Master password + secret key for enhanced security
- Strong cryptography: Argon2id key derivation + AES-256-GCM encryption
- System keyring integration: Secret key stored securely in OS keyring
- Biometric authentication: Touch ID, Face ID, Apple Watch, Passkey support on macOS 🆕
- Session caching: Avoid repeated password entry with configurable timeout
- Flexible entries: Custom key-value fields per entry
- SSH key management: Store and manage SSH keys with ssh-agent integration
- SSH wrapper: Auto-load keys and connect with aliases (
hc ssh connect git@github.com) - File loading: Load fields directly from files with
--fileoption - TOTP support: Dedicated TOTP entry for 2FA code generation with auto-clipboard copy
- Smart clipboard: Copy specific fields with auto-clear after 30 seconds
- Template injection: Render templates with entry fields
- Environment variables: Run commands with secrets as env vars
- Vault reinitialization: Safe vault reset with confirmation prompt
Installation
From source (recommended)
From crates.io
From binary releases (coming soon)
Download pre-built binaries from GitHub Releases.
Supported platforms:
- macOS Apple Silicon (aarch64)
- macOS Intel (x86_64)
- Linux x86_64
With Homebrew (coming soon)
With cargo-binstall (coming soon)
Quick Start
# Initialize vault (creates master password + secret key + totp entry)
# Add an entry
# Or add interactively
# Add SSH key from file
# Connect via SSH (auto-loads key)
# List entries
# Get an entry
# Copy password to clipboard (auto-clears after 30s)
# Copy specific field
# Add TOTP secret
# Get TOTP code (displays + copies to clipboard)
Usage
Managing Entries
# Add entry with custom fields
# Add entry with fields from files
# Edit existing entry
# Edit with file field
# Remove entry
# Copy specific field to clipboard
# Export vault to JSON (plaintext - handle with care)
# Import from JSON
SSH Key Management
Securely store SSH keys and manage ssh-agent with seamless integration.
# Add SSH key from file (recommended - preserves newlines)
# Connect via SSH (auto-loads key)
# Pass additional SSH arguments
# Manually load key into ssh-agent
# Load with lifetime (auto-expires after 8 hours)
# List loaded keys in ssh-agent
# Unload key from ssh-agent
Why use hc ssh over plain ssh-add?
- Store encrypted SSH keys in vault with Argon2id + AES-256-GCM
- Auto-load keys on connect with aliases (
git@github.com→ Entry name) - Manage passphrases securely without typing them repeatedly
- Integrate with session management (
hc lockclears both vault and ssh-agent)
TOTP Support
All TOTP secrets are stored in a dedicated totp entry that is automatically created during initialization.
# Add TOTP secret for a service
# Get TOTP code (displays + copies to clipboard)
# Output:
# TOTP Code: 123456 (valid for 28 seconds)
# ✓ Copied to clipboard (will clear in 30 seconds)
# Remove TOTP secret
# View all TOTP services
Template Injection
# Render template with entry fields
# Access specific fields
Running Commands with Secrets
# Entry fields become uppercase environment variables
|
# Use with any command
Biometric Authentication (macOS only)
Touch ID, Face ID, Apple Watch, and Passkey authentication for seamless vault access.
# Enable/disable biometric authentication (enabled by default on macOS)
# First unlock: Biometric + master password entry (cached in keyring)
# Subsequent unlocks: Biometric only (no password needed)
# Biometric authentication required for sensitive operations:
# - hc get --show/--clip
# - hc edit
# - hc rm
# - hc export
Supported authentication methods:
- Touch ID (MacBook Pro/Air, Magic Keyboard)
- Face ID (future Mac devices)
- Apple Watch unlock
- Passkey
- macOS login password (fallback)
Session Management
# Check session status
# Lock vault (clear cached session)
# Configure session timeout (minutes)
Configuration
# View current config
# Set vault file path
# Set session timeout
# Reinitialize vault (WARNING: deletes all data)
# Output:
# âš Vault already exists!
# âš Vault already exists. Reinitialize? This will DELETE ALL existing data! (y/N):
Security
Encryption
- Key derivation: Argon2id with master password + secret key
- Encryption: AES-256-GCM with random nonce per save
- Secret key: 160-bit random key stored in system keyring
Backup and Recovery
Use hc export to backup your entire vault:
The export file is encrypted with a password you choose. To restore:
Important:
- Store export files in a secure location (external drive, encrypted cloud storage, etc.)
- Use a strong password for export encryption
- You need BOTH the export file and its password to restore your vault
- Regular backups protect against data loss
Session Caching
The derived encryption key is cached in the system keyring to avoid repeated password entry. Sessions automatically expire after the configured timeout (default: 60 minutes).
Biometric Authentication (macOS)
On macOS, biometric authentication is enabled by default. After the initial setup:
- First unlock: Touch ID/Face ID + master password entry (password cached in keyring)
- Subsequent unlocks: Touch ID/Face ID only (password retrieved automatically)
Sensitive operations (get --show, edit, rm, export) require additional biometric verification for security.
Security benefits:
- No password typing (reduces shoulder surfing risk)
- Master password stored in macOS keyring with device-level encryption
- Biometric authentication uses system LocalAuthentication framework
- Automatic fallback to password if biometric unavailable
File Locations
| File | Description |
|---|---|
~/.holecard/config.toml |
Configuration file (enable_biometric, vault_path, session_timeout_minutes) |
~/.holecard/vault.enc |
Encrypted vault (default) |
~/.holecard/session_*.json |
Session metadata |
| macOS Keychain | Master password (when biometric enabled), secret key, session key |
Platform Support
- macOS: Apple Silicon (aarch64) and Intel (x86_64)
- Linux: x86_64 GNU
Building from Source
# Clone repository
# Build
# Run tests
# Check
# Lint
# Format
# Install locally
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.
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Acknowledgments
Built with: