Skip to main content

Overview

The Sutro CLI is the fastest way to build a SLang backend from your local editor. You write .slang files locally, and Sutro runs validation, preview, and publish workflows on the hosted Sutro backend. In this guide, you’ll:
  • Install the CLI.
  • Log in with your Sutro account.
  • Link a local folder to a Sutro Project and Application.
  • Run a remote dev session with live reload.
  • Validate and publish the backend.

Before you begin

You need:
  • Node.js 22 or later.
  • npm, pnpm, or yarn.
  • A Sutro account.
Publishing requires a payment method on file. You can add one in Sutro Studio or Sutro Console.

Steps

1

Install the CLI

Install the CLI globally:
Confirm that the sutro command is available:
2

Log in

Start the browser-based login flow:
The CLI opens Sutro Studio in your browser. After login completes, the CLI stores a local session for future commands.If your environment cannot open a browser automatically, print the login URL instead:
3

Create a local project

Create a new folder and initialize it with Sutro:
sutro init creates a remote Project and Application, writes sutro.config.json, and creates app.slang if it does not exist.To link an existing Application instead, pass its ID:
4

Write a SLang backend

Replace the generated app.slang with a small task API:
5

Start a remote dev session

Start the preview server:
The CLI creates a remote dev session, uploads your local .slang files, and prints a preview API URL:
Keep this command running while you edit. When a .slang file or sutro.config.json changes, the CLI uploads the latest source and refreshes the remote preview.Press Ctrl + C to stop the dev session.
6

Call the preview API

Open a second terminal and call the URL printed by sutro dev:
Replace <SESSION_ID> with the value printed by sutro dev.
7

Validate the project

Run validation before publishing:
The CLI uploads the local SLang source to Sutro for validation and prints compiler diagnostics if the project does not compile.
8

Publish the backend

Publish the linked Application:
The CLI uploads the local SLang source, publishes the Application, and prints the published API URL and version.
9

Inspect the published app

Check the linked Application:
Save the published OpenAPI spec:
You now have a local SLang project linked to Sutro, a remote dev preview, and a published backend API.

Learn more