> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stoffelmpc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the Stoffel CLI and verify the `stoffel` command line tool for building Stoffel apps.

The `stoffel` command line tool can currently be run on Linux and macOS, and on Windows through WSL2.

Use this page to install the `stoffel` CLI, verify that the command is on your path, and create a first project. The CLI is the entry point for creating projects, checking source, building bytecode, and running local MPC development workflows.

<Note>
  Using an AI coding agent? Start with the [agent install prompt](#install-stoffel-with-an-ai-coding-agent). It installs the `stoffel` CLI, adds Stoffel skills, connects docs access, and verifies the setup before the agent changes a Stoffel project.
</Note>

## Requirements

Required for the CLI:

* A Unix-like shell: Linux, macOS, or Windows with WSL2
* `curl` or `wget`
* 4 GB RAM minimum; 8 GB recommended

Required only for source builds or repository examples:

* [Rust and Cargo](https://www.rust-lang.org/tools/install)
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)

Required only for AI-agent setup:

* [Node.js](https://nodejs.org/) for `npx`-based skill and MCP setup commands

## Prebuilt CLI (recommended)

Install the `stoffel` CLI with the official installer:

```bash theme={null}
curl -fsSL https://get.stoffelmpc.com | sh
```

The installer places `stoffel` in `~/.local/bin` by default. If your shell cannot find it, add that directory to your `PATH`:

```bash theme={null}
export PATH="$HOME/.local/bin:$PATH"
```

Verify the installation:

```bash theme={null}
stoffel --help
```

You should see commands for the normal project loop:

```text theme={null}
init     Create a new Stoffel project
check    Validate source and project MPC settings without writing bytecode
build    Build project bytecode under target/
run      Run source or bytecode through local or network MPC execution
dev      Watch a project and rerun it through local MPC when files change
```

You can also check the installed version:

```bash theme={null}
stoffel --version
```

## Verify with a new project

Create and build a project:

```bash theme={null}
stoffel init hello-mpc
cd hello-mpc
stoffel check
stoffel build
```

Expected output includes:

```text theme={null}
Created Stoffel project at hello-mpc
Checked .../hello-mpc/src/main.stfl
Built .../hello-mpc/target/debug/hello-mpc.stflb
```

This verifies that the `stoffel` command line tool can create, check, and build a Stoffel app. The [Quick Start](./quick-start) continues from here into local MPC execution and the Rust SDK wrapper.

## Install Stoffel with an AI coding agent

Paste this prompt into your AI coding agent if you want it to install Stoffel, connect the docs context, and prove the setup works:

```text theme={null}
You are helping me build a Stoffel app.

First, install Stoffel and the agent context for this workspace:

1. Confirm this terminal can run shell commands and that Node.js is available:
   node --version
   npm --version

2. Install the `stoffel` CLI binary and put it on PATH for this shell:
   curl -fsSL https://get.stoffelmpc.com | sh
   export PATH="$HOME/.local/bin:$PATH"

3. Verify the CLI works:
   stoffel --version
   stoffel --help

4. Install the Stoffel developer skills:
   npx skills add https://docs.stoffelmpc.com --all

5. If this agent supports MCP, connect the live Stoffel docs:
   npx add-mcp --name stoffel-docs --transport http https://docs.stoffelmpc.com/mcp

6. Verify docs access by listing the installed Stoffel skills and searching the docs for `ClientStore` or `local MPC` using the tools available in this agent harness.

7. Create and verify a smoke project:
   stoffel init hello-mpc
   cd hello-mpc
   stoffel status --verbose
   stoffel check
   stoffel build

Use the main Stoffel docs as the source of truth for CLI, SDK, StoffelLang, and local MPC behavior. Use Developer Skills as task playbooks.

After setup, use the Developer Skills overview to choose the right playbook for the task.

Do not claim the setup is complete unless you can show real output from `stoffel --version`, `stoffel check`, and `stoffel build`. If a command fails, report the exact error and fix the root cause instead of inventing expected output.
```

### Manual agent-context setup

If you do not want your agent to install the CLI and skills, run the core setup yourself:

```bash theme={null}
curl -fsSL https://get.stoffelmpc.com | sh
export PATH="$HOME/.local/bin:$PATH"
stoffel --version
stoffel --help
npx skills add https://docs.stoffelmpc.com --all
```

List the available skills without installing:

```bash theme={null}
npx skills add https://docs.stoffelmpc.com --list
```

Connect the live Stoffel docs through Mintlify's hosted MCP server when your agent supports MCP:

```bash theme={null}
npx add-mcp --name stoffel-docs --transport http https://docs.stoffelmpc.com/mcp
```

After setup, continue to [Quick Start](./quick-start) or choose a playbook from [Developer Skills](/developer-skills/overview).

## Pin a CLI version

Pin a version when you want every developer or CI job to use the same CLI:

```bash theme={null}
curl -fsSL https://get.stoffelmpc.com | sh -s -- --version <version>
```

For example, use `--version 0.1.0` when a project or CI job intentionally standardizes on that CLI version.

Install into a different directory when your environment manages tool paths explicitly:

```bash theme={null}
curl -fsSL https://get.stoffelmpc.com | STOFFEL_INSTALL_DIR="$HOME/bin" sh
```

## Build the CLI from source

Build from source when you need repository examples, workspace development, or local CLI changes.

```bash theme={null}
git clone https://github.com/Stoffel-Labs/stoffel.git
cd stoffel
cargo build
cargo build -p stoffel-cli --bin stoffel
```

The debug CLI path is:

```text theme={null}
stoffel/target/debug/stoffel
```

For a faster CLI binary, build in release mode:

```bash theme={null}
cargo build --release -p stoffel-cli --bin stoffel
```

The release CLI path is:

```text theme={null}
stoffel/target/release/stoffel
```

<Note>
  Use the prebuilt CLI for the normal app development loop. Build the CLI from source only when you need local CLI changes or repository examples.
</Note>

## Troubleshooting

### `stoffel` is not found

Add the CLI install directory to your path:

```bash theme={null}
export PATH="$HOME/.local/bin:$PATH"
```

If you installed into another directory, add that directory instead.

### `cargo` is not found

Install Rust and load Cargo's shell environment:

```bash theme={null}
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustc --version
cargo --version
```

### Source builds take a while

The CLI source build compiles several workspace crates. The first Cargo build may take several minutes while dependencies are fetched and compiled.

### Native Windows issues

Use WSL2 unless you are specifically testing native Windows support.

## Next steps

* [Quick Start](./quick-start)
* [CLI Overview](../cli/overview)
* [Rust SDK Overview](../rust-sdk/overview)
