Skip to main content
Version: 13.x (Current)

Setup

Installation

miactl can be installed in different ways, you can choose the one that better fits your needs and the operating system you are using:

Linux and MacOs

Homebrew

If you have Homebrew installed on your system miactl is only a command away:

brew install mia-platform/tap/miactl

Go

If you have Golang installed with a version >= 1.13 in your system and you have the $GOPATHenv set, you can install miactl like this:

go install github.com/mia-platform/miactl/cmd/miactl@v0.12.2

Or like this if the install command is not available

go get -u github.com/mia-platform/miactl/cmd/miactl@0.12.2

Binary Download

You can install miactl with the use of curl or wget and downloading the latest packages available on GitHub choosing the correct platform and operating system:

curl -fsSL https://github.com/mia-platform/miactl/releases/download/v0.12.2/miactl-linux-amd64 -o /tmp/miactl
wget -q https://github.com/mia-platform/miactl/releases/download/v0.12.2/miactl-linux-amd64 -O /tmp/miactl

After you have downloaded the file you can validate it against the checksum you can find at this url running the command:

sha256sum /tmp/miactl

After you have validated that the downloaded file is correct, move the binary in your /usr/local/bin folder

chmod +x /tmp/miactl
mv /tmp/miactl /usr/local/bin

If the mv command replies with a Permission denied, retry it as root:

sudo mv /tmp/miactl /usr/local/bin

Docker

If you want to run the cli in its environment or you want to test the cli you can use the Docker image:

docker run ghcr.io/mia-platform/miactl:v0.12.2 miactl

Windows

miactl is not directly compatible with Windows, even if you have Go installed: compilation on this OS is not possible due to current technical restrictions.

However, it is still possible to use miactl with Windows Subsystem for Linux (WSL), as explained here below.

Installation of WSL

If you don't have WSL on your system, follow the official guide to get it.

Once WSL is installed, to open a Linux bash terminal, press Start+R, enter bash in the text box and press OK.

Install miactl

You can now install miactl with any of the methods explained above for Linux, we suggest the binary installation since it's the most straightforward.

Setup a service account

Due to some technical restriction, it is not possible to login with a browser when using WSL. For this reason, we need to setup a service account.

Once you have created it, you need to use the miactl context auth command to setup authentication.

You are now ready to use miactl.

Shell Autocompletion

Once you have installed the cli in your system you can setup the commands completion for one of this shells:

When you update the command remember to relaunch the command for your shell to update the completion definition and get the latest command and/or flags that has been added.

bash

The bash autocompletion needs the bash-completion package installed on your system.

Warning: for working correctly you need the bash-completion V2 that is compatible only with Bash 4.1+, please be sure to have the correct versions installed on your system before running the command.

miactl completion bash >/usr/local/etc/bash_completion.d/miactl

After done this you must restart your shell environment or launch exec bash for reloading the configurations and enable the autocompletion.

zsh

For setting up the zsh completion, you must enable it. You can use the following command:

echo "autoload -U compinit; compinit" >> ~/.zshrc

Or use something like oh-my-zsh that will enable it by default. Once you have done it you can launch the following command to create the file needed by zsh:

miactl completion zsh > /usr/local/share/zsh/site-functions/_miactl

After done this you must restart your shell environment or launch exec zsh for reloading the configurations and enable the autocompletion.

fish

To enable the autocompletion in fish you have to run this command:

miactl completion fish > ~/.config/fish/completions/miactl.fish

After done this you must restart your shell environment or launch exec fish for reloading the configurations and enable the autocompletion.

Setup Authorization Provider

If you are not using the cloud offering of Mia-Platform Console, the on premise installation must be properly configured to enable the correct functionality of the login via user account.

You must add the following URL http://localhost:53535/oauth/callback as a valid callback to your provider for enabling the cli to correctly receive the login data. If you are not able to do it, please ask one of the administrator of your chosen provider to do the changes.

If you plan to use the cli only with service accounts you don’t have to do anything because the login flow will happen only via APIs.