Elixir Language Mix Create a Custom Mix Task


Example

# lib/mix/tasks/mytask.ex
defmodule Mix.Tasks.MyTask do
  use Mix.Task

  @shortdoc "A simple mix task"
  def run(_) do
    IO.puts "YO!"
  end
end

Compile and run:

$ mix compile
$ mix my_task
"YO!"