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 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 has 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
-
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)
curl https://gitlab.com/api/v4/projects/38097768/packages/generic/cli-releases/latest/mason-cli-mac-m1 --output mason
MacOS (x86)
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]