Local Development: Go
Put ennote secret get "<secret>" -- in front of the command that starts your service. Go reads the values with os.Getenv, like any environment variable.
The examples use a secret named api-env. Set your organization and workspace once with ennote config set, or add --organization-id and --workspace-id flags as in the overview.
Running the Service
ennote secret get "api-env" -- go run ./cmd/api
Reading Values
package main
import (
"log"
"os"
)
func mustEnv(key string) string {
v, ok := os.LookupEnv(key)
if !ok || v == "" {
log.Fatalf("missing required environment variable %s", key)
}
return v
}
var databaseURL = mustEnv("DATABASE_URL")
All values arrive as strings. Parse numbers and booleans with strconv. Libraries that read the environment, such as caarlos0/env or kelseyhightower/envconfig, work without changes.
Live Reload With Air
Start Air through Ennote. Every rebuild of your service inherits the variables:
ennote secret get "api-env" -- air
Tests
Integration tests that need real credentials can run the same way:
ennote secret get "api-test-env" -- go test ./...
Saving the Command in a Makefile
ENNOTE = ennote secret get "api-env" --organization-id "my-org-id" --workspace-id "local-development" --
dev:
$(ENNOTE) air
run:
$(ENNOTE) go run ./cmd/api
Keeping godotenv
If your code calls godotenv.Load(), you can leave it in place while you migrate. It does not override variables that are already set, so the values from Ennote win. It returns an error when no .env file exists, so ignore that error or remove the call once every developer uses Ennote.
Need Help?
If you encounter any issues or have questions, don't hesitate to contact support. Our team is here to assist you with any challenges you might face.
Python
Run Django, FastAPI, Flask and Python scripts locally with secrets from Ennote instead of a .env file, using ennote secret get with python, uv, Poetry or a Makefile.
Java & Kotlin
Run Spring Boot apps locally with secrets from Ennote instead of a .env file or credentials in application.properties, using ennote secret get with Maven or Gradle.