|  | 
|  | 1 | +# Setup | 
|  | 2 | + | 
|  | 3 | +## Installation | 
|  | 4 | + | 
|  | 5 | +`vab` can be installed in different ways, you can choose the one that better fits your needs and the operating system | 
|  | 6 | +you are using: | 
|  | 7 | + | 
|  | 8 | +- [Linux and MacOs](#linux-and-macos) | 
|  | 9 | +  - [Homebrew](#homebrew) | 
|  | 10 | +  - [Go](#go) | 
|  | 11 | +  - [Binary Download](#binary-download) | 
|  | 12 | +  - [Docker](#docker) | 
|  | 13 | +- [Windows (with WSL)](#windows) | 
|  | 14 | +- [Shell Autocompletion](#shell-autocompletion) | 
|  | 15 | + | 
|  | 16 | +### Linux and MacOs | 
|  | 17 | + | 
|  | 18 | +#### Homebrew | 
|  | 19 | + | 
|  | 20 | +If you have [Homebrew] installed on your system `vab` is only a command away: | 
|  | 21 | + | 
|  | 22 | +```sh | 
|  | 23 | +brew install mia-platform/tap/vab | 
|  | 24 | +``` | 
|  | 25 | + | 
|  | 26 | +#### Go | 
|  | 27 | + | 
|  | 28 | +If you have [Golang] installed with a version >= 1.13 in your system and you have the `$GOPATH`env set, you can | 
|  | 29 | +install `vab` like this: | 
|  | 30 | + | 
|  | 31 | +```sh | 
|  | 32 | +go install github.com/mia-platform/vab/cmd/[email protected] | 
|  | 33 | +``` | 
|  | 34 | + | 
|  | 35 | +Or like this if the `install` command is not available | 
|  | 36 | + | 
|  | 37 | +```sh | 
|  | 38 | +go get -u github.com/mia-platform/vab/cmd/[email protected] | 
|  | 39 | +``` | 
|  | 40 | + | 
|  | 41 | +#### Binary Download | 
|  | 42 | + | 
|  | 43 | +You can install `vab` with the use of `curl` or `wget` and downloading the latest packages available on GitHub | 
|  | 44 | +choosing the correct platform and operating system: | 
|  | 45 | + | 
|  | 46 | +```sh | 
|  | 47 | +curl -fsSL https://github.com/mia-platform/vab/releases/download/v0.9.0/vab-linux-amd64 -o /tmp/vab | 
|  | 48 | +``` | 
|  | 49 | + | 
|  | 50 | +```sh | 
|  | 51 | +wget -q https://github.com/mia-platform/vab/releases/download/v0.9.0/vab-linux-amd64 -O /tmp/vab | 
|  | 52 | +``` | 
|  | 53 | + | 
|  | 54 | +After you have downloaded the file you can validate it against the checksum you can find at this [url] running the | 
|  | 55 | +command: | 
|  | 56 | + | 
|  | 57 | +```sh | 
|  | 58 | +sha256sum /tmp/vab | 
|  | 59 | +``` | 
|  | 60 | + | 
|  | 61 | +After you have validated that the downloaded file is correct, move the binary in your `/usr/local/bin` folder | 
|  | 62 | + | 
|  | 63 | +```sh | 
|  | 64 | +sudo install -g root -o root /tmp/vab /usr/local/bin | 
|  | 65 | +``` | 
|  | 66 | + | 
|  | 67 | +#### Docker | 
|  | 68 | + | 
|  | 69 | +If you want to run the cli in its environment or you want to test the cli you can use the Docker image: | 
|  | 70 | + | 
|  | 71 | +```sh | 
|  | 72 | +docker run ghcr.io/mia-platform/vab:0.9.0 | 
|  | 73 | +``` | 
|  | 74 | + | 
|  | 75 | +### Windows | 
|  | 76 | + | 
|  | 77 | +`vab` is not directly compatible with Windows, even if you have Go installed compilation on this OS | 
|  | 78 | +is not possible due to current technical restrictions. | 
|  | 79 | + | 
|  | 80 | +However, it is still possible to use `vab` with Windows Subsystem for Linux (WSL), as explained here below. | 
|  | 81 | + | 
|  | 82 | +#### Installation of WSL | 
|  | 83 | + | 
|  | 84 | +If you don't have WSL on your system, follow the [official guide] to get it. | 
|  | 85 | + | 
|  | 86 | +Once WSL is installed, to open a Linux bash terminal, press Start+R, enter `bash` in the text box and press OK. | 
|  | 87 | + | 
|  | 88 | +#### Install `vab` | 
|  | 89 | + | 
|  | 90 | +You can now install vab with any of the methods explained above for Linux, | 
|  | 91 | +we suggest the [binary installation](#binary-download) since it's the most straightforward. | 
|  | 92 | + | 
|  | 93 | +## Shell Autocompletion | 
|  | 94 | + | 
|  | 95 | +If you have choosen to use an installation method different from the brew one, you will have to setup the | 
|  | 96 | +commands autocompletion for your shell following one of these guides: | 
|  | 97 | + | 
|  | 98 | +- [`bash`](#bash) | 
|  | 99 | +- [`zsh`](#zsh) | 
|  | 100 | +- [`fish`](#fish) | 
|  | 101 | + | 
|  | 102 | +When you update the command remember to relaunch the command for your shell to update the completion definition | 
|  | 103 | +and get the latest command and/or flags that has been added. | 
|  | 104 | + | 
|  | 105 | +### `bash` | 
|  | 106 | + | 
|  | 107 | +The `bash` autocompletion needs the [`bash-completion`] package installed on your system. | 
|  | 108 | + | 
|  | 109 | +**Warning:** for working correctly you need the `bash-completion` V2 that is compatible only with Bash 4.1+, | 
|  | 110 | +please be sure to have the correct versions installed on your system before running the command. | 
|  | 111 | + | 
|  | 112 | +```sh | 
|  | 113 | +vab completion bash >/usr/local/etc/bash_completion.d/vab | 
|  | 114 | +``` | 
|  | 115 | + | 
|  | 116 | +After done this you must restart your shell environment or launch `exec bash` for reloading the configurations | 
|  | 117 | +and enable the autocompletion. | 
|  | 118 | + | 
|  | 119 | +### `zsh` | 
|  | 120 | + | 
|  | 121 | +For setting up the `zsh` completion, you must enable it. You can use the following command: | 
|  | 122 | + | 
|  | 123 | +```sh | 
|  | 124 | +echo "autoload -U compinit; compinit" >> ~/.zshrc | 
|  | 125 | +``` | 
|  | 126 | + | 
|  | 127 | +Or use something like [`oh-my-zsh`] that will enable it by default. Once you have done it you can launch the | 
|  | 128 | +following command to create the file needed by `zsh`: | 
|  | 129 | + | 
|  | 130 | +```sh | 
|  | 131 | +vab completion zsh > /usr/local/share/zsh/site-functions/_vab | 
|  | 132 | +``` | 
|  | 133 | + | 
|  | 134 | +After done this you must restart your shell environment or launch `exec zsh` for reloading the configurations and | 
|  | 135 | +enable the autocompletion. | 
|  | 136 | + | 
|  | 137 | +### `fish` | 
|  | 138 | + | 
|  | 139 | +To enable the autocompletion in `fish` you have to run this command: | 
|  | 140 | + | 
|  | 141 | +```sh | 
|  | 142 | +vab completion fish > ~/.config/fish/completions/vab.fish | 
|  | 143 | +``` | 
|  | 144 | + | 
|  | 145 | +After done this you must restart your shell environment or launch `exec fish` for reloading the configurations and | 
|  | 146 | +enable the autocompletion. | 
|  | 147 | + | 
|  | 148 | +[Homebrew]: https://brew.sh "The Missing Package Manager for macOS (or Linux)" | 
|  | 149 | +[Golang]: https://go.dev "Build simple, secure, scalable systems with Go" | 
|  | 150 | +[url]: https://github.com/mia-platform/vab/releases/download/v0.12.2/checksums.txt "vab checksums" | 
|  | 151 | +[`bash-completion`]: https://github.com/scop/bash-completion "Programmable completion functions for bash" | 
|  | 152 | +[`oh-my-zsh`]: https://ohmyz.sh "Oh My Zsh is a delightful, open source, community-driven | 
|  | 153 | +	framework for managing your Zsh configuration" | 
|  | 154 | +[official guide]: https://learn.microsoft.com/en-us/windows/wsl/install "How to install Linux on Windows with WSL" | 
0 commit comments