Skip to main content

Installation

Install the CLI globally:
npm install --global @sutro-dev/sutro-cli
The package installs the sutro command. Requirements:
RequirementValue
Node.js22 or later
npm package@sutro-dev/sutro-cli
Binarysutro

Global options

Global options work with every command.
OptionDescription
-V, --versionPrint the CLI version.
--jsonOutput machine-readable JSON. For sutro dev, output is newline-delimited JSON events.
--debugPrint debug details, including API request context and error context.
--colorForce color output.
--no-colorDisable color output.
-h, --helpShow help for a command.
Examples:
sutro --version
sutro status --json
sutro publish --debug

Commands

sutro login

Log in to Sutro through the browser and store a local CLI session.
sutro login
Options:
OptionDescription
--no-openPrint the login URL instead of opening a browser.

sutro logout

Clear the locally stored CLI session.
sutro logout

sutro whoami

Show the currently logged-in user.
sutro whoami

sutro init

Link the current folder to a Sutro Project and Application. If no IDs are provided, the CLI creates a new Project and Application.
sutro init --name "Task API"
Options:
OptionDescription
-n, --name <name>App name used when creating a new Project.
--project-id <id>Link to an existing Project and create a new Application inside it.
--application-id <id>Link to an existing Application. The CLI reads its Project ID automatically.
--entry-file <path>SLang entry file to scaffold and track. Defaults to app.slang.
-y, --yesAccept defaults without prompting.
sutro init writes sutro.config.json and creates the entry file if it does not already exist.

sutro dev

Run the linked SLang app in a remote dev session.
sutro dev
Options:
OptionDescription
--no-watchUpload once and keep the remote session alive without watching for file changes.
sutro dev uploads all local .slang files under the project root, starts a remote preview, and prints an API URL like:
https://dev-<SESSION_ID>.app.withsutro.com/api/latest/
While watching is enabled, changes to .slang files and sutro.config.json trigger a remote reload. Press Ctrl + C to stop the dev session.

sutro validate

Validate the linked SLang project without publishing it.
sutro validate
The CLI uploads the local source to Sutro and prints compiler diagnostics if validation fails.

sutro publish

Upload the linked SLang project and publish the Application.
sutro publish
The command uploads all local .slang files, publishes the Application, waits for the published version to become active, and prints the published URL. Publishing requires a payment method on file.

sutro status

Show the linked Project, Application, entry file, publish state, and published version.
sutro status

sutro openapi

Open the published OpenAPI spec in Console.
sutro openapi
Options:
OptionDescription
--out [path]Save the OpenAPI spec locally instead of opening Console. Defaults to openapi.json when no path is provided.
Examples:
sutro openapi --out
sutro openapi --out ./schema/openapi.json

Exit codes

CodeMeaning
0Command succeeded.
1Runtime, authentication, network, API, validation, or publish failure.
2Usage error, such as an unknown flag or missing required input in a non-interactive shell.

Automation

Use --json when calling the CLI from scripts or AI coding agents:
sutro status --json
sutro validate --json
sutro publish --json
sutro dev --json writes newline-delimited events because the command keeps running:
sutro dev --json
Each event includes an event field, such as session_ready, session_update, or session_update_failed.