Getting Started
Get up and running with Hush in just a few minutes.
Prerequisites
Hush uses SOPS with age encryption. Install them first:
brew install sops age# SOPScurl -LO https://github.com/getsops/sops/releases/download/v3.8.1/sops-v3.8.1.linux.amd64sudo mv sops-v3.8.1.linux.amd64 /usr/local/bin/sopssudo chmod +x /usr/local/bin/sops
# agecurl -LO https://github.com/FiloSottile/age/releases/download/v1.1.1/age-v1.1.1-linux-amd64.tar.gztar xzf age-v1.1.1-linux-amd64.tar.gzsudo mv age/age /usr/local/bin/# Using scoopscoop install sops age
# Or using chocolateychoco install sops ageInstallation
pnpm add -D @chriscode/hushnpm install -D @chriscode/hushyarn add -D @chriscode/hushSetup
-
Generate an age key
Create a key pair for encrypting your secrets:
Terminal window mkdir -p ~/.config/sops/ageage-keygen -o ~/.config/sops/age/key.txtThis creates a private key at
~/.config/sops/age/key.txt. The public key is printed to the console. -
Create
.sops.yamlIn your repository root, create a SOPS configuration file:
.sops.yaml creation_rules:- encrypted_regex: '.*'age: age1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxReplace the
age:value with your public key from step 1. -
Initialize Hush
Run the init command to create
hush.yaml:Terminal window npx hush initThis auto-detects packages in your monorepo and creates a configuration file.
-
Create your env files
Terminal window # .env (shared across environments)DATABASE_URL=postgres://localhost/mydbSTRIPE_SECRET_KEY=sk_test_xxxEXPO_PUBLIC_API_URL=${API_BASE}/v1# .env.developmentAPI_BASE=http://localhost:8787# .env.productionAPI_BASE=https://api.example.com -
Encrypt
Terminal window npx hush encryptThis creates encrypted versions of your env files (
.env.encrypted, etc.) that are safe to commit. -
Decrypt for development
Terminal window npx hush decryptThis decrypts and distributes secrets to all configured targets.
Verify Your Setup
Check that everything is configured correctly:
npx hush statusThis shows your configuration, encrypted files, and target distribution.
Next Steps
- Learn about Configuration to customize your setup
- Understand Monorepo Patterns for routing secrets
- Explore AI-Native Workflow for working with AI assistants
- See the full Command Reference