Keeps `.env` files in sync with `env.sample`.

Related tags

Command-line envsync
Overview

envsync

This is a Rust port of env-sample-sync.

It keeps .env files in sync with env.sample.

It checks whether the local repository has an .env file and if one exists, it is scrubbed of secrets/values and made available as env.sample. This ensures that all application environment variables are safely and automatically documented without leaking secrets.

Installation

cargo install --git https://github.com/mre/envsync

Usage

envsync

This will check for an .env file in the current directory and if one exists, it will be scrubbed of secrets/values and made available as env.sample.

You can pass in custom example values for environment variables for environment variables

For example, say you have the following .env file:

FOO=bar
BAR=baz
BAZ=qux

and you want to set the value of BAR to bla, you can do so by running:

envsync -e BAR=bla

This will result in the following env.sample file:

FOO=<FOO>
BAR=bla
BAZ=<BAZ>

CI/CD

I use this in my CI/CD pipelines to ensure that all environment variables are documented and that secrets are not leaked.

Related Projects

  • envy: A Rust library for managing environment variables globally. Automatically loads environment variables from a global config file and sets them in the current shell session when entering a directory.
You might also like...
Env.exe for Windows

env.exe for Windows $ env {options} {NAME=VALUE}... COMMAND ARGS... -v, --debug print verbose information --version output version information -h, -

A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.
A tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK.

FileQL - File Query Language FileQL is a tool that allow you to run SQL-like query on local files instead of database files using the GitQL SDK. Sampl

CLI Tool for tagging and organizing files by tags.

wutag 🔱 🏷️ CLI tool for tagging and organizing files by tags. Install If you use arch Linux and have AUR repositories set up you can use your favour

mdBook is a utility to create modern online books from Markdown files.

Create book from markdown files. Like Gitbook but implemented in Rust

CLI tool to bake your fresh and hot MD files

At least once in your Rust dev lifetime you wanted to make sure all code examples in your markdown files are up-to-date, correct and code is formated, but you couldn't make that done with already existing tools - fear not!

The dead easy way to use config files in your rust project

Configr The dead easy way to use config files in your project This will load a config.toml file if it exists, otherwise it will create the needed fold

 miniserve - a CLI tool to serve files and dirs over HTTP
miniserve - a CLI tool to serve files and dirs over HTTP

🌟 For when you really just want to serve some files over HTTP right now!

A cli tool to download specific GitHub directories or files

cloneit A cli tool to download specific GitHub directories or files. Installation From git git clone https://github.com/alok8bb/cloneit cd cloneit car

Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.

Voila is a domain-specific language designed for doing complex operations to folders & files. It is based on a CLI tool, although you can write your V

Comments
  • Better error handling

    Better error handling

    At the moment, this project uses unwrap, which is not an idiomatic way of handling errors. If someone wants to give it a try, they can replace the unwraps with proper error handling based on anyhow. It's a nice exercise to learn some Rust or contribute to the ecosystem in general, so pull requests welcome!

    opened by mre 1
Releases(v0.1.0)
Owner
Matthias Endler
Curious person. Maker. Rustacean. Oxidizing things.
Matthias Endler
Provide CRUD CLI for Moco Activities with Jira Cloud Sync Option for faster time tracking.

Moco CLI Provide CRUD CLI for Moco Activities with Jira Cloud Sync Option for faster time tracking. Available commands Login Jira Must be called befor

Emanuel Vollmer 7 Nov 18, 2022
A Yocto setup and management tool that helps you keep your environment up-to-date and in-sync with your team

yb (Yocto Buddy) yb is designed to make it easy to setup and (perhaps more importantly) keep Yocto environments up-to-date and in-sync with your team.

null 13 Oct 31, 2022
Blazingly fast Rust CLI app to sync data from a folder of excel workbooks into generated c# code for unity usage

Extensions supported ( .xls, .xlsx, .xlsm, .xlsb, .xla, .xlam, .ods ) Speed Test Image shows the results of 5000defs synced from 2 workbooks and 5 she

null 4 Feb 16, 2023
Proof-of-concept on how to solve Bitcoin's light node sync problem with zkSNARKs

BTC Warp Prove and verify the longest Bitcoin PoW chain BTC Warp is a proof-of-concept system that aims to solve the client-syncing problem for Bitcoi

Succinct 45 May 31, 2023
A reconciliation service to sync a key-value map over multiple instances.

reconcile-rs Docs This crate provides a key-data map structure HRTree that can be used together with the reconciliation Service. Different instances c

Akvize 3 Nov 8, 2023
A parser combinator that is fully statically dispatched and supports both sync/async.

XParse A parser combinator that is fully statically dispatched and supports both sync & async parsing. How to use An example of a very simple JSON par

Alsein 4 Nov 27, 2023
Sample and plot power consumption, average frequency and cpu die temperatures over time.

sense Sense is a small tool to gather data on cpu temperature, power usage and clock frequency and plot graphs during some load. Dependencies Sense is

Luuk van der Duim 6 Oct 31, 2022
Command line tool to convert env variables beginning with user to a htpasswd file

envhtp This command line tool converts environment variables whose keys start with "user_" into htpasswd compatible username/password pairs. The goal

Florian Neumann 1 Apr 5, 2022
Download pdbs from symbol servers and cache locally, parse symbol paths from env vars

symsrv This crate lets you download and cache pdb files from symbol servers, according to the rules from the _NT_SYMBOL_PATH environment variable. It

Markus Stange 6 Sep 15, 2022
⚡️(cd with env) Is a configurable cd wrapper that lets you define your environment per directory.

⚡️cdwe (cd with env) A simple configurable cd wrapper that provides powerful utilities for customizing your envionment per directory. (For ZSH / BASH

teo 20 Aug 6, 2023