---
# System prepended metadata

title: CLI Info Design
tags: [' change', cli]

---

---
tags: cli, change
author: Oliver.W
---

# CLI Info Design

[![hackmd-github-sync-badge](https://hackmd.io/lx6nT5O_SgKjSGI8S1W12A/badge)](https://hackmd.io/lx6nT5O_SgKjSGI8S1W12A)

## CLI Warning

Use warning show message that user should take care or double check. 

> color: yellow

### Full Message

* Beak the process, show directly after user input a command. 

```
  Serverless 警告 ---------------------------------------
  dotenv 文件不支持行内注释。变量 TENCENT_APP_ID 发现行内注释, 请检查。
  
  帮助信息 -----------------------------------------------
     相关说明:          github.com/motdotla/dotenv#rules
     帮助文档:          serverless.com/cn/docs
     问答社区:          serverless.com/cn/forum
```

### In-Process Message

* Show the warn message but not break process. 

```
  Serverless 警告 ---------------------------------------
  * 当前函数实例将进入单例模式；
  * 调试时不能执行其他命令；
  * $LATEST版本执行超时时间将调整为900s；
  * 关闭调试模式后，上述配置将恢复；
  
31s › expressDemo › ...
```

### Process message

* Break the process, Show after the process break.

```
31s › expressDemo › {消息}

  帮助信息 -----------------------------------------------
     相关说明:          link to specific page.
     帮助文档:          serverless.com/cn/docs
     问答社区:          serverless.com/cn/forum
```

## CLI Error

Use error show exception(5xx) and error(5xx) messages, Once there is an error, we should check what's the cause, and should avoid show error to users.

Error should write in Chinese with clear guid how this happen and linke to fix. 

> color: red

* Break the process, Show after the process break.

```
31s › expressDemo › {消息}

  帮助信息 -----------------------------------------------
     帮助文档:          serverless.com/cn/docs
     问答社区:          serverless.com/cn/forum
     提交问题:          serverless.com/cn/issues

  调试信息 -----------------------------------------------
     requestId:   9da79a64-f96f-4104-9bf7-95c1dad177fd  （没有traceId用requestId，）
     操作系统(OS):            darwin
     Node 版本:              12.20.1
     Components 版本:        3.7.2
     Framework 版本:         2.28.7
     SDK 版本:               2.3.2
```

## Success & Example

Use example show hot do use CLI with example. This is extra guide for user to lean and user serverless CLI

> color: green

```
31s › expressDemo › 部署完成

```

## DataStructure

```
# Warn Object
{
message: string || [string]
refLink: string?
}



# Error Object
{
message: string || [string]
requestId: string?
}
```