@sutro-dev/sutro-cli
v1.3.0
Published
Command line interface for authenticating and publishing to Sutro.
Readme
Sutro CLI
The Sutro CLI provides a scriptable and interactive interface for building, previewing, validating, and publishing SLang projects with Sutro.
Development
pnpm --filter @sutro-dev/sutro-cli build
pnpm --filter @sutro-dev/sutro-cli test
pnpm --filter @sutro-dev/sutro-cli exec node ./dist/cli.js --helpTo install the local build as a global sutro command for manual testing:
pnpm cli:install:local
sutro --version
sutrodev --versionThe local install exposes two commands for repository development:
sutrouses normal runtime environment selection. IfSUTRO_ENVis unset, it defaults to production.sutrodevalways forcesSUTRO_ENV=development, so it talks to the local Sutro backend (https://sapi.local.withsutro.com) regardless of the current shell environment.
For explicit smoke checks after installing, use pnpm cli:install:prod for
sutro or pnpm cli:install:dev for sutrodev.
UX features
- Global
--json,--debug,--color, and--no-colorflags. - Environment-based host selection via
SUTRO_ENV. - Interactive recovery for missing required values when running in a TTY.
- Actionable error messages with stable error codes, docs links, and bug-report links.
- Secure auth persistence in the XDG config directory.
Common usage
npm install --global @sutro-dev/sutro-cli
sutro login
sutro init --name "Task API"
sutro dev
sutro validate
sutro publish
sutro status
sutro openapi --out openapi.json
sutro logoutsutro login opens Studio, completes sign-in in the browser, then persists the
resulting session locally. Pass --no-open to print the login URL and wait for
the callback without launching the OS default browser.
sutro init links the current folder to a Sutro Project and Application. It
writes sutro.config.json and creates the configured SLang entry file if it
does not exist.
sutro dev reads sutro.config.json, uploads local .slang files to a remote
dev session, and prints a preview API URL. It watches .slang files and
sutro.config.json by default, then reloads the remote preview after changes.
sutro validate validates the linked SLang project on Sutro without publishing
it.
sutro publish uploads the linked SLang project and publishes the Application.
Distribution
The npm package is @sutro-dev/sutro-cli. Public users should install and run
the sutro executable:
npm install --global @sutro-dev/sutro-cli
sutro --versionsutro --version reads the version from this package's package.json, which is
the source of truth for the published package version.
Error codes
The full list of CLI error codes and their suggestions lives in src/cli-error.ts (CLI_ERRORS).
Release checklist
- Bump
apps/cli/package.jsonwithnpm version patch,npm version minor, ornpm version majorfromapps/cliusing--no-git-tag-versionuntil CLI releases are automated. - Update
CHANGELOG.mdwith the release version and date. - Run
pnpm --filter @sutro-dev/sutro-cli lint. - Run
pnpm --filter @sutro-dev/sutro-cli test. - Run
pnpm --filter @sutro-dev/sutro-cli build. - Run
cd apps/cli && npm pack --dry-run. - Publish from
apps/cliwithnpm publish --access public. - Smoke-test a fresh install:
npm install --global @sutro-dev/sutro-cli@latest sutro --version sutro login sutro publish
Automated release path
Once the manual checklist is stable, add a CI release workflow that runs on a
version tag or manual dispatch. It should install dependencies, run the CLI
lint/test/build steps, run npm pack --dry-run, publish with an npm automation
token and provenance when available, then run a post-publish smoke test that
installs @sutro-dev/sutro-cli@latest and verifies sutro --version.
