Skip to main content

aegra-cli

Aegra CLI - Command-line interface for managing self-hosted agent deployments.

Aegra is an open-source, self-hosted alternative to LangSmith Deployments. Use this CLI to initialize projects, run development servers, and manage Docker services.

Installation

From PyPI

pip install aegra-cli

From Source

# Clone the repository
git clone https://github.com/aegra/aegra.git
cd aegra

# Install all workspace packages
uv sync --all-packages

Quick Start

# Initialize a new Aegra project (prompts for location, template, and name)
aegra init

# Follow the printed next steps
cd <your-project>
cp .env.example .env     # Add your OPENAI_API_KEY
uv sync                  # Install dependencies
uv run aegra dev         # Start PostgreSQL + dev server

Commands

aegra version

Show version information for aegra-cli and aegra-api.

aegra version

Output displays a table with versions for both packages.


aegra init

Initialize a new Aegra project with configuration files and directory structure.

aegra init [PATH] [OPTIONS]

Arguments:

Argument Default Description
PATH . Project directory to initialize

Options:

Option Description
-t, --template INT Template number (1 = "New Aegra Project", 2 = "ReAct Agent")
-n, --name STR Project name
--force Overwrite existing files if they exist

Templates:

# Name Description
1 New Aegra Project Simple chatbot with basic graph structure
2 ReAct Agent Tool-calling agent with a tools module

Examples:

# Initialize in current directory
aegra init

# Initialize in a specific directory
aegra init my-project

# Initialize with a specific template and name
aegra init my-project --template 2 --name "My ReAct Agent"

# Initialize in current directory, overwriting existing files
aegra init --force

Created Files:

  • aegra.json - Graph configuration
  • pyproject.toml - Python project configuration
  • .env.example - Environment variable template
  • .gitignore - Git ignore rules
  • README.md - Project readme
  • src/<slug>/__init__.py - Package init file
  • src/<slug>/graph.py - Graph implementation
  • src/<slug>/state.py - State schema definition
  • src/<slug>/prompts.py - Prompt templates
  • src/<slug>/context.py - Context configuration
  • src/<slug>/utils.py - Utility functions
  • src/<slug>/tools.py - Tool definitions (ReAct template only)
  • docker-compose.yml - Docker Compose for PostgreSQL and API services
  • Dockerfile - Container build

aegra dev

Run the development server with hot reload.

aegra dev [OPTIONS]

Options:

Option Default Description
--host HOST 127.0.0.1 Host to bind the server to
--port PORT 2026 Port to bind the server to
--app APP aegra_api.main:app Application import path
-c, --config PATH Path to aegra.json config file
-e, --env-file PATH Path to .env file
-f, --file PATH Path to docker-compose.yml file
--no-db-check Skip the automatic database check

Examples:

# Start with defaults (localhost:2026)
aegra dev

# Start on all interfaces, port 3000
aegra dev --host 0.0.0.0 --port 3000

# Start with a custom app
aegra dev --app myapp.main:app

# Start with a specific config and env file
aegra dev --config ./aegra.json --env-file ./.env

# Start without automatic database check
aegra dev --no-db-check

The server automatically restarts when code changes are detected.


aegra serve

Run the production server (no hot reload).

aegra serve [OPTIONS]

Options:

Option Default Description
--host HOST 0.0.0.0 Host to bind the server to
--port PORT 2026 Port to bind the server to
--app APP aegra_api.main:app Application import path
-c, --config PATH Path to aegra.json config file

Examples:

# Start with defaults (0.0.0.0:2026)
aegra serve

# Start with a custom config
aegra serve --config ./aegra.json

aegra up

Start services with Docker Compose.

aegra up [SERVICES...] [OPTIONS]

Arguments:

Argument Description
SERVICES Optional list of specific services to start

Options:

Option Default Description
-f, --file FILE Path to docker-compose.yml file
--build / --no-build --build Build images before starting containers (on by default)

Examples:

# Start all services (builds by default)
aegra up

# Start only postgres
aegra up postgres

# Start without building
aegra up --no-build

# Start with a custom compose file
aegra up -f ./docker-compose.yml

aegra down

Stop services with Docker Compose.

aegra down [OPTIONS]

Options:

Option Description
-f, --file FILE Path to docker-compose.yml file
-v, --volumes Remove named volumes declared in the compose file

Examples:

# Stop all services
aegra down

# Stop and remove volumes (WARNING: data will be lost)
aegra down -v

# Stop with a custom compose file
aegra down -f ./docker-compose.yml

Environment Variables

The CLI respects the following environment variables (typically set via .env file):

# Database
POSTGRES_USER=aegra
POSTGRES_PASSWORD=aegra_secret
POSTGRES_HOST=localhost
POSTGRES_DB=aegra

# Authentication
AUTH_TYPE=noop  # Options: noop, custom

# Server (for aegra dev)
HOST=0.0.0.0
PORT=2026

# Configuration
AEGRA_CONFIG=aegra.json

Requirements

  • Python 3.12+
  • Docker (for aegra up and aegra down commands)
  • PostgreSQL (or use Docker)

Related Packages

  • aegra-api: Core API package providing the Agent Protocol server
  • aegra: Meta-package that installs both aegra-cli and aegra-api

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aegra_cli-0.10.0.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aegra_cli-0.10.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file aegra_cli-0.10.0.tar.gz.

File metadata

  • Download URL: aegra_cli-0.10.0.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aegra_cli-0.10.0.tar.gz
Algorithm Hash digest
SHA256 b0ad91960af864a714904eaa0a2db1921abd422877544ee730cbcf10d7e5f35e
MD5 80ab107731b79b521ae78430d5e682c4
BLAKE2b-256 086d75a98dfa2801461e5af5d1fe522e928027671869f34a1a040313386f947d

See more details on using hashes here.

File details

Details for the file aegra_cli-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: aegra_cli-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for aegra_cli-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b360e16616c48e72d7dd293a4dbdf6b1d99106a4ae70eb0385dfc3f3e03d19f0
MD5 50da922882c8a84cdd77dbf8b5c8ff58
BLAKE2b-256 e5c1755d9f2bbf458eb524e244071f7906ab5233ee7b6d9a2efea4013e35f566

See more details on using hashes here.

Release history Release notifications | RSS feed

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

This release

0.10.0 This release

2 files

0.9.25

2 files

0.9.24

2 files

0.9.23

2 files

0.9.22

2 files

0.9.21

2 files

0.9.20

2 files

0.9.19

2 files

0.9.18

2 files

0.9.17

2 files

0.9.16

2 files

0.9.15

2 files

0.9.14

2 files

0.9.13

2 files

0.9.12

2 files

0.9.11

2 files

0.9.10

2 files

0.9.9

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.5

2 files

0.7.4

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page