Lucky Task

A Crystal library for creating command line tasks to be used with the LuckyCli.


  1. Add the dependency to your shard.yml:

        github: luckyframework/lucky_task
  2. Run shards install

Integrating With LuckyCli

Create a file at the root of your project

require "lucky_task"

# Using `lucky` from the command line will do nothing if you forget this

Creating Tasks

Create a tasks directory in the root of your project.

Update your file to require all files within that directory for them to be registered with the CLI.

require "lucky_task"
require "./tasks/*"

In the directory create a file called

class SendDailyNotifications < LuckyTask::Task
  summary "Send notifications to users"
  # Name is inferred from class name ("send_daily_notifications")
  # It can be overridden:
  #   task_name "app.send_daily_notifications"
  def call
    # Code that sends notifications to all your users...


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request