envio 0.4.1

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// In this example we export the profile passed as an argument to the program to a file passed as the second argument

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

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

    let profile_name = args[1].to_string(); // The first argument is the name of the profile to export
    let file_to_save = args[2].to_string(); // The second argument is the path to the file to export the profile to
    let key = &args[3]; // The third argument is the key to decrypt the profile

    // exporting the environment variables in the profile
    let profile = envio::get_profile(profile_name, key);
    profile.unwrap().export_envs(file_to_save);
}