---
id: cli-commands
title: CLI Commands
sidebar_position: 1
---

# 💻 CLI Commands

## Start Application and Worker Together (Recommended)

```bash
# Start both app and worker with default config.yml
eai start-all

# Start with custom config
eai start-all --config production.yml

# Start with frontend file watching (auto-rebuild on changes)
eai start-all --watch-frontend

# Start without building frontend (if already built)
eai start-all --no-build-frontend

# Start without auto-reload (production mode)
eai start-all --no-reload --no-build-frontend

# Customize worker log level
eai start-all --worker-loglevel debug
```

**Note**: This is the recommended way to run EfficientAI. It starts both the API server and Celery worker in a single command. Press `Ctrl+C` to stop both services.

## Start Application Only

```bash
# Start just the API server (worker must be started separately)
eai start --config config.yml

# Start with auto-reload for development
eai start --reload

# Start with frontend file watching
eai start --watch-frontend

# Start with default config.yml
eai start

# Start with custom config
eai start --config production.yml

# Start with frontend file watching (auto-rebuild on changes)
eai start --watch-frontend

# Start without building frontend (if already built)
eai start --no-build-frontend

# Start without auto-reload (production mode)
eai start --no-reload --no-build-frontend
```

## Start Worker Only

```bash
# Start Celery worker with default config.yml
eai worker

# Start with custom config
eai worker --config production.yml

# Start with custom log level
eai worker --loglevel debug

# Or use Celery command directly
celery -A app.workers.celery_app worker --loglevel=info
```

**Note**: The worker is required for processing background tasks (transcription, evaluation, etc.). If you use `eai start-all`, the worker starts automatically. Only use this command if you need to run the worker separately.

## Development Mode

```bash
# Full development setup with both backend and frontend hot reload
eai start-all --watch-frontend --reload

# Or for application only
eai start --watch-frontend --reload
```

## Generate Config File

```bash
# Generate default config.yml
eai init-config

# Generate custom config file
eai init-config --output my-config.yml
```

## Database Migrations

```bash
# Run pending migrations manually
eai migrate

# Run migrations with verbose output
eai migrate --verbose
```

**Note**: Migrations run automatically on application startup. You only need to run them manually if you want to apply migrations before starting the server.
