Setting up your environment

Overview

In order to use Starknet, you need to install several tools. This section will walk you through installing the three most recommended tools to begin developing on Starknet:

  • Starkli, a command-line interface that allows you to interact with Starknet.

  • Scarb, a build toolchain and package manager for Cairo and Starknet ecosystems.

  • Starknet Foundry, the go-to framework for building and testing Starknet Smart Contracts

To review all Starknet developer tools, check out the tools and resources section.

Setting up Starkli

MacOS and Linux installation

It is highly recommended to install Starkli on MacOS and Linux using the starkliup portable script. starkliup manages shell configuration for you, and using any other installation method requires to manually set up shell completions.

Procedure
  1. Download starkliup:

    curl https://get.starkli.sh | sh
  2. Restart the terminal and install Starkli:

    starkliup
  3. Restart the terminal and verify that Starkli is installed correctly:

    starkli --version

Windows installation

Starknet Foundry’s installation on Windows requires manually setting up shell completions.

Procedure
  1. Install Starkli:

    cargo install --locked --git https://github.com/xJonathanLEI/starkli
  2. Restart the terminal and verify that Starkli is installed correctly:

    starkli --version
  3. Set up Starkli’s shell completions by following the instructions in the Starkli documentation.

Setting up Scarb

MacOS and Linux installation

It is highly recommended to install Scarb on MacOS and Linux via the asdf version manager. Installing Scarb with asdf seamlessly integrates with the Cairo Cairo VSCode extension, and allows to easily switch between different versions of Scarb, both globally and per project (see full details in the asdf documentation or by running asdf --help).

Procedure
  1. Verify that asdf is installed:

    asdf --version

    or install it by following the instructions in the asdf documentation.

  2. Install the asdf Scarb plugin:

    asdf plugin add scarb
  3. Install the latest version of Scarb:

    asdf install scarb latest
  4. Set a global version for Scarb (need for using scarb init):

    asdf global scarb latest
  5. Restart the terminal and verify that Scarb is installed correctly:

    scarb --version

Windows installation

Scarb’s installation on Windows requires manual setup.

Procedure
  1. Follow the instructions in the Scarb documentation.

  2. Restart the terminal and verify that Scarb is installed correctly:

    scarb --version

Setting up Starknet Foundry

MacOS and Linux installation

It is highly recommended to install Starknet Foundry on MacOS and Linux using the asdf version manager. Installing Starknet Foundry with asdf allows to easily switch between different versions of Starknet Foundry, both globally and per project (see full details in the asdf documentation or by running asdf --help).

Procedure
  1. Verify that asdf is installed, or install it by following the instructions on the asdf documentation.

  2. Install the asdf Starknet Foundry plugin:

    asdf plugin add starknet-foundry
  3. Install the latest version of Starknet Foundry:

    asdf install starknet-foundry latest
  4. Set a global version for Starknet Foundry using asdf (need for using scarb init):

    asdf global starknet-foundry latest
  5. Restart the terminal and verify that Starknet Foundry is installed correctly:

    snforge --version
    sncast --version

Windows installation

Starknet Foundry’s installation on Windows requires manual setup.

Procedure
  1. Follow the instructions in the Starknet Foundry documentation.

  2. Restart the terminal and verify that Starknet Foundry is installed correctly:

    snforge --version
    sncast --version