From 5a260838229bd8626aa0d64bb36552fd1756caa6 Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Thu, 3 Oct 2024 15:14:20 +0100 Subject: [PATCH] fix: missing cli init cmd --- cli/src/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cli/src/index.ts b/cli/src/index.ts index cbf5d0a..29707d8 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -108,6 +108,21 @@ program .description('A CLI to manage your Hexabot chatbot instance') .version('1.0.0'); +program + .command('init') + .description('Initialize the environment by copying .env.example to .env') + .action(() => { + const envPath = path.join(FOLDER, '.env'); + const exampleEnvPath = path.join(FOLDER, '.env.example'); + + if (fs.existsSync(envPath)) { + console.log(chalk.yellow('.env file already exists.')); + } else { + fs.copyFileSync(exampleEnvPath, envPath); + console.log(chalk.green('Copied .env.example to .env')); + } + }); + program .command('start') .description('Start specified services with Docker Compose')