Coder Social home page Coder Social logo

isabella232 / typescript-cli-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chainsafe/typescript-cli-generator

0.0 0.0 0.0 360 KB

A TypeScript CLI Template

License: Apache License 2.0

JavaScript 7.64% TypeScript 80.76% EJS 11.60%

typescript-cli-generator's Introduction

TypeScript CLI Template Generator

The template that is used was a port of the Lodestar CLI, and thus heavily inspired by the design patters of Lodestar.

Available Commands

Commands:
  generate  Generates the CLI from a template.
  config    Creates an empty configuration file.

Options:
  -h, --help     Show help
  -v, --version  Show version number

Using the generator

The generator requires a configuration file, config.example.json is provided as guidance. It can be run as followed:

npx @chainsafe/ts-cli generate --config ./<local_file> -o ./my-cli

Configuration File

The configuration file follows the following interface pattern:

interface Config {
    name: string;               // Name of the CLI
    globalOptions: IOption[];   // Options available at the global scope
    commands: ICommand[];       // List of commands
}

interface IOption {             
    name: string;               // Name of the option, eg: --<name>
    description: string;        // Provides a description when --help is used
    type: string;               // Valid TypeScript type in strings, eg: number
    default: string;            // The default value
}

interface ICommand {
    name: string;               // Name of the command
    description: string;        // Provides a description when --help is used
    options: IOption[];         // Options available at the command level
    subCommands: ICommand[];    // Optional sub-commands
}

Modifications

Although there is a lot that can be changed, the bulk of the setup has been done for you. The main things that need updating can be searched for by looking up // TODO: change this!. After that, the world is your oyster.

Roadmap

  • Cli generator
  • ?

typescript-cli-generator's People

Contributors

gregthegreek avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.