Mason CLI
The Mason Platform CLI helps you manage your production devices. Using the CLI, you can do the following and more:
- Update your projects with new Mason OS configurations
- Push apps to your projects directly without making a new Mason OS config
- Use our X-Ray features to remotely debug issues in the field
Installation
View installation instructions below based on your operating system and desired CLI version. The CLI supports all platform operations and provides X-Ray support for devices running Mason OS 6.0.5 or later. The Legacy X-Ray CLI supports X-Ray functionality for devices running Mason OS 6.0.4 or earlier.
- CLI for Windows
- CLI for OSX and Linux
- Legacy X-Ray for Windows
- Legacy X-Ray for OSX and Linux
Before you begin installing the Mason CLI, verify that you do not have a previous version of the Mason CLI installed.
To open powershell, press
Ctrl + L
, then typepowershell
and pressenter
where mason
The output given from running the command
where mason
should be empty. If you are given a filepath, you have a version of the Mason CLI installed and should remove it before continuing with the installation.Download the CLI
Invoke-WebRequest -Uri https://gitlab.com/api/v4/projects/38097768/packages/generic/cli-releases/latest/mason-cli-windows -OutFile mason.exe
Type
mason.exe -v
to ensure the version you downloaded matches what you see:$ .\mason.exe -v
Mason CLI vX.X # Where X.X is the version you downloaded
Configure with an API key
All commands in the Mason CLI require a permissioned API key. This guide will show you how to supply an API key to the Mason CLI.
Prerequisites
- Install the Mason CLI
- Create an API Key
Configuration
There are two ways you can configure an API key with the Mason CLI. The following options are checked on every Mason CLI command execution in the order they are listed.
Supply your API key on every command execution
mason --api-key [APIKEY] ...
Supply your API key through an environment variable
$Env:MASON_API_KEY = “<apikey>”
Before you begin installing the Mason CLI, verify that you do not have a previous version of the Mason CLI installed.
which mason
The output given from running the command
which mason
should be empty. If you are given a filepath, you have a version of the Mason CLI installed and should remove it before continuing with the installation.Open a terminal and download the CLI
- Linux
curl https://gitlab.com/api/v4/projects/38097768/packages/generic/cli-releases/latest/mason-cli-linux --output mason
- macOS (M1 / Arm Processors)
curl https://gitlab.com/api/v4/projects/38097768/packages/generic/cli-releases/latest/mason-cli-mac-m1 --output mason
- macOS
curl https://gitlab.com/api/v4/projects/38097768/packages/generic/cli-releases/latest/mason-cli-mac --output mason
Add execute permissions to the CLI
chmod +x mason
Run
mason -v
to ensure the version you downloaded matches what you see:$ mason -v
Mason CLI vX.X # Where X.X is the version you downloaded
Configure with an API key
All commands in the Mason CLI require a permissioned API key. This guide will show you how to supply an API key to the Mason CLI.
Prerequisites
- Install the Mason CLI
- Create an API key
Configuration
There are two ways you can configure an API key with the Mason CLI. The following options are checked on every Mason CLI command execution in the order they are listed.
Supply your API key on every command execution
mason --api-key [APIKEY] ...
Supply your API key through an environment variable
export MASON_API_KEY=[APIKEY]
Before you begin installing the Mason CLI, verify that you do not have a previous version of the Mason CLI installed.
where mason
The output given from running the command
where mason
should be empty. If you are given a filepath, you have a version of the Mason CLI installed and should remove it before continuing with the installation.Download the official Mason CLI binary for windows.
In Explorer, open the folder where
mason.exe
was downloaded toStill in Explorer, press
Ctrl + L
, then typecmd
and pressenter
In the Command Prompt window that opened, type
mason.exe -V
to ensure the version you downloaded matches what you see:$ mason.exe -V
Mason CLI vX.X # Where X.X is the version you downloaded
Configure with an API Key
Some commands in the Mason CLI require a permissioned API Key. This guide will show you how to supply an API key to the Mason CLI.
Prerequisites
- Install the Mason CLI
- Create an API key
Configuration
There is one way to configure your API key for the legacy X-Ray CLI.
Set your API key once and persist it across CLI sessions.
mason login --api-key [APIKEY]
Before you begin installing the Mason CLI, verify that you do not have a previous version of the Mason CLI installed.
which mason
The output given from running the command
which mason
should be empty. If you are given a filepath, you have a version of the Mason CLI installed and should remove it before continuing with the installation.Open a terminal and download the CLI
- Linux
curl -LO $(curl -s https://api.github.com/repos/MasonAmerica/mason-cli/releases/latest | grep "browser_download_url.*linux\"" | cut -d '"' -f 4)
- macOS (Catalina)
curl -LO $(curl -s https://api.github.com/repos/MasonAmerica/mason-cli/releases/latest | grep "browser_download_url.*mason-macos.tar.gz\"" | cut -d '"' -f 4)
- macOS
curl -LO $(curl -s https://api.github.com/repos/MasonAmerica/mason-cli/releases/latest | grep "browser_download_url.*macos\"" | cut -d '"' -f 4)
Add execute permissions to the CLI
chmod +x mason
Run
./mason -V
to ensure the version you downloaded matches what you see:
$ ./mason -V
Mason CLI vX.X # Where X.X is the version you downloaded
Configure with an API key
Some commands in the Mason CLI require a permissioned API key. This guide will show you how to supply an API key to the Mason CLI.
Prerequisites
- Install the Mason CLI
- Create an API key
Configuration
There is one way to configure your API key for the legacy X-Ray CLI.
Set your API key once and persist it across CLI sessions.
mason login --api-key [APIKEY]