Skip to content

Usage

lazyenv [path] [flags]

Run lazyenv in the current directory, or pass a path to scan a different folder.

# Current directory
lazyenv

# Specific directory
lazyenv ./services

# Recursive scan
lazyenv ./services -r

Flags

Flag Long form Description
-r --recursive Scan subdirectories recursively, skipping hidden directories, node_modules and vendor.
-a --show-all Show secrets in cleartext at startup instead of masking them.
-s --sort Sort order for variables: position (default, preserves file order) or alphabetical.
-g --group / --no-group Start with prefix grouping enabled (default off). Toggle at runtime with g.
-B --no-backup Disable the .bak backup made before each file's first save in a session.
-G --no-git-check Disable .gitignore check. Auto-disabled if git is not found in $PATH.
--theme Built-in theme preset (see --list-themes). Overrides theme setting in config file.
--no-theme-bg Disable theme background color, keeping the terminal's native background. Useful for transparent terminals.
--no-mouse Disable mouse support. Useful in terminals or multiplexers with mouse conflicts.
--read-only Disable all write operations. Useful for safely inspecting production files.
--session-summary / --no-session-summary Force-enable or disable the on-exit summary of disk changes (default: enabled). --read-only forces it off.
--file-list-width Width of the file list panel in characters. 0 = auto (1/4 screen); min 20, lower values are raised.
-c --config Path to configuration file. Takes highest priority over default search paths.
--check-config Validate configuration file and exit. Shows search paths and any errors found.
--show-config Print the effective configuration (TOML) and exit.
--list-themes List available built-in themes and exit.
--themes Interactive theme preview. Browse all built-in themes and see their colors live.
-v --version Show version, commit, and build date.
-h --help Show help.

Precedence

Configuration is resolved in this order, from lowest to highest priority:

  1. Built-in defaults — sensible out-of-the-box values.
  2. Config file — the first one found among the --config file, .lazyenvrc in the current directory, and the global config files (see Config file location). Files are not merged: the one found is used whole, so a project .lazyenvrc replaces the global file instead of adding to it.
  3. CLI flags — always win. A flag passed on the command line overrides both the config file and the defaults.

For example, if your config file has recursive = false but you run lazyenv -r, the recursive scan is enabled for that session.

The following flags have a corresponding config file key:

Flag Config key
-r recursive
-a show-secrets
-s sort
-g group
-B no-backup
-G no-git-check
--theme theme
--no-theme-bg no-theme-bg
--no-mouse no-mouse
--read-only read-only
--session-summary / --no-session-summary session-summary
--file-list-width layout.file-list-width

Flags without a config equivalent: --config picks the config file itself, and --check-config, --show-config, --list-themes, --themes, --version and --help are one-shot actions that print output and exit.

See Configuration for all available config file options.

Development

The project uses just as a task runner. Run just with no arguments to see all available recipes:

just

Common recipes for devs

Recipe Description
just build Build the binary to bin/lazyenv.
just run Build and run with go run. Accepts arguments: just run ./myproject -r.
just test Run all tests with race detection.
just test-cover Run tests with race detection and coverage report.
just check Run all checks: formatting and import grouping, vet, lint, and tests — same as CI. Read-only, does not modify files.
just fmt Format all Go source files and group their imports (gofmt + gci).
just fix Apply Go modernization fixes (go fix). Run this before just check.
just vet Run static analysis.
just lint Run the linters: gocyclo, ineffassign, deadcode, exhaustive.
just clean Remove build artifacts (bin/, coverage.out, dist/).
just demo Regenerate the README demo GIF from docs/assets/demo.tape. Needs vhs, ttyd, ffmpeg, gifsicle.
just page-media Render the media for the lazynop.dev project page from docs/assets/page/ into dist/page-media/. Needs vhs, ttyd, ffmpeg (with libx264 and libwebp).

Trying themes and configs for devs

Recipe Description
just try-theme <name> Launch lazyenv with a built-in theme (e.g. just try-theme tokyo-night).
just try-config <name> Launch with an example config from examples/config/.
just show-config <name> Print the effective config for an example config file.

Shorthand recipes are available for common configs: just try-dracula, just try-nord, just try-catppuccin, just try-full, etc.