aegra dev, aegra up, and aegra down run docker compose or podman compose. With AEGRA_CONTAINER_RUNTIME unset, each command picks the runtime as described below. Set the variable to docker or podman to choose directly.
Install
Commands
aegra init
Create a new Aegra project interactively.
aegra.json, Dockerfile, docker-compose.yml, .env.example, and a starter graph based on the selected template.
Templates:
- simple-chatbot — Basic conversational agent
- react-agent — ReAct agent with tool use
aegra dev
Start the development server with hot reload and automatic PostgreSQL.
- Starts PostgreSQL with Compose. When
AEGRA_CONTAINER_RUNTIMEis unset, this prefers a running Docker daemon, then Podman if it is installed, then Docker if it is installed but stopped. Set the variable todockerorpodmanto choose directly. - Loads your
.envfile - Applies database migrations automatically
- Runs uvicorn with
--reloadby default
aegra serve
Start the production server without Docker. You must provide a running database.
- Finds the config:
--config, elseAEGRA_CONFIGwherever it points, elseaegra.jsonorlanggraph.jsonin the current directory. IfAEGRA_CONFIGnames a file that does not exist,servestops instead of using another config (the defaultaegra.jsonis the exception) - Loads your
.envfile - Replaces itself with uvicorn in production mode (no reload), so as a container’s PID 1 the server receives
SIGTERMdirectly and drains in-flight runs; on Windows, which has no exec, uvicorn runs as a child process - Applies database migrations automatically
- Connects to the database configured via
DATABASE_URLorPOSTGRES_*variables
Use
aegra serve for:
- PaaS platforms (Railway, Render, Fly.io)
- Inside Docker containers (generated
Dockerfileuses this as CMD) - Bare metal / VM with external PostgreSQL
- Kubernetes pod specs
aegra up
Build and start all Compose services (PostgreSQL + app). When AEGRA_CONTAINER_RUNTIME is unset, this uses a running Docker daemon, then Podman if it is installed, then Docker if it is installed but stopped. Set the variable to docker or podman to choose directly.
aegra down
Stop Compose services.
With AEGRA_CONTAINER_RUNTIME set to docker or podman, this uses only that runtime. If it is not running, aegra down tries to start it before running compose down, and exits non-zero if it cannot.
With the variable unset, this checks each installed runtime for containers from the Compose file, then runs compose down on every runtime that has them:
- A runtime whose status check exits non-zero counts as not running, whatever the cause, including a permission error. It is skipped, so its containers stay until that runtime can be reached and
aegra downis run again, andaegra downcan still exit successfully after stopping another runtime. - Stopped containers are included when
compose ps --allsucceeds. If it fails, the check falls back tocompose ps, which only sees running containers. A runtime with running containers still counts as an owner, soaegra downcan exit successfully. A runtime with none counts as a failed check. - If a runtime’s status check times out, or its container listing or Podman Compose check fails or times out,
aegra downstops the owners it can and exits non-zero. If it has no owner it can stop, it stops nothing. When the failure was a status check or listing, set the variable to choose a runtime. - If every check finishes and no containers are found, it uses the same auto-detect order as
aegra up. That order can select a skipped runtime that is not running.aegra downthen tries to start it and runscompose downthere, which removes its containers for this file, and its volumes with--volumes.