Mason Docs

Configure the Mason CLI 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

Configuration

There are three 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

  1. Supply your API key on every command execution

    mason --api-key [APIKEY] ...
    
  2. Supply your API key through an environment variable

    export MASON_API_KEY=[APIKEY]
    
  3. Set your API key once and persist it across CLI sessions

    mason login is not available on Mason CLI versions 2.0 and higher, use an API key instead.

    mason login --api-key [APIKEY]
    

Support