# cli

## 大致功能
- [x] 本地 lego.config.js // 读取配置
- [x] 服务 lego start
- [x] 新增 lego new "....."
- [ ] 编辑 lego edit filePath or id
- [x] 删除 lego del filePath or id
- [ ] 展示 lego list
- [ ] 加入git lego add . // 只将lego相关代码加入git
- [ ] lego refactor //

### lego.config.js
```
{
  root: process.cwd(),   // 根目录
  suffix: 'lego.js',    // lego配置文件后缀
  dirSuffix: 'lego',    // 文件夹后缀
  prefix: '',           // 前缀
  dirPrefix: '',        // 文件夹前缀
}
```

### 文件id生成规则
- [ ] 根据创建时间 + 随机字符串
- [ ] 根据文件相对路径, 相对root

### 命名空间
- 后面需要重新设计
[命名空间](./namespace.md)