cargo-dotenv

Crates.iocargo-dotenv
lib.rscargo-dotenv
version1.0.1
sourcesrc
created_at2023-07-05 18:41:32.352603
updated_at2023-07-05 18:52:47.558022
descriptionA tiny cargo subcommand to run cargo commands with dotenv
homepage
repositoryhttps://github.com/kurtbuilds/cargo-dotenv
max_upload_size
id909288
size13,123
Kurt Wolf (kurtbuilds)

documentation

README

This is a tiny utility that injects env variables before running cargo commands.

I built this utility specifically because IntelliJ Rust does not support .env files, nor does the EnvFile plugin support Rust.

Otherwise, I recommend adding env variables through just, your shell, or other means.

Usage

# Runs `cargo run` with env coming from `.env`
cargo dotenv run
# Runs `cargo check` with env coming from `.env.production`
cargo dotenv -e .env.production check

You can run dotenv recursively arbitrarily. This fact is useless, but I find it amusing.

cargo dotenv dotenv dotenv dotenv dotenv dotenv dotenv dotenv dotenv check

Installation

cargo install cargo-dotenv

Issue Tracker

Commit count: 3

cargo fmt