Setting up the CLI

Installation

To install the Space CLI on MacOS, open a Terminal session and enter:

curl -fsSL https://get.deta.dev/space-cli.sh | sh

This will download the binary which contains the CLI code. It will try to export the space command to your path. If it does not succeed, follow the directions output by the install script to export space to your path.

Authentication

Once you have successfully installed the Space CLI, you’ll need to log in to Deta Space.

The Space CLI authenticates itself with ā€˜Access Tokens’. You can create an access token under Settings in your Space. Just type ā€˜settings’ in Teletype to open them.

After you have generated a new key you can add it to the CLI using space login. It will prompt you for the key and then store it safely.

From a terminal type:

space login

This command will ask for an ā€˜access token’ to authenticate your CLI.

? Enter access token >

To get an access token, enter your Space dashboard, open the Teletype (command bar) and click ā€˜Settings’:

This will open the Settings modal, where you can click ā€˜Generate Token’ to generate an access token:

Copy the resulting token:

You can paste this back into your CLI prompt. After you hit enter, you should be greeted by a success message.

šŸ‘ Login Successful!

Upon a successful log-in, you are ready to start building Space apps.

CLI Commands

Run space help to get a overview of the available commands or refer to the Reference section for a complete list of CLI commands and options.