Skip to content

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.

  • kiln installed on your system
  • A project directory where you want to manage secrets
  • Basic familiarity with environment variables
  1. Generate an encryption key

    Terminal window
    kiln init key

    This creates:

    • Directoryhome
      • Directoryuser
        • Directory.kiln
          • kiln.key # Your private key (keep secret)
          • kiln.key.pub # Your public key (safe to share)
  2. Create a configuration file

    Terminal window
    kiln init config --recipients "$(whoami)=$(cat ~/.kiln/kiln.key.pub)"

    This creates kiln.toml with yourself as the first recipient.

  3. Set your first secret

    Terminal window
    kiln set DATABASE_URL

    kiln prompts you to enter the value securely (input is hidden).

  4. Verify it works

    Terminal window
    kiln get DATABASE_URL
  5. Run your application

    Terminal window
    kiln run -- your-application

    kiln automatically injects all encrypted variables into your application’s environment.

Expand to support a team member:

  1. Teammate generates their key

    Terminal window
    # Teammate runs on their machine
    kiln init key --path ./teammate.key
  2. Add them to your project

    Terminal window
    kiln rekey --file default --add-recipient "alice=$(cat ./teammate.key.pub)"
  3. Update team configuration

    Edit kiln.toml to organize your team:

    [recipients]
    you = "age1..."
    alice = "age1..."
    [groups]
    developers = ["you", "alice"]
    [files]
    default = { filename = ".kiln.env", access = ["developers"] }
  4. 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-key

    Update kiln.toml:

    [files]
    default = { filename = ".kiln.env", access = ["developers"] }
    staging = { filename = "staging.env", access = ["developers"] }
    production = { filename = "prod.env", access = ["you"] }
Terminal window
kiln set DEBUG true
kiln set LOG_LEVEL debug
kiln run -- npm run dev

Your encrypted files are safe to commit:

Terminal window
git add kiln.toml .kiln.env staging.env prod.env
git commit -m "Add encrypted environment configuration"
git push origin main

Check file status:

Terminal window
kiln info --verify

Export for scripts:

Terminal window
eval $(kiln export)
kiln export --format json > config.json

Edit multiple variables:

Terminal window
kiln edit --file production

You now have a working kiln setup. Continue with:

Advanced Configuration Team Workflows Explore All Commands