Skip to content

ash serve

Start the HTTP server for Telegram integration and webhooks.

Usage

Terminal window
uv run ash serve [OPTIONS]

Options

OptionDefaultDescription
--config, -cautoPath to config file
--host, -h127.0.0.1Host to bind to
--port, -p8080Port to bind to
--webhookfalseUse webhook mode

Basic Usage

Start with defaults (polling mode):

Terminal window
uv run ash serve

Custom Host/Port

Bind to all interfaces:

Terminal window
uv run ash serve --host 0.0.0.0 --port 3000

Webhook Mode

Use webhooks instead of polling:

Terminal window
uv run ash serve --webhook

Requires [telegram].webhook_url to be configured.

What the Server Does

  1. Loads configuration
  2. Initializes database
  3. Sets up the agent
  4. Starts Telegram provider (if configured)
  5. Runs FastAPI server

Endpoints

PathMethodDescription
/healthGETHealth check
/webhookPOSTTelegram webhook

Stopping

Press Ctrl+C to gracefully stop the server.

Production

For production deployments:

Terminal window
uv run ash serve --host 0.0.0.0 --port 8080 --webhook

Use a reverse proxy (nginx, Caddy) for TLS.