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

CLI commands and options

The aegil command-line interface provides tools to initialize, compile, run, migrate, and verify full-stack applications. The CLI recognizes 13 commands and 23 options, and rejects any unknown flag or extra positional argument with exit code 2 before modifying the workspace.

Command What it does
init Creates a new Aegil project directory with aegil.yaml (pinned to the installed Dart, Flutter and Serverpod versions) and starter specs (specs/.tsp, specs/app.tsp, specs/platforms.tsp) without overwriting existing Aegil files.
create Creates a project like flutter create: the directory names the project (snake_case), the template defaults to empty, and build runs straight away. Writes only aegil.yaml and specs/ before building. Never asks questions.
build Compiles the project’s specs/**/*.tsp and aegil.yaml into the Serverpod server, client package, Flutter app shell, platform folders, hook mirrors and .aegil/manifest.json, then runs flutter pub get and serverpod generate.
check Validates project config, specs, ownership plan, and freshness without writing any files to disk or running external toolchains. Fast read-only check for pre-commit hooks and CI.
migrate Generates an append-only, deterministic spec-diff SQL migration and snapshot baseline under migrations/. Rejects destructive changes unless –allow-destructive is passed.
run Runs the app like flutter run: builds if the project is missing or stale, starts Postgres in Docker and the Serverpod server, runs flutter run (with -d and anything after –), and stops the server and database when the app ends. Serverpod + Flutter projects only.
verify Runs the 6-step verification harness: hash-lock integrity, build and hook-mirror freshness, hook completeness, dart analyze, client invariant tests, and real Postgres integration tests in a throwaway Docker container.
tasks Evaluates all custom @mutation operations in the spec and prints the hook implementation tasks, their targetFile in hooks/, the generated Handler interface, and the compiler-guaranteed preconditions and required postconditions.
context Extracts and prints token-dense JSON context of the application’s spec models, enums, operations, and exact Dart hook signatures for LLM agents, optionally filtered to a single feature folder via –feature.
mcp Starts the zero-dependency Aegil Model Context Protocol (MCP) server over stdio JSON-RPC, exposing tools/list and tools/call (build, check, verify, tasks, context) to AI coding agents.
secrets Lists the required password keys and SERVERPOD_* environment variables per run mode (development, test, staging, production), plus whether local gitignored secret files exist. Prints names only, never secret values.
permissions Prints the @permission support matrix across iOS, Android, macOS and Web (which platforms declare the permission in project files, which ask at runtime, and which require a usage reason).
version Prints the Aegil compiler version, contract version, and the Flutter version the embedded platform templates were derived from.
Flag Alias Value Meaning
--project — <dir> Path to the target application project directory containing aegil.yaml (defaults to the current directory if it has aegil.yaml, otherwise examples/helpdesk).
--feature — <name> For context: limits the emitted agent context to declarations within a single spec feature folder (specs//).
--spec — <path> Path to a specific .tsp file or directory of .tsp files (defaults to /<paths.specs>, usually /specs).
--name — <snake_case> For init: required lowercase snake_case project and package prefix (not a Dart reserved word), used for aegil.yaml and specs/.tsp.
--id — <com.acme.app> For init: required reverse-DNS application identifier (e.g. com.acme.app) written to @app in specs/app.tsp and used for iOS/macOS bundle IDs and Android applicationId/namespace.
--display-name — <title> For init: sets @app displayName in specs/app.tsp (at most 60 characters, single line; defaults to Title Case of –name).
--namespace — <Pascal> For init: PascalCase spec namespace written to aegil.yaml and all specs/*.tsp files (defaults to PascalCase of –name).
--template — <name> For create: starting point: empty (default; only the namespace, app identity and platforms), counter (a tap counter), notes, helpdesk or alarm. The server templates need backend: serverpod.
--project-name — <name> For create: the project name when the directory name is not a valid snake_case name.
--org — <com.example> For create: your organization in reverse-DNS form (default com.example). The app id is ..
--backend — <kind> For create: backend target, serverpod (default) or none (no server; refuses templates that need policies or hooks).
--client — <kind> For create: client target, flutter (default) or none. serverpod with none is not supported.
--device -d <id> For run: the device to run on, passed to flutter run as -d (alias: -d).
--force — — For build: forces running pub get and serverpod generate even when spec and config inputs are unchanged.
--no-build — — For create: writes the project files only and does not run build. For run: skips the build even if the project is missing or stale.
--reset-db — — For run: deletes this project’s database (its containers and volumes) before starting. Use it when the database was created with a different password, for example after recreating the project in the same directory. Its data is lost.
--allow-destructive — — For migrate: confirms destructive schema changes (dropping tables, dropping columns, or incompatible column type changes). Without this flag, migrate fails with ERR_DESTRUCTIVE_MIGRATION.
--agent --json — Prints machine-readable JSON on stdout instead of human-formatted text (alias: –json).
--only — <stages> For verify: comma-separated subset of verification stages to execute (hash,freshness,hooks,analyze,invariants,integration). Skips unmentioned stages and reports VERIFIED_PARTIAL if tests are omitted.
--skip-integration — — For verify: skips the Docker-backed Postgres server integration suite and returns VERIFIED_PARTIAL (exit 0) instead of a full VERIFIED.
--strict-toolchain — — For build and verify: enforces exact pinned version matching for Dart, Flutter, and Serverpod even when aegil.yaml uses semver caret constraints (e.g. ^3.9.0).
--version -v — Prints the Aegil compiler version and exits 0 (alias: -v).
--help -h — Prints the CLI usage summary and exits 0 (alias: -h).

Generated from aegil @ 948ae8e. Do not edit: change the code, or the description in site/annotations/.