Skip to content
On this page

CLI โ€‹

TIP

Before installing SmartPy you can try out the online IDE.

The preferred way of running SmartPy is via the smartpy wrapper. This requires Docker and works on both Linux and macOS. It can be obtained as follows:

shell
wget https://legacy.smartpy.io/smartpy
chmod a+x smartpy

To test it, you can download an example and run the smartpy command:

shell
wget https://legacy.smartpy.io/templates/welcome.py
./smartpy test welcome.py welcome/

The first time this command is invoked, the necessary Docker image will be downloaded. Subsequent invocations will be much faster.

You should now see a new welcome/ directory with test results and compiled contracts:

shell
$ ls -R welcome/
welcome/:
Welcome  scenario.json  script_init.py  script_pure.py

welcome/Welcome:
log.txt                        step_003_cont_0_params.json  step_006_cont_0_params.json  step_010_cont_1_contract.json
step_002_cont_0_contract.json  step_003_cont_0_params.py    step_006_cont_0_params.py    step_010_cont_1_contract.py
step_002_cont_0_contract.py    step_003_cont_0_params.tz    step_006_cont_0_params.tz    step_010_cont_1_contract.tz
step_002_cont_0_contract.tz    step_004_cont_0_params.json  step_007_cont_0_params.json  step_010_cont_1_sizes.csv
step_002_cont_0_sizes.csv      step_004_cont_0_params.py    step_007_cont_0_params.py    step_010_cont_1_storage.json
step_002_cont_0_storage.json   step_004_cont_0_params.tz    step_007_cont_0_params.tz    step_010_cont_1_storage.py
step_002_cont_0_storage.py     step_005_cont_0_params.json  step_008_cont_0_params.json  step_010_cont_1_storage.tz
step_002_cont_0_storage.tz     step_005_cont_0_params.py    step_008_cont_0_params.py    step_010_cont_1_types.py
step_002_cont_0_types.py       step_005_cont_0_params.tz    step_008_cont_0_params.tz