Installation
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
There are a number of ways to install Leo, depending on your platform and preferences. Take your pick!
If you'd like to try Leo without installing it locally on your machine, check out the Leo Playground.
<Tabs defaultValue="cargo"
values={[
{ label: 'Cargo', value: 'cargo' },
{ label: 'Pre-Built Binaries', value: 'prebuilt' },
{ label: 'Build from Source', value: 'source' },
]}>
Install Cargo
The easiest way to install Cargo is to install the latest stable release of Rust.
Install Leo
cargo install leo-lang leo-fmt
This will install the leo and leo-fmt executables at ~/.cargo/bin/.
MacOS (Apple Silicon):
-
Extract the
.zipfile -
Open a terminal and navigate to the extracted directory.
-
Run
chmod +x leo leo-fmtto make the files executable -
Move both binaries to
/usr/local/binto use them system wide.mv leo leo-fmt /usr/local/bin -
Run
leo --versionto confirm installation
Release archives now include plugin binaries (such as leo-fmt) alongside leo. Distribution details are subject to change - see Leo #29355.
Other Platforms:
Install Rust
Install the latest stable release of Rust. You can verify the installation by running:
cargo --version
Install Git
Install the latest version of Git. You can verify the installation by running:
git --version
Build Leo from Source Code
# Download the source code
git clone https://github.com/ProvableHQ/leo
cd leo
# Build and install Leo
cargo install --path .
# Build and install the formatter plugin
cargo install --path crates/fmt
This will install the leo and leo-fmt executables at ~/.cargo/bin/.
To use Leo, run:
leo