direnv

package
v0.65.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allow

func Allow(cmd oscommands.ICmdObjBuilder, envrcPath string) error

Allow runs `direnv allow <envrcPath>` to approve a .envrc file so the next Load can read it.

Types

type LoadResult

type LoadResult struct {
	// Message is whatever direnv printed to stderr — useful to log
	// (success: "direnv: loading .envrc"; error: the error text).
	Message string

	// Err is non-nil when direnv exited non-zero or its stdout could
	// not be parsed.
	Err error

	// Blocked is true when the target .envrc exists but hasn't been
	// approved with `direnv allow` yet. EnvrcPath then holds the path
	// direnv said was blocked, suitable for passing to Allow.
	Blocked   bool
	EnvrcPath string
}

LoadResult bundles everything callers might want to know about a direnv invocation. The env-var delta has already been applied to the process by the time Load returns.

func Load

Load runs `direnv export json` for the current working directory and applies the resulting env-var delta to the current process. If direnv isn't on PATH, it's a no-op — users who don't use direnv pay nothing, and users who do need no config to opt in.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL