Skip to content

Commit f6eb1aa

Browse files
authored
Merge pull request #5 from kellysweetie/master
update readme.md
2 parents 907f639 + 4de83d7 commit f6eb1aa

1 file changed

Lines changed: 59 additions & 24 deletions

File tree

README.md

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,84 @@
1-
## UCloud Command Line Interface
1+
## <u>ucloud-cli
2+
3+
- website: https://www.ucloud.cn/
24

3-
The UCloud Command Line Interface is a tool to manage your UCloud services. It's built on the [UCloud API](https://docs.ucloud.cn/api/summary/index).
5+
![](http://cli-ucloud-logo.sg.ufileos.com/ucloud.png)
46

5-
### Install UCloud CLI
7+
The ucloud-cli provides a unified command line interface to manage Ucloud services. It works through Golang SDK based on UCloud OpenAPI and support Linux, macOS, and Windows.
68

7-
You can install UCloud CLI by Homebrew/Linuxbrew, downloading executable binary file or building from the source code by yourself.
9+
## Installation
810

9-
##### Homebrew(recommended)
11+
The easiest way to install ucloud-cli is to use home-brew for Linux and macOS users. This will install the package as well as all dependencies.
1012

11-
You can use [Homebrew](https://brew.sh/) on macOS or [Linuxbrew](http://linuxbrew.sh/) on Linux. After installing Homebrew or Linuxbrew,just type the following command to complete the installation.
1213
```
13-
brew install ucloud
14+
$ brew install ucloud
1415
```
15-
##### Build from source code
1616

17-
If you have installed golang, run the following commands to install the UCloud CLI.
17+
If you have the ucloud-cli installed and want to upgrade to the latest version you can run:
1818

1919
```
20-
$ mkdir -p $GOPATH/src/github.com/ucloud
20+
$ brew upgrade ucloud
21+
```
22+
23+
**Note**
24+
25+
If you come across error during the installation via home-brew, you may update the management package first.
26+
27+
```
28+
$ brew update
29+
```
30+
31+
**Build from the source code**
32+
33+
For windows users, suggest build from the source code which require install Golang first. This also works for Linux and macOS.
34+
35+
```
36+
$ mkdir -p $ GOPATH/src/github.com/ucloud
2137
$ cd $GOPATH/src/github.com/ucloud
2238
$ git clone https://github.com/ucloud/ucloud-cli.git
2339
$ cd ucloud-cli
2440
$ make install
2541
```
2642

27-
### Uninstall UCloud CLI
28-
29-
Remove the executable file /usr/local/bin/ucloud and the directory $HOME/.ucloud
30-
31-
### Config UCloud CLI
32-
33-
After install the cli, run 'ucloud init' to complete the cli configuration following the tips. Local settings will be saved in directory $HOME/.ucloud
43+
## Command Completion
3444

35-
### Auto complete
36-
Run 'ucloud --completion' for help
45+
The ucloud-cli include command completion feature and need configure it manually. Add following scripts to ~/.bash_profile or ~/.bashrc
3746

38-
#### Bash shell
39-
Please append the following scripts to file ~/.bash_profile or ~/.bashrc.
4047
```
4148
complete -C /usr/local/bin/ucloud ucloud
4249
```
4350

44-
#### Zsh shell
45-
Please append the following scripts to file ~/.zshrc.
51+
**Zsh shell** please add following scripts to ~/.zshrc
52+
4653
```
4754
autoload -U +X bashcompinit && bashcompinit
4855
complete -F /usr/local/bin/ucloud ucloud
49-
```
56+
```
57+
58+
## Getting Started
59+
60+
Run the command to get started and configure ucloud-cli follow the steps. The public & private keys will be saved automatically and locally.
61+
62+
```
63+
$ ucloud init
64+
```
65+
66+
To reset the configurations, run the command:
67+
68+
```
69+
$ ucloud config
70+
```
71+
72+
To learn the usage and flags, run the command:
73+
74+
```
75+
$ ucloud help
76+
```
77+
78+
## Example
79+
80+
Taking configure globalssh to uhost instance as an example, which will acceleare the instance SSH management efficiency (TCP 22 as default):
81+
82+
```
83+
$ ucloud gssh create --area Washington --target-ip 128.14.225.161
84+
```

0 commit comments

Comments
 (0)