---
title: "Console Commands"
description: "Create Artisan commands and schedule automated tasks"
url: https://campaigns.kb.mumara.com/en/articles/39-console-commands
collection: "Developer Guides"
updated: 2026-06-12
language: en
---

# Console Commands

Create Artisan commands and schedule automated tasks

Your addon can ship its own Artisan commands for CLI operations, background processing, and scheduled tasks. Command classes live in the addon's `Console/` directory, extend Laravel's `Command`, and define a `$signature` (prefix it with your addon name, e.g. `emailvalidator:cleanup`) with arguments and options, plus a `handle()` method. Register them in your service provider's `commands()` call, ideally guarded by `runningInConsole()`. Commands support interactive prompts (`ask`, `secret`, `choice`, `confirm`), styled output (`info`, `warn`, `error`), tables, progress bars, and verbosity levels, and should return `Command::SUCCESS`, `FAILURE`, or `INVALID`.

To schedule commands, resolve the `Schedule` class in your provider via `callAfterResolving()` and register frequencies there — anything from `everyFiveMinutes()` to `dailyAt()`, custom `cron()` expressions, day constraints, and conditional `when()`/`skip()` closures. You can even build schedules dynamically from database settings. Execution modifiers like `withoutOverlapping()`, `onOneServer()`, and `runInBackground()` control how scheduled runs behave, and output can be logged, emailed, or wrapped in before/after/success/failure callbacks. Commands can also be invoked programmatically with `Artisan::call()` or `Artisan::queue()` from controllers.

Good habits: add `--dry-run` options for data-changing commands, require confirmation for destructive actions with a `--force` bypass, show progress on long operations, log scheduled runs, and always use `withoutOverlapping()` on recurring tasks.

📖 [**Read the full guide on docs.mumara.com →**](https://docs.mumara.com/campaigns/addons/console-commands)
