Skip to content

MGC CLI (Command Line Interface) is a tool that allows users to interact with Magalu Cloud (MGC) services through the command line. It's available for macOS, Linux, and Windows on AMD64 and ARM architectures.

Notifications You must be signed in to change notification settings

MagaluCloud/mgccli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 

Repository files navigation

Go Latest Version License

Magalu Cloud CLI

MGC CLI (Command Line Interface) is a tool that allows users to interact with Magalu Cloud (MGC) services through the command line. It's available for macOS, Linux, and Windows on AMD64 and ARM architectures.

With the CLI, you can manage:

  • Object Storage (buckets, objects, ACL, versions, signed URL)
  • Virtual Machines (instances, snapshots)
  • DBaaS (instances, replications)
  • Block Storage (volumes, associations with VMs)
  • VPC (subnets, security rules, public IP)
  • Kubernetes Cluster (create, scale, monitor)

The CLI also allows the creation of profiles to better separate your configurations and tenants.

How to contribute?

Currently, this repository only hosts the CLI builds/releases. The source code is in our monorepo, and code contributions should be made there. Moving the code to this repo is in our plans.

If you'd like to report a bug or request a feature, please create an issue:

Prerequisites

To use the CLI, you need to have already created an account on Magalu Cloud through the Magalu Cloud Console.

Once you have created your account, simply follow the download and installation procedure for your system.

Download and Installation

Download the correct release for your system and architecture from the link below.

Releases

Linux

APT Repository (Debian/Ubuntu)

Add the Magalu Cloud repository and install the CLI:

sudo gpg --yes --keyserver keyserver.ubuntu.com --recv-keys 0C59E21A5CB00594 && sudo gpg --export --armor 0C59E21A5CB00594 | sudo gpg --dearmor -o /etc/apt/keyrings/magalu-archive-keyring.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/magalu-archive-keyring.gpg] https://packages.magalu.cloud/apt stable main" | sudo tee /etc/apt/sources.list.d/magalu.list

sudo apt update
sudo apt install mgccli

Debian / Ubuntu (Manual Installation)

To install the CLI from the deb package, run the command below in a terminal inside the directory where the package is located. Update the .deb filename according to the one you downloaded.

sudo dpkg -i mgccli_x.xx.x_linux_amd64.deb

Fedora / CentOS

To install the CLI from the rpm package, run the command below in the same directory where the package is located. Update the .rpm filename according to the one you downloaded.

sudo rpm -i mgccli_x.xx.x_linux_amd64.rpm

Tar.gz Archive

Open a terminal and run the following command to create a directory dedicated to the CLI in your user's home directory.

mkdir ~/mgc_cli

Run the command below in the same folder where the .tar.gz file is located. Update the filename according to the one you downloaded.

tar -xvf mgccli_x.xx.x_linux_amd64.tar.gz -C ~/mgc_cli

For a better experience with the CLI, we recommend adding the installation directory to the PATH variable. Run the command below and then add this line to the ~/.bashrc or ~/.zshrc file depending on your shell.

export PATH=$HOME/mgc_cli:$PATH

Community Packages

macOS

Homebrew

To install the CLI using Homebrew, you need to make sure it's correctly installed on your system. Visit the official website: https://brew.sh/

Then open a terminal and run the tap command on our official repository:

brew tap MagaluCloud/homebrew-mgccli

and finally run the installation command:

brew install mgccli

Tar.gz Archive

The CLI has separate installation files for each architecture. Download the file corresponding to your architecture from the official repository.

https://github.com/MagaluCloud/mgccli/releases/

Make sure your user has sudo permission.

Open a terminal and run the following command to create a directory dedicated to the CLI in your user's home directory.

mkdir ~/mgc_cli

Run the command below in the same directory where the .tar.gz file is located. Update the filename according to the one you downloaded.

tar -xvf mgccli_x.xx.x_darwin_amd64.tar.gz -C ~/mgc_cli

For a better experience with the CLI, we recommend adding the installation directory to the PATH variable. Run the command below and then add this line to the ~/.bashrc or ~/.zshrc file depending on your shell.

export PATH=$HOME/mgc_cli:$PATH

Windows

The CLI has separate installation files for each architecture. Download the file corresponding to your architecture (amd64 / arm) from the official repository.

To install the CLI on your Windows 10/11 system, follow the steps below.

  1. Extract the contents of the ZIP file to a folder of your choice.

  2. Open a Command Prompt or Powershell terminal in the folder where you extracted the files.

  3. Run the command below to confirm the installation:

    mgc --version

Authentication

To authenticate in the CLI and have your credential stored in the configuration file, you need to run the following command:

mgc auth login

This command will open a window in your default browser directly on the Magalu ID site, where you should log in. After completing the procedure and closing the browser, the CLI will display the confirmation, and your access token will be saved in the file below.

$HOME/.config/mgc/<PROFILE>/auth.yaml

Where is the name of the profile you want to configure.

If you need the access token to use with the Magalu Cloud API, you can also get it by running the command below.

mgc auth access-token

Technical Information

  • Built with Go
  • Open source
  • Cross-platform (Linux, macOS, Windows)
  • Supports both AMD64 and ARM architectures

About

MGC CLI (Command Line Interface) is a tool that allows users to interact with Magalu Cloud (MGC) services through the command line. It's available for macOS, Linux, and Windows on AMD64 and ARM architectures.

Resources

Stars

Watchers

Forks