1.2.46 • Published 4 months ago

@tryghost/pretty-cli v1.2.46

Weekly downloads
16,123
License
MIT
Repository
-
Last release
4 months ago

Pretty CLI

A mini-module to style a sywac instance in a standard way

Install

Either: npm install @tryghost/pretty-cli --save

Or: yarn add @tryghost/pretty-cli

Usage

E.g. const prettyCLI = require('@tryghost/pretty-cli');

prettyCLI is a pre-styled instance of the sywac API.

See the sywac quickstart and config guide for full usage.

Example:

#!/usr/bin/env node
const prettyCLI = require('@tryghost/pretty-cli');


prettyCLI
  .command({
    flags: 'myTask [option]',
    desc: 'Run myTask',
    run: (argv) =>  { ... do something here }
  })
  .parseAndExit();

Pretty CLI also provides a common UI interface, providing log functions to output coloured messages to the UI:

const ui = require('@tryghost/pretty-cli/ui');`

ui.log.info('Done');
ui.log.warn('Uh Oh', 'Something went wrong');

You can also grab a fresh instance of the api with prettyCLI.Api.get().

The style rules used are available at prettyCLI.styles.

Test

  • yarn lint run just eslint
  • yarn test run lint && tests

Copyright & License

Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.

1.2.46

4 months ago

1.2.45

10 months ago

1.2.43

12 months ago

1.2.44

12 months ago

1.2.42

1 year ago

1.2.41

1 year ago

1.2.40

1 year ago

1.2.38

2 years ago

1.2.39

2 years ago

1.2.37

2 years ago

1.2.35

2 years ago

1.2.36

2 years ago

1.2.34

2 years ago

1.2.33

3 years ago

1.2.31

3 years ago

1.2.32

3 years ago

1.2.29

3 years ago

1.2.30

3 years ago

1.2.27

3 years ago

1.2.28

3 years ago

1.2.26

3 years ago

1.2.25

3 years ago

1.2.24

3 years ago

1.2.23

3 years ago

1.2.22

4 years ago

1.2.20

4 years ago

1.2.21

4 years ago

1.2.19

4 years ago

1.2.18

4 years ago

1.2.17

4 years ago

1.2.16

4 years ago

1.2.15

4 years ago

1.2.14

4 years ago

1.2.13

4 years ago

1.2.12

5 years ago

1.2.11

5 years ago

1.2.10

5 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago