Skip to content

dac serve

Start a development server with live reload.

shell
dac serve [flags]

Flags

FlagAliasTypeDefaultDescription
--port-pint8321Port to listen on
--dir-dstring.Dashboard definitions directory
--template-tstringbruinTheme name or path to YAML file
--hoststringlocalhostHost to bind to
--openboolfalseOpen browser automatically
--passwordstringAdmin password for management API
--agent-effortstringmediumAI agent reasoning effort (low, medium, high)

Examples

shell
# Start with defaults (port 8321, current directory)
dac serve

# Custom port, open browser
dac serve --port 3000 --open

# Dark theme, specific directory
dac serve --template bruin-dark --dir ./dashboards

# Enable admin API
dac serve --password my-secret

Features

Live Reload

The server watches the dashboard directory for file changes. When you save a YAML or TSX file, connected browsers refresh automatically via Server-Sent Events (SSE).

Query Caching

Query results are cached with a 5-minute TTL. The cache is invalidated when dashboard files change. This means rapid page refreshes don't re-execute queries.

Auto Port Increment

If the requested port is already in use, the server automatically tries the next port.

Admin API

When --password is set, the server exposes admin endpoints for managing database connections via the browser UI. See the API section for details.

AI Agent

The server includes an AI-powered agent that can edit dashboards through natural language. Access it through the chat interface in the browser. The --agent-effort flag controls the reasoning depth.

API Endpoints

The server exposes a REST API used by the frontend:

MethodPathDescription
GET/api/v1/dashboardsList all dashboards
GET/api/v1/dashboards/{name}Get dashboard definition
GET/api/v1/dashboards/{name}/rawGet raw YAML/TSX source
POST/api/v1/dashboards/{name}/widgets/{id}/queryExecute a widget query
POST/api/v1/queryExecute arbitrary SQL
GET/api/v1/themesList available themes
GET/api/v1/eventsSSE stream for live reload