Skip to content
sproutboat
Esc
↑↓navigate↵open⌘Jpreview
On this page

Quickstart

Go from nothing to a deployed Sproutboat app in four commands.

Prerequisites

  • A package manager. npm install -g sproutboat, npx sproutboat, bunx sproutboat and pnpm dlx sproutboat all resolve a self-contained native binary for your platform.
  • An account on a platform you or your admin run. See Install the platform to run one, or Get access to join one. For a standalone binary 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.

Zero to deployed

Sign in once, from a browser

bunx sproutboat login --api-url https://control.example.com
npx 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.

Scaffold a project

bunx sproutboat init hello
cd hello
npx sproutboat init hello
cd hello

Writes sproutboat.jsonc and src/index.js under ./hello.

Edit the handler

Open src/index.js and make your changes. See The handler for the contract. sproutboat dev runs it on this machine with real bindings and rebuilds on save.

Deploy

bunx sproutboat deploy
npx sproutboat deploy

deploy prints the URL and waits until it serves. Deploying an unchanged artifact is a no-op.

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.

What’s next

Was this page helpful?