Skip to content

Install Toit#

The Toit command-line interface (CLI) is for interacting with the Toit console and your devices.

Install the Toit CLI#

Download the Toit installer#

Download the Toit installer for Windows and follow the instructions in the installer.

Check#

Type toit in a terminal window.

Note that Mac users may need administrator rights to run Toit at the end of the installation process.

Download the Toit executable#

Download the Toit executable for macOS.

Unpack the toit_darwin.tgz file and save the executable file named toit to a new folder (that you can call for example toit) within your favorite installation folder (for example the Applications folder).

Add Toit to your PATH#

To make sure you can run the Toit CLI in a terminal window from any directory, add the toit executable to your PATH environment variable by editing the shell configuration script, depending on which shell you are using: open a .zshrc file (on Catalina) or a .bash_profile file (on older macOS versions) with open ~/.zshrc or open ~/.bash_profile.

Type in the shell configuration script

export PATH=/Applications/toit:$PATH
where Applications/toit is an example of where the toit executable is located. Save the file before closing it.

zshrcbashprofile

Configure VSCODE#

You also need to configure VSCode PATH on macOS. If you have not done so yet, download Visual Studio Code and launch VS Code. In the View menu, choose to open the Command Palette. Type 'shell command' to find the Shell Command: Install 'code' command in PATH.

Check#

To verify that you successfully configured the PATH with the toit executable, type toit in a new terminal.

Note that Mac users may get the following warning when starting Toit for the first time. Click on the ? and follow the instructions to Allow anyway the toit executable

macwarning1

Download the Toit executable#

Download the Toit executable for Linux.

When the download of the Toit CLI has completed, open the Downloads folder on your computer and copy the downloaded file to your preferred installation directory.

Downloadsfolder

Next, uncompress the downloaded Toit CLI, which is packed as a tgz file.

Open a terminal and navigate to the directory where you copied the downloaded file to.

To unpack, run

tar x -vzf toit_linux.tgz

The result of unpacking the Toit CLI is an executable file, named toit, and the result should look like this:

Extract

Add Toit to your PATH#

Add the folder where the toit executable is located to your PATH environment variable so you can run the Toit CLI tool from any directory in a terminal. For example, add the following line to a shell script that runs before you open a terminal, such as .bash_profile or rczsh located in your home directory:

export PATH=$HOME/local/bin:$PATH

Check#

A logout/login is required for this to take effect. Reopen a terminal and type toit to verify that the changes have taken effect.

The output of running toit in a terminal window is a list of all available commands for the Toit CLI.

toitcli

Install the Toit SDK and the Toit language extension#

Next, install the latest released Toit SDK on your computer by write running the CLI command in a terminal:

toit doctor fix

If you have installed Visual Studio Code as mentioned in here, the command also installs the Toit language extension for VSCode.

The command

toit doctor

reports the health status of your local Toit installation. Its output should look like this:

Toit health:
 [OK] Toit SDK
 [OK] Visual Studio Code
 [OK] Toit CLI