---
title: Quickstart
description: "Install the CLI, scaffold a project and deploy it."
---

## Prerequisites

- **Node.js 18 or later, or Bun,** with a package manager: npm, pnpm, Bun or Yarn. The `sproutboat` package resolves a self-contained native binary for your platform.
- **An account on a platform** you or your admin run. See [Install the platform](/docs/get-started/install) to run one, or [Get access](/docs/get-started/access) to join one. For a [standalone binary](/docs/get-started/standalone) you need neither.

The CLI compiles with the local C toolchain when there is one, and falls back to its own Zig otherwise, so a C compiler is optional.

## Install the CLI

Install Sproutboat locally, in each of your projects. The CLI is the compiler, so pinning its version in `package.json` means a project builds the same way on every machine and in CI, and you choose when to update.

```sh npm
npm i -D sproutboat
```

```sh pnpm
pnpm add -D sproutboat
```

```sh bun
bun add -d sproutboat
```

```sh yarn
yarn add -D sproutboat
```

Because it is a local install, run it through your package manager: `npx sproutboat <command>`, or a `package.json` script such as `npm run deploy`. `sproutboat init` (below) adds the dependency and the `dev`, `deploy` and `check` scripts for you. To update, run the install command again with `@latest`; `npx sproutboat --version` shows what a project uses.

If you only want a few commands outside any project, such as `sproutboat init`, `login` or `whoami`, install it globally. A global install is not pinned to anything, so keep project builds on the local one. `yarn global add` is Yarn 1 only.

```sh npm
npm i -g sproutboat
```

```sh pnpm
pnpm add -g sproutboat
```

```sh bun
bun add -g sproutboat
```

```sh yarn
yarn global add sproutboat
```

## Zero to deployed

1. **Scaffold a project**

    ```sh npm
    npx sproutboat init hello
    ```

    ```sh pnpm
    pnpm dlx sproutboat init hello
    ```

    ```sh bun
    bunx sproutboat init hello
    ```

    ```sh yarn
    yarn dlx sproutboat init hello
    ```

    `yarn dlx` needs Yarn 2 or later; with Yarn 1, run `npx sproutboat init hello`. It writes `sproutboat.jsonc`, `src/index.js` and a `package.json` that lists `sproutboat` in `devDependencies` with the `dev`, `deploy` and `check` scripts, under `./hello`. An existing `package.json` keeps its fields, and a script with the same name is never overwritten. Then install:

    ```sh npm
    cd hello\nnpm install
    ```

    ```sh pnpm
    cd hello\npnpm install
    ```

    ```sh bun
    cd hello\nbun install
    ```

    ```sh yarn
    cd hello\nyarn install
    ```

2. **Sign in once, from a browser**

    ```sh npm
    npx sproutboat login --api-url https://control.example.com
    ```

    ```sh pnpm
    pnpm sproutboat login --api-url https://control.example.com
    ```

    ```sh bun
    bunx sproutboat login --api-url https://control.example.com
    ```

    ```sh yarn
    yarn sproutboat login --api-url https://control.example.com
    ```

    This is the only step that needs a browser tab where you are signed in to the dashboard. It writes a long-lived token to `~/.config/sproutboat/credentials.json`.

3. **Edit the handler**

    Open `src/index.js` and make your changes. See [The handler](/docs/concepts/handler) for the contract. `dev` runs it on this machine with real bindings and rebuilds on save.

    ```sh npm
    npm run dev
    ```

    ```sh pnpm
    pnpm run dev
    ```

    ```sh bun
    bun run dev
    ```

    ```sh yarn
    yarn dev
    ```

4. **Deploy**

    ```sh npm
    npm run deploy
    ```

    ```sh pnpm
    pnpm run deploy
    ```

    ```sh bun
    bun run deploy
    ```

    ```sh yarn
    yarn deploy
    ```

    `deploy` prints the URL and waits until it serves. Deploying an unchanged artifact is a no-op. `npx sproutboat deploy` does the same without the script.

## Use TypeScript

The starter creates JavaScript. To use TypeScript, rename `src/index.js` to `src/index.ts` and set `main` in `sproutboat.jsonc` to `"src/index.ts"`. The same `dev`, `build` and `deploy` commands work. Sproutboat bundles the file and removes TypeScript syntax before native compilation.

Run `sproutboat types` to generate binding types for your editor. To make type errors fail a build, add a `tsconfig.json` and run your own type check; `sproutboat check` checks runtime compatibility, not types. See [Generated types](/docs/concepts/types).

## What's next

**[Standalone binaries](/docs/get-started/standalone)**

Run Sproutboat without a platform: one executable on your own server.

**[Bindings](/docs/bindings)**

Attach KV, D1-compatible SQLite, R2-compatible object storage, queues and more to your handler.
