Go

Updated

github.com/dev-kryptic/krypticdev injects your project's secrets into the process environment with os.Setenv during development startup. Outside development it is a no-op, and it never panics.

Install

go get github.com/dev-kryptic/krypticdev

Use

import "github.com/dev-kryptic/krypticdev"

func main() {
    krypticdev.Inject() // before anything reads the environment

    dbURL := os.Getenv("DATABASE_URL")
}

Behavior

  • No-op when GO_ENV/APP_ENV/ENVIRONMENT/ENV indicates production or staging, or when KRYPTIC_DISABLED=true.
  • Finds kryptic.json by walking up from the working directory.
  • Never overwrites environment variables that are already set.
  • Returns a Result{Injected, Skipped, Reason}.
  • macOS/Linux via unix socket, Windows via named pipe - standard library only.