mix jido_action.gen.action (Jido Action v2.3.0)

View Source

Generates a Jido Action module

Usage

mix jido_action.gen.action MyApp.Actions.FetchWeather

Options

  • --no-test - Skip generating the test file

Generated Files

This task generates:

  1. An action module at lib/my_app/actions/fetch_weather.ex
  2. A test file at test/my_app/actions/fetch_weather_test.exs (unless --no-test)

Example

mix jido_action.gen.action MyApp.Actions.SendEmail

Generates:

defmodule MyApp.Actions.SendEmail do
  use Jido.Action,
    name: "send_email",
    description: "TODO: Add description",
    schema: []

  @impl true
  def run(_params, _context) do
    {:ok, %{}}
  end
end