wu-sheng commented on a change in pull request #8: Add command manual and documentations URL: https://github.com/apache/skywalking-cli/pull/8#discussion_r344466547
########## File path: README.md ########## @@ -1,18 +1,63 @@ Apache SkyWalking CLI =============== +![](https://github.com/apache/skywalking-cli/workflows/Build/badge.svg?branch=master) +![](https://codecov.io/gh/apache/skywalking-cli/branch/master/graph/badge.svg) + <img src="http://skywalking.apache.org/assets/logo.svg" alt="Sky Walking logo" height="90px" align="right" /> The CLI (Command Line Interface) for [Apache SkyWalking](https://github.com/apache/skywalking). SkyWalking CLI is a command interaction tool for the SkyWalking user or OPS team, as an alternative besides using browser GUI. It is based on SkyWalking [GraphQL query protocol](https://github.com/apache/skywalking-query-protocol), same as GUI. +# Install +As SkyWalking CLI is using `Makefile`, compiling the project is as easy as executing a command in the root directory of the project. + +```shell +git clone https://github.com/apache/skywalking-cli +cd skywalking-cli +make clean && make +``` + +and copy the `./bin/swctl` to your `PATH` directory, usually `/usr/bin/` or `/usr/local/bin`, or you can copy it to any directory you like, +and add that directory to `PATH`. + # Commands -TODO +Commands in SkyWalking CLI are organized into two levels, in the form of `swctl --option <level1> --option <level2> --option`, +there're options in each level, which should follow right after the corresponding command, take the following command as example: + +```shell +$ swctl --debug service list --start="2019-11-11" --end="2019-11-12" +``` + +where `--debug` is is an option of `swctl`, and since the `swctl` is a top-level command, `--debug` is also called global option, +and `--start` is an option of the third level command `list`, there is no option for the second level command `service`. + +Generally, the second level commands are entity related, there're entities like `service`, `service instance`, `metrics` in SkyWalking, +and we have corresponding sub-command like `service`; the third level commands are operations on the entities, such as `list` command +will list all the `service`s, `service instance`s, etc. + +## All available commands +This section covers all the available commands in SkyWalking CLI and their usages + +### `service` sub-command +`service` sub-command (second level command) is an entry for all operations related to services, and it also has some sub-commands. + +#### `service list [--start=<start time>] [--end=<end time>]` +`service list` lists all the services in the time range of \[`start`, `end`\]. +`--start` and `--end` are both optional, and their default values follow the rules below: Review comment: Time should be a shared config in all entity related query. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services