Skip to main content
Version: 1.1.0

CLI Commands

Contracts written in LIGO can be compiled using the ligo executable.

Compiling a contract

Compile your contract.

ligo compile contract SOURCE_FILE


ligo compile contract examples/counter.mligo

Compiling a view

Compile a view.

ligo compile view SOURCE_FILE VIEW_NAME


ligo compile view examples/counter.mligo v1

Defining the initial storage

If your contract implements a sophisticated storage, you can compile a LIGO expression into a Michelson value quite easily.

ligo compile storage SOURCE_FILE EXPRESSION --entry-point ENTRY_POINT


ligo compile storage examples/counter.mligo 5
# Outputs: 5

Invoking the contract with a parameter

ligo compile parameter SOURCE_FILE EXPRESSION


ligo compile parameter examples/counter.mligo "Increment(5)" --entry-point main
# Outputs: (Right 5)