diff --git a/rvc/cli/utils/env.py b/rvc/cli/utils/env.py index 818f0cf..0393dd4 100644 --- a/rvc/cli/utils/env.py +++ b/rvc/cli/utils/env.py @@ -1,13 +1,40 @@ """ setup or cleanup enviroment file -usage: rvc env [set / cleanup] +usage: rvc env [create / cleanup] Default: [nowDir/.env] """ +import os + import click -@click.command() +@click.group() def env(): pass + + +@env.command() +def create(): + env_file_path = os.path.join(os.getcwd(), ".env") + + if not os.path.exists(env_file_path): + default_values = { + "weight_root": "", + "weight_uvr5_root": "", + "index_root": "", + "rmvpe_root": "", + "hubert_path": "", + "save_uvr_path": "", + "TEMP": "", + "pretrained": "", + } + + with open(env_file_path, "w") as env_file: + for key, value in default_values.items(): + env_file.write(f"{key}={value}\n") + + click.echo(f"{env_file_path} created successfully.") + else: + click.echo(f"{env_file_path} already exists, no change")