91admin-cli 中文文档教程
91admin
一个轻量级的项目生成工具(修改scion-cli)。
Installation
npm install 91admin-cli -g
Usage
打开您的终端并输入 91admin
或 91admin -h
,您将看到以下帮助信息:
Usage: 91admin <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
请注意,如果您使用的是
MacOS
,<使用命令add
和delete
时需要 code>sudo。
Commands
add | a
此命令将帮助您向 templates.json
添加一个新模板,91admin
将使用该模板生成项目。
$ 91admin add
? Set the custom name of the template: vue-admin
?Git https/http link (OR Owner/name) of the template: http://***.git
? Branch of the template: (master)
┌────────────────────┬───────────────────────┬────────┐
│ Template Name │ Owner/Name │ Branch │
├────────────────────┼───────────────────────┼────────┤
│ vue-admin │ https://***.git │ master │
└────────────────────┴───────────────────────┴────────┘
✔ New template has been added successfully!
✔ New template has been added successfully!
91admin
使用 download-git-repo 下载 git repos。 回答 3 个问题后,您将向 91admin
添加一个新模板。
list | l
它向您显示模板列表。
$ 91admin list
┌────────────────────┬───────────────────────┬────────┐
│ Template Name │ Owner/Name │ Branch │
├────────────────────┼───────────────────────┼────────┤
│ vue-admin │ https://***.git │ master │
└────────────────────┴───────────────────────┴────────┘
init | i
添加新模板后,您可以使用此命令通过选择模板来生成您自己的项目。
$ 91admin init
? Template name: my-first-template
? Project name: my-project
? Where to init the project? ../
⠹ Downloading template...
New project has been initialized successfully!
这很容易,对吧?
delete | d
要删除一个模板,你可以使用这个命令:
$ 91admin delete
? Which template you want to delete? my-second-template
┌───────────────────┬────────────────┬────────┐
│ Template Name │ Owner/Name │ Branch │
├───────────────────┼────────────────┼────────┤
│ my-first-template │ jrainlau/scion │ new │
└───────────────────┴────────────────┴────────┘
✔ Template has been deleted successfully
Template
91admin 最重要的部分是template
。 所有模板的信息都列在 templates.json
中。 模板是指一个项目示例,它具有简单或复杂的文件结构。
您可以创建自己的模板存储库,并将模板推送到不同的分支。 然后您需要做的就是将模板添加到 91admin 的 templates.json
中。
License
麻省理工学院。
91admin
A light tool to generate projects in an easy way(Modify the scion-cli).
Installation
npm install 91admin-cli -g
Usage
Open your terminal and type 91admin
or 91admin -h
, you'll see the help infomation below:
Usage: 91admin <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
Note that if you are using
MacOS
,sudo
was required while using commandsadd
anddelete
.
Commands
add | a
This command would help you to add a new template to the templates.json
, which will be used by 91admin
to generate projects.
$ 91admin add
? Set the custom name of the template: vue-admin
?Git https/http link (OR Owner/name) of the template: http://***.git
? Branch of the template: (master)
┌────────────────────┬───────────────────────┬────────┐
│ Template Name │ Owner/Name │ Branch │
├────────────────────┼───────────────────────┼────────┤
│ vue-admin │ https://***.git │ master │
└────────────────────┴───────────────────────┴────────┘
✔ New template has been added successfully!
✔ New template has been added successfully!
91admin
use download-git-repo to down load git repos. After answering 3 questions, you'll add a new template to 91admin
.
list | l
It shows you the templates list.
$ 91admin list
┌────────────────────┬───────────────────────┬────────┐
│ Template Name │ Owner/Name │ Branch │
├────────────────────┼───────────────────────┼────────┤
│ vue-admin │ https://***.git │ master │
└────────────────────┴───────────────────────┴────────┘
init | i
After adding new templates, you could use this command to generate your own project by choosing template.
$ 91admin init
? Template name: my-first-template
? Project name: my-project
? Where to init the project? ../
⠹ Downloading template...
New project has been initialized successfully!
It's easy, right?
delete | d
To delete a template, you could use this command:
$ 91admin delete
? Which template you want to delete? my-second-template
┌───────────────────┬────────────────┬────────┐
│ Template Name │ Owner/Name │ Branch │
├───────────────────┼────────────────┼────────┤
│ my-first-template │ jrainlau/scion │ new │
└───────────────────┴────────────────┴────────┘
✔ Template has been deleted successfully
Template
The most important part of 91admin 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 91admin's templates.json
.
License
MIT.