Scaleway Command Line Interface (CLI) - Quickstart
The Scaleway command line interface (CLI) is a tool that allows you to pilot your Scaleway infrastructure and resources directly from your terminal. This page explains how to install and configure the CLI on your local machine.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A valid API key
How to install the Scaleway CLI locally
Download the Scaleway CLI using a package manager according to your operating system:
macOS
Install the latest stable release on macOS using Homebrew:
brew install scw
Arch Linux
Install the latest stable release on Arch Linux from official repositories using pacman
:
pacman -S scaleway-cli
Windows
Install the latest stable release on Windows using WinGet:
winget install scw
Manual installation on other OS
Scaleway provides static compiled binaries for GNU/Linux and macOS platforms.
Use the following command to download a binary compatible with your platform directly in your PATH
:
curl -s https://raw.githubusercontent.com/scaleway/scaleway-cli/master/scripts/get.sh | sh
How to configure the Scaleway CLI
-
Open a terminal and type the following command to configure the Scaleway CLI on your machine:
scw init
-
The following message displays:
Enter a valid secret-key:
Enter your API secret Key.
-
The following message displays:
Enter a valid access-key:
Enter your API access key.
-
The following message displays:
Choose your default organization ID:
Enter the ID of the Organization that will be used by default.
-
The following message displays:
Choose your default project ID > default (-776f-4f65-a41e-6c5fc58b4076) Test (-fc7f-4e0d-8cd9-0da41b2c8793)
Select the Project that will be used by default using your keyboard's arrows.
-
The following message displays:
To improve this tool we rely on diagnostic and usage data. Sending such data is optional and can be disabled at any time by running "scw config set send-telemetry=false". Do you want to send usage statistics and diagnostics? (Y/n):
Type
Y
orn
according to your preference. -
The following message displays:
To fully enjoy Scaleway CLI we recommend you install autocomplete support in your shell. Do you want to install autocomplete? (Y/n):
Type
y
orn
according to your preference. -
The following message displays:
To enable autocomplete, scw needs to update your shell configuration. What type of shell are you using (default: zsh):
Press enter if the default shell type displayed is the one you are using. Otherwise, enter the correct shell type you are using.
-
The Scaleway CLI will now check if an SSH key is present in your local machine in the
id_ecdsa.pub
,id_ed25519.pub
, andid_rsa.pub
files.If a key is present, but not associated with the default Scaleway Project, the Scaleway CLI will add this key to the Project defined previously.
Otherwise, the Scaleway CLI will either confirm that the key is already present in your Scaleway Project, or warn you that no key were found. Refer to the dedicated documentation to create an SSH key.
-
The configuration is complete, and the message below displays:
Initialization completed with success.
-
Run
scw help
to display the available commands:$ scw help Get help about how the CLI works USAGE: scw help <command> AVAILABLE COMMANDS: date Get help about how date parsing works in the CLI output Get help about how the CLI output works FLAGS: -h, --help help for help GLOBAL FLAGS: -c, --config string The path to the config file -D, --debug Enable debug mode -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") -p, --profile string The config profile to use Use "scw help [command] --help" for more information about a command.
Automate CLI actions with Scaleway Serverless Jobs
You can automate your CLI actions by scheduling them with Scaleway Serverless Jobs. This allows you to run your Scaleway CLI commands at specific times or intervals without needing to manually execute them.
For step-by-step guides, check out the following tutorials:
- Power your Instances on and off using Serverless Jobs
- Create snapshots of a Managed MongoDB® database
- Create recurring scheduled backups and snapshots of a database
- Create snapshots of an Instance
Refer to the dedicated documentation for more information.