Skip to content

Environment Variable Provider

The Environment Variable provider reads secrets directly from process environment variables. This is a read-only provider designed for CI/CD compatibility and containerized environments.

The env provider accepts no configuration options:

Terminal window
# All these are equivalent
$ secretspec check --provider env
$ secretspec check --provider env:
$ secretspec check --provider env://
  • Running in CI/CD pipelines where secrets are injected as environment variables
  • Testing with temporary environment variables
  • Working with containerized applications that use environment variables
Terminal window
# Set environment variables
export DATABASE_URL="postgresql://localhost/mydb"
export API_KEY="sk-1234567890"
# Check secrets are available
$ secretspec check --provider env
All required secrets are configured
# Run with environment variables
$ secretspec run --provider env -- npm start
# GitHub Actions
- name: Run with secrets
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
API_KEY: ${{ secrets.API_KEY }}
run: |
secretspec run --provider env -- npm run deploy