Introduction
The Automagik Spark CLI provides a comprehensive command-line interface for managing workflow sources, schedules, tasks, and workers. The CLI is the primary way to interact with Spark for administrative tasks and operational management.Installation
Install the Automagik Spark package via pip:automagik-spark command will be available in your terminal.
Command Structure
All Spark CLI commands follow a consistent structure:<group>: The command group (sources, workflows, schedules, tasks, worker, api, db, telemetry)<command>: The specific command within the group[options]: Command-specific options and flags
Command Groups
| Group | Description |
|---|---|
sources | Manage workflow sources (LangFlow, Hive) |
workflows | List, sync, run, and delete workflows |
schedules | Create and manage workflow schedules |
tasks | View task execution history and retry failed tasks |
worker | Start, stop, and monitor Celery workers |
api | Start the FastAPI REST server |
db | Database migrations and management |
telemetry | Manage telemetry and usage tracking settings |
Global Options
These options are available for all commands:Debug Mode
Enable detailed logging output for troubleshooting:Telemetry
By default, Spark collects anonymous usage analytics to improve the product. To disable telemetry:Configuration
Environment Variables
The CLI reads configuration from environment variables. Key variables include:| Variable | Description | Default |
|---|---|---|
AUTOMAGIK_DATABASE_URL | PostgreSQL connection string | Required |
CELERY_BROKER_URL | Redis broker URL for Celery | redis://localhost:6379/0 |
CELERY_RESULT_BACKEND | Redis result backend URL | redis://localhost:6379/0 |
AUTOMAGIK_HOST | API server host | 0.0.0.0 |
AUTOMAGIK_PORT | API server port | 8883 |
AUTOMAGIK_API_KEY | API authentication key | Required |
ENCRYPTION_KEY | Key for encrypting API credentials | Auto-generated |
AUTOMAGIK_SPARK_DISABLE_TELEMETRY | Disable telemetry | false |
AUTOMAGIK_SPARK_LOG_LEVEL | Log level (DEBUG, INFO, WARNING, ERROR) | INFO |
AUTOMAGIK_SPARK_WORKER_LOG | Worker log file path | /var/log/automagik/worker.log |
Configuration File
Store environment variables in a.env file in your project directory:
.env file from the current directory.

