fnox works with either—or both! They've got their pros and cons. Either way, fnox gives you a
nice front-end to manage secrets and make them easy to work with in dev/ci/prod.
fnox's config file, fnox.toml, will either contain the encrypted secrets, or a reference to a secret in a cloud provider. You can either use fnox exec -- <command> to run a command with the secrets, or you can use the shell integration to automatically load the secrets into your shell environment when you cd into a directory with a fnox.toml file.
git clone https://github.com/jdx/fnox
cd fnox
cargo install --path .
# Initialize fnox in your project
fnox init
# Set a secret (stores it encrypted in fnox.toml)
fnox set DATABASE_URL
# Get a secret
fnox get DATABASE_URL
# Run commands with secrets loaded as env vars
fnox exec -- npm start
# Enable shell integration (auto-load secrets on cd)eval"$(fnox activate bash)"# or zsh, fish
fnox uses a simple TOML config file (fnox.toml) that you check into git. Secrets are either:
Encrypted inline - The encrypted ciphertext lives in the config file
Remote references - The config contains a reference (like "my-db-password") that points to a secret in AWS/1Password/etc.
You configure providers (encryption methods or cloud services), then assign each secret to a provider. fnox handles the rest.
# fnox.toml
[providers.age]
type = "age"recipients = ["age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"]
[secrets.DATABASE_URL]
provider = "age"value = "YWdlLWVuY3J5cHRpb24uLi4="# ← encrypted ciphertext, safe to commit
[secrets.API_KEY]
default = "dev-key-12345"# ← plain default value for local dev
When you run fnox get DATABASE_URL, it decrypts the value using your age key. When you run fnox exec, all secrets are loaded as environment variables.
fnox can automatically load secrets when you cd into directories with a fnox.toml file:
# Enable it onceeval"$(fnox activate bash)"# or zsh, fish# Add to your shell config for persistenceecho'eval "$(fnox activate bash)"'>>~/.bashrc
Now secrets auto-load on directory changes:
~/projects $ cd my-app
fnox: +3 DATABASE_URL, API_KEY, JWT_SECRET
~/projects/my-app $ cd ..
fnox: -3 DATABASE_URL, API_KEY, JWT_SECRET
Control the output with FNOX_SHELL_OUTPUT:
export FNOX_SHELL_OUTPUT=none - Silent mode
export FNOX_SHELL_OUTPUT=normal - Show count and keys (default)
export FNOX_PROFILE=production
cd my-app # Loads production secrets
Why is this a standalone CLI and not part of mise?
mise has support for encrypted secrets but mise's design makes it a poor fit for remote secrets. mise reloads
its environment too frequently—whenever a directory is changed, mise x is run, a shim is called, etc. Any other use-case like this mise leverages caching
but secrets are an area where caching is a bad idea for obvious reasons. It might be possible to change mise's design to retain its environment in part to
better support something like this but that's a huge challenge.
Basically it's just too hard to get remote secrets to work effectively with mise so I made this a standalone tool.
Providers: Complete Getting Started Guides
Each provider below is a complete standalone guide. Choose the ones that fit your workflow.
Use age when: You want secrets in git, encrypted, with minimal setup. Perfect for development secrets, open source projects, or teams that want secrets in version control.
What is age? A modern encryption tool by @FiloSottile. It's simple, secure, and works beautifully with SSH keys you already have.
Generate an age key (or use your existing SSH key):
# Option 1: Generate a new age key
age-keygen -o ~/.config/fnox/age.txt
# Option 2: Use your existing SSH key (recommended!)# age can encrypt to SSH keys directly, no conversion needed
Get your public key (for encrypting secrets):
# If you generated an age key:
grep "public key:"~/.config/fnox/age.txt
# Output: age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p# If using SSH key:
ssh-keygen -Y find-principals -s ~/.ssh/id_ed25519.pub
# Or just use the SSH public key directly!
Configure fnox:
fnox init
# Add the age provider (use your public key)
cat >> fnox.toml << 'EOF'[providers.age]type = "age"recipients = ["age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"]# Or for SSH key:# recipients = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA..."]EOF
Set the decryption key (your private key):
# If using age key:export FNOX_AGE_KEY=$(cat ~/.config/fnox/age.txt | grep "AGE-SECRET-KEY")# If using SSH key:export FNOX_AGE_KEY_FILE=~/.ssh/id_ed25519
# Add to your shell profile for persistence:echo'export FNOX_AGE_KEY_FILE=~/.ssh/id_ed25519'>>~/.bashrc
# Encrypt and store a secret (automatically uses age provider)
fnox set DATABASE_URL "postgresql://localhost/mydb" --provider age
# The resulting fnox.toml looks like:# [secrets.DATABASE_URL]# provider = "age"# value = "YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+I..." # ← encrypted, safe to commit!# Retrieve and decrypt
fnox get DATABASE_URL
# Run commands with decrypted secrets
fnox exec -- npm run dev
age has first-class support for SSH keys! Instead of managing separate age keys, just use your existing SSH keys:
# Encrypt to your SSH public key
[providers.age]
type = "age"
recipients = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGQs..."]
# Decrypt with your SSH private keyexport FNOX_AGE_KEY_FILE=~/.ssh/id_ed25519
Works with ssh-ed25519 and ssh-rsa keys. For teams, add multiple recipients:
Create a service account with read access to your vault
Copy the OP_SERVICE_ACCOUNT_TOKEN
Store the token (bootstrap with age!):
# First, set up age encryption (see age section above)
fnox init
# ... configure age provider ...# Store the 1Password token encrypted in fnox
fnox set OP_SERVICE_ACCOUNT_TOKEN "ops_YOUR_TOKEN_HERE" --provider age
# Now you can bootstrap the token from fnox itself:export OP_SERVICE_ACCOUNT_TOKEN=$(fnox get OP_SERVICE_ACCOUNT_TOKEN)
Add secrets to 1Password (via 1Password app or CLI):
# Create an item in 1Password
op item create --category=login \
--title="Database" \
--vault="Development" \
password="super-secret-password"
Reference secrets in fnox:
cat >> fnox.toml << 'EOF'[secrets.DATABASE_URL]provider = "onepass"value = "Database" # ← Item name in 1Password (fetches 'password' field)[secrets.DB_USERNAME]provider = "onepass"value = "Database/username" # ← Specific field[secrets.API_KEY]provider = "onepass"value = "op://Development/API Keys/credential" # ← Full op:// URIEOF
# Export the token (one-time per session)export OP_SERVICE_ACCOUNT_TOKEN=$(fnox get OP_SERVICE_ACCOUNT_TOKEN)# Get secrets from 1Password
fnox get DATABASE_URL
# Run commands with 1Password secrets
fnox exec -- ./deploy.sh
"item-name" → Gets the password field
"item-name/field" → Gets a specific field (username, password, etc.)
"op://vault/item/field" → Full 1Password reference URI
Pros:
Beautiful UI, great mobile apps
Excellent audit logs and access control
No encryption key management
Team-friendly
Cons:
Requires 1Password subscription
Requires network access
Service account token management
Use Bitwarden when: You want an open-source password manager, or you're already using Bitwarden/Vaultwarden.
# Login
bw login
# Unlock and get session tokenexport BW_SESSION=$(bw unlock --raw)
Store the session token (optional, for bootstrap):
# Store encrypted with age
fnox set BW_SESSION "$(bw unlock --raw)" --provider age
# Next time, bootstrap from fnox:export BW_SESSION=$(fnox get BW_SESSION)
# Unlock Bitwarden (once per session)export BW_SESSION=$(bw unlock --raw)# Or bootstrap: export BW_SESSION=$(fnox get BW_SESSION)# Get secrets
fnox get DATABASE_URL
# Run commands
fnox exec -- npm start
"item-name" → Gets the password field
"item-name/field" → Gets specific field (username, password, notes, uri, totp)
For local development without a Bitwarden account:
# Start local vaultwarden serversource ./test/setup-bitwarden-test.sh
# Follow on-screen instructions to create account and login
Pros:
Open source
Free for personal use
Self-hosting option (Vaultwarden)
Good audit logs
Cons:
UI less polished than 1Password
Session token expires (need to unlock regularly)
Use AWS Secrets Manager when: You're running on AWS infrastructure and want centralized secret management with IAM access control, audit logs, and automatic rotation.
Note: This is remote storage - secrets live in AWS, not in your config file. Your fnox.toml only contains references to the secret names.
AWS account
AWS credentials configured (CLI, environment variables, or IAM role)
# Secrets are fetched from AWS on-demand
fnox get DATABASE_URL
# Run commands (fetches all secrets from AWS)
fnox exec -- ./start-server.sh
# Use different profiles for different environments
fnox exec --profile production -- ./deploy.sh
Storage: Secrets live in AWS Secrets Manager (NOT in fnox.toml)
Config: fnox.toml contains only the secret name/reference
Retrieval: Running fnox get calls AWS API to fetch the current value
Prefix: If configured, the prefix is prepended (e.g., value = "db-url" → fetches myapp/db-url)
Pros:
Centralized secret management
IAM access control
CloudTrail audit logs
Automatic rotation support
Secrets never in git
Cons:
Requires AWS account and network access
Costs money ($0.40/secret/month + $0.05/10k API calls)
More complex setup than encryption
Use AWS KMS when: You want secrets in git (encrypted), but with AWS-managed encryption keys and IAM access control. Different from Secrets Manager - this stores encrypted ciphertext in fnox.toml.
Note: This is local encryption - the encrypted ciphertext lives in your fnox.toml file. AWS KMS is only called to encrypt/decrypt.
AWS account
AWS credentials configured
KMS key created
IAM permissions (see below)
Create KMS key:
# Via AWS CLI
aws kms create-key \
--description "fnox secrets encryption" \
--key-usage ENCRYPT_DECRYPT
# Note the KeyId from output
# Set token (once per session, or use VAULT_TOKEN env var)export VAULT_TOKEN="hvs.CAESIJ..."# Get secrets from Vault
fnox get DATABASE_URL
# Run commands
fnox exec -- ./app
Pros:
Advanced features (dynamic secrets, leasing, rotation)
Fine-grained access policies
Audit logging
Multi-cloud support
Self-hosted option
Cons:
Complex to set up and operate
Requires running Vault infrastructure
Token management
Use Keychain when: You want secrets stored securely on your local machine using the OS native credential store. Perfect for personal projects, local development, or storing tokens that bootstrap other providers.
fnox can store secrets in your operating system's native secure storage:
macOS: Keychain Access
Windows: Credential Manager
Linux: Secret Service (GNOME Keyring, KWallet, etc.)
Secrets are stored outside fnox.toml, encrypted by the OS.
# Store a secret in OS keychain
fnox set DATABASE_URL "postgresql://localhost/mydb" --provider keychain
# The fnox.toml only contains a reference:# [secrets.DATABASE_URL]# provider = "keychain"# value = "database-url" # ← Keychain entry name, not the actual secret# Retrieve from keychain
fnox get DATABASE_URL
# Run commands
fnox exec -- npm run dev
Storage: Secrets stored in OS credential manager (encrypted by OS)
Config: fnox.toml contains only the secret name, not the value
Retrieval: fnox queries the OS keychain API
Service: Acts as a namespace (isolates fnox secrets from other apps)
Prefix: Additional namespacing within the service
Pros:
OS-managed encryption
Cross-platform
No external dependencies
Free
Cons:
Requires GUI/interactive session (doesn't work in headless CI)
Not suitable for teams (secrets are per-machine)
Keyring must be unlocked
Use case example: Store your OP_SERVICE_ACCOUNT_TOKEN in keychain, then bootstrap it for 1Password access:
Let's build a complete setup for a typical web app with development and production environments.
You're building an API that needs:
Database URL
API keys
JWT secret
Requirements:
Development secrets: In git, encrypted (so team can clone and run)
Production secrets: In AWS Secrets Manager (never in git)
This creates a fnox.toml file.
Step 2: Set Up Age Encryption (for dev secrets)
# Generate age key
age-keygen -o ~/.config/fnox/age.txt
# Get your public key
grep "public key:"~/.config/fnox/age.txt
# age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p# Configure age provider
cat >> fnox.toml << 'EOF'[providers.age]type = "age"recipients = ["age1ql3z7hjy54pw3hyww5ayyfg7zqgvc7w3j2elw8zmrj2kg5sfn9aqmcac8p"]EOF# Set your private key in shell profileecho'export FNOX_AGE_KEY=$(cat ~/.config/fnox/age.txt | grep "AGE-SECRET-KEY")'>>~/.bashrc
source~/.bashrc
# Encrypt development secrets
fnox set DATABASE_URL "postgresql://localhost/mydb" --provider age
fnox set JWT_SECRET "dev-jwt-secret-$(openssl rand -hex 32)" --provider age
fnox set STRIPE_KEY "sk_test_abc123" --provider age
# Enable shell integration (one time)eval"$(fnox activate bash)"echo'eval "$(fnox activate bash)"'>>~/.bashrc
# Now just cd into the projectcd my-api
# fnox: +3 DATABASE_URL, JWT_SECRET, STRIPE_KEY# Run your app (secrets are already loaded!)
npm run dev
# Or explicitly:
fnox exec -- npm run dev
Production:
# Set AWS credentials (IAM role, or env vars)export AWS_REGION=us-east-1
# Run with production profile
fnox exec --profile production -- node server.js
CI/CD:
# .github/workflows/deploy.ymlname: Deployon: [push]jobs:
deploy:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v3 # you'll need a mise.toml with fnox configured
- name: Setup age keyenv:
FNOX_AGE_KEY: ${{ secrets.FNOX_AGE_KEY }}run: | mkdir -p ~/.config/fnox echo "$FNOX_AGE_KEY" > ~/.config/fnox/age.txt chmod 600 ~/.config/fnox/age.txt
- name: Deploy to productionenv:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}run: | fnox exec --profile production -- ./deploy.sh
✅ Dev secrets are encrypted in git → Team can clone and run immediately
✅ Prod secrets are in AWS → Never in git, centrally managed
✅ Shell integration → Secrets auto-load on cd
✅ CI/CD ready → GitHub Actions can decrypt dev secrets and access AWS for prod
✅ Profiles → Same fnox.toml, different environments
Encrypted value (provider = "age", value = "encrypted...")
Provider reference (provider = "aws", value = "secret-name")
Environment variable (if $ENV_VAR exists)
Default value (default = "fallback")
First match wins!
Set fallbacks for optional secrets:
[secrets.NODE_ENV]
default = "development"# Used if not found elsewhere
[secrets.LOG_LEVEL]
default = "info"if_missing = "warn"# "error", "warn", or "ignore"