Advanced Guide
Storing Your API Key
In most CLI commands, it is necessary to provide your API key. This can be done by passing the --token option, as shown in the example below:
squarecloud app-list --token <YOUR_API_TOKEN>
However, this is not the best way to store your API key. There is a much better alternative.
Environment Variables:
Alternatively, you can set your API key as an environment variable
named SQUARECLOUD-TOKEN
. The command will automatically read this variable
if the --token
option is not used.
Setting Your Environment Variable:
To set an environment variable named SQUARECLOUD-TOKEN, use the following command based on your operating system.
Windows
Linux
setx SQUARECLOUD-TOKEN "YOUR_API_TOKEN"
Was this page helpful?