--- tags: cli, feature author: Oliver.W --- # Auto generated components help info [![hackmd-github-sync-badge](https://hackmd.io/E959kt7IQzOIMJuVwGmasA/badge)](https://hackmd.io/E959kt7IQzOIMJuVwGmasA) ## User Story As a user of serverless developer I like to see the commands help info in a simple and clean way So that i can has better understanding of the commands available. As a user of serverless developer I like to see paramaters and usage help info for a specific commands So that i can see how to execute a command with help in details easily. ## Logic Path ### General Help info user execute `sls --help` in components folder. > General help info commands with blue color, help context with white color. ``` serverless ⚡components 快速开始(blue) * 直接输入 “serverless" (或缩写 “sls”) 进行项目初始化(灰色) 链接(blue) 帮助文档: https://cloud.tencent.com/document/product/1154(灰色) 控制面板: https://serverless.cloud.tencent.com/(灰色) 问答社区: https://github.com/serverless/serverless-tencent/discussions 命令(blue) * 您可以通过 “serverless” 或简称 “sls” 来执行命令(灰色) * 使用 "serverless [command] --help" 获取详细帮助信息(灰色) init 通过模板或者 URL 地址初始化新项目 deploy 部署应用到云端 info 获取应用详情 dev 启动调试模式 logs 查看应用日志 remove 移除应用 credentials 管理全局授权信息 registry 查看应用中心的组件与模版信息 publish 发布组件或模版到应用中心 bind role 重新分配所需权限 函数组件命令 (blue)仅在组件应用中显示 serverless invoke 调用函数 serverless invoke local 本地调用函数 ``` > sub commands help info commands with blue color, help context with blue color. ### init ``` init 通过模板或者 URL 地址初始化新应用 {name/url} [必填]模板名称或 URL 地址 --name 指定应用目录名称 ``` ### deploy ``` deploy 部署应用到云端 --target 指定要部署的组件实例路径 --inputs 覆写 inputs 配置 --profile 使用指定身份的全局授权信息 --login 使用临时授权 --debug 显示 debug 信息 ``` ### info ``` info 获取应用详情 --profile 指定身份的全局授权信息 ``` ### dev ``` dev 启动调试模式 --profile 使用指定身份的全局授权信息 ``` ### logs ``` logs 查看应用日志 --function / -f 查看指定函数的日志,默认使用配置的函数 --startTime 指定开始时间,如:3h, 20130208T080910,默认10m --tail / -t 启动监听模式 --intervial / -i 监听模式的刷新时间 默认:2000ms --stage / -s 指定环境名称,默认使用配置环境 --region / -r 指定地区名称,默认使用配置地区 ``` ### remove ``` remove 移除应用 --target 指定要移除的组件实例路径 --profile 使用指定身份的全局授权信息 --debug 显示 debug 信息 ``` ### credentials ``` credentials 管理全局授权信息 credentials set 存储用户授权信息 --secretId / -i [必填]腾讯云CAM账号secretId --secretKey / -k [必填]腾讯云CAM账号secretKey --profile / -n {name} 身份名称. 默认为 "default" --overwrite / -o 覆写已有身份名称授权信息 credentials remove 删除用户授权信息 --profile / -n {name} 身份名称. 默认为 "default" credentials list 查看已有用户授权信息 ``` ### registry ``` registry 查看注册中心的组件与模版信息 {name} 模板名称 ``` ### invoke ``` invoke 调用函数 --function / -f 调用的函数名称,默认使用配置的函数 --stage / -s 指定环境名称,默认使用配置环境 --region / -r 指定地区名称,默认使用配置地区 --data / -d 指定传入函数的事件(event)参数数据,需要使用序列化的 JSON 格式 --path / -p 指定传入还输的事件(event)参数的 JSON 文件路径 ``` ### invoke local ``` invoke local 本地调用函数 --function / -f 调用的函数名称,默认使用配置的函数 --data / -d 指定传入函数的事件(event)参数数据,需要使用序列化的 JSON 格式 --path / -p 指定传入还输的事件(event)参数的 JSON 文件路径 --context 指定传入函数的上下文(context)参数数据,需要使用序列化的 JSON 格式 --contextPath / -x 指定传入函数的上下文(context)参数的 JSON 文件路径 --env / -e 指定环境变量信息 如: --env VAR=val --config / -c 指定使用的配置文件 ```