envio 0.4.0

Envio is a command-line tool that simplifies the management of environment variables across multiple profiles. It allows users to easily switch between different configurations and apply them to their current environment. Envio also encrypts sensitive environment variable values to ensure secure storage and transmission
// In this example we import the profile passed as an argument to the program and then save it

fn main() {
    let args: Vec<String> = std::env::args().collect();

    if args.len() != 4 {
        println!("Usage: <file_path> <profile_name> <key>");
        return;
    }

    let file_path = args[1].to_string(); // The first argument is the name file path of the profile to be imported
    let profile_name = args[2].to_string(); // The second argument is the name that the profile will be saved as

    envio::import_profile(file_path, profile_name.clone());

    let key = &args[3]; // The third argument is the key, make sure you have the key that was used to encrypt the profile file or else you won't be able to decrypt it

    // Check that the profile was imported correctly
    for (env_var, value) in &envio::get_profile(profile_name, key).unwrap().envs {
        println!("{}: {}", env_var, value);
    }
}