Install and configure the CLI
Crusoe Cloud is currently in private beta. If you do not currently have access, please request access to continue.
Install the CLI
You can install the Crusoe CLI via a number of common package managers, including brew
and apt
.
- Mac OS
- Linux
- Windows
On Mac, use homebrew
to install the Crusoe CLI:
brew install crusoecloud/cli/crusoe
To upgrade to a newer version of the CLI, use brew upgrade crusoe
.
On Linux, use apt
to install the Crusoe CLI:
echo "deb [trusted=yes] https://apt.fury.io/crusoe/ * *" > /etc/apt/sources.list.d/fury.list
sudo apt update
sudo apt install crusoe
To upgrade to a newer version of the CLI, use sudo apt upgrade crusoe
.
Otherwise, to use yum
, visit the latest GitHub release and download the .rpm
asset suited for your machine, and run sudo yum install <path_to_crusoe_rpm_.rpm>
.
On Windows, visit the latest GitHub release and download the crusoe_Windows_$PLATFORM.tar.gz
asset suited for your machine (e.g. crusoe_Windows_arm64.tar.gz
), untar it, and install it.
Configure the CLI using a config file
To authenticate with the Crusoe CLI, you will need an API access key ID and a secret key. You can generate these in the Crusoe Cloud console from the Security page.
Warning: You will only be able to view the Secret key once! Ensure that you save it somewhere secure before you refresh or leave the page.
Then, run the following commands to set up a default configuration for the CLI to use. Under the hood, these will create and populate a config file at ~/.crusoe/config
, which you can edit anytime. View all of your projects anytime in the Console on the Projects page.
crusoe config set default_project <project_name>
crusoe config set access_key_id <access_key_id>
crusoe config set secret_key <secret_key>
Use crusoe config get <variable>
to see what values are currently set, or validate your account is set up properly with:
$ cat ~/.crusoe/config
[default]
default_project="<project_name>"
access_key_id="<access_key_id>"
secret_key="<secret_key>"
To switch between multiple profiles in your ~/.crusoe/config
file, use the environment variable CRUSOE_PROFILE
(e.g., export CRUSOE_PROFILE="my-other-environment"
)
Configure the CLI using environment variables
To configure the CLI without a config file, set equivalent environment variables:
CRUSOE_DEFAULT_PROJECT
CRUSOE_ACCESS_KEY_ID
CRUSOE_SECRET_KEY
Test the CLI
If you've properly installed and configured the CLI, you should be able to run the crusoe whoami
command and see the logged-in user:
> crusoe whoami
<Full name> [email protected]
You're ready to go! Now, try creating a VM.
If you don't see this, make sure you've properly installed the CLI, provided a config file at ~/.crusoe/config
, and added your API keys to the config file. If it still isn't working, contact support.