Commands
Overview
hush <command> [options]Global Options
| Option | Description |
|---|---|
-e, --env <env> | Environment: development or production (default: development) |
-r, --root <dir> | Root directory (default: current directory) |
-h, --help | Show help message |
-v, --version | Show version number |
init
Generate a hush.yaml configuration file with auto-detected targets.
hush initThis command scans your monorepo for packages with package.json files and creates an initial configuration.
Example Output
# hush.yaml (generated)sources: shared: .env development: .env.development production: .env.production
targets: - name: root path: . format: dotenv - name: app path: ./packages/app format: dotenv - name: api path: ./packages/api format: wranglerencrypt
Encrypt source .env files to .env.encrypted files.
hush encryptWhat Gets Encrypted
Based on your hush.yaml sources configuration:
.env→.env.encrypted.env.development→.env.development.encrypted.env.production→.env.production.encrypted
decrypt
Decrypt and distribute secrets to all configured targets.
# Decrypt for development (default)hush decrypt
# Decrypt for productionhush decrypt -e productionhush decrypt --env prodHow It Works
- Loads and decrypts encrypted source files
- Merges shared → environment → local overrides
- Interpolates variable references (
${VAR}) - Filters variables per target using
include/excludepatterns - Writes to each target in the configured format
Source File Priority
Later sources override earlier ones:
- Shared (
.env.encrypted) - Base variables - Environment (
.env.development.encryptedor.env.production.encrypted) - Environment overrides - Local (
.env.local, unencrypted) - Personal overrides (not committed)
set
Set or modify secrets. Opens encrypted file in your $EDITOR. Alias: edit
# Set shared secretshush set
# Set development secretshush set development
# Set production secretshush set productionThis temporarily decrypts the file, opens it in your editor, and re-encrypts on save.
list
List all variables with their actual values.
# List development variableshush list
# List production variableshush list -e productioninspect
List all variables with masked values. Safe for AI agents.
hush inspecthush inspect -e productionExample Output
Secrets for development:
DATABASE_URL = post****************... (45 chars) STRIPE_SECRET_KEY = sk_t****************... (32 chars) API_KEY = (not set)
Total: 3 variables
Target distribution:
root (.) - 3 vars app (./app/) - 1 vars include: EXPO_PUBLIC_* api (./api/) - 2 vars exclude: EXPO_PUBLIC_*This lets AI agents reason about your configuration without seeing actual secrets.
has
Check if a specific secret exists. Returns exit code 0 if set, 1 if not.
# Check if a variable is sethush has DATABASE_URL
# Quiet mode (no output, just exit code)hush has API_KEY -q
# Use in scriptshush has DATABASE_URL -q && echo "DB configured"Options
| Option | Description |
|---|---|
-q, --quiet | Suppress output, only return exit code |
Example Output
DATABASE_URL is set (45 chars)Or if not set:
DATABASE_URL not foundpush
Push production secrets to Cloudflare Workers.
# Push secretshush push
# Preview without pushinghush push --dry-runOptions
| Option | Description |
|---|---|
--dry-run | Preview what would be pushed without making changes |
How It Works
- Finds targets with
format: wranglerand awrangler.tomlfile - Reads the worker name from
wrangler.toml - Uploads production secrets using
wrangler secret put
status
Show configuration and file status.
hush statusExample Output
Hush Status
Configuration: hush.yaml
Sources: shared: .env (encrypted: yes, modified: no) development: .env.development (encrypted: yes, modified: no) production: .env.production (encrypted: yes, modified: no)
Targets: root (.) format: dotenv app (./packages/app) format: dotenv include: EXPO_PUBLIC_* api (./packages/api) format: wrangler exclude: EXPO_PUBLIC_*
All encrypted files are up to date.check
Verify encrypted files are in sync with source files. Useful for pre-commit hooks.
# Basic checkhush check
# Warn but don't failhush check --warn
# JSON output for CIhush check --json
# Only check git-modified fileshush check --only-changedOptions
| Option | Description |
|---|---|
--warn | Warn on drift but exit 0 |
--json | Output machine-readable JSON |
--quiet | Suppress output |
--only-changed | Only check files modified in git |
--require-source | Fail if source file is missing |
Exit Codes
| Code | Meaning |
|---|---|
0 | All in sync |
1 | Drift detected (run hush encrypt) |
2 | Config error |
3 | Runtime error (sops missing, decrypt failed) |
Pre-commit Hook
npx hush check || exit 1Bypass with: HUSH_SKIP_CHECK=1 git commit -m "message"
skill
Install the Claude Code / OpenCode skill for AI-safe secrets management.
# Interactive: choose global or localhush skill
# Install globally (all projects)hush skill --global
# Install locally (this project only)hush skill --localOptions
| Option | Description |
|---|---|
--global | Install to ~/.claude/skills/ |
--local | Install to ./.claude/skills/ |
Global vs Local
- Global - Works across all your projects. Recommended for personal use.
- Local - Bundled with the project. Recommended for teams (commit
.claude/to git).