Skip to content
VerificationWould you notice if your agent drifted in production?Explore the 5-stage harness›
Development & CLI

Running and Debugging Locally

This guide shows how to run your full-stack Aegil application locally during development, select target client devices, reset the local PostgreSQL container, and inspect generated credentials.

  • Docker Desktop or Docker Engine running locally.
  • Aegil CLI installed and accessible on your PATH.
  • A valid project workspace containing aegil.yaml and specs/.

Before running a full build or verification suite, you can run a fast, read-only check:

Terminal window
aegil check

aegil check parses all specs/**/*.tsp files, validates toolchain pins in aegil.yaml, verifies ownership boundaries, and checks schema compatibility—without writing any files to disk. It is ideal for pre-commit hooks or fast editor diagnostics.


Running the full stack locally (aegil run)

Section titled “Running the full stack locally (aegil run)”

Just like flutter run starts your client application, aegil run manages your entire full-stack development environment:

Terminal window
aegil run

What aegil run automates:

  1. Docker container: Checks Docker and launches a PostgreSQL container on port 8090.
  2. Database migrations: Automatically applies Serverpod database migrations.
  3. Backend server: Starts the Serverpod server listening on http://localhost:8080.
  4. Flutter client: Boots the Flutter application on your default device (macOS, Chrome, or mobile).

Pass the -d flag to target a specific Flutter device or browser:

Terminal window
# Run Flutter on Chrome web
aegil run -d chrome
# Run Flutter on macOS desktop
aegil run -d macos

If you make substantial changes to your schemas during development or need to reset sample data, pass --reset-db:

Terminal window
aegil run --reset-db

This safely removes the existing local PostgreSQL container volume, starts a fresh database container, applies all migrations from scratch, and regenerates server passwords.


Managing local development secrets (aegil secrets)

Section titled “Managing local development secrets (aegil secrets)”

To inspect the environment variables and passwords generated for local development:

Terminal window
aegil secrets

This displays the local database passwords, JWT signing keys, and Redis configuration stored securely in .aegil/server/config/passwords.yaml and .aegil/server/.env (mode 0600).


What you see Why What to do
Cannot connect to Docker Docker Desktop or daemon is not running. Start Docker Desktop and re-run aegil run or aegil verify.
Password authentication failed for user postgres Stale container volume with outdated credentials. Run aegil run --reset-db to reset the container with fresh credentials.
ERR_STALE_BUILD Specs or hooks were edited since the last build. Run aegil build before aegil verify.
ERR_TAMPERED_GENERATED_FILE A file in .aegil/ was edited manually. Discard changes to .aegil/ and edit specs/<feature>/*.tsp instead.