GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - envcheck/envcheck: Fast, modern Rust CLI for linting .env files and syncing with Kubernetes, Terraform, and Ansible.

BranchesTags
Open more actions menu

Latest commit

 

History

13 Commits
13 Commits

Folders and files

NameName
Last commit message
Last commit date
.cargo
.cargo
 
 
.github/workflows
.github/workflows
 
 
Formula
Formula
 
 
benches
benches
 
 
schema
schema
 
 
src
src
 
 
tests
tests
 
 
.envcheckignore.example
.envcheckignore.example
 
 
.envcheckrc.example.yaml
.envcheckrc.example.yaml
 
 
.gitignore
.gitignore
 
 
.pre-commit-hooks.yaml
.pre-commit-hooks.yaml
 
 
.releaserc.json
.releaserc.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
deny.toml
deny.toml
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

envcheck

Crates.io CI npm

A fast, modern Rust CLI for linting .env files and ensuring environment synchronization across your entire DevSecOps stack.

โœจ Features

Core

  • Lint - Detects duplicate keys, invalid syntax, empty values, trailing whitespace, unsorted keys
  • Compare - Identifies missing keys across multiple environment files
  • Fix - Auto-fix issues with --commit and --pr flags for CI integration
  • TUI - Interactive terminal UI for comparing and merging .env files

DevSecOps Integrations

Integration Command What it checks
Kubernetes envcheck k8s-sync SecretKeyRef/ConfigMapKeyRef vs .env
Terraform envcheck terraform TF_VAR_* variable usage
Ansible envcheck ansible lookup('env', 'VAR') calls
GitHub Actions envcheck actions env: blocks in workflows
Helm envcheck helm SCREAMING_SNAKE_CASE in values.yaml
ArgoCD envcheck argo plugin.env and kustomize.commonEnv

Output Formats

  • Text - Colored terminal output (default)
  • JSON - Machine-readable for pipelines
  • GitHub - Native GitHub Actions annotations
  • SARIF - GitHub Security tab integration
  • PR Comment - Markdown for PR/MR comments

๐Ÿš€ Installation

Cargo (Recommended)

cargo install envcheck

npm

npm install -g @envcheck/cli
# or use without installing
npx @envcheck/cli lint .env

Homebrew

brew tap envcheck/tap
brew install envcheck

Binary Releases

Download pre-built binaries from GitHub Releases.

๐Ÿ“– Usage

Lint .env files

envcheck lint .env
envcheck lint .env .env.local .env.prod
envcheck lint .env --format json
envcheck lint .env --format sarif > results.sarif

Compare environments

envcheck compare .env.example .env.prod

Fix issues automatically

envcheck fix .env                    # Sort keys, remove whitespace
envcheck fix .env --commit           # Auto-commit changes
envcheck fix .env --pr               # Create a PR with fixes

Interactive TUI

envcheck tui .env.example .env .env.prod

K8s Sync

envcheck k8s-sync k8s/*.yaml --env .env.example

Terraform

envcheck terraform infra/ --env .env

Ansible

envcheck ansible playbooks/ --env .env

GitHub Actions

envcheck actions .github/workflows --env .env

Helm

envcheck helm charts/myapp --env .env

ArgoCD

envcheck argo argocd/apps --env .env

Shell Completions

envcheck completions bash > /etc/bash_completion.d/envcheck
envcheck completions zsh > ~/.zsh/completions/_envcheck
envcheck completions fish > ~/.config/fish/completions/envcheck.fish

๐Ÿ“‹ Lint Rules

ID Rule Severity Description
E001 Duplicate Key Error Key defined multiple times
E002 Invalid Syntax Error Line is not KEY=VALUE
W001 Empty Value Warning Key has no value
W002 Trailing Whitespace Warning Line ends with whitespace
W003 Unsorted Keys Warning Keys are not alphabetically sorted
W004 Missing Key Warning Key missing in comparison file
W005 K8s Missing Env Warning Key in K8s not in .env
W006 Unused Env Info Key in .env not in K8s

โš™๏ธ Configuration

Create .envcheckrc.yaml or .envcheckrc.toml in your project root:

# .envcheckrc.yaml
rules:
  disable:
    - W003  # Don't warn about unsorted keys
  warnings_as_errors: false

ignore:
  - "*.local"
  - ".env.development"

format: text

files:
  - .env
  - .env.example

.envcheckignore

# Ignore patterns (like .gitignore)
*.local
.env.development
tests/fixtures/**

JSON Schema for IDE autocompletion: https://envcheck.github.io/schema/envcheckrc.json

๐Ÿ”„ CI/CD Integration

GitHub Actions

- uses: envcheck/action-envcheck@v1
  with:
    command: lint
    args: .env.example .env
    format: github

Pre-commit

repos:
  - repo: https://github.com/envcheck/envcheck
    rev: v0.1.0
    hooks:
      - id: envcheck-lint
        args: [".env.example", ".env"]
      - id: envcheck-k8s
        args: ["k8s/*.yaml", "--env", ".env.example"]

GitLab CI

envcheck:
  image: rust:latest
  script:
    - cargo install envcheck
    - envcheck lint .env --format json > envcheck-report.json
  artifacts:
    reports:
      codequality: envcheck-report.json

๐Ÿ—๏ธ Architecture

envcheck/
โ”œโ”€โ”€ envcheck/           # Core Rust CLI (this repo)
โ”œโ”€โ”€ envcheck-npm/       # npm wrapper package
โ”œโ”€โ”€ action-envcheck/    # GitHub Action
โ””โ”€โ”€ envcheck.github.io/ # Documentation website

๐Ÿ”ง Performance

  • Parallel processing with Rayon
  • Zero-copy parsing with Cow<str> for reduced allocations
  • Benchmarks available via cargo bench
parse_env_file:  ~3.3 ยตs
lint_rules:      ~2.3 ยตs

๐Ÿค Comparison

Feature envcheck dotenv-linter
Linting โœ… โœ…
Compare โœ… โœ…
Auto-fix โœ… + commit/PR โœ…
K8s Sync โœ… โŒ
Terraform โœ… โŒ
Ansible โœ… โŒ
GitHub Actions โœ… โŒ
Helm โœ… โŒ
ArgoCD โœ… โŒ
TUI โœ… โŒ
SARIF โœ… โŒ
Config files โœ… โŒ
Shell completions โœ… โŒ

๐Ÿ“ฆ Related Packages

  • envcheck-npm - npm wrapper
  • action-envcheck - GitHub Action
  • envcheck.github.io - Documentation

๐Ÿ“„ License

MIT

About

Fast, modern Rust CLI for linting .env files and syncing with Kubernetes, Terraform, and Ansible.

envcheck.github.io

Topics

clidevopsdevsecopsenv-fileskuberneteslintingruststefan-wiestterraform

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.