Skip to main content
The Aegra CLI manages project creation, development servers, and Docker deployments.

Install

pip install aegra-cli
Install aegra-cli directly — not the aegra meta-package on PyPI.

Commands

aegra init

Create a new Aegra project interactively.
aegra init              # Prompts for location, template, and name
aegra init ./my-agent   # Create at path (still prompts for template)
Generates the project structure including 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.
aegra dev
What it does:
  1. Starts a PostgreSQL container via Docker Compose
  2. Loads your .env file
  3. Applies database migrations automatically
  4. Runs uvicorn with --reload
OptionDefaultDescription
--host127.0.0.1Host to bind to
--port8000Port to bind to
--config / -cAuto-detectedPath to aegra.json
--env-file / -e.envPath to .env file
--file / -fAuto-detectedPath to docker-compose.yml
--no-db-checkSkip database readiness check

aegra serve

Start the production server without Docker. You must provide a running database.
aegra serve
What it does:
  1. Loads your .env file
  2. Runs uvicorn in production mode (no reload)
  3. Applies database migrations automatically
  4. Connects to the database configured via DATABASE_URL or POSTGRES_* variables
OptionDefaultDescription
--host0.0.0.0Host to bind to
--portFrom env or 8000Port to bind to
--config / -cAuto-detectedPath to aegra.json
Use aegra serve for:
  • PaaS platforms (Railway, Render, Fly.io)
  • Inside Docker containers (generated Dockerfile uses this as CMD)
  • Bare metal / VM with external PostgreSQL
  • Kubernetes pod specs

aegra up

Build and start all Docker services (PostgreSQL + app).
aegra up
OptionDefaultDescription
--build / --no-buildBuild onBuild images before starting
--file / -fAuto-detectedPath to compose file
SERVICE...AllSpecific services to start

aegra down

Stop Docker services.
aegra down              # Stop containers
aegra down --volumes    # Stop and remove data volumes

aegra version

Show version information.
aegra version

When to use each command

ScenarioCommand
Local developmentaegra dev
Self-hosted Docker productionaegra up
PaaS deployment (Railway, Render)aegra serve
Kubernetesaegra serve (in pod spec)
Inside a Docker containeraegra serve (as CMD)