rent
ReferenceCommand line

Rent command line

The rent command handles project setup and database lifecycle work. Run it from the project root so its default rent/schema.rsl, rent/generated, and rent/migrations paths resolve correctly.

rent --help
Rust-native entity framework

Usage: rent [OPTIONS] <COMMAND>

Commands:
  new          Create a complete local Rent application
  init         Create schema declarations for one or more entities
  generate     Generate the statically typed client source tree
  dev          Generate immediately and keep the typed client synchronized while the schema changes
  seed         Run the application's database seed binary
  describe     Print the normalized schema description
  validate     Validate an RSL schema and its semantic model
  format       Canonically format an RSL schema
  fix          Convert ordered legacy entity types into stable global-ID ranges
  migrate      Inspect, plan, or apply database migrations
  extension    Create and validate `PostgreSQL` extension packs
  db           Inspect or manage a live database
  studio       Browse and optionally edit a local development database in a web interface
  doctor       Validate project configuration, schema, generated code, migrations, Cargo, and optional database access
  completions  Generate a shell completion script
  help         Print this message or the help of the given subcommand(s)

Options:
      --root <ROOT>  Project directory used to resolve relative paths [default: .]
  -h, --help         Print help
  -V, --version      Print version

Typical project workflow

  1. rent new creates a complete local application.
  2. rent init adds models to the central RSL schema.
  3. rent db pull can create entities from an existing database.
  4. rent validate checks grammar and semantic correctness.
  5. rent format canonicalizes the authored schema.
  6. rent generate generates the typed Rust client once.
  7. rent dev keeps that client synchronized while the schema changes.
  8. rent doctor checks that the project is internally consistent.
  9. rent seed runs application-owned development or reference-data setup.
  10. rent describe gives you a quick, reviewable schema summary.
  11. rent migrate preflight classifies every proposed change.
  12. rent migrate dev plans, applies, and verifies a local schema edit.
  13. rent migrate diff previews the database changes.
  14. rent migrate plan writes a checksummed migration for review.
  15. rent migrate validate verifies the committed directory.
  16. rent migrate apply executes the exact reviewed files.
  17. rent migrate status and rent migrate drift verify deployment state.
  18. rent studio browses the live development data without writing SQL.

rent migrate history reads the durable journal. rent migrate repair is reserved for operator-controlled dirty-state recovery.

rent migrate reset proves a development database can be rebuilt from reviewed history. rent fix is for applications adopting global IDs with existing data.

Use rent migrate create and rent migrate seal for authored data backfills that cannot be derived from the RSL schema.

rent extension check verifies that a PostgreSQL environment can satisfy the schema, rent extension status inspects installed extension objects, and rent extension init scaffolds a reusable extension pack.

Shared options

Pass --root before the subcommand when the project is not the current directory:

rent --root services/api generate

Database commands first use an explicit --database-url, then DATABASE_URL from the process environment, then DATABASE_URL from the project-root .env. A generated SQLite project works without additional configuration:

rent migrate diff

Use --database-url for a deliberate one-command override. URL schemes select PostgreSQL, MySQL/MariaDB, or SQLite automatically. Use --dialect only when the URL cannot express the correct backend.

Relative SQLite filenames resolve against --root (the current directory when omitted), regardless of whether the URL comes from a flag, environment variable, .env, or the default. Absolute filenames and in-memory URLs are unchanged. This keeps migrations and their database together when running from a parent directory, for example rent --root services/social migrate dev --name add_comments.

Install tab completion with rent completions.

On this page