Introduction
In order to use the command-line tool, you will need to authenticate yourself to the Civo API using a special key. You can find an automatically-generated API key or regenerate a new key at https://www.civo.com/api.
Adding a current API Key to your account
You can add the API Key to the CLI tool through the API Keys command.
civo apikey add apikey_name apikey
such as:
$ civo apikey add Demo_Test_Key DAb75oyqVeaE7BI6Aa74FaRSP0E2tMZXkDWLC9wNQdcpGfH51r
Saved the API Key Demo_Test_Key as DAb75oyqVeaE7BI6Aa74FaRSP0E2tMZXkDWLC9wNQdcpGfH51r
As you can have multiple API keys stored to handle multiple accounts, you will need to tell which key the tool should use to authenticate with civo apikey current [apikey_name]
. This sets your chosen API key as the default key to use for any subsequent commands:
$ civo apikey current Demo_Test_Key
Set the default API Key to be Demo_Test_Key
Managing and listing API keys
You can list all stored API keys in your configuration by invoking civo apikey list
or remove one by name by using civo apikey remove apikey_name
.
To see the secret key you can use civo apikey show
which will show only the default key, to see others just use civo apikey show NAME
civo apikey list
+--------------+---------+
| Name | Default |
+--------------+---------+
| my_username | <===== |
+--------------+---------+
civo apikey show my_username
+-------------+------------+
| Name | Key |
+-------------+------------+
| my_username | secret_key |
+-------------+------------+