Quick Start
This guide walks you through setting up kiln for your project in 5 minutes. You’ll encrypt secrets, manage team access, and run applications with decrypted environment variables.
Prerequisites
Section titled “Prerequisites”- kiln installed on your system
- A project directory where you want to manage secrets
- Basic familiarity with environment variables
Initial Setup
Section titled “Initial Setup”-
Generate an encryption key
Terminal window kiln init keyThis creates:
Directoryhome
Directoryuser
Directory.kiln
- kiln.key # Your private key (keep secret)
- kiln.key.pub # Your public key (safe to share)
-
Create a configuration file
Terminal window kiln init config --recipients "$(whoami)=$(cat ~/.kiln/kiln.key.pub)"This creates
kiln.tomlwith yourself as the first recipient. -
Set your first secret
Terminal window kiln set DATABASE_URLkiln prompts you to enter the value securely (input is hidden).
-
Verify it works
Terminal window kiln get DATABASE_URL -
Run your application
Terminal window kiln run -- your-applicationkiln automatically injects all encrypted variables into your application’s environment.
Team Setup
Section titled “Team Setup”Expand to support a team member:
-
Teammate generates their key
Terminal window # Teammate runs on their machinekiln init key --path ./teammate.key -
Add them to your project
Terminal window kiln rekey --file default --add-recipient "alice=$(cat ./teammate.key.pub)" -
Update team configuration
Edit
kiln.tomlto organize your team:[recipients]you = "age1..."alice = "age1..."[groups]developers = ["you", "alice"][files]default = { filename = ".kiln.env", access = ["developers"] } -
Create environment-specific files
Terminal window # Staging secrets (all developers)kiln set --file staging API_URL https://staging.api.com# Production secrets (you only)kiln set --file production SECRET_KEY super-secret-production-keyUpdate
kiln.toml:[files]default = { filename = ".kiln.env", access = ["developers"] }staging = { filename = "staging.env", access = ["developers"] }production = { filename = "prod.env", access = ["you"] }
Working with Environments
Section titled “Working with Environments”kiln set DEBUG truekiln set LOG_LEVEL debugkiln run -- npm run devkiln set --file staging API_URL https://staging.api.comkiln run --file staging -- ./deploy-staging.shkiln set --file production SECRET_KEY production-secretkiln run --file production -- ./deploy-production.shVersion Control
Section titled “Version Control”Your encrypted files are safe to commit:
git add kiln.toml .kiln.env staging.env prod.envgit commit -m "Add encrypted environment configuration"git push origin mainCommon Operations
Section titled “Common Operations”Check file status:
kiln info --verifyExport for scripts:
eval $(kiln export)kiln export --format json > config.jsonEdit multiple variables:
kiln edit --file productionNext Steps
Section titled “Next Steps”You now have a working kiln setup. Continue with:
Advanced Configuration Team Workflows Explore All Commands