Ghost/ghost/pretty-cli
Hannah Wolfe e7bc545b36 Add support for public vs private
- Projects can be public or private -> they are either oss or not.
  - With flags like this, there is no default. We either want to pass a flag or be prompted later if we forget
  - To achieve this: added a custom sywac type of Switch, that is able to handle this concept
 - We may want to change this to a proper boolean that defaults to true
  - That would be easier, and possibly more sensible for the public tool
2018-09-28 17:59:41 +01:00
..
test Pretty CLI - provide a styled sywac instance 2018-09-21 13:12:12 +01:00
.eslintrc.js Pretty CLI - provide a styled sywac instance 2018-09-21 13:12:12 +01:00
index.js Pretty CLI - provide a styled sywac instance 2018-09-21 13:12:12 +01:00
LICENSE Pretty CLI - provide a styled sywac instance 2018-09-21 13:12:12 +01:00
package.json Published new versions 2018-09-21 14:15:45 +01:00
pretty-cli.js Add support for public vs private 2018-09-28 17:59:41 +01:00
README.md 📖 Updated READMEs with more clarity 2018-09-21 13:45:33 +01:00
styles.js Pretty CLI - provide a styled sywac instance 2018-09-21 13:12:12 +01:00

Pretty CLI

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

Install

Either: npm i @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();

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) 2018 Ghost Foundation - Released under the MIT license.