Toit for Linux

Install the Toit CLI

The Toit CLI is used for interacting with the Toit console and your Toit devices.

Download

  • Download the Toit executable for Linux.

  • Move the downloaded file to your preferred installation directory.

Unpack

  • Uncompress the downloaded tgz-file that contains the Toit CLI.

  • Open a terminal window and navigate to the directory where you uncompressed the Toit CLI.

  • To unpack the Toit CLI, run

tar x -vzf toit_linux.tgz
  • The result of unpacking the Toit CLI is an executable file, named toit:
Linux screenshot
Linux screenshot

Add Toit to PATH

Add the folder where the toit executable is located to your PATH environment variable, so that you can run the Toit CLI in a terminal window from any directory.

Depending on the shell you use: edit either the .rczsh file or the .bashrc file located in your home directory.

For example, if you use bash and if you chose to put the toit executable into the $HOME/local/bin folder, execute the following command in a terminal window:

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc;

Check installation

Open a new terminal window and type

toit

to verify that the changes have taken effect. The output is a list of all available commands in the Toit CLI.

Install Visual Studio Code

Toit comes with a language server and provides a Visual Studio Code Language Extension for the Toit programming language.

You can download Visual Studio Code here.

Install language extension

The Toit Language Extension provides built-in language support for the Toit programming language, but also a device view and a serial view from where you can interact directly with your devices.

The Toit language extension also provides helpful commands for the developer, such that you can run or deploy Toit programs on your devices directly from Visual Studio Code.

When you have downloaded and installed Visual Studio Code, get the language extension for Toit either from the Visual Studio marketplace or from the open marketplace.

The Toit Language Extension is currently only supported for Visual Studio Code.