You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-14Lines changed: 55 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,58 +5,99 @@
5
5
The UCloud CLI provides a unified command line interface to UCloud services. It works on Golang SDK based on UCloud OpenAPI and supports Linux, macOS and Windows.
6
6
https://docs.ucloud.cn/software/cli/index
7
7
8
-
## Installing ucloud-cli
8
+
## Installing ucloud-cli on macOS or Linux
9
9
10
10
**Using Homebrew(Preferred)**
11
11
12
-
The [Homebrew](https://docs.brew.sh/Installation) package manager may be used on macOS, Linux and Windows Subsystem for Linux (WSL).
12
+
The [Homebrew](https://docs.brew.sh/Installation) package manager may be used on macOSand Linux.
13
13
It could install ucloud-cli and its dependencies automatically by running command below.
14
14
15
15
```
16
-
$ brew install ucloud
16
+
brew install ucloud
17
17
```
18
18
19
19
If you have installed ucloud-cli already and want to upgrade to the latest version, just run:
20
20
21
21
```
22
-
$ brew upgrade ucloud
22
+
brew upgrade ucloud
23
23
```
24
24
25
25
If you come across some errors during the installation via homebrew, please update the homebrew first and try again.
26
26
27
27
```
28
-
$ brew update
28
+
brew update
29
29
```
30
30
31
31
If the error is still unresolved, try the following command for help.
32
32
33
33
```
34
-
$ brew doctor
34
+
brew doctor
35
35
```
36
36
37
37
**Building from source**
38
38
39
39
If you have installed git and golang on your platform, you can fetch the source code of ucloud cli from github and complie it by yourself.
Vist the [Releases page](https://github.com/ucloud/ucloud-cli/releases) of ucloud cli, and find the appropriate archive for your operating system and architecture.
49
+
Vist the [releases page](https://github.com/ucloud/ucloud-cli/releases) of ucloud cli, and find the appropriate archive for your operating system and architecture.
50
50
Download the archive , check the shasum256 hashcode and extract it to your $PATH
tar zxf ucloud-cli-macosx-0.1.20-amd64.tgz -C /usr/local/bin/
57
57
```
58
58
59
-
## Enabling Shell Auto-Completion
59
+
## Installing ucloud cli on Windows
60
+
61
+
**Building from source**
62
+
63
+
Download the source code of ucloud cli from [releases page](https://github.com/ucloud/ucloud-cli/releases). You can also download it by running ```git clone https://github.com/ucloud/ucloud-cli.git```
64
+
Ensure you have git installed, because go will download packages using git. Go to the directory of the source code, and then compile the source code by running "go build -o ucloud.exe"
65
+
After that add ucloud.exe to your environment variable PATH. You could follow [this document](https://www.java.com/en/download/help/path.xml) if you don't know how to do.
66
+
Open CMD Terminal and run ```ucloud --version ``` to test installation.
67
+
68
+
69
+
**Downloading binary release**
70
+
71
+
Vist the [releases page](https://github.com/ucloud/ucloud-cli/releases) of ucloud cli, and find the appropriate archive for your operating system and architecture.
72
+
Download the archive , and extract it. Add binary file ucloud.exe to your environment variable PATH following [this document](https://www.java.com/en/download/help/path.xml)
73
+
74
+
## Using ucloud cli in a Docker container
75
+
If you have installed docker on your platform, pull the docker image embeded ucloud cli by follow command.
The docker image was built by the Dockerfile as follow.
81
+
```
82
+
FROM ubuntu:18.04
83
+
RUN apt-get update && apt-get install wget -y
84
+
RUN wget https://github.com/ucloud/ucloud-cli/releases/download/0.1.20/ucloud-cli-linux-0.1.20-amd64.tgz
85
+
RUN tar -zxf ucloud-cli-linux-0.1.20-amd64.tgz -C /usr/local/bin/
86
+
RUN echo "complete -C $(which ucloud) ucloud" >> ~/.bashrc #enable auto completion
87
+
```
88
+
89
+
Create a docker container named ucloud-cli using the docker image your have pulled by following command.
90
+
91
+
```
92
+
docker run --name ucloud-cli -it -d uhub.service.ucloud.cn/ucloudcli/ucloud-cli:0.1.20
93
+
```
94
+
Run bash command in ucloud-cli container, and then you could play with ucloud cli.
95
+
96
+
```
97
+
docker exec -it ucloud-cli bash
98
+
```
99
+
100
+
## Enabling Shell Auto-Completion for bash or zsh shell user.
60
101
61
102
UCloud CLI also has auto-completion support. It can be set up so that if you partially type a command and then press TAB, the rest of the command is automatically filled in.
0 commit comments