AWS Secrets Manager → .env

A fast, secure CLI tool that fetches secrets from AWS Secrets Manager and saves them as .env, JSON, YAML, or CSV — with 0600 file permissions out of the box.

Install See Features 100% Free
# Fetch a secret and write it as .env (default)
sm2env get myapp/prod --region us-east-1
# Output as JSON, YAML, or CSV
sm2env get myapp/prod --output json
# Merge multiple secrets into one .env
sm2env get myapp/prod myapp/shared --merge
# Preview without writing any file
sm2env get myapp/prod --dry-run
# List all secrets with a filter
sm2env list --filter myapp

Everything you need

Built in Rust for speed and safety. No runtime, no dependencies, single binary.

Multiple output formats

Write secrets as .env, JSON, YAML, or CSV. Use --output stdout to pipe into other tools.

Secure by default

Output files are created with 0600 permissions. Path traversal attacks are rejected before any write.

Multi-secret merge

Combine keys from multiple secrets into one output file with --merge. Last-write-wins on duplicate keys.

Shell completions

Generate tab completions for bash, zsh, and fish with sm2env completions <shell>.

Config file support

Set default region, profile, and format in ~/.sm2env to avoid repeating flags on every command.

Key filtering & prefix

Extract only the keys you need with --keys, or prepend a namespace to all output keys with --prefix.

100%

Free forever

0600

File permissions

5

Output formats

Rust

Single binary

Get started quickly

Available for macOS and Linux — no account, no sign-up, no license key.

# Add the tap
brew tap amioranza/tools
# Install sm2env
brew install amioranza/tools/sm2env
# Update to latest version
brew upgrade amioranza/tools/sm2env
# Download and extract
curl -LO https://releases.mioranza.tech/sm2env-v0.2.0-x86_64-unknown-linux-gnu.tar.gz
tar xzf sm2env-v0.2.0-x86_64-unknown-linux-gnu.tar.gz
sudo mv sm2env /usr/local/bin/

Download the binary tarball

Download v0.2.0 for Linux x86_64

Ubuntu 22.04+, Debian 12+, Fedora 38+