11#!/usr/bin/env node
2- import chalk from 'chalk' ;
32import dotenv from 'dotenv' ;
43
5- import { formatHeader , handleError , konsola } from './utils' ;
4+ import { handleError , konsola } from './utils' ;
65import { getProgram } from './program' ;
76import './commands/login' ;
87import './commands/logout' ;
@@ -11,25 +10,25 @@ import './commands/components';
1110import './commands/languages' ;
1211import './commands/migrations' ;
1312import './commands/types' ;
13+ import pkg from '../package.json' ;
1414
1515import { colorPalette } from './constants' ;
1616
1717export * from './types/storyblok' ;
1818
1919dotenv . config ( ) ; // This will load variables from .env into process.env
2020const 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
2928program . 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