base-pro-man

1.0.8 • Public • Published

base-pro-man

A light CLI to generate projects in an easy way.

Installation

npm install base-pro-man -g

Usage

Open your terminal and type base-pro-man or base-pro-man -h , you'll see the help infomation below:

  Usage: base-pro-man <command>


  Commands:

    add|a      Add a new template
    list|l     List all the templates
    init|i     Generate a new project
    delete|d   Delete a template

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

Commands

add | a

This command would help you to add a new template to the templates.json, which will be used by base-pro-man to generate projects.

$ base-pro-man add
 /*  your template's name */
Template name: my-tpl

 /* your template's git https link, note that it ends with .git */
Git https link:  https://gitxxx/somebody/my-tpl.git 

 /* your template's branch */
Branch: master 

Once confirm you'll see the message like below:

The last template list is:

{ tpl:
   { 'my-tpl-name':
      { url: 'https://gitxxx/somebody/my-tpl.git',
        branch: 'master' } } }

Now you've added a new template to base-pro-man successfully.

list | l

It shows you the templates list.

$ base-pro-man list

{ tpl:
   { 'my-tpl-name':
      { url: 'https://gitxxx/somebody/my-tpl.git',
        branch: 'master' } } }

init | i

After adding new templates, you could use this command to generate your own project by choosing template.

$ base-pro-man init

/* enter a template name which was added by yourself */
Template name: my-tpl-name

/* your project name */
Project name: my-new-project

After enter correct template name and confirm, you'll see the message below:

Start generating...

 √ Generation completed!

 cd my-new-project && npm install

It's easy, right?

delete | d

To delete a template, you could use this command:

$ base-pro-man delete

and type the template name you want to delete:

Template name: my-tpl-name

if the name exist, you will see:

Template deleted!
The last template list is:

{ tpl:
   { 'my-tpl-name': undefined } }

once a template is undefined, it means you've deleted it successfully.

Template

The most important part of base-pro-man is template. All templates' infomation were list in the templates.json. A template means a project sample, which has a simple or complex file structure.

You can create your own templates repository, and push your templates in different branches. All you need to do then is to add the templates into base-pro-man's templates.json.

License

MIT.

Dependents (0)

Package Sidebar

Install

npm i base-pro-man

Weekly Downloads

1

Version

1.0.8

License

ISC

Last publish

Collaborators

  • zhuqinglian