Skip to content

Commit

Permalink
Merge pull request #135 from Hexastack/fix/cli-missing-init
Browse files Browse the repository at this point in the history
fix: missing cli init cmd
  • Loading branch information
marrouchi authored Oct 3, 2024
2 parents c0fe6b1 + 5a26083 commit b43ff65
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit b43ff65

Please sign in to comment.