Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

Commit fe67f79

Browse files
authored
Merge pull request #190 from storyblok/bugfix/console-tweaks
fix: streamline index.ts by removing chalk and enhancing konsola usage
2 parents c3faa77 + 7ed5b47 commit fe67f79

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

src/index.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env node
2-
import chalk from 'chalk';
32
import dotenv from 'dotenv';
43

5-
import { formatHeader, handleError, konsola } from './utils';
4+
import { handleError, konsola } from './utils';
65
import { getProgram } from './program';
76
import './commands/login';
87
import './commands/logout';
@@ -11,25 +10,25 @@ import './commands/components';
1110
import './commands/languages';
1211
import './commands/migrations';
1312
import './commands/types';
13+
import pkg from '../package.json';
1414

1515
import { colorPalette } from './constants';
1616

1717
export * from './types/storyblok';
1818

1919
dotenv.config(); // This will load variables from .env into process.env
2020
const program = getProgram();
21-
console.clear();
22-
const introText = chalk.bgHex(colorPalette.PRIMARY).bold(` Storyblok CLI `);
23-
const messageText = ` `;
24-
console.log(formatHeader(`
25-
${introText} ${messageText}`));
2621

27-
program.option('-v, --verbose', 'Enable verbose output');
22+
konsola.title(` Storyblok CLI `, colorPalette.PRIMARY);
23+
24+
program.option('--verbose', 'Enable verbose output');
25+
program.version(pkg.version, '-v, --vers', 'Output the current version');
26+
program.helpOption('-h, --help', 'Display help for command');
2827

2928
program.on('command:*', () => {
3029
console.error(`Invalid command: ${program.args.join(' ')}`);
30+
konsola.br();
3131
program.help();
32-
konsola.br(); // Add a line break
3332
});
3433

3534
/* console.log(`

0 commit comments

Comments
 (0)