runtime

CLI

The marreta command-line interface: build and run, migrate, format, lint, and editor tooling.

The marreta command runs and inspects a project. The everyday commands are init, serve, and test.

Build and run

CommandPurpose
marreta init <path> [--with db,cache,doc,queue]Scaffolds a new project, adding the chosen providers and a docker-compose.yml.
marreta serveServes the project over HTTP on MARRETA_PORT (8080 by default).
marreta test [path] [--filter TEXT] [--coverage]Runs the scenario tests, optionally filtered, with --coverage for a report.
marreta doctorLoads the project and reports its configuration without serving.
bash
marreta init shop --with db,cache
cd shop
marreta serve

Database

marreta migrate <subcommand> manages relational migrations:

SubcommandPurpose
generateWrites a migration from the current db: schemas. Reports unsupported changes (a type change, a removed field) as drift instead of writing them.
diffShows the SQL a new migration would contain, without writing it. Also reports unsupported changes as drift.
status / listShow applied and pending migrations.
explain <state>Explains a migration state (pending, changed, missing_local, workflow).
applyApplies pending migrations and changes the database.
rollbackReverts the most recent applied migration.
discard <version>Removes an unapplied local migration.

See Evolve your database with migrations.

Code quality

CommandPurpose
marreta fmt [--check]Formats every .marreta file the project loads (the same files serve and test read, in any folder). --check verifies formatting without writing.
marreta lint [--strict]Lints the project for problems, with --strict to fail on warnings.

Editor tooling

marreta tooling <catalog, symbols, completions, hover, definition> --format json powers editor features. It is consumed by the VS Code extension, not run by hand.

Notes

  • serve and doctor load the project the same way, so doctor catches a misconfiguration before you deploy.
  • fmt and lint also read from stdin (--stdin --file <path>) for editor integration.