qmetrics.net

GoDotEnv

Go library loading environment variables from .env files

Build & DeploymentDesktop/CLI app
GoDotEnv screenshot

GoDotEnv ports Ruby’s dotenv behavior to Go, reading key-value pairs from .env files into the process environment. It works as an importable package or a small command-line helper.

Overview

GoDotEnv loads configuration from .env files into environment variables when a Go program or shell command starts, following the twelve-factor idea of keeping deployment-specific settings out of source code. It is a Go port of the Ruby dotenv project and can serve daemons as a library or wrap arbitrary commands via its binary.

Typical use adds variables to a root .env file, then calls Load near program entry or imports the autoload package to read .env on import. Multiple files, non-default paths, maps via Read or Parse, and writing Marshal output back to disk are supported. Syntax allows comments, exports, inline comments, and YAML-like key colon forms.

Later-loaded values do not override variables already set in the environment unless you deliberately use Overload. A common pattern chains .env files by application environment name. The command-line mode loads a chosen file then execs another program, with an optional flag to override existing variables.

Key names allow the same character set as Node’s dotenv, including hyphens, which differs from Ruby’s stricter set. Continuous integration covers Linux-style and Windows environments for the library, though Windows behavior of the binary is not guaranteed.

Key features

  • Load and Overload from .env files
  • Autoload package on import
  • Parse from files, readers, or strings
  • Marshal and Write env maps to disk
  • Command wrapper with optional override
  • Multi-file and environment-specific chains
  • Comments and export syntax in files

Use cases

  • Local development configuration in Go
  • Injecting secrets before running commands
  • Layered .env files per environment name
  • Round-tripping env maps to disk
  • Twelve-factor config without hardcoding

Tags

Similar software

nvm

POSIX shell version manager for Node.js

nvm installs and switches between Node.js versions from the command line on POSIX shells including bash and zsh.

★ 96.3k⟳ 2 days agoMIT
Build & DeploymentDesktop/CLI app

uv

Fast Python package and project manager

uv is a Rust-based tool that manages Python dependencies, virtual environments, scripts, and interpreters. It offers a pip-compatible interface and universal lockfiles for projects.

★ 92.7k⟳ 2 days agoApache-2.0
Build & DeploymentDesktop/CLI app

Hugo

Go-based static site generator with flexible templating

Hugo is a static site generator written in Go. It turns content and templates into deployable HTML sites with asset pipelines for CSS, JavaScript, Sass, and images.

★ 90.6k⟳ todayApache-2.0
Build & DeploymentDesktop/CLI app

Vite

Frontend build tool for modern web projects

Vite is a build tool for modern web projects, combining a development server with an optimized production build. It targets a faster, leaner local development workflow.

★ 84.2k⟳ yesterdayMIT
Build & DeploymentDesktop/CLI app

act

Local runner for GitHub Actions workflows

A command-line tool that executes GitHub Actions workflows on your machine using Docker. It mirrors GitHub’s environment for faster feedback while editing workflow files.

★ 72.8k⟳ 12 days agoMIT
Build & DeploymentDesktop/CLI app

Moby

Modular toolkit for assembling container systems

Moby bundles container build, runtime, registry, and orchestration components so integrators can craft custom container platforms instead of using a single fixed product.

★ 72.3k⟳ todayApache-2.0