Go

Updated

github.com/dev-kryptic/Kryptic.Go 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.

Source: github.com/dev-kryptic/Kryptic.Go. The import path and the Go package name are both kryptic.

Install

go get github.com/dev-kryptic/Kryptic.Go

Use

import "github.com/dev-kryptic/Kryptic.Go"

func main() {
    kryptic.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.

Environment variables override everything: KRYPTIC_PROJECT_ID, KRYPTIC_ENV, KRYPTIC_SOCKET_PATH, KRYPTIC_TIMEOUT_MS, KRYPTIC_DISABLED, KRYPTIC_SILENT.