Merge pull request #135 from Hexastack/fix/cli-missing-init

fix: missing cli init cmd
This commit is contained in:
Mohamed Marrouchi 2024-10-03 16:15:16 +01:00 committed by GitHub
commit b43ff65341
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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')