1.2.41 • Published 5 days ago

@tryghost/pretty-cli v1.2.41

Weekly downloads
16,123
License
MIT
Repository
github
Last release
5 days 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.41

5 days ago

1.2.40

2 months ago

1.2.38

9 months ago

1.2.39

6 months ago

1.2.37

1 year ago

1.2.35

1 year ago

1.2.36

1 year ago

1.2.34

1 year ago

1.2.33

1 year ago

1.2.31

2 years ago

1.2.32

1 year ago

1.2.29

2 years ago

1.2.30

2 years ago

1.2.27

2 years ago

1.2.28

2 years ago

1.2.26

2 years ago

1.2.25

2 years ago

1.2.24

2 years ago

1.2.23

2 years ago

1.2.22

3 years ago

1.2.20

3 years ago

1.2.21

3 years ago

1.2.19

3 years ago

1.2.18

3 years ago

1.2.17

3 years ago

1.2.16

3 years ago

1.2.15

3 years ago

1.2.14

3 years ago

1.2.13

3 years ago

1.2.12

3 years ago

1.2.11

4 years ago

1.2.10

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago