# eris-cli

> Eris 脚手架工具，快速创建 React、Vue 应用，模板丰富、功能齐全、开箱即用

Latest version **1.0.2** (published 2022-02-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install eris-cli
pnpm add eris-cli
yarn add eris-cli
bun add eris-cli
```

Provides the commands `eris`, `eris-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-02-21 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.15.0 |
| Dependencies | 13 |
| Unpacked size | 471.1 KB |
| Known vulnerabilities | 0 (+31 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | adamlu, cyphant |

## Links

- npm: https://www.npmjs.com/package/eris-cli
- Repository: https://github.com/cyphant-tech/eris
- Homepage: https://github.com/cyphant-tech/eris#readme
- Issues: https://github.com/cyphant-tech/eris/issues
- npm.io page: https://npm.io/package/eris-cli

## Dependencies (13)

- [del](https://npm.io/package/del.md) ^5.1.0
- [ejs](https://npm.io/package/ejs.md) ^2.7.2
- [ora](https://npm.io/package/ora.md) ^4.0.3
- [axios](https://npm.io/package/axios.md) ^0.21.1
- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [inquirer](https://npm.io/package/inquirer.md) ^7.0.0
- [commander](https://npm.io/package/commander.md) ^4.0.1
- [node-watch](https://npm.io/package/node-watch.md) ^0.6.3
- [simple-git](https://npm.io/package/simple-git.md) ^2.44.0
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.3
- [ansi-escapes](https://npm.io/package/ansi-escapes.md) ^4.3.0
- [@gitbeaker/node](https://npm.io/package/@gitbeaker/node.md) ^32.1.2
- [supports-hyperlinks](https://npm.io/package/supports-hyperlinks.md) ^2.0.0

## Recent versions

- 1.0.2 (latest) — 2022-02-21
- 1.0.1 — 2022-02-18

## README

# Eris CLI

基于 typescript 的前端脚手架工具，快速创建 React、Vue 应用，模板丰富、功能齐全、开箱即用。
## 🚀 使用说明

全局安装
```shell
sudo yarn global add eris-cli
```
或
```shell
sudo npm i eris-cli -g
```
运行 eris 命令
```shell
➜  $ eris

  _______   ________  ___  ________
  |\  ___ \ |\   __  \|\  \|\   ____\
  \ \   __/|\ \  \|\  \ \  \ \  \___|_
   \ \  \_|/_\ \   _  _\ \  \ \_____  \
    \ \  \_|\ \ \  \\  \\ \  \|____|\  \
     \ \_______\ \__\\ _\\ \__\____\_\  \
      \|_______|\|__|\|__|\|__|\_________\
                              \|_________|
  
 ---------- 欢迎使用 Eris 脚手架 ------------ 

? 请选择需要执行的操作 (Use arrow keys)
❯ 创建应用 
  启动应用 
  打包应用 
  删除应用 
  查看帮助 
  退出 

```
## 🎉 本地开发

* 安装依赖包
```shell
$ npm install
```
* 软连接到全局
```shell
$ npm link 或者 yarn link
```
* 启动 watch 实时编译
```shell
$ npm run start
```
此时可以在任何位置，开始 eris 命令进入交互式界面

* 编译打包
```shell
$ npm run build
```


## 📖 详细使用教程

* help  脚手架使用帮助
```shell
$ eris -h
```

* create 创建应用
```shell
# 从git上获取模板
$ eris create <appid> --app-name <appName> --template <git地址>

# 从本地获取模板，根据命令行提示获取模板
$ eris create <appid> --app-name <appName>

```
* start  启动应用
```shell
$ eris start <appid>

```
* build  打包应用
```shell
$ eris build <appid>
```
* delete_app  删除应用
```shell
# 进入 eris 交互式命令行模式删除应用
$ eris
```



## 📋 开发及维护脚手架模板

模板开发命令：

```
npm run dev-tpl
```

必要约定：

- package.json 的 name 需要填写为 `<%= appId %>`，如： `"name": "<%= appId %>"`
- package.json 的 scripts 要保证有 start 和 build 命令，start: 开发环境启动，build: 打包项目
- 其它的可参考已有模板的 `.umirc.ts` 或 `vue.config.js` 文件中的配置
- 模板渲染使用 ejs 模板


下面以 `app-template-admin` 模板为例进行步骤说明：

#### Step1: 启动模板开发模式

```shell
npm run dev-tpl
```

#### Step2: 配置模板

编辑 src/templates/tpl.config.dev.js


#### Step3: 进入预览模式

```shell
# 进入模板编译后的目录
cd template/dist/app-template-admin

# 安装依赖
npm install

# 启动
npm run start

# 启动后根据命令输出的地址访问即可
```

#### Step4: 实时预览

此时，可以一边修改模板文件，一边在浏览器里进行预览

---
_Source: https://npm.io/package/eris-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
