Follow the lxs24sxl for updates on new list additions.
$ npm install -g ayd-cli
# OR
$ yarn global add ayd-cli
$ ayd create <project-name>
初始化全局.aydrc文件
{
"VUE_ADMIN_TEMPLATE_REPO": "",
"config": {
"configurable": true // 是否配置化
}
}
Command | Description |
---|---|
-f, --force | Overwrite target directory if it exists |
$ ayd create .
$ ayd create <project-name>
$ ayd create
# error: missing required argument 'app-name'
Command | Description |
---|---|
-g, --get 'key' | get value from option |
-s, --set 'key' 'value' | set option value |
-d, --delete 'key' | delete option from config |
-e, --edit | open config with default editor |
--json | outputs JSON result only |
$ ayd config -g configurable
# true
$ ayd config -g configurable --json
# {
# "value": true
# }
$ ayd config -s configurable false
# You have updated the option: configurable to false
$ ayd config -d configurable
# You have removed the option: configurable
$ ayd config --json
# {
# "resolvedPath": "/Users/lxs24sxl/.aydrc",
# "content": {
# "VUE_ADMIN_TEMPLATE_REPO": "",
# "config": {
# "configurable": true
# }
# }
# }
$ ayd creat
# Usage: ayd <command> [options]
# Options:
# -V, --version output the version number
# -h, --help display help for command
# Commands:
# create [options] <app-name> create a new project powered by ayd-cli-service
# init initialize the .aydrc file
# config [options] [value] inspect and modify the config
# Run ayd <command> --help for detailed usage of given command.
# Unknown command creat.
# Did you mean create.
$ ayd -V
# ayd-cli 1.0.0
? 请输入后台模版名称 默认后台模版
? 请输入后台模版路由名( 路由为空则为一级路由,否则为二级路由,例:/retail/ )
? 请输入后台模版系统编码( 传递给后端的名称,例:admin-retail ) admin-test
? 请输入端口号 8081
$ ayd config -s configurable false
先跑init生成.aydrc文件,再进行修改
$ ayd init
$ ayd config -s configurable false
$ ayd create <project-name>
- 目前版本定义框架为vue或react,模版类型为admin/standard/mobile。
- 添加需要的模板路径只需要使用config命令配置不同的repo地址
- repo配置方法详细见download-git-repo
- 常用repo配置法: gitlab -> gitlab地址:gitlab中项目地址#分支名, github -> github地址:github名称/项目地址#分支名
$ ayd config -s VUE_STANDARD_TEMPLATE_REPO <repo>
$ ayd config -s REACT_ADMIN_TEMPLATE_REPO <repo>