Skip to content

Latest commit

 

History

History
107 lines (69 loc) · 2.92 KB

cli_design.md

File metadata and controls

107 lines (69 loc) · 2.92 KB
title description position category
Cli specification
Serverless Devs Command line design specification
10
Overview

Command line design specification

Serverless Devs, as a developer tool in the serverless field, the standardization and standardization of its output will have a more obvious impact on the user experience to a certain extent.

This document will standardize and upgrade the output of Serverless Devs command line tools through some text and cases.

Specification details

The canonical goals of the output format are:

  • Clearer
  • More concise
  • Does not affect the function and practicality

Based on the above three principles, we can use examples to illustrate the normal output form and the abnormal output form.

Basic output

The basic output form includes two parts as a whole:

  1. Project implementation phase

The project execution phase mainly includes a basic format:

⌛ Steps for process
====================

The rewrite mechanism is used to continuously update the output content. After each project is executed, the corresponding result can be output. Example:

⌛ Steps for process
====================
✔ Pre-action completed (10s)
  1. Result output stage

The project execution phase mainly includes a basic format:

🚀 Result for process
====================

The specific project output is output in the format of Yaml. When outputting, the project name should be underlined. If there is no output, the project will be ended directly. Example:

🚀 Result for process
====================
✔ MyProject deployed (11s)
fc-deploy-test:
  region: cn-hangzhou
  service:
    name: fc-deploy-service
    memorySize: 128

Single item output example

render1629447409205

Multi-project output example

render1629448703505

Debug mode

When the user enters the debug mode with --debug, very detailed information will be printed on the console, but the information will be printed out in gray to maintain the overall sense of hierarchy:

render1629448900851

Error output

When an error occurs in execution, Serverless Devs must sense and output the corresponding content:

⌛ Steps for process
====================
✔ MyProject pre-action completed (10s)
✖ MyProject failed to deploy:

Error Message:
t[r] is not a function

Env: darwin, node v15.14.0
Docs: https://github.com/serverless-devs/docs
Bugs: https://github.com/Serverless-Devs/Serverless-Devs/issues
Logs: ~/demo/demo/demo/s.log

The dynamic effects are:

render1629447327225